Skip to content
View in the app

A better way to browse. Learn more.

Unraid

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

[SUPPORT] Bversluis/ Onedrive

Featured Replies

Has anyone else just updated this container and struggling to keep it running? I start the container and moments later, it stopped. Nothing in the logs seems to explain why. I get a message saying I require a --resync. I can't open the console from the container as it won't run. How do I run the --resync? I tried opening Unraid terminal and typing onedrive --resync but it tells me it's an unknown command.

  • Replies 58
  • Views 22.5k
  • Created
  • Last Reply

Top Posters In This Topic

Most Popular Posts

  • This is awesome, thanks so much. Struggled getting rclone working but this works a treat.    edit: I would like to sync / backup my onedrive share using rsync or vorta. I am getting permissi

  • Try to use  -e ONEDRIVE_RESYNC=1  as extra parameter. That works so far for me, but when disabled the --resync request is there again. Its a kind of loop and I can see that the container cha

  • Hi There, I'm not sure if this thread is still active or not, but I was hoping to bounce my situation off you guys so I can learn what I've misconfigured. Firstly - very new, have learned a lot sett

Posted Images

On 9/16/2024 at 6:03 PM, bigrizz said:

Has anyone else just updated this container and struggling to keep it running? I start the container and moments later, it stopped. Nothing in the logs seems to explain why. I get a message saying I require a --resync. I can't open the console from the container as it won't run. How do I run the --resync? I tried opening Unraid terminal and typing onedrive --resync but it tells me it's an unknown command.

Same Issue here....

The container stops with the following log output after the first sync run:
 

Attempting to perform a database vacuum to optimise database
Database vacuum is complete
core.time.TimeException@/usr/lib/ldc/x86_64-linux-gnu/include/d/std/datetime/systime.d(9101): Invalid ISO Extended String: 2024-Sep-19 17:22:58.440
----------------
??:? [0x55e4b1223da5]
??:? [0x55e4b1220a31]
??:? [0x55e4b1220692]
??:? [0x55e4b1246eef]
??:? [0x55e4b1246f5d]
??:? [0x55e4b123660e]
??:? [0x55e4b122d6e7]
??:? [0x55e4b122cb8a]
??:? [0x55e4b12bde1a]
??:? [0x55e4b12bb54e]
??:? void rt.dmain2._d_run_main2(char[][], ulong, extern (C) int function(char[][])*).runAll() [0x14a210b9db7b]
??:? _d_run_main2 [0x14a210b9d995]
??:? _d_run_main [0x14a210b9d7ed]
??:? [0x14a21081c249]
??:? __libc_start_main [0x14a21081c304]
??:? [0x55e4b1202100]

 

onedrive docker asking for --resync in endless loop

 

Hello,

I have the problem that I run onedrive docker on Unraid since years, but after the last update its asking for a --resync because the config files was changed.

 

I let the config file unchanged and started docker with ONEDRIVE_RESYNC=1. After it was synced and finished, I removed ONEDRIVE_RESYNC=1 and restarted onedrive docker. But its aksing again for --resync as the config file was changed, but it was not changed. I tried this already several times. It finishes with "Sync with Microsoft OneDrive is complete"

 

Error:

# Running container as user: onedrive

# Base Args: --monitor

# We are being verbose

# Adding --verbose

# Changing ownership permissions on /onedrive/data and /onedrive/conf to onedrive:onedrive

# Launching 'onedrive' as onedrive via gosu

Reading configuration file: /onedrive/conf/config

Configuration file successfully loaded

Using 'user' configuration path for application config and state data: /onedrive/conf

An application configuration change has been detected where a --resync is required

 

Unraid 6.12.13 (latest)
onedrive docker driveone/onedrive latest, Sep 19, 2024

 

 

It seems that onedrive docker changes the config file itself:

 

Before start:

-rw------- 1 1997 users 358 Sep 21 13:25 .config.backup

-rw------- 1 1997 nogroup 28 Sep 21 13:25 .config.hash

-rw-r--r-- 1 1997 users 111 **Sep 21 13:59 config**

-rw-r--r-- 1 1997 nogroup 28672 Sep 21 13:25 items.sqlite3

-rw-r--r-- 1 1997 nogroup 32768 Sep 21 13:25 items.sqlite3-shm

-rw-r--r-- 1 1997 nogroup 16274032 Sep 21 14:22 items.sqlite3-wal -

rw------- 1 1997 users 928 Sep 21 13:25 refresh_token

-rw-r--r-- 1 1997 nogroup 1458 Sep 21 14:23 session_upload.2WStbYzhR0xQHpUw

-rw-r--r-- 1 1997 nogroup 1458 Sep 21 14:23 session_upload.6oOmZsewx3BVQNk5

-rw-r--r-- 1 1997 nogroup 1458 Sep 21 14:23 session_upload.hLEsbQDvjaHFc9Su

 

After start:

-rw------- 1 1997 users 111 Sep 21 14:24 .config.backup

-rw------- 1 1997 nogroup 28 Sep 21 14:24 .config.hash

-rw-r--r-- 1 1997 users 111 **Sep 21 14:24 config**

-rw-r--r-- 1 1997 nogroup 28672 Sep 21 14:24 items.sqlite3

-rw-r--r-- 1 1997 nogroup 32768 Sep 21 14:24 items.sqlite3-shm

-rw-r--r-- 1 1997 nogroup 24752 Sep 21 14:24 items.sqlite3-wal

-rw------- 1 1997 users 928 Sep 21 14:24 refresh_token

 

I already asked this question on: 

https://github.com/abraunegg/onedrive/discussions/2839

and abraunegg answered me:

 

Quote

"I need to 100% correct your understanding here - the Docker container that is pulled from here: https://hub.docker.com/r/driveone/onedrive - does not - under any circumstance update, or write the config file."

 

 

Anyone an idea?

On 9/17/2024 at 2:03 AM, bigrizz said:

Has anyone else just updated this container and struggling to keep it running? I start the container and moments later, it stopped. Nothing in the logs seems to explain why. I get a message saying I require a --resync. I can't open the console from the container as it won't run. How do I run the --resync? I tried opening Unraid terminal and typing onedrive --resync but it tells me it's an unknown command.

I have the same problem.

 

On 9/17/2024 at 2:03 AM, bigrizz said:

Has anyone else just updated this container and struggling to keep it running? I start the container and moments later, it stopped. Nothing in the logs seems to explain why. I get a message saying I require a --resync. I can't open the console from the container as it won't run. How do I run the --resync? I tried opening Unraid terminal and typing onedrive --resync but it tells me it's an unknown command.

Try to use 

-e ONEDRIVE_RESYNC=1 

as extra parameter. That works so far for me, but when disabled the --resync request is there again. Its a kind of loop and I can see that the container changes the config file itself as the date changes. Therefore onedrive thinks, that the config file was changed.

Quote

Its a kind of loop and I can see that the container changes the config file itself as the date changes. Therefore onedrive thinks, that the config file was changed.


Whilst it may be in a loop - your theory that the container changes the config file is 100% inaccurate and false.

The application and/or the Docker container has zero code to write to the 'config' file. The application only ever reads it and closes it post reading it.

This issue you are all facing is something to do with how the Docker container has been integrated with this platform.

@abraunegg

 

The thing is, that I run onedrive container on Unraid since more than 2 years now. And i run several other docker containers on my system. I tested already yesterday, but its clear: ondrive docker on Unraid changes the config file. 

 

I tested with 2 onedrive installations and both change the date/time of the config file.

 

I tested with other docker containers and checked, if they change the config file, but the do not.

 

Therefore I think its a problem with this docker image.

And if you see above, other user have the same problem: @Cheeshead @bigrizz

 

The files are located on 2 WD black NVME 4 TB drives in a mirrored cache group.

Quote

Therefore I think its a problem with this docker image.

As the developer of the 'onedrive' application used within the Docker container, I know what the code of the application does. As the provider of the Docker image https://hub.docker.com/r/driveone/onedrive I also know what it does - which is it only uses a Docker volume to read a 'config' file if it exists, and to store the online cache file and your access token to the OneDrive service.

Neither the application or the Docker container writes a 'config' file. The application 'only' reads it if it exists.

Who ever implemented this in this platform, something with that integration is modifying the 'config' file each and every time - it is not the 'onedrive' binary or the Docker container.

Edited by abraunegg

@cosmas

What is the content of the 'config' file before you start the Docker container and after?

 

As per https://github.com/abraunegg/onedrive/blob/master/docs/usage.md#performing-a---resync - a resync is required when the following options are changed:

 

  • drive_id
  • sync_dir
  • skip_file
  • skip_dir
  • skip_dotfiles
  • skip_symlinks
  • sync_business_shared_items

Additionally, if you modify your 'sync_list' file, this also triggers this requirement.

 

A hash file is used to determine if the file has been changed, changing a single character in a comment will trigger a check of the 'config' or 'sync_list' to determine if something has changed, so the current backup of the files are read in, so that they can be compared with the current actual files.

 

If there is then a difference in the options being used, then this flags that a resync is required.

 

So .. either these options are being changed by Unraid (and given the config file is being updated - and I know that the 'onedrive' client does not do this) - this is why I am advising this is not a 'onedrive' bug or issue .. it is to do with how this has been integrated with this platform.

 

 

I uninstalled and reinstalled the docker and that seems to have rectified the --resync requirement. My new problem is that I am unable to open files in my shares that have been synced from OneDrive to my NAS. I had this same issue with the previous version and uncommenting the lines sync_dir_permissions = "777" and sync_file_permissions = "777" in the config file solved the issue previously. I just checked my config file and those lines are uncommented but I still have the permission issue. @abraunegg, is there anything else in the new version that I might need to adjust or is there something else I can do to restore the sync permissions?

Quote

is there anything else in the new version that I might need to adjust or is there something else I can do to restore the sync permissions?

Permission issues are a problem for how this is integrated to this platform ... 

 

Are you unable to access all files, or just files post re-installation of the Docker container? 

 

If all files, then this will be some sort of unraid problem because the 2nd Docker volume that gets used is your physical disk media ... nothing is stored inside the Docker container.

 

 

14 minutes ago, abraunegg said:

Permission issues are a problem for how this is integrated to this platform ... 

 

Are you unable to access all files, or just files post re-installation of the Docker container? 

 

If all files, then this will be some sort of unraid problem because the 2nd Docker volume that gets used is your physical disk media ... nothing is stored inside the Docker container.

 

 

Thanks for your quick response. I've just gone in to check other files and they were fine. Just the files post re-installation. That prompted me to check if anything else changed and I think I found my problem. I think the config file location in the Docker configuration reverted to the wrong folder. I changed it which then once again triggered a --resync requirement. I've kicked off a resync and I'll test permissions again. I'll come back with an update once I've done the check.

@abraunegg

 

I understand what you mean, but there is anywhere a code, which alters the config file. Therefore onedrive docker thinks, there are changes made in the config file and asks for a resync. I checked it already many times. This behavior is new.

 

To clarify it:

- onedrive docker changes the time and date of the config file immediately after start/restart

- but it does not change the content of the config file

 

This is e.g. the content of a config file:

monitor_interval = "86400"
check_nosync = "true""
rate_limit = "9830400"
download_only = "true"
skip_dir = "NAS01_upload"
skip_dir = "Anlagen"
skip_dir = "Duplicati"
skip_dir = "Synology_DS720plus_Uploads"

 

Files while onedrive docker was running:

 

drwxr-x--- 1 onedrive-download users        9 Sep 22 16:27 ./
drwxr-x--- 1 onedrive-download users        3 Sep 27  2023 ../
-rw------- 1 onedrive-download users      207 Sep 22 16:27 .config.backup
-rw------- 1 onedrive-download users       28 Sep 22 16:27 .config.hash
-rw-r----- 1 onedrive-download users      207 Sep 22 16:27 config
-rw-r--r-- 1 onedrive-download users 39702528 Sep 22 16:42 items.sqlite3
-rw-r--r-- 1 onedrive-download users    32768 Sep 22 16:27 items.sqlite3-shm
-rw-r--r-- 1 onedrive-download users        0 Sep 22 16:43 items.sqlite3-wal
-rw------- 1 onedrive-download users      928 Sep 22 16:27 refresh_token

 

Files after a restart of onedrive docker container on Sept. 23, at 11:14am:

 

drwxr-x--- 1 onedrive-download users        7 Sep 23 11:14 ./
drwxr-x--- 1 onedrive-download users        3 Sep 27  2023 ../
-rw------- 1 onedrive-download users      207 Sep 22 16:27 .config.backup
-rw------- 1 onedrive-download users       28 Sep 22 16:27 .config.hash
-rw-r----- 1 onedrive-download users      207 Sep 23 11:14 config
-rw-r--r-- 1 onedrive-download users 36794368 Sep 23 11:14 items.sqlite3
-rw------- 1 onedrive-download users      928 Sep 22 16:27 refresh_token

 

Edited by cosmas
need for more information

@cosmas

Are you 100% sure that the config file changed when starting and not when stopping the container?
Some Apps write out their config when being stopped...

@ADvorsky

Yes I am sure.

But it should NEVER change the config file.

@abraunegg

 

I found the reason for the problem with this --resync loop:

 

It was because there was the code "sync_dir = "/onedrive/data" " missing in the config file.

It seems that the new version need this setting, the older versions not.

 

After adding

 

sync_dir = "/onedrive/data"

 

to the config file, the file is not touched by onedrive docker, means the date and time is not changed and the resync loop stopped. 

 

I have seen, when installing new docker container, "sync_dir = "/onedrive/data" " is added automatically in the config file... so I found the reason for this problem.

Quote

I understand what you mean, but there is anywhere a code, which alters the config file.

 

I wrote the application. There is zero code that modifies a users config file.

 

Quote

I have seen, when installing new docker container, "sync_dir = "/onedrive/data" " is added automatically in the config file... so I found the reason for this problem.


Great - but by default the client or Docker container does not write out any 'config' file. It only ever reads it.

So the integration with this platform is where your problem lies as to why the 'config' file is being re-written etc ..... that is not my issue - but is an issue for the developer of the integration with this platform.
 

18 hours ago, bigrizz said:

Thanks for your quick response. I've just gone in to check other files and they were fine. Just the files post re-installation. That prompted me to check if anything else changed and I think I found my problem. I think the config file location in the Docker configuration reverted to the wrong folder. I changed it which then once again triggered a --resync requirement. I've kicked off a resync and I'll test permissions again. I'll come back with an update once I've done the check.

@abraunegg, I can confirm it was indeed the change in the config file location that was the problem as it now seems to be working properly after a resync. Thank you again for your response and your work on creating the integration. It is an indispensible part of how we access our files.

I am not very versed in this, but I have a theory why this was happening.

 

After reading the docker usage documentation on GitHub of the client it seems that in 2.5.0 that the volume of the onedrive data dir was changed to a variable:

version: "3"
services:
    onedrive:
        image: driveone/onedrive:edge
        restart: unless-stopped
        environment:
            - ONEDRIVE_UID=${PUID}
            - ONEDRIVE_GID=${PGID}
        volumes: 
            - onedrive_conf:/onedrive/conf
            - ${ONEDRIVE_DATA_DIR}:/onedrive/data

- ${ONEDRIVE_DATA_DIR}:/onedrive/data

 

Whilst the docker template has defined the data dir with a container to host path configuration:

image.png.80db63911b39ab0ceb778838e06d10af.png

 

My theory is that with the template the data dir is not properly defined and the docker can't find the data dir in the template paths/variables or the config file and somehow that triggers a modify of the conf file. That could be the reason why it works to add sync_dir = "/onedrive/data" to the conf file.

 

I am not sure how we could translate - ${ONEDRIVE_DATA_DIR}:/onedrive/data to be used as a variable or path in the docker template on unraid, perhaps someone more versed can step in with some advice.

 

I could be completely wrong with all of the above, @abraunegg can maybe chime in if this is even possible.

When starting the container the modified time is updated on the conf file but as far as I can see no data is modified in the config file.

 

Confirming, adding:

sync_dir = "/onedrive/data"

to the config file does not trigger the modify. Modify date on the file stays the same as before starting the container.

Quote

After reading the docker usage documentation on GitHub of the client it seems that in 2.5.0 that the volume of the onedrive data dir was changed to a variable


It has always been that way in the documentation, even in prior releases (v2.3.x, v2.4.x etc).

 

Quote

When starting the container the modified time is updated on the conf file but as far as I can see no data is modified in the config file.


Again I need to re-iterate that the client or Docker container does not do this. The integration / this plugin that has been created is what must be doing that. I did not create the integration used here.
 

  • 1 month later...

How do I reauth?

 

It gives me this error: ERROR: You will need to issue a --reauth and re-authorise this client to obtain a fresh auth token.

  • 1 month later...

Hi there, 

 

i got the same problem. Is there a solution visible?

I am having an issue with the initialization of the app that I just can't get past.  Every time I start the container, it stops immediately, and in the logs I see:

 

Enter the response uri from your browser: An empty or invalid response uri was entered
The OneDrive API could not be initialised

 

I never get a chance to enter the response after visiting the login page.  Even when I start the container via command line it starts up, shows some logs, and goes right past the point where I am to enter information from the response.  I am not able to get it to pause so that I can login to my onedrive account and then come back to enter the response URI.  It immediately goes to the message above. 

Any ideas on how to get the response entered?

(am using the web based terminal for unraid here - should I be going in via SSH?)

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.