jstaf / onedriver

A native Linux filesystem for Microsoft OneDrive
GNU General Public License v3.0
1.95k stars 96 forks source link

OneDrive disconnects #391

Closed username227 closed 5 months ago

username227 commented 7 months ago

Hi, the OneDrive mount disconnects randomly when I haven't used my computer in a little while. It won't automatically connect.

Is there a way to get it to automatically reconnect? Or, alternatively, is there a way to set up a cronjob to run at regular intervals to reconnect in the event it was disconnected? I've tried the second approach but can't get it to work properly.

foopsss commented 7 months ago

I'm pretty sure that's not normal behaviour (or never happened to me at least). Sounds like you might have something killing the onedriver process.

It'd help if you can provide some details about your system, like your distro, and the method you used to install onedriver.

username227 commented 7 months ago

Hi, thanks for responding. I am using Arch with Cinnamon. Onedriver was installed through the chaotic-aur repository.

I did finally get a workaround going, I was able to successfully schedule a cronjob to run a onedriver command every hour just in case that it is disconnected, but I assume this should not be necessary.

username227 commented 7 months ago

onedriverjournal.txt.gz I'm attaching journal control output associated with onedriver, perhaps this might help.

Is it normal to have this much going on in journalctl related to onedriver? I noticed also some entries indicating that auth expired and it was attempting to restore. I have no idea if this is related to the disconnecting or not.

username227 commented 7 months ago

Just found the error code after having it drop off in real time:

Feb 28 08:26:24 archlinux onedriver[1037]: 08:26:24 INF Fetched 0 deltas. Feb 28 08:26:24 archlinux onedriver[1037]: 08:26:24 DBG Serializing cache metadata to disk. Feb 28 08:26:54 archlinux onedriver[1037]: 08:26:54 INF Fetched 0 deltas. Feb 28 08:26:54 archlinux onedriver[1037]: 08:26:54 DBG Serializing cache metadata to disk. Feb 28 08:27:24 archlinux onedriver[1037]: 08:27:24 WRN Authentication token invalid or new app permissions required, forcing reauth before retrying. code=InvalidAuthenticationToken Feb 28 08:27:24 archlinux onedriver[1037]: cannot open display: Feb 28 08:27:24 archlinux systemd[1027]: onedriver@home-jerry-OneDrive.service: Main process exited, code=exited, status=1/FAILURE Feb 28 08:27:24 archlinux systemd[1]: home-jerry-OneDrive.mount: Deactivated successfully. Feb 28 08:27:24 archlinux systemd[1027]: onedriver@home-jerry-OneDrive.service: Failed with result 'exit-code'. Feb 28 08:27:24 archlinux systemd[1027]: onedriver@home-jerry-OneDrive.service: Consumed 8.339s CPU time.

There have also been a few times when i have tried to reactivate using the GUI and it asks for new credentials even though it's already been authenticated long ago. could be related.

jstaf commented 5 months ago

The authentication can expire in some cases. You should do what the app says and reauthenticate. It looks like there's some issue with opening up an authentication window on your setup, so you can also try onedriver -a to manually authenticate on the command line.

LiamTheBox commented 4 months ago

Just found the error code after having it drop off in real time:

Feb 28 08:26:24 archlinux onedriver[1037]: 08:26:24 INF Fetched 0 deltas. Feb 28 08:26:24 archlinux onedriver[1037]: 08:26:24 DBG Serializing cache metadata to disk. Feb 28 08:26:54 archlinux onedriver[1037]: 08:26:54 INF Fetched 0 deltas. Feb 28 08:26:54 archlinux onedriver[1037]: 08:26:54 DBG Serializing cache metadata to disk. Feb 28 08:27:24 archlinux onedriver[1037]: 08:27:24 WRN Authentication token invalid or new app permissions required, forcing reauth before retrying. code=InvalidAuthenticationToken Feb 28 08:27:24 archlinux onedriver[1037]: cannot open display: Feb 28 08:27:24 archlinux systemd[1027]: onedriver@home-jerry-OneDrive.service: Main process exited, code=exited, status=1/FAILURE Feb 28 08:27:24 archlinux systemd[1]: home-jerry-OneDrive.mount: Deactivated successfully. Feb 28 08:27:24 archlinux systemd[1027]: onedriver@home-jerry-OneDrive.service: Failed with result 'exit-code'. Feb 28 08:27:24 archlinux systemd[1027]: onedriver@home-jerry-OneDrive.service: Consumed 8.339s CPU time.

There have also been a few times when i have tried to reactivate using the GUI and it asks for new credentials even though it's already been authenticated long ago. could be related.

This happened to me aswell, expect I would lose connection when using a VPN or moving to a different network like my university after turning it on

jpiesing commented 1 month ago

I'm seeing the same issue when I leave onedrive connected overnight doing an rsync from my laptop to the onedrive.

05:09:37 WRN Authentication token invalid or new app permissions required, forcing reauth before retrying. code=unauthenticated SIGABRT: abort