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: 500 Did not receive Set Token Message after First Authenticated Request Message #29

Open
michael0815000 opened this issue Jul 10, 2024 · 17 comments

Comments

@michael0815000
Copy link

michael0815000 commented Jul 10, 2024

Hallo Stefan,

first I want to thank you for providing this software.
I am using it since more than a year in a docker container on my Synology NAS for backups to MS Onedrive in the HyperBackup App.
The last successfull backup I created on June 5th 2024.
Now all Onedrive targets have the status "Offline".
In the logs I see the following error messages:

2024/07/10 20:27:20,stdout,2024-07-10T18:27:20.631Z proxy:error [168608926/9686] Sending error response: 500 Did not receive Set Token Message after First Authenticated Request Message
2024/07/10 20:27:20,stdout,2024-07-10T18:27:20.630Z proxy:error Did not receive Set Token Message after First Authenticated Request Message

Do you have any idea what is happening here? Would be very nice if you could fix this.

Thanks & Best Regards

Michael

@alexdraconian
Copy link

I also getting same error message. I'm using Synology intel CPU model and using this via docker container.

  • Resetting container, or deleting and recreating container did nothing.
  • No changes were made before this occurs.
  • I started getting this error since july 3, when backup rotation was enabled. Since then, I couldn't create new task also. (Cloudsync also errored out, but I could fix it by deleting Onedrive and re-logging in)

@seal-82
Copy link

seal-82 commented Oct 12, 2024

I'm also encountering this error. From one day to the other, backup stopped working. Removed the backup. Also restarted the Docker container. But still getting the error. For other backups to OneDrive, it is running without errors. Very strage.

Did you somehow manage to get it working again?

@SIA325
Copy link

SIA325 commented Oct 18, 2024

Same here. Two backup jobs with different Onedrive users suddenly stopped working. Even a clean reinstall of the container results in the error mentioned above.

@seal-82
Copy link

seal-82 commented Oct 22, 2024

second backup task that was running without problems until yesterday, now throwing the same error...

@seal-82
Copy link

seal-82 commented Oct 22, 2024

I'm currently having a closer look at https://github.com/abraunegg/onedrive
Maybe this could be a new option.

@Jermin
Copy link

Jermin commented Oct 22, 2024

I'm having the same issue. I've noticed that https://d.docs.live.net/ gives a HTTP 400 error. Do you think this is the cause?

@seal-82
Copy link

seal-82 commented Oct 23, 2024

The 400 error seems to be normal if you open the address in a browser. To test the Webdav accessibility of my onedrives, I did the following:
https://www.techstream.at/en/how-to-access-onedrive-via-webdav/

This was working properly without any limitations. So it seems to be related to some authentication issues inside the docker container. Still trying to figure it out...

@aleyush
Copy link

aleyush commented Oct 26, 2024

The same issue for me.
I use 2 OneDrive accounts. One stopped working with this error today, the other one works for now.

Сoincidence or not, the error appeared after I upgraded from DSM 7.2.1 to DSM 7.2.2.

@xiaosteven
Copy link

I encountered the same issue three days ago. I tried removing and re-adding the account, but it didn’t resolve the problem. I suspect that Microsoft may have introduced new authentication protocols on the server side, as error 500 usually indicates a server-related issue.

@pewsheen
Copy link

pewsheen commented Oct 27, 2024

https://learn.microsoft.com/en-us/openspecs/windows_protocols/ms-pass/2c80637d-438c-4d4b-adc5-903170a779f3
It was expected to receive a Set-Cookie header in the response of First Authenticated Request Message. But it doesn't now.

It seems that Set-Cookie is in response to the previous step of First Authenticated Request Message, and First Authenticated Request Message returns your Onedrive's file structure in the data section. If I set the cookie in the following requests, it'll respond with a 302 and ask for authentication.

BTW, I was testing it on my local machine. So the issue should not related to the NAS or docker container.

@seyfidin
Copy link

