Skip to content

Bug: Software ignores my data folder and config #3465

@AleixMT

Description

@AleixMT

Describe the bug

When I run the program, I pass it my config via volume mounting, which is recognized by OneDrive, but then it does not use the specified data folder via sync_dir, resulting in syncing the data inside the container and not being able to see it from the host.

Operating System Details

Linux p023 5.14.0-1033-oem #36-Ubuntu SMP Mon Apr 4 15:15:49 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux

Client Installation Method

From Distribution Package

OneDrive Account Type

SharePoint

What is your OneDrive Application Version

onedrive v2.5.7

What is your OneDrive Application Configuration

Application version                          = onedrive v2.5.7                                                                                                                                                     
Compiled with                                = LDC 2100                                                                                                                                                            
Curl version                                 = libcurl/8.14.1 OpenSSL/3.0.17 zlib/1.2.13 brotli/1.0.9 zstd/1.5.4 libidn2/2.3.3 libpsl/0.21.2 libssh2/1.10.0 nghttp2/1.52.0 librtmp/2.3 OpenLDAP/2.5.13             
User Application Config path                 = /root/.config/onedrive                                                                                                                                              
System Application Config path               = /etc/onedrive                                                                                                                                                       
Applicable Application 'config' location     = /root/.config/onedrive/config                                                                                                                                       
Configuration file found in config location  = false - using application defaults                                                                                                                                  
Applicable 'sync_list' location              = /root/.config/onedrive/sync_list                                                                                                                                    
Applicable 'items.sqlite3' location          = /root/.config/onedrive/items.sqlite3                                                                                                                                
Config option 'drive_id'                     =                                                                                                                                                                     
Config option 'sync_dir'                     = ~/OneDrive                                                                                                                                                          
Config option 'use_intune_sso'               = false                                                                                                                                                               
Config option 'use_device_auth'              = false                                                                                                                                                               
Config option 'enable_logging'               = false                                                                                                                                                               
Config option 'log_dir'                      = /var/log/onedrive                                                                                                                                                   
Config option 'disable_notifications'        = false                                                                                                                                                               
Config option 'skip_dir'                     =                                                                                                                                                                     
Config option 'skip_dir_strict_match'        = false                                                                                                                                                               
Config option 'skip_file'                    = ~*|.~*|*.tmp|*.swp|*.partial
Config option 'skip_dotfiles'                = false 
Config option 'skip_symlinks'                = false 
Config option 'skip_size'                    = 0
Config option 'monitor_interval'             = 300
Config option 'monitor_log_frequency'        = 12
Config option 'monitor_fullscan_frequency'   = 12
Config option 'read_only_auth_scope'         = false 
Config option 'dry_run'                      = false 
Config option 'upload_only'                  = false 
Config option 'download_only'                = false 
Config option 'local_first'                  = false 
Config option 'check_nosync'                 = false 
Config option 'check_nomount'                = false 
Config option 'resync'                       = false 
Config option 'resync_auth'                  = false 
Config option 'cleanup_local_files'          = false 
Config option 'disable_permission_set'       = false 
Config option 'transfer_order'               = default
Config option 'delay_inotify_processing'     = false 
Config option 'inotify_delay'                = 5
Config option 'display_transfer_metrics'     = false 
Config option 'force_session_upload'         = false 
Config option 'file_fragment_size'           = 10
Config option 'classify_as_big_delete'       = 1000
Config option 'disable_upload_validation'    = false 
Config option 'disable_download_validation'  = false 
Config option 'bypass_data_preservation'     = false 
Config option 'no_remote_delete'             = false 
Config option 'remove_source_files'          = false 
Config option 'sync_dir_permissions'         = 700
Config option 'sync_file_permissions'        = 600
Config option 'space_reservation'            = 52428800
Config option 'permanent_delete'             = false 
Config option 'write_xattr_data'             = false 
Config option 'create_new_file_version'      = false
Config option 'application_id'               = d50ca740-c83f-4d1b-b616-12c519384f0c
Config option 'azure_ad_endpoint'            = 
Config option 'azure_tenant_id'              = 
Config option 'user_agent'                   = ISV|abraunegg|OneDrive Client for Linux/v2.5.7
Config option 'force_http_11'                = false
Config option 'debug_https'                  = false
Config option 'rate_limit'                   = 0
Config option 'operation_timeout'            = 3600
Config option 'dns_timeout'                  = 60
Config option 'connect_timeout'              = 10
Config option 'data_timeout'                 = 60
Config option 'ip_protocol_version'          = 0
Config option 'threads'                      = 8
Config option 'max_curl_idle'                = 120
Compile time option --enable-notifications   = false
Config option 'use_recycle_bin'              = false
Config option 'recycle_bin_path'             = /root/.local/share/Trash/

Selective sync 'sync_list' configured        = false

Config option 'sync_business_shared_items'   = false

Config option 'webhook_enabled'              = false

What is your 'curl' version

curl 8.14.1 (x86_64-pc-linux-gnu) libcurl/8.14.1 OpenSSL/3.0.17 zlib/1.2.13 brotli/1.0.9 zstd/1.5.4 libidn2/2.3.3 libpsl/0.21.2 libssh2/1.10.0 nghttp2/1.52.0 librtmp/2.3 OpenLDAP/2.5.13
Release-Date: 2025-06-04, security patched: 8.14.1-2~bpo12+1
Protocols: dict file ftp ftps gopher gophers http https imap imaps ipfs ipns ldap ldaps mqtt pop3 pop3s rtmp rtsp scp sftp smb smbs smtp smtps telnet tftp ws wss
Features: alt-svc AsynchDNS brotli GSS-API HSTS HTTP2 HTTPS-proxy IDN IPv6 Kerberos Largefile libz NTLM PSL SPNEGO SSL threadsafe TLS-SRP UnixSockets zstd

Where is your 'sync_dir' located

Local

What are all your system 'mount points'

overlay on / type overlay (rw,relatime,lowerdir=/var/lib/docker/overlay2/l/XHZ3JJA3AK7YUH5W2A3YP5QD2U:/var/lib/docker/overlay2/l/GVY7CEUGB56HVT45U3KTDCHJVW:/var/lib/docker/overlay2/l/VU2YUXC2ECMGKHKVWJH3MTE3HD:/var/lib/docker/overlay2/l/5RPXP6IDWROOR5MAGUSC52UQAH:/var/lib/docker/overlay2/l/MVZTAXMVFWEP3T55JUL2IZIOMI:/var/lib/docker/overlay2/l/5L7AY5HPNWY5ZL3GLNQGKRUP6S:/var/lib/docker/overlay2/l/WPJI2GF4JGKB3E5HYCSMTWJYVS,upperdir=/var/lib/docker/overlay2/cd1407955fb6c60aa6a4af262b134a4f14057d55290f5151e5f4bffe43f82826/diff,workdir=/var/lib/docker/overlay2/cd1407955fb6c60aa6a4af262b134a4f14057d55290f5151e5f4bffe43f82826/work)
proc on /proc type proc (rw,nosuid,nodev,noexec,relatime)
tmpfs on /dev type tmpfs (rw,nosuid,size=65536k,mode=755,inode64)
devpts on /dev/pts type devpts (rw,nosuid,noexec,relatime,gid=5,mode=620,ptmxmode=666)
sysfs on /sys type sysfs (ro,nosuid,nodev,noexec,relatime)
tmpfs on /sys/fs/cgroup type tmpfs (rw,nosuid,nodev,noexec,relatime,mode=755,inode64)
cgroup on /sys/fs/cgroup/systemd type cgroup (ro,nosuid,nodev,noexec,relatime,xattr,name=systemd)
cgroup on /sys/fs/cgroup/hugetlb type cgroup (ro,nosuid,nodev,noexec,relatime,hugetlb)
cgroup on /sys/fs/cgroup/pids type cgroup (ro,nosuid,nodev,noexec,relatime,pids)
cgroup on /sys/fs/cgroup/misc type cgroup (ro,nosuid,nodev,noexec,relatime,misc)
cgroup on /sys/fs/cgroup/blkio type cgroup (ro,nosuid,nodev,noexec,relatime,blkio)
cgroup on /sys/fs/cgroup/perf_event type cgroup (ro,nosuid,nodev,noexec,relatime,perf_event)
cgroup on /sys/fs/cgroup/freezer type cgroup (ro,nosuid,nodev,noexec,relatime,freezer)
cgroup on /sys/fs/cgroup/cpu,cpuacct type cgroup (ro,nosuid,nodev,noexec,relatime,cpu,cpuacct)
cgroup on /sys/fs/cgroup/cpuset type cgroup (ro,nosuid,nodev,noexec,relatime,cpuset)
cgroup on /sys/fs/cgroup/devices type cgroup (ro,nosuid,nodev,noexec,relatime,devices)
cgroup on /sys/fs/cgroup/net_cls,net_prio type cgroup (ro,nosuid,nodev,noexec,relatime,net_cls,net_prio)
cgroup on /sys/fs/cgroup/rdma type cgroup (ro,nosuid,nodev,noexec,relatime,rdma)
cgroup on /sys/fs/cgroup/memory type cgroup (ro,nosuid,nodev,noexec,relatime,memory)
mqueue on /dev/mqueue type mqueue (rw,nosuid,nodev,noexec,relatime)
shm on /dev/shm type tmpfs (rw,nosuid,nodev,noexec,relatime,size=65536k,inode64)
/dev/nvme1n1p2 on /onedrive/data type ext4 (rw,relatime,errors=remount-ro)
/dev/nvme1n1p2 on /onedrive/logs type ext4 (rw,relatime,errors=remount-ro)
/dev/nvme1n1p2 on /onedrive/conf type ext4 (rw,relatime,errors=remount-ro)
/dev/nvme1n1p2 on /etc/resolv.conf type ext4 (rw,relatime,errors=remount-ro)
/dev/nvme1n1p2 on /etc/hostname type ext4 (rw,relatime,errors=remount-ro)
/dev/nvme1n1p2 on /etc/hosts type ext4 (rw,relatime,errors=remount-ro)
devpts on /dev/console type devpts (rw,nosuid,noexec,relatime,gid=5,mode=620,ptmxmode=666)
proc on /proc/bus type proc (ro,nosuid,nodev,noexec,relatime)
proc on /proc/fs type proc (ro,nosuid,nodev,noexec,relatime)
proc on /proc/irq type proc (ro,nosuid,nodev,noexec,relatime)
proc on /proc/sys type proc (ro,nosuid,nodev,noexec,relatime)
proc on /proc/sysrq-trigger type proc (ro,nosuid,nodev,noexec,relatime)
tmpfs on /proc/asound type tmpfs (ro,relatime,inode64)
tmpfs on /proc/acpi type tmpfs (ro,relatime,inode64)
tmpfs on /proc/kcore type tmpfs (rw,nosuid,size=65536k,mode=755,inode64)
tmpfs on /proc/keys type tmpfs (rw,nosuid,size=65536k,mode=755,inode64)
tmpfs on /proc/timer_list type tmpfs (rw,nosuid,size=65536k,mode=755,inode64)
tmpfs on /proc/scsi type tmpfs (ro,relatime,inode64)
tmpfs on /sys/firmware type tmpfs (ro,relatime,inode64)
tmpfs on /sys/devices/virtual/powercap type tmpfs (ro,relatime,inode64)

