OneDrive not Syncing Files

  • Hi everyone,


    I am running OMV 7.4.10-1 (Sandworm) on a server I built for my homelab. I have no dockers/ containers as I just want a NAS that is reliable. I am running into issues with OneDrive not syncing my files. It's not uploading like it should. I have done this before with success but I had to redo my NAS and now it isn't working correctly. I have reinstalled OMV twice now and also reinstalled the plugin in hopes that it would fix the issue. No fix. Any ideas would be greatly appreciated.

  • chente

    Approved the thread.
    • Official Post

    You need to check the systemd journal for messages from onedrive.service. I had to run omv-onedrive --sync --resync to get it partly running. omv-onedrive is a wrapper command to use the correct configuration file and responsible for stopping and restarting the systemd service before executing the specified command line action; so do NOT use the onedrive command.


    I think the new onedrive package is bugged. I got really strange journal messages like


    Code
    Oct 27 18:47:12 omv7box (sleep)[14686]: onedrive.service: ProtectHostname=yes is configured, but UTS namespace setup is prohibited (container manager?), ignoring namespace setup.

    The strange thing is there is no ProtectHostname=yes setting in the onedrive systemd unit service file.



    It also seems to crash while downloading files.



    abraunegg Any ideas what is going wrong here?

  • votdev

    Added the Label OMV 7.x
  • Quote

    The strange thing is there is no ProtectHostname=yes setting in the onedrive systemd unit service file.

    That is a systemd issue .. nothing to do with the application. Take this up with the systemd developers



    Quote

    Any ideas what is going wrong here?


    What version of 'curl' is OMV providing? Please read:


    You have a couple of options here:

    1. Provide to OMV users a more up-to-date version of 'curl'

    2. Implement by 'default' the 'curl' downgrade options


    Additionally, v2.5.3 will also implement some of these items, but also print warning messages when bad curl versions are being used by the platform.


    Please also note - I did ask you to test v.2.5.x during the development phase to help iron out any issues with your OMV platform.

  • votdev


    Also - from your systemd service file extract, it does not *match* what is from the source:


    onedrive/contrib/systemd/onedrive.service.in at master · abraunegg/onedrive
    OneDrive Client for Linux. Contribute to abraunegg/onedrive development by creating an account on GitHub.
    github.com


    Your 'RestartPreventExitStatus=3` is incorrect.


    This should read 'RestartPreventExitStatus=126' so that when a resync is required, the system does not keep restarting the systemd service.



    Your logs also seem to indicate you have *multiple* onedrive processes running - one via the default systemd service and potentially one running manually.


    Please double check / triple check all of your configuration(s) to ensure you *only* have one client running per application configuration.


    The default Debian | Ubuntu packages *always* seem to install a default systemd service which can cause this sort of issue. Please read: https://github.com/abraunegg/o…a-or-distribution-package

    • Official Post

    Thanks for the response. I can not provide a newer curl package than Debian ships via their package repo for Debian 12, so i have to configure the downgrade options.


    I've done the following changes. Due to how the plugin is running the service, i had to use onedrive@root.service and override some values because the configuration is stored at /var/cache/onedrive. Nevertheless, the service does not start even if i authenticate the app. The refresh_token is in /var/cache/onedrive.


    Code
    # ls -alh /var/cache/onedrive/
    total 1.6M
    drwxr-xr-x  2 onedrive root  4.0K Oct 27 21:12 .
    drwxr-xr-x 16 root     root  4.0K Oct 25 18:36 ..
    -rw-------  1 onedrive users  772 Oct 27 20:00 .config.backup
    -rw-------  1 onedrive users   28 Oct 27 20:00 .config.hash
    -rw-r--r--  1 onedrive root   775 Oct 27 20:48 config
    -rw-r--r--  1 onedrive users 1.6M Oct 27 21:12 items.sqlite3
    -rw-r-----  1 onedrive users  360 Oct 27 21:12 refresh_token

    Do you have an idea or hint how to get it working?

  • Quote

    Thanks for the response. I can not provide a newer curl package than Debian ships via their package repo for Debian 12, so i have to configure the downgrade options.


    This is not accurate or correct. Debian 12 ships newer curl version (8.10.1) via Debian 12 Backports. Make sure you install:

    • curl
    • libcurl4

    from Debian 12 Backports and any other associated packages that these 2 pull in.


    Curl 7.88.x is horribly broken as is 7.81 that Ubuntu uses.


    Quote

    Do you have an idea or hint how to get it working?


    Code
    Using IPv4 and IPv6 (if configured) for all network operations



    Based on your change you are not using those changes .. the application is still using IPv4 and IPv6 and defaulting to HTTP/2 operations.


    So .. you need to rethink your change and how you are integrating the client to your platform to ensure that the client is reading the configuration file as specified.


    Your 'OMV' configuration is not being read in / used, thus defaults are being used leading to all these issues.

  • To help you work out what is going on add to whatever method you are using to start the client

    Code
    --display-running-config


    When using this option, the client will display all running configuration at startup to help you diagnose what is going on.


    You can also use:

    Code
    --display-config


    when just running the client manually, for example:


    Code
    onedrive --display-config
    • Official Post


    This is not accurate or correct. Debian 12 ships newer curl version (8.10.1) via Debian 12 Backports. Make sure you install:

    • curl
    • libcurl4

    from Debian 12 Backports and any other associated packages that these 2 pull in.


    Curl 7.88.x is horribly broken as is 7.81 that Ubuntu uses.

    OMV does not use and support backports because this breaks binary compatibility in some cases.

    OMV is fixed to the stable repo only; thus it is guaranteed that the OMV code works.

  • OMV does not use and support backports because this breaks binary compatibility in some cases.

    OMV is fixed to the stable repo only; thus it is guaranteed that the OMV code works.

    Well you know what the fix is .. it is your platform and your choice in that manner. For your users there are only these 3 options to fix download:


    • The configuration options to downgrade HTTP/2 operations to HTTP/1.1 and use IPv4 needs to be configured by default due to HTTP/2 bugs and Debian's configuration of version 7.88 to default compilation to use HTTP/2 operations
    • You provide curl version 8.10.1 from Debian 12 backports
    • Your users manually upgrade their curl version from Debian 12 Backports


    This is the only way forward due to 'curl' bugs due to the version of 'curl' that Debian 12 ships with. Whilst the 'onedrive' client works around some of these bugs, the only true fix is to use a newer curl version.


    Now .. the question always then is asked, why was this not seen with the v2.4.x client series?


    Simple - for each operation a new 'curl' instance was created. This was time intensive, slow, inefficient amongst other items. It also did not allow then streamlining of operations to allow multi-threading to occur, which is why v2.5.x was a 20 month 100% re-write. Because of how curl was being used, it 100% masked the problematic curl versions that exist on certain platforms like Debian and Ubuntu.

  • Clean install of 'OMV OneDrive Plugin'

    Service cannot be started, not initialised (expected), systemd keeps restarting the service until the client is authenticated.

    systemd unit file being used

    Not as per OneDrive GitHub Repository for the systemd service ... however this is an OMV platform item on how to handle.

    forum.openmediavault.org/wsc/index.php?attachment/37930/


    Issues with this file:

    • Prevent exit restart is wrong value
    • Application name / service name is wrong (cosmetic issue)


    Update systemd service file to add more details

    Add --display-running-config to see what the application is doing in a default state




    Review actual OMV config for client application



    Authenticate the client using 'omv-onedrive' from CLI via SSH

    Client is restarted by OMV and starts interacting with Microsoft OneDrive



    Recommendations based on observations:

    • Add --display-running-config to assist what configuration is actually being used and where are application files being accessed from
    • Enable a mechanism to enable logging of all 'onedrive' output to a separate file to allow users to have a history transactional record of actions
    • Add to the OMV generated config file the 'curl' compatibility flags due to broken curl version
    • Update systemd service file for correct exit not to restart code (126) when a --resync is required. The application should stop constantly restarting when exiting with a 126 value
    • Remove all config options that have been added, that are equal to their application 'default'. It is pointless having these set.
    • Suggestion: Remove 'disable_notifications' as this is 100% pointless in OMV as required variables to enable GUI notifications are not present, and at this point is only preventing a warning message on startup that, because the 'client' was built with notification support, and that the client attempts to enable these by default, as the required items are missing, GUI notifications get disabled.
    • Official Post

    Add --display-running-config to assist what configuration is actually being used and where are application files being accessed from

    This helped me to identify the problem. Thx



    Update systemd service file for correct exit not to restart code (126) when a --resync is required. The application should stop constantly restarting when exiting with a 126 value

    The problem here is a strange problem of the Debian package from SUSE build service. If the old package is replaced bythe 2.5.2 one, it seems the old onedrive.service is not deleted and survives the package upgrade. Because of that i had a mixture of old and new systemd unit files. Using the onedrive@.service file will result in the expected behaviour.


    Remove all config options that have been added, that are equal to their application 'default'. It is pointless having these set.

    If the config file is manually generated then i am with you, but OMV is using a configuration management and orchestration tool to deploy the configuration. I'm too lazy to check if the config option matches the default or not. Second, if i'm doing a check, then i have to monitor the defaults per every update because they might change.

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!