Skip to content

Frequently Asked Questions

abraunegg edited this page Mar 30, 2024 · 15 revisions

What is the operational process | How does this client work?

This client runs through the following steps, regardless of mode of use (standalone or monitor):

  • Query OneDrive API for changed items by using the /delta API query
    • Process each element that is responded by the OneDrive API, including processing new items, changes + deletions
  • Perform a database consistency check, to ensure that the data matches what is contained online. This can be a time intensive operation, and depending on how much data you have, can take a considerable amount of time to go through.
  • Perform a filesystem walk to upload differences and new files that are local and not stored online yet

Post the 3rd step, when using --synchronize, the application will display Sync with OneDrive is complete and exit.

Post the 3rd step, when using --monitor, the application will 'wait' according to the 'monitor_interval' value (default is 300 seconds) before looping back to the start again. It is during this wait time (before the application goes to check the OneDrive API /delta again) that the application will process any local realtime (add, change, delete) events as reported by inotify to your data, and will action this independently so that the changed local data is reflected online before the next online check is performed.

The difference here between the two modes is how and when the monitor mode performs the database integrity check. The database integrity check will be done at the following intervals:

  • On application startup when using --monitor
  • At least once per hour post completion of the cycle loop as governed by 'monitor_interval' and 'monitor_fullscan_frequency' when using the application defaults

Tips:

  • Keep 'monitor_interval' at 300 seconds or increase this to match your data rate of change on OneDrive. If your data is changing highly infrequently, increase this to 1800 or 3600 or higher. It is highly recommended to not select a value lower that 300 seconds.
  • Change 'monitor_fullscan_frequency' to align to checking your data integrity at least once per 12 or 24 hour period, based on what you set 'monitor_interval' to.

Read https://github.com/abraunegg/onedrive/blob/master/docs/USAGE.md#monitor_fullscan_frequency for further details.

The client is slow when downloading / syncing

Various websites express that Microsoft appears to be playing Web Browser funny business and prioritising end user experience around what sort of Web Browser is detected - for example: https://www.theregister.co.uk/2017/03/23/microsoft_onedrive_linux_slow/

This client utilises the Curl libraries to perform it's actions, thus presents a specific User Agent to the Microsoft Services. Testing was performed when changing this user agent and no significant differences were found:

User Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; Trident/7.0; AS; rv:11.0) like Gecko

IE 11 User Agent - Download

real    0m16.172s
user    0m5.361s
sys     0m0.787s
Throughput ~= 2.48Mb/s

IE 11 User Agent - Upload

real    0m33.508s
user    0m2.623s
sys     0m0.223s
Throughput ~= 1.19Mb/s

User-Agent: Phobos-std.net.curl/2.079 (libcurl/7.29.0)

Standard User Agent - Download

real    0m17.260s
user    0m4.988s
sys     0m0.864s
Throughput ~= 2.32Mb/s

Standard User Agent - Upload

real    0m33.286s
user    0m2.680s
sys     0m0.218s
Throughput ~= 1.20Mb/s

Syncing of Microsoft OneNote items

When attempting to sync Microsoft OneNote items the following is logged:

This item type (OneNote Folder Name) is not supported

The syncing of OneNote items is not supported. The OneNote files on OneDrive are not really files, but rather links to get OneNote to load the corresponding Notebook. See https://docs.microsoft.com/en-us/onedrive/developer/rest-api/#working-with-onenote-notebooks for further details.

As we can't sync them this is why the message is displayed rather than erroring out.

Device platform Unknown used by the user is an unsupported device platform

This error is generally presented when attempting to use the client with OneDrive Business Accounts where the Administrator has set restrictions on what platforms a client can access OneDrive from. This is not a bug and will not be fixed.

Make command during installation encounters error 127

When attempting to compile the onedrive client you receive the following error:

~/onedrive$ make
echo v1.1.2-15-g54fcb63 >version
dmd -g -ofonedrive -O -L-lcurl -L-lsqlite3 -L-ldl -J. src/config.d src/itemdb.d src/log.d src/main.d src/monitor.d src/onedrive.d src/qxor.d src/selective.d src/sqlite.d src/sync.d src/upload.d src/util.d
make: dmd: Command not found
Makefile:34: recipe for target 'onedrive' failed
make: *** [onedrive] Error 127

This is indicative of not activating dmd before compilation. To activate you need to perform the following:

Run source ~/dlang/dmd-2.080.1/activate in your shell to use dmd-2.080.1.

You then should be able to compile onedrive without issue. Once compiled, run deactivate to remove dmd from being active in your environment.

The parent item is not in the local database

After upgrading to this branch you may receive the following error:

Initializing the Synchronization Engine ...
Syncing changes from OneDrive ...
The parent item is not in the local database
Syncing changes from OneDrive ...
The parent item is not in the local database
Syncing changes from OneDrive ...
object.Exception@src/sync.d(1091): The parent item is not in the local database

This is indicative of the application you are running is actually still the 'skilion' version and exists somewhere in your default path, and your prior version has not been successfully uninstalled or removed. If you installed the version from a distribution package, you will need to uninstall that package before using the git version from this repository.

To find where your 'onedrive' application versions are running from, either using sudo or as a root user:

find / | grep 'onedrive'

This should tell you where every onedrive file / folder is so you can check against where you think things should be & assist with you manually uninstalling the older version of the application.

Additionally, if you are running 'onedrive' via a service (init.d or systemd) ensure the service is stopped before performing the compilation & installation of the client.

You also may need to ensure you remove any ~/.config/onedrive/items.* file, however as from v2.1.x, the database should be automatically upgraded to handle all of the applicable data.

Cannot connect to Microsoft OneDrive Service - Network Connection Issue

After installing the application, the application presents the following error:

Cannot connect to Microsoft OneDrive Service - Network Connection Issue

ERROR: Microsoft OneDrive API returned an error with the following message:
  Error Message:    Timeout was reached on handle 55B20994D1E0
  Calling Function: testNetwork()

Unable to reach Microsoft OneDrive API service, unable to initialize application

You most likely have a firewall blocking HTTPS / DNS requests or have slow DNS responses. The client cannot resolve or connect to the required services that it needs to use, to determine if the service is reachable.

This is not a bug or issue with the client, but an issue with your Linux system, your local network, your local security policies.

To diagnose your issue further, you can use:

curl -I --connect-timeout 5 --max-time 5 https://login.microsoftonline.com
curl -I --connect-timeout 5 --max-time 5 https://graph.microsoft.com

If the site is login.microsoftonline.com reachable, something like the following will be returned:

HTTP/1.1 200 OK
Cache-Control: no-store, no-cache
Pragma: no-cache
Content-Length: 149018
Content-Type: text/html; charset=utf-8
Expires: -1
Strict-Transport-Security: max-age=31536000; includeSubDomains
X-Content-Type-Options: nosniff
Link: <https://aadcdn.msauth.net>; rel=preconnect; crossorigin
Link: <https://aadcdn.msauth.net>; rel=dns-prefetch
Link: <https://aadcdn.msftauth.net>; rel=dns-prefetch
X-DNS-Prefetch-Control: on
P3P: CP="DSP CUR OTPi IND OTRi ONL FIN"
x-ms-request-id: 9e4014b7-d7ab-4b3c-b9e8-90cd15d30100
x-ms-ests-server: 2.1.11397.10 - SEASLR1 ProdSlices
Set-Cookie: fpc=Ag3BdGWv6h5Hhyj3iQ9XZ-4; expires=Thu, 11-Feb-2021 19:13:04 GMT; path=/; secure; HttpOnly; SameSite=None
Set-Cookie: esctx=AQABAAAAAABeStGSRwwnTq2vHplZ9KL4ytg81iXsrrQ1yUHVGZXn5WvXq2FBtm_sC1rpeDQrfGMRmBdFwMUmqJZMJxx1mzRMGbZKwV9AF9E0r6j1RdCs2aum2Ery7qMcxpTuHQU7XOkLXZAKz8yQ9x_1JLWuXEmVS3ZzGOjYQjGcf6MoIvcnaR6AMpjfuOWs9qA6FrDR764gAA; domain=.login.microsoftonline.com; path=/; secure; HttpOnly; SameSite=None
Set-Cookie: x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly
Set-Cookie: stsservicecookie=estsfd; path=/; secure; samesite=none; httponly
Date: Tue, 12 Jan 2021 19:13:04 GMT

If HTTPS is blocked, the curl response will be similar to the following:

curl: (7) Failed connect to login.microsoftonline.com:443; Operation now in progress

If DNS is blocked or has slow response, the curl response will be similar to the following:

curl: (6) Could not resolve host: login.microsoftonline.com; Unknown error

To resolve your 'onedrive' client network issue, you must fix your local environment so that the above curl command executes successfully. Once this does, the OneDrive Client will operate normally.

To assist with resolving your slow DNS resolution issue, utilise 'DNS Benchmark' to benchmark your DNS servers:

https://www.grc.com/dns/benchmark.htm

You may also be experiencing this issue due to a misbehaving DNS Servers and/or Firewall that will only give one reply to a parallel A and AAAA request. This is most prevalent when your system is using IPv4 and IPv6 network address spaces.

This can be fixed by adding the following setting the following option in your /etc/resolv.conf:

options single-request

Understanding the error: "An internal database error occurred: disk I/O error"

When this error message is displayed by the application:

ERROR: An internal database error occurred: disk I/O error

It typically indicates one of two potential issues:

  1. Concurrent Instances of the OneDrive Client: This scenario occurs when two instances of the OneDrive client are running simultaneously, leading to the database being overwritten by one of the instances. This issue frequently arises from the installation of unsupported packages, notably Ubuntu PPA or Ubuntu Universe packages. These not only inadvertently introduce conflicting systemd service files but also tend to install outdated versions of the client application, potentially leading to compatibility and performance issues.

  2. Local Disk Issues: This encompasses a range of disk-related problems, such as insufficient disk space, filesystem corruption, or inadequate permissions for the application configuration directory.

Resolving the Issue

To address and rectify this error, follow the steps below:

  1. Proper Installation of the Client: Ensure the OneDrive client is installed correctly. For Ubuntu users, adhere to the installation guidelines provided here.

  2. Systemd Service Audit: Review all systemd services to identify and eliminate any rogue services that might be operating in the background.

  3. Local Filesystem Check: Examine your local filesystem for issues such as insufficient disk space, permission restrictions, or signs of filesystem corruption.

By systematically addressing these areas, you can identify the root cause of the error and implement the appropriate solution to restore normal operation.