There was a change on microsofts side and they are migrating users in waves to the new servers, which behave sligthly different. WinSCP faced the same issues but they already fixed it.
https://winscp.net/tracker/2321

I hope the maintainer is still around otherwise I'll try to fix it und fork the repo when I'm done.

@seal-82
Copy link

seal-82 commented Nov 10, 2024

seyfidin, thanks for investigating! Looking forward to your fix.

Nevertheless, I changed to a different solution that I want to share with you: I'm running rclone in serve webdav mode as container. In this mode, rclone provides access to your Onedrive per webdav on a specified port of localhost.

Advantage: full power of rclone - all the possible remotes of rclone are available. speed is very good - I can use the full upload speed of my ISP.
Disadvantage: for each Onedrive you need a separate container running. And also: creating rclone config file is a bit tricky.

@seyfidin
Copy link

@seal-82 Thank you, that's a way better solution in my opinion. The setup was very easy and rclone is using the official onedrive api, where webdav for onedrive was never officially supported. Even Windows Explorer (Win 11 24H2) can't connect to Onedrive via webdav since the switch. So I would recommend everyone to switch to a more future proof solution, rclone.

@aleyush
Copy link

aleyush commented Nov 11, 2024

And also: creating rclone config file is a bit tricky.
The setup was very easy

Could one write an end-to-end instruction how to setup Hyper Backup to OneDive via rclone (like the one existed for the WebDav solution)?
I have read many mentions that it is possible, but all of them useless for people not knowing rclone well.

Also I do not understand how it works in "not a happy day" scenarios.
Does rclone work like a proxy, so any errors in any place results in Hyper Backup error?
Or sometimes Hyper Backup can "successfully" backup to rclone, rclone fails to transfer that to OneDrive, and noone knows about that?

@seyfidin
Copy link

When using '--vfs-cache-mode off' (default value, so you can ommit this parameter) it will act exactly like this proxy. The config file creation is tricky because of how the onedrive token is retrieved. It is possible to run all steps on a synology but it's easier to create the config on a seperate windows, mac or linux machine.

Download the binary for your machine and run "rclone config" -> new remote -> choose name -> choose onedrive by number -> skip client id -> skip client_secret -> region global ->advanced config no -> webbrowser yes -> finish authentication in browser -> retrieve your config file.

Then create a docker container and mount the config file to /config/rclone/rclone.conf, set following variables.

RCLONE_USER=choose_any_user // this credentials will hyperbackup use to connect to the local webdav server
RCLONE_PASS=choose_any_pass
RCLONE_ADDR=:8080 //choose a port where the webdav server will listen to

'docker run -d --name rclone --volume PATH_TO_CONFIG:/config/rclone/rclone.conf -e RCLONE_USER=choose_any_user -e RCLONE_PASS=choose_any_pass -e RCLONE_ADDR=:8080 -p 127.0.0.1:8080:8080 rclone/rclone serve webdav NAME_YOU_CHOOSE:'

@seal-82
Copy link

seal-82 commented Nov 12, 2024

@seyfidin : Thanks for the explanation... I learned that parameters can also be given to rclone by the environment variable RCLONE_<...>. Didn't know that.

For all looking for a documentation on how to get the Onedrive token, I can recommend to have a look at the Rclone documentation which offers a quite nice description: https://rclone.org/onedrive/

In the beginning, I used vfs-buffer 'full' as this was recommended in the rlcone container logs. If you don't give it a limit with vfs-cache-max-size, it will use your disk to buffer the files. I got a lot of errors in the rclone logs, so I changed back to vfs-cache-mode 'off'. Now it is working wihtout any errors in the logs.

@michael0815000
Copy link
Author

Thank you for all posts which finally solved my backup problem.
I have just created a little description what I did to switch to rclone in the german Synology forum:

https://www.synology-forum.de/threads/onedrive-fuer-verschluesseltes-hyperbackup.78169/post-1207202

Maybe this helps somebody.

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

9 participants