abraunegg / onedrive

OneDrive Client for Linux
https://abraunegg.github.io
GNU General Public License v3.0
10.16k stars 864 forks source link

Bug: (Docker) conf file is modified on container start causing resync to be required #2889

Closed cholzer79 closed 1 month ago

cholzer79 commented 1 month ago

Describe the bug

https://github.com/abraunegg/onedrive/discussions/2887 When using a bind to give the docker container access to the data and conf folders on the host, the container will modify the conf file on every start causing a resync to be required. The solution is to enter the host path of the data folder inside the conf file for the sync_dir parameter.

Operating System Details

Linux truenas 6.6.44-production+truenas #1 SMP PREEMPT_DYNAMIC Wed Oct  2 13:32:21 UTC 2024 x86_64 GNU/Linux
No LSB modules are available.
Distributor ID: Debian
Description:    Debian GNU/Linux 12 (bookworm)
Release:        12
Codename:       bookworm

Client Installation Method

From Distribution Package

OneDrive Account Type

Personal

What is your OneDrive Application Version

v2.5.2-2-g3ad139a

What is your OneDrive Application Configuration

when I run onedrive --display-config inside the docker container, it does not return the contents of the conf file.

The result I get shows that i.e. webhook is disabled, while webhook is not only enabled, it is also working fine and showing up inside the log.

output from onedrive --display-config:
Config option 'webhook_enabled'              = false

Output from the log:
Renewing webhook subscription for updates ...
OneDrive API Webhook: handled validation request
Renewed webhook subscription 43a47ee9-57c3-401d-bc51-7f1cb50dc9ff with expiration: 2024-10-06T20:57:29.483Z

What is your 'curl' version

that is the result from inside the docker container:
curl 8.10.1 (x86_64-pc-linux-gnu) libcurl/8.10.1 GnuTLS/3.7.9 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 ngtcp2/1.6.0 nghttp3/1.4.0 librtmp/2.3 OpenLDAP/2.5.13
Release-Date: 2024-09-18, security patched: 8.10.1-1~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 HTTP3 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'

not sure if this is required as this is about the docker container

What are all your local file system partition types

not sure if this is required as this is about the docker container

How do you use 'onedrive'

onedrive runs as docker container on my TrueNAS system. onedrive has been setup with Portainer.

Steps to reproduce the behaviour

  1. install the onedrive docker container
  2. use binds for data and conf folders Screenshot 2024-10-06 193848
  3. (not sure if required) configure webhook in conf file
  4. start the container with the ONEDRIVE_RESYNC ENV set to 1
  5. let it sync
  6. stop the container
  7. change the ONEDRIVE_RESYNC ENV to 1
  8. watch the modification time of the conf file
  9. start the onedrive container
  10. see the conf file modification date change and onedrive report "An application configuration change has been detected where a --resync is required"

Complete Verbose Log Output

I am not sure how not to run the docker container in --monitor mode.

Screenshots

No response

Other Log Information or Details

No response

Additional context

No response

abraunegg commented 1 month ago

To all with this issue This has been determined an unfortunate regression from v2.5.0-alpha-4

In v2.5.0-alpha-4 there was specific code to look for Docker use of --sync-dir .. however somehow this got lost|dropped|erased between alpha-4 and alpha-5 ............

Please use the following instructions to clone this PR:

git clone https://github.com/abraunegg/onedrive.git
cd onedrive
git fetch origin pull/2901/head:pr2901
git checkout pr2901

Augment the above with the instructions here on building your own Docker container:

https://github.com/abraunegg/onedrive/blob/master/docs/docker.md#building-a-custom-docker-image

This has been tested with Docker via standard means, and via Docker Compose.

Please can you test this PR in your environment for resolution.

abraunegg commented 3 weeks ago

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.