grocy icon indicating copy to clipboard operation
grocy copied to clipboard

Integration doesn't work after grocy addon update to 0.18.2

Open grossqx opened this issue 2 years ago • 5 comments

Describe the bug All entities provided by the integration became unavaliable.

To Reproduce Update the Grocty addon to 0.18.2

Versions of custom component also tried with no luck: 4.3.4 4.4.0 4.5.0 (beta, currently installed)

I have also tried deleting and adding back the integration, re-enabling all entities, restarting multiple times, creating a new grocy API key.

Log:

This error originated from a custom integration.

Logger: custom_components.grocy.coordinator
Source: helpers/update_coordinator.py:237
Integration: Grocy (documentation, issues)
First occurred: 12:46:37 PM (4 occurrences)
Last logged: 12:50:40 PM

Error fetching grocy data: Update failed: 1 validation error for TaskResponse due_date invalid date format (type=value_error.date)

grossqx avatar Jul 30 '22 10:07 grossqx

Not sure is this is relevant, but services still work. Just checked.

grossqx avatar Jul 30 '22 11:07 grossqx

I have this same issue. Grocy is running normally. Error came after newest update 0.18.2. I can see this error from logs -> "Error setting up entry Grocy for grocy"

ainetaki avatar Jul 31 '22 14:07 ainetaki

Have no issues with add-on 0.18.2 (Grocy 3.3.1) and integration 4.5.0.

@grossqx Check the due date for the tasks in Grocy, there is an invalid date somewhere. Grocy does some validation but you can bypass it.

@ainetaki Can you open a new issue and fill out the template? We need more information to help.

marcelvriend avatar Jul 31 '22 19:07 marcelvriend

@marcelvriend It helped! I had some tasks in my grocy that were created from hass interface via lovelace-grocy-chores-card. Those were created a while ago,while on a previous version of both grocy and the integration. After I deleted those tasks, it immediately started working. Thank you! Hope this information helps to pinpoint where the wrong date format originated.

grossqx avatar Aug 01 '22 06:08 grossqx

The issue appeared again after update of hass supervisor to 2022.08.5. Everything else is also in the latest version. Component v.4.5.2

All entities are unavailable and the log throws a: Error fetching grocy data: Update failed: 1 validation error for CurrentChoreResponse next_estimated_execution_time invalid datetime format (type=value_error.datetime)

I tried removing the latest actions that were taken through the integration right before it broke. This time it doesn't help

grossqx avatar Aug 30 '22 10:08 grossqx

Apparently there is incorrect data in your Grocy db (coming from the Android app you mentioned). Grocy and also this integration require valid data. To fix it, you need to find and correct the invalid chore(s) in Grocy.

marcelvriend avatar Sep 06 '22 18:09 marcelvriend

@marcelvriend yes, you are absolutely right. But there might be also other grocy integrations or apps that cause this error because, as you have said, grocy apparently allows to bypass the validation. And even with these incorrect data, grocy itself works without any errors and displays all fields correctly. Would it be possible to ignore the errors in a particular chore or a particular product? I would expect it to show null values instead of disabling the whole integration. Or at least if there's, for example, a chore data error, would it be possible to keep stock and shopping list working? Because right now all entities go to unavailable if there's incorrect data in at least one of grocy objects. And unless you spot the problem right away and know what to look for, it is hard to pinpoint.

grossqx avatar Sep 07 '22 20:09 grossqx

The linked PR will ensure that not all entities become unavailable.

marcelvriend avatar Sep 09 '22 14:09 marcelvriend