-
Notifications
You must be signed in to change notification settings - Fork 869
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[HELP] Thingsboard gateway file type storage issue #284
Comments
HI @sobehard Thank you for your interest in ThingsBoard IoT gateway and feedback, I will investigate this and fix it. |
Hi, there is another bug in the lastest version of thingsboard gateway that I forgot to mention earlier. In version 2.2.4.2, the thingsboard gateway does not auto reconnect back to the thingsboard server when it is disconnected from the server (due to internet issue / server down). |
I fixed the issue with auto reconnect, could you try to install version from sources and test it in your environment? |
Alright, will try it out. |
Already tested with the new update, the re-connection issue is resolved. Thanks. |
Is it resolve the issue with storage read/write? |
@ZBeacon |
To install the latest version, please use this guide. |
@ZBeacon |
Hi, I had tested the latest version based on the instruction given. The reconnection to server issue did resolved by the latest version. But the file storage issue is still exist. Based on the screen shot above, I was running the gateway in file storage configuration. The file system was working fine for first few minutes. After it reached the limit of the storage setting (max_read_record_count), it won't cleanup old file but keeping writting new file without update to the thingsboard server. Screenshot above is generated file from the file storage configuration. |
Please try now, storage should works properly. |
Hi @ZBeacon , I'm testing it with Windows 10. The gateway is sending data continuously right now. But I notice it does not clean up old files due to the following errors:
This leads to plenty of old files in the data folder and I need to delete manually them. I'm not sure if it only happens in Windows. Will test on Ubuntu and feedback further |
Hi @ZBeacon Sorry for the slow response. I just tested the latest commit source code from github. But I found that the storage issue still the same. Not sure why. Below is the screenshot of the storage.log file and content of the file inside the data path. The setting that I used for the test is as shown in picture below. |
Hi @ZBeacon I did test with windows 10 wls (which is same as @skangmy ), the file storage thing is working fine, the old file is deleted when a new file is created as shown in image below. I was using the same file storage setting as ubuntu version as shown below. But I found another issue with the latest commit code in windows 10 wls environment. I tried to disconnect the tb gateway from the thingsboard for certain amount of period then connect back. The offline file is created when there is more and more data coming in during the period. But the tb gateway seem like does not read all the file inside the folder during the "disconnected" period. When I reconnect the tb gateway back to thingsboard, it oni read and delete one file instead of whole bunch of file inside the folder. And there is no upcoming data from the tb gateway to thingsboard after that. While the new file is keep created for incoming data without sending to thingsboard. I had tried to restart the tb gateway, and it did print out Initializing from state file..., but it will only keep on creating new file without reading it and pushing to thingsboard. The only method that I'm not sure whether I'm the one only have this issue, please correct me if I'm wrong. ps: this is issue won't happen when there is only one file inside the "data" folder |
Hi @sobehard We have released a version 2.2.5. Please try it (or just download version from master branch). It should solve the issue. |
Hi, Alright, will test it out and let you know the result. |
Hi @sobehard Please try the following command to update the gateway version for thingsboard_gateway user (It uses to run the gateway as a daemon): sudo pip3 install thingsboard-gateway --user thingsboard_gateway --upgrade |
Hi, do you have idea on how to solve the previous issue that I mention? Or I need to open a new issue for this? Btw, the following is the log file from tb gateway when run as daemon. |
Hi @skangmy |
Hi @ZBeacon Any solution for my issue? I had re-tried the tb gateway (version 2.2.5) today and I found out another issue. (Noted: test is conducted not with daemon process, but with sudo thingsboard-gateway as the daemon process still having issue now) I had start the tb gateway since morning, everything is working fine, storage file keep updating by deleting old file. After running for 6 hours +, the following error comes out suddenly (it is the content of the tb gateway storage log file). I had checked the file inside the storage folder, but there is only one file. Not sure why it say too many open files. To temporary solve this, I had to manually delete the storage file and run the tb gateway again. |
@ZBeacon please ignore this issue as I think it is caused by the read/write limitation of ubuntu system itself. |
Hi @ZBeacon I have tested version 2.2.5 recently. I noticed there files being created and deleted constantly and at a very fast pace but no data is being sent to thingsboard server. The following is the content of the log: This is the storage setting in tb_gateway.yaml:
Any idea what have gone wrong? |
Hi @skangmy Please try the version from the develop/2.4-python branch. And let me know about results. |
Hi @ZBeacon I have tested develop/2.4-python branch and it is still having issues. I created a test script that publishes data for 5 devices every second via MQTT. When I first run tb gateway, the data is being sent to thingsboard server every second. But once it starts cleaning up old data files, the data is only being sent every 20 seconds. Please refer to attached screenshot The following is my storage setting:
|
Hi @skangmy I created the same script to sent data Could you email me ibarkov@thingsboard.io, access credentials to investigate the issue in your environment? SSH/TeamViewer/etc. |
Hi @ZBeacon, I had tested the new tb gateway (version 2.3.0.1) with file storage setup. Below is the screenshot of the thingsboard gateway log file. I found that the storage files always replaced with same name and only the position of the file keep changing. The data from the storage file did pass to the thingsboard server, but after 50 minutes +, the thingsboard gateway stop publish the data to the server anyone. Below is the screenshot of the thingsboard dashboard for the testing. Picture below shows the logging of the content of thingsboard gateway's static file when the thingsboard gateway stop sending data to thingsboard server. When I restart the thingsboard gateway, it will start to push data to the server but the same issue will still happen after 50 minutes +. Can I know how to solve this? Version OS: Ubuntu 18.04 |
Hi @ZBeacon , sorry for the delay. I have sent you the access credentials to your email. As I was doing the setup and testing, I noticed the behavior has changed and it's pretty much similar to what @sobehard has reported. |
Thanks @skangmy , I saw the email, but I will be available to connect in few days. I made some changes to the file storage and put them in the development branch, please check the version from the development branch. I am still testing this version, but it looks like it works. |
Thanks @ZBeacon, the latest version of tb gateway did solved the issue. Sorry for the slow response. |
this issue still exist with the new gateway. please help to check. |
Hi, I'm having issue with the file type storage in thingsboard gateway setup. The picture below show the storage log file of the thingsboard gateway. Previously I was using memory type storage setup, and it is working fine for storing offline data and upload all the offline data file when it is back to online. But when I change it to file type storage, there is an issue exist after running for some amount of time. At first, the event storage writer and event storage reader is working fine as there is data storing in the file and pass to the thingsboard server. But after awhile (due to the max_record_setting and max_read_record_count setup), it only perform file writing without read the file. At this time, the thingsboard gateway keep writing new file without passing the incoming data to the thingsboard server.
I was testing on version 2.2.3.2 and 2.2.4.2, both of the version having same issue. May I know how to solve this issue?
Version
The text was updated successfully, but these errors were encountered: