lavinir / hassio-onedrive-backup

MIT License
222 stars 5 forks source link

After update no more connection to onedrive #174

Open Pleeriezer opened 4 months ago

Pleeriezer commented 4 months ago

Hell,

I have updated to 2.4 and now I must reconnect to Onedrive. I get a code for it but if I try to connect onedrive is telling me that the code is wrong?

Thanks and greetings,

Erik.

lavinir commented 4 months ago

Hi,

What exactly is the message you see in the logs? If you restart the addon it will generate a new code to use. Please try that.

Pleeriezer commented 4 months ago

After restart I am getting the same code?

lavinir commented 4 months ago

I assume that's not a question :) Something is not right if you're getting the same code as this is coming from the Microsoft Auth flow each time. If you stopped it completely and started but you see the same code (I cannot explain that) could you please try to uninstall and re-install the addon to see if that fixes the issue ?

Liam-Whiteside commented 4 months ago

I'm having a problem with this as well. I found that trying to use Chrome to authenticate I just eneded up at a page with "next / cancel" as though it was a dialogue box and a broken image. If I click next, nothing happens. Using safari I seemed to get through to a "you are authenticated" confirmation, but nothing changes within the onedrive ad-on, it's still showing the "Not logged in" banner. In both cases, no errors shown in the logs.

Liam-Whiteside commented 4 months ago

I just tried going around the loop again, using a private window in Safari and finally got to the message "You're now signed in to hassio-onedrive-backup. You can safely close this window." and a couple of seconds later the banner in the add-on UI cleared.

SmilyHM commented 4 months ago

I was using Chrome to reauth. LogIn, accept, approval = all fine but didnÄt work. Using Edge was "my way to go" --> few seconds later = banner/message was gone.

bh56 commented 4 months ago

I'm having the same issue. I upgraded and now get the following message on the OneDrive Backup page. Not logged in! To sign in to OneDrive, navigate to https://microsoft.com/devicelogin and enter the code "NOTMYCODE" to authenticate. I put the the actual code in and then get the following message. That code didn't work. Check the code and try again. I typically use Chrome. I tried Edge, but get the same error message. Any one have suggestions?

bh56 commented 4 months ago

I was able to resolve this. Although I did restart HASS and this didn't fix it. I went into OneDrive backup add-on page and did a restart. That gave me a new code. Then this worked.

Pleeriezer commented 4 months ago

Mhh Tried it in Chrome Safari and Edge not succesful..

Stopped the backup restarted again and it is working!!

Thanks and greetings,

Erik.

Doughboy68 commented 4 months ago

I think the copy button was adding a space to end of code, not that it matters maybe? I had to restart and try a couple times though... think was problem with using the right account and authenticator but finally got working.

nickt444 commented 4 months ago

same for me. original code did not work, restarted add-on and new code worked

GoodnessJSON commented 4 months ago

Same as well. A restart fixed it up. The copy button also inserts a space after the code.

tomajzl commented 4 months ago

Hello, same workaround as for other helped me:

1) Restart addon 2) New code will generate 3) Login to Onedrive using the link

Now it again works :)

peteS-UK commented 4 months ago

Yep - same for me. After upgrade, the original code didn't work. Restart addon to get a new code, login to onedrive with the new code (minus the space on the end), then restart the addon again and it's working.

mikeynp commented 4 months ago

FWIW, just upgraded to 2.3 and it worked fine for me. Re-authenticated with the code displayed in the banner. All fine.

mf22433 commented 4 months ago

Same here: after the upgrade to 2.4 OneDrive backup requested a re-authentication. The code initially provided did not work. After restarting the the Onedrive backup add-on I received a new code and this one worked.

vinnie1234 commented 4 months ago

Same problem here, also after restarting it works!

Maby make an button with "Get Code". I think the code that I saw was expired.

cgressens commented 4 months ago

I noticed (after a few days) that after an update my OneDrive credentials for the add-on stopped working. What happened with the backups was that the local backups kept running and I was up to 13 local backups and the OneDrive backups stayed at my setting of 10 but I believe it was just using the number from the last successful sync since the syncs were failing. I think that was the best possible result if it can't connect to OneDrive. BUT - during the period where the syncs were failing the status of "onedrivebackup" still said "backed up" I guess because both numbers were greater than my configured retention of 10 and even though I had "notify on error" enabled I did not get a notice (all other HA notices were working) about the sync failures. I found it in the add-on log when I was just checking stuff. I fixed the auth (which was generating a new code properly - thanks for that error handling) and everything went back in sync. Just wanted to let you know about the lack of notice on those 2 items. I went ahead and added an automation to look for the event types you list in your docs and send me a notice. Unfortunately the HA docs don't give much detail about event triggers so I just put the values you list in the "event type" field and have not come up with a good way to verify that the trigger will work. In spite of this latest hiccup, I appreciate the effort you have put into this add-on and have been more than happy with it's reliability, versitility and ease of configuration.

lavinir commented 4 months ago

Thank you for sharing. What's strange to me is if there were errors fetching the OneDrive backups you shouldn't have been getting new local backups created and the logs should have shown errors. (I don't suppose you have those somewhere?)

The state should also not have been showing backed up (at most a "Backed Up Local" state) unless it throw an error before it reached the update code though this would have killed all future backup creation.

How long did this last and what is the backup interval that you have set ?

The Persistent HA notifications are scoped to just some specific flows (Backup Creations / Syncs). But it is probably a good idea to expand this for general / unexpected errors so that users get a notification of a problem in case they have no automations set around this.

@cgressens. Would be better if you opened a dedicated issue please.

camsaway commented 4 months ago

Hi, I'm guessing I have the same issue - 2 weeks ago my backups to OneDrive stopped. Will try the options above to fix.

Above has worked. I did see something in the log before I restarted but unfortunately with the restart it's gone. Said something like "can't find a new config, setting backup interval to 24hours".

Giolovin commented 4 months ago

I am getting the following message from Microsoft:

invalid_request: The provided request must include a 'redirecturi' input parameter.

I am signing in from the same browser (Microsoft Edge) as where I'm signed in for Home Assistant.

lavinir commented 4 months ago

I am getting the following message from Microsoft:

invalid_request: The provided request must include a 'redirecturi' input parameter.

I am signing in from the same browser (Microsoft Edge) as where I'm signed in for Home Assistant.

When are you seeing this error ? During the sign in process? Try to clear your history and restart the addon.

If it still persists try to start clean by re-installing the addon. I'm not sure if this is related but there were some issues caused by upgrading to the newest libraries.

amorris101 commented 4 months ago

Realized today that i hadn't had a OneDrive backup since FEB 7. Code was rejected for signing in to OneDrive via HA OneDrive Backup Add-On. Stopped and started OneDrive Backup add-on and new code was generated and it was accepted by Microsoft and now I'm back in business with backups to OneDrive.

Any way a notification can be generated when OneDrive Backup stops working? I had no idea I wasn't backing up to OneDrive for nearly three weeks until I decided to take a look earlier today.

charlierutledge commented 4 months ago

Same thing happened to me. My backups stopped working after the Feb 13 backup. Same issues as reported above, once I restarted the add-on I was able to go through the login flow.

github-actions[bot] commented 3 months ago

This issue is stale because it has been open for 30 days with no activity.

Marty56 commented 1 week ago

The authentication is not working. I have tried all the "tricks" in this thread but no luck.

lavinir commented 1 week ago

@Marty56 Could you please share some specific details. What happens on start up of the addon? Do you get a new code to authenticate with ? What happens when you authenticate ?