What are all your local file system partition types

NAME        FSTYPE FSVER LABEL UUID FSAVAIL FSUSE% MOUNTPOINTS
loop0                                              
loop1                                              
loop2                                              
loop3                                              
loop4                                              
loop5                                              
loop7                                              
loop8                                              
loop9                                              
loop10                                             
loop11                                             
loop12                                             
loop13                                             
loop14                                             
loop15                                             
loop16                                             
loop17                                             
loop18                                             
loop19                                             
loop20                                             
loop21                                             
loop22                                             
loop23                                             
loop24                                             
loop25                                             
loop26                                             
loop27                                             
loop28                                             
loop29                                             
nvme0n1                                            
`-nvme0n1p1                                        
nvme1n1                                            
|-nvme1n1p1                                        
`-nvme1n1p2                          411.9G    51% /etc/hosts
                                                   /etc/hostname
                                                   /etc/resolv.conf
                                                   /onedrive/conf
                                                   /onedrive/logs
                                                   /onedrive/data

How do you use 'onedrive'

I am using it to sync one folder from Sharepoint with a local folder in my machine. I just want to download from my machine. Soon, I will be installing the service in another machine that will either download and upload files.

Steps to reproduce the behaviour

  1. Create the onedrive folder.
  2. Create inside the folders conf, data and logs
  3. Inside the folder conf, paste the following text:
sync_dir = "/onedrive/data"
drive_id = "b!KJ1B2DCzSkuCoY3RpzAwFygN2jp0uu1LuLHdfD8wx_3n_8Rkg41LSY25TQTmrzYb"

log_dir = "/onedrive/logs/"

sync_dir_permissions = "755"
sync_file_permissions = "644"

#download_only = "true"
cleanup_local_files = "true"
  1. Inside onedrive, create the run.sh script and paste this content:
#!/usr/bin/env bash

SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )

docker stop onedrive
docker rm onedrive


echo "Running on ${SCRIPT_DIR}"
docker run \
  -it \
  --name onedrive \
  --userns host \
  -v ${SCRIPT_DIR}/conf:/onedrive/conf \
  -v ${SCRIPT_DIR}/data:/onedrive/data \
  -v ${SCRIPT_DIR}/logs:/onedrive/logs \
  -l io.containers.autoupdate=image \
  --restart unless-stopped \
  --health-cmd "sh -c '[ -s /onedrive/conf/items.sqlite3-wal ]'" \
  --health-interval 60s \
  --health-retries 2 \
  --health-timeout 5s \
  docker.io/driveone/onedrive:latest \
  --single-directory "Institutional Strengthening/_Projects/iMarina_load_automation/input" --monitor
  1. Run the script. It is possible that the first execution works well, but after the first, it stops using /onedrive/data as the destination of information, and instead uses the onedrive folder in the home folder. You can remove the contents of the volumes and the error will still persist.

I also tried the edge image with the same results: docker.io/driveone/onedrive:latest

Complete Verbose Log Output

10:36 $ /bin/bash /home/amarine/Desktop/iMarina-load/services/onedrive/run.sh
onedrive
onedrive
Running on /home/amarine/Desktop/iMarina-load/services/onedrive
# Running container as user: onedrive
# Base Args: --confdir /onedrive/conf --syncdir /onedrive/data
# We run in Monitor Mode
# Adding --monitor
# Changing ownership permissions on /onedrive/data and /onedrive/conf to onedrive:onedrive
# Launching 'onedrive' as onedrive via gosu
Using IPv4 and IPv6 (if configured) for all network operations
Attempting to contact Microsoft OneDrive Login Service
Successfully reached Microsoft OneDrive Login Service
Configuring Global Azure AD Endpoints

Please authorise this application by visiting the following URL:

https://login.microsoftonline.com/common/oauth2/v2.0/authorize?client_id=d50ca740-c83f-4d1b-b616-12c519384f0c&scope=Files.ReadWrite%20Files.ReadWrite.All%20Sites.ReadWrite.All%20offline_access&response_type=code&prompt=login&redirect_uri=https://login.microsoftonline.com/common/oauth2/nativeclient

After completing the authorisation in your browser, copy the full redirect URI (from the address bar) and paste it below.

Paste redirect URI here: LOGIN_URL_OMITTED_FOR_SECURITY
The OneDrive Client was asked to search for this directory online and create it if it's not located: ./Institutional Strengthening/_Projects/iMarina_load_automation/input
WARNING: The requested path for --single-directory does not exist locally. Creating requested path within /home/onedrive/OneDrive
OneDrive synchronisation interval (seconds): 300
Initialising filesystem inotify monitoring ...
Performing initial synchronisation to ensure consistent local state ...
Attempting to contact Microsoft OneDrive Login Service
Successfully reached Microsoft OneDrive Login Service
Starting a sync with Microsoft OneDrive
Generating a /delta response from the OneDrive API for this Drive ID: b!YdV0WtIOYU2cCp4JCb4vTACp0jPx3tlKuEyh3jeKPH5FfNilemd1SJ5ZOxZysJDM and Item ID: 01XVZ3PHBHJ2FSJ6JCPZFKDMV5GI4ZZB24 . 
Finished processing self generated /delta JSON response from the OneDrive API
Processing 1 applicable JSON items received from Microsoft OneDrive .. 
Performing a database consistency and integrity check on locally stored data . 
Scanning the local file system 'Institutional Strengthening/_Projects/iMarina_load_automation/input' for new data to upload . 
Performing a last examination of the most recent online data within Microsoft OneDrive to complete the reconciliation process
Generating a /delta response from the OneDrive API for this Drive ID: b!YdV0WtIOYU2cCp4JCb4vTACp0jPx3tlKuEyh3jeKPH5FfNilemd1SJ5ZOxZysJDM and Item ID: 01XVZ3PHBHJ2FSJ6JCPZFKDMV5GI4ZZB24 . 
Finished processing self generated /delta JSON response from the OneDrive API
Processing 1 applicable JSON items received from Microsoft OneDrive . 
Sync with Microsoft OneDrive is complete
Attempting to contact Microsoft OneDrive Login Service
Successfully reached Microsoft OneDrive Login Service
Starting a sync with Microsoft OneDrive
Syncing changes from Microsoft OneDrive ...
Sync with Microsoft OneDrive is complete
Attempting to contact Microsoft OneDrive Login Service
Successfully reached Microsoft OneDrive Login Service
Starting a sync with Microsoft OneDrive
Syncing changes from Microsoft OneDrive ...
Sync with Microsoft OneDrive is complete

Screenshots

No response

Other Log Information or Details

Additional context

I know it seems weird, and probably is my fault for not knowing a lot of Docker, but from what I know each execution should be independent from each other. Only the information on the volumes is retained and should not affect more executions. But I tried deleting the information on the volumes to "reset" the system but it keeps on ignoring the usage of /onedrive/data.

Could you be so kind to take a look into this and explain me what I am doing wrong? This is not like a previous issue where I was doing shady things with the refresh_token or the --resync option. Now i'm just running the program in my developer workstation, so there is no need for full automation.

Thank you so much for your effort on creating and maintaining this program. My contribution is small but sincere.

I had experienced similar issues when using compose.yml to deploy this software automatically, but I finally fixed it. That is why I tried with Docker run this time, with the same results.

You can see how I specified sync_dir = "/onedrive/data", but the logs say WARNING: The requested path for --single-directory does not exist locally. Creating requested path within /home/onedrive/OneDrive

Is it because I am using --single-directory incorrectly? Any help is welcome

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions