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

Integration keeps losing connection #12

Open
Axsgranted opened this issue Oct 12, 2023 · 26 comments
Open

Integration keeps losing connection #12

Axsgranted opened this issue Oct 12, 2023 · 26 comments

Comments

@Axsgranted
Copy link

Integration was working for a couple of weeks flawlessly. Was asked to reconfigure, which I did assuming maybe there was a 30 day token and now it asks me to reconfigure every 5 minutes.

@Axsgranted
Copy link
Author

Error Log Details after authenticating successfully and then it "loses" connection:

Logger: custom_components.petsafe
Source: helpers/update_coordinator.py:343
Integration: PetSafe (documentation, issues)
First occurred: 6:53:07 PM (6 occurrences)
Last logged: 7:25:48 PM

Authentication failed while fetching PetSafe data: Client error '403 Forbidden' for url 'https://platform.cloud.petsafe.net/scoopfree/product/product' For more information check: https://httpstatuses.com/403

@dcmeglio
Copy link
Owner

I think they changed something or broke something. It might fix itself but if not it might be best to disable the integration so they don’t lock you out for too many failed attempts.

@cadwizzard
Copy link

cadwizzard commented Oct 12, 2023

I'm seeing this too. But I was asked to reconfigure again just once (15h ago).
I input email again and got the access code.
Now i have my email address showing twice in the integration, but only one with device and entity behind it.... but all entities are unavailable

UPDATE: i've since reloaded the integration from menu next to my email address - entities are now live again

@Axsgranted
Copy link
Author

I'm seeing this too. But I was asked to reconfigure again just once (15h ago). I input email again and got the access code. Now i have my email address showing twice in the integration, but only one with device and entity behind it.... but all entities are unavailable

UPDATE: i've since reloaded the integration from menu next to my email address - entities are now live again

I've seen this exact behavior. I also did a reload and it worked for a little bit then stopped again.

@Axsgranted
Copy link
Author

Axsgranted commented Oct 12, 2023

Update: I removed the integration and re-added it and it appears to be working normally again. But when it wasn't, how it handled the issues created the duplicate configuration entries @cadwizzard mentioned.

Update2: Spoke too soon. The entities went offline shortly after.

@Zeunas
Copy link

Zeunas commented Mar 16, 2024

Are you guys still having this issue? It just started happening to me ( that I noticed)

@MivraMe
Copy link

MivraMe commented Jul 30, 2024

Are you guys still having this issue? It just started happening to me ( that I noticed)

Yep same here

@Axsgranted
Copy link
Author

Happening to me again after the latest updates

@dcmeglio
Copy link
Owner

I'm working on a fix for this it's just kind of hard to prove it fixes it since I haven't found a pattern to when the issue occurs.

@dcmeglio
Copy link
Owner

If you want to test out my fix and you know what to do, update the manifest.json for the integration to use petsafe 2.0.7

  "requirements": [
    "petsafe==2.0.7"
  ],

Since it's kind of a "wait and see" bug having more people let me know if they can see an improvement will help. After changing the file just restart HA

@ablack89
Copy link

I have been seeing the issue every few days recently - have applied your fix and will report back if I see it happen again.

@Axsgranted
Copy link
Author

If you want to test out my fix and you know what to do, update the manifest.json for the integration to use petsafe 2.0.7

  "requirements": [
    "petsafe==2.0.7"
  ],

Since it's kind of a "wait and see" bug having more people let me know if they can see an improvement will help. After changing the file just restart HA

Trying this as well. The connection usually stays for 5 days or so, so it might be a few days before I can report back.

@Axsgranted
Copy link
Author

Just lost connection and it wants me to re-authenticate even after setting the requirements version.

@ablack89
Copy link

ablack89 commented Aug 31, 2024

I've also had it happen again today, with the updated version. The error in the log at the time is below.

`This error originated from a custom integration.

Logger: custom_components.petsafe
Source: helpers/update_coordinator.py:407
integration: PetSafe (documentation, issues)
First occurred: 17:48:33 (1 occurrences)
Last logged: 17:48:33

Authentication failed while fetching PetSafe data: Client error '403 Forbidden' for url 'https://platform.cloud.petsafe.net/scoopfree/product/product' For more information check: https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/403`

@MivraMe
Copy link

MivraMe commented Sep 1, 2024

Same for me, just lost connection, do we ping the server at a high interval so we are kicked out ?

@siobhanellis
Copy link

I just lost connection after reconfiguring today

@dcmeglio
Copy link
Owner

dcmeglio commented Sep 3, 2024

Darn happened to me today too. I'll keep investigating.

@dcmeglio
Copy link
Owner

dcmeglio commented Sep 5, 2024

I want to check if you're experiencing the same thing I am while yes I am getting a 403 that causes a reauth, it does seem the data is continuing to update? I'm wondering if there API is just a bit flaky and throws 403s sometimes and I just need to add retries. Seems like an odd thing, but it does appear my litter box is still updating even though I got that error.

@ablack89
Copy link

ablack89 commented Sep 5, 2024

Yes, if I ignore the re-auth prompts the data keeps coming in for me.

@MivraMe
Copy link

MivraMe commented Sep 8, 2024

No data for me... and it's seem to create a new device every time..
image

@dcmeglio
Copy link
Owner

dcmeglio commented Sep 8, 2024

@MivraMe the duplicate items is a different bug, I'll look into that, but this sounds like you did the reauth. It seems if you ignore the reauth, everything continues to work.

@MivraMe
Copy link

MivraMe commented Sep 8, 2024

All my sensors are unavailable for my petsafe food..

@dcmeglio
Copy link
Owner

dcmeglio commented Sep 8, 2024

Right, as I said, you did the reauth workflow, correct? That is causing the bug I just filed on your behalf #18. If you delete the devices and reinstall it should begin working again.

@dcmeglio
Copy link
Owner

I've been testing a fix for this that so far seems good. If it's still working this weekend I'll release a new version

@dcmeglio
Copy link
Owner

I ran this for a week and didn't have any auth issues or data issues. I think their API just occasionally throws 403s so I added some retries to detect multiple errors before triggering a reauth can you guys try out 1.3.5 and let me know if it works? https://github.com/dcmeglio/homeassistant-petsafe/releases/tag/1.3.5

@ablack89
Copy link

Thanks, have updated and will report back if I see any issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants