Skip to content
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

Error fetching bring data: Unable to connect and retrieve data from bring #118043

Closed
jocamane opened this issue May 24, 2024 · 15 comments
Closed

Comments

@jocamane
Copy link

The problem

Several times a day errors appear in the log, although, apparently, everything is working fine

What version of Home Assistant Core has the issue?

2024.4.4

What was the last working version of Home Assistant Core?

No response

What type of installation are you running?

Home Assistant OS

Integration causing the issue

BRING

Link to integration documentation on our website

No response

Diagnostics information

No response

Example YAML snippet

No response

Anything in the logs that might be useful for us?

Logger: homeassistant.components.bring.coordinator
Source: helpers/update_coordinator.py:347
integration: Bring! (documentation, issues)
First occurred: 13:36:52 (1 occurrences)
Last logged: 13:36:52

Error fetching bring data: Unable to connect and retrieve data from bring




Logger: bring_api.bring
Source: components/bring/coordinator.py:54
First occurred: 13:36:52 (1 occurrences)
Last logged: 13:36:52

Exception: Cannot get items for list 06945b01-9606-4513-90fe-d0fd7deaa327: Traceback (most recent call last): File "/usr/local/lib/python3.12/site-packages/bring_api/bring.py", line 244, in get_list r.raise_for_status() File "/usr/local/lib/python3.12/site-packages/aiohttp/client_reqrep.py", line 1070, in raise_for_status raise ClientResponseError( aiohttp.client_exceptions.ClientResponseError: 502, message='Bad Gateway', url=URL('https://api.getbring.com/rest/v2/bringlists/06945b01-9606-4513-90fe-d0fd7deaa327')

Additional information

despite the errors everything seems to work fine

@home-assistant
Copy link

Hey there @miaucl, @tr4nt0r, mind taking a look at this issue as it has been labeled with an integration (bring) you are listed as a code owner for? Thanks!

Code owner commands

Code owners of bring can trigger bot actions by commenting:

  • @home-assistant close Closes the issue.
  • @home-assistant rename Awesome new title Renames the issue.
  • @home-assistant reopen Reopen the issue.
  • @home-assistant unassign bring Removes the current integration label and assignees on the issue, add the integration domain after the command.
  • @home-assistant add-label needs-more-information Add a label (needs-more-information, problem in dependency, problem in custom component) to the issue.
  • @home-assistant remove-label needs-more-information Remove a label (needs-more-information, problem in dependency, problem in custom component) on the issue.

(message by CodeOwnersMention)


bring documentation
bring source
(message by IssueLinks)

@mib1185
Copy link
Contributor

mib1185 commented May 24, 2024

message='Bad Gateway' often indicates an issue with the webservice itself, so on the very first I would suggest to try it later again

@jocamane
Copy link
Author

@mib1185 I'm not the one trying to do anything. The BRING integration is working well. I can see all the lists and the items that are there. Errors appear in the HA core log from time to time (about 12 hours), but apparently everything is OK. I've already tried deleting the integration and putting it back together, everything goes fine, but after a while the error appears again.

Thanks

@tr4nt0r
Copy link
Contributor

tr4nt0r commented May 25, 2024

@mib1185 I'm not the one trying to do anything. The BRING integration is working well. I can see all the lists and the items that are there. Errors appear in the HA core log from time to time (about 12 hours), but apparently everything is OK. I've already tried deleting the integration and putting it back together, everything goes fine, but after a while the error appears again.

Thanks

Hi @jocamane
as @mib1185 already mentioned, that error is nothing to worry about, just an error in the network communication with the Bring service, i also get these errors regularly. Bad Gateway indicates the error is on the server side and there is nothing we can do aside from wait and retry. Errors like this will always happen from time to time and operation will usually recover to normal. If an error persists you should maybe investigate, otherwise it is safe to ignore it.

I will try to update the error messages and make it sound less alarming ^^

@tr4nt0r
Copy link
Contributor

tr4nt0r commented May 25, 2024

@home-assistant close

@jocamane
Copy link
Author

This error has been happening for more than 6 months. Isn't that enough to investigate? OK

@jocamane
Copy link
Author

@home-assistant reopen

@jocamane
Copy link
Author

No error or warning is normal in any application in the world. If there is an error, it is because something is not right, so it must be investigated.

@tr4nt0r
Copy link
Contributor

tr4nt0r commented May 25, 2024

No error or warning is normal in any application in the world. If there is an error, it is because something is not right, so it must be investigated.

Internet connections are never 100% reliable by nature, Services like bring can produce errors, for example if servers are overloaded with too many requests. These errors are normal, they are expected to happen. If they happen too often, only then it is required to take action. In this case especially, there is nothing i can do in the bring integration or the bring-api library to fix them, aside from throwing an error and retrying again later, which is already happening in the Integration and Home Assistant takes care of retrying later.
Also this an error on the server side. If you think this should be addressed somehow, please open a ticket directly with the company that provides the service for the Bring App. You can send an e-mail to feedback@getbring.com
Please also be aware, that we, the maintainers, are not in any way affiliated with bring and this integration is not officially supported by Bring Labs.

@jocamane
Copy link
Author

Do not worry.
I will stop using Bring integration in Home assistant.
It's always better than having a log full of errors every day

@tr4nt0r
Copy link
Contributor

tr4nt0r commented May 25, 2024

Do not worry. I will stop using Bring integration in Home assistant. It's always better than having a log full of errors every day

I'm ok with that. I'm doing this for free in my spare time and don't get paid for it. If you don't like it, don't use it🤷‍♂️

Also please refer to this passage of the License:

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.

@jocamane
Copy link
Author

exactly

@jocamane
Copy link
Author

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.

Regarding the software, I have nothing to do with it

@mib1185
Copy link
Contributor

mib1185 commented May 25, 2024

Hi,
first, please calm down - we do this all in our free spare time and it's just an error message from time to time (caused by an server side error, not HA side!). Since we are not affiliated in any kind with Bring, we can't say anything about the cause of this outage of their servers.
What we could do is fetch this particular ClientResponseError and wrap it into the UpdateFailed error, which is properly handled by HA. There would still be an entry in your log, but not such prominent. (what @tr4nt0r has also mentioned earlier in #118043 (comment))

@tr4nt0r
Copy link
Contributor

tr4nt0r commented May 25, 2024

Hi, first, please calm down - we do this all in our free spare time and it's just an error message from time to time (caused by an server side error, not HA side!). Since we are not affiliated in any kind with Bring, we can't say anything about the cause of this outage of their servers. What we could do is fetch this particular ClientResponseError and wrap it into the UpdateFailed error, which is properly handled by HA. There would still be an entry in your log, but not such prominent. (what @tr4nt0r has also mentioned earlier in #118043 (comment))

ClientResponseError is already handled by UpdateFailed, hence the first message in the error log

Error fetching bring data: Unable to connect and retrieve data from bring

The second error log comes from the upstream library, which logs an error with the full stack trace. This has already been addressed, the current version 0.7.1 of bring-api is a lot less talkative and will log these messages only if debug is enabled.

The library will be updated to v0.7.1 in the next Home Assistant main release

@github-actions github-actions bot locked and limited conversation to collaborators Jun 24, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants