Closed psa-anddev closed 1 year ago
After refreshing the page twice, I got the stock overview to show up using the open port to the add-on but the part where it loads the number of overdue products and so on took more than a minute to be populated.
One update on this issue. Yesterday, I backed up the add-on data as a way to preserve the latest version of the database. After doing that, suddenly Grocy worked as it should for the whole day. This morning, I tried to access to it again both from Grocy Android (which it failed with a NetworkError) and using the web UI which worked but it went really slow. That makes me thing that there might be a problem in the way the add-on is handling either the database or any of the files that conforms the configuration of the add-on.
After working with my Home Assistant set up a bit longer, I'm noticing the same symptoms in other places such as when restarting the Home Assistant host. Since I no longer thing there is a problem with the add on, I'm going to close the issue. Thank you for your good work putting up this add on.
Problem/Motivation
I am running version 0.19.1 of the add-on using Home Assistant Core 2023.5.3 in Home Assistant OS 2023.04.1. This is running on a VM in a Proxmox server where I am running other VMs. At first, the add-on worked as expected, showing pages quickly and behaving as expected. However, over time, the add-on has become slower and slower. When I click on the web ui, it takes over a minute to load the stock overview. It also takes a long time to do anything such as consume products, mark chores as done or virtually anything. Restarting the add-on makes it work well for a while but in minutes it starts behaving slowly again. Funnily enough, restarting the add-on in an of itself is slow. I use the Grocy Android app to be able to update the stock overview quickly but, again, it is slow and unresponsive. Eventually, I see myself forced to log out and go through the whole process again and again.
Other add-ons, such as Zigbee2MQTT work flawlessly and they respond quickly as expected. That makes me think it is not a problem with HA itself. I wanted to isolate where the problem is so I took a back up I had from a week ago and extracted the files that Grocy use. With these, I replicated the same set up in a Docker container using the linuxserver image for Grocy, which I was using without any problems before I moved Home Assistant to Proxmox. What I found is that with the exact same database that I had a week ago, the application behaves in a responsive manner. I also decided to try to configure my Grocy Android app to use the container and it is, again, as responsive as expected.
I have a port open because I use the Grocy HACS integration to have Grocy sensors in Home Assistant, I tried to log in accessing it from outside Home Assistant and after waiting for 3 minutes, I got a database locked error in the file /var/www/grocy/vendor/morris/lessql/src/LessQL/Database.php:493
I have looked at other issues that have been brought up regarding the performance of both the add-on and Grocy itself. The ones I've seen in this repository make the argument that this add-on only wraps Grocy so if there is a performance issue, it should be reported to Grocy itself. However, given that the exact same database works with the same version of Grocy running on Docker, I think there is something going on with the add-on itself. I have checked the database and it is not that big (around 300K).
Expected behavior
Grocy should behave in the same manner when using the add-on as it does when using Docker to configure it.
Actual behavior
Grocy add-on keeps becoming slower and slower up to the point that it cannot be used. Using the same database, running Grocy on Docker works flawlessly.
Steps to reproduce
Just install Home Assistant OS in a VM and use the Grocy add-on for a while (it is around 1-2 months that I've been using it).
Proposed changes
I am really not sure since I don't know how the add-on is put together.
More info
Here is the stack trace for the database locked issue I mentioned before. Error source:
Error message:
Stack trace:
System info: