Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug: Application crash when calculating path due to 15 character driveId API bug #3115

Open
abraunegg opened this issue Feb 12, 2025 · 31 comments · May be fixed by #3116
Open

Bug: Application crash when calculating path due to 15 character driveId API bug #3115

abraunegg opened this issue Feb 12, 2025 · 31 comments · May be fixed by #3116

Comments

@abraunegg
Copy link
Owner

Describe the bug

Handle application crash when an unhandled driveId reference is < 16 characters and attempting to calculate the Shared Folder path extension.

21:35:21 onedrive: ??:? [0x598740f84294]
21:35:21 onedrive: ??:? [0x598740f84294]
21:35:21 onedrive: ??:? __libc_start_main [0x70efa362a47a]
21:35:21 onedrive: ??:? [0x70efa362a3b7]
21:35:21 onedrive: ??:? [0x5987410b5f61]
21:35:21 onedrive: ??:? _d_run_main [0x70efa3ba5a3c]
21:35:21 onedrive: ??:? _d_run_main2 [0x70efa3ba5be6]
21:35:21 onedrive: ??:? void rt.dmain2._d_run_main2(char[][], ulong, extern (C) int function(char[][])*).runAll() [0x70efa3ba5dcc]
21:35:21 onedrive: ??:? [0x59874108a3cc]
21:35:21 onedrive: ??:? [0x59874108c636]
21:35:21 onedrive: ??:? [0x598740fc147a]
21:35:21 onedrive: ??:? [0x598740fc3763]
21:35:21 onedrive: ??:? [0x598740fcffc3]
21:35:21 onedrive: ??:? [0x598740fd676f]
21:35:21 onedrive: ??:? [0x598740fc4d22]
21:35:21 onedrive: ??:? [0x598740fb5f01]
21:35:21 onedrive: ??:? _d_assert [0x70efa3b6e942]
21:35:21 onedrive: ----------------
21:35:21 onedrive: core.exception.AssertError@src/itemdb.d(892): Assertion failure
21:35:21 onedrive: Database vacuum is complete
21:35:21 onedrive: Generating a /delta response from the OneDrive API for this Drive ID: (removed) and Item ID: (removed) ........................................................Attempting to perform a database vacuum to optimise database

This bug is related to: #3072

This bug report is raised on behalf of @H76TWE

Operating System Details

N/A - Self raised for tracking

Client Installation Method

From Source

OneDrive Account Type

Personal

What is your OneDrive Application Version

N/A - Self raised for tracking

What is your OneDrive Application Configuration

N/A - Self raised for tracking

What is your 'curl' version

N/A - Self raised for tracking

Where is your 'sync_dir' located

Local

What are all your system 'mount points'

N/A - Self raised for tracking

What are all your local file system partition types

N/A - Self raised for tracking

How do you use 'onedrive'

N/A - Self raised for tracking

Steps to reproduce the behaviour

N/A - Self raised for tracking

Complete Verbose Log Output

N/A - Self raised for tracking

Screenshots

N/A - Self raised for tracking

Other Log Information or Details

N/A - Self raised for tracking

Additional context

N/A - Self raised for tracking

@abraunegg abraunegg added the Bug Something isn't working label Feb 12, 2025
@abraunegg abraunegg added this to the v2.5.5 milestone Feb 12, 2025
@abraunegg
Copy link
Owner Author

@H76TWE
Please can you test the following PR to potentially resolve your issue.

I cannot replicate your issue, thus I need you to test this PR to work around the API Bug.

To test the PR, first install all the require platform dependencies to build the client on your respective platforms. Please read https://github.com/abraunegg/onedrive/blob/master/docs/install.md#building-from-source---high-level-requirements and then follow correctly for your platform.

Important

Currently there is an issue with installing the DMD or LDC compiler using the documentation instructions:
curl -fsS https://dlang.org/install.sh | bash -s dmd or curl -fsS https://dlang.org/install.sh | bash -s ldc

This is not something I can solve and I have emailed the appropriate folk and raised dlang/dmd#20830

Please augment the installation of DMD or LDC with your distribution version if it is available

Once this is done, to clone the PR to resolve your issue, you can use a script like the following:

#!/bin/bash

PR=3116

rm -rf ./onedrive-pr${PR}
git clone https://github.com/abraunegg/onedrive.git onedrive-pr${PR}
cd onedrive-pr${PR}
git fetch origin pull/${PR}/head:pr${PR}
git checkout pr${PR}

# Configure and Build
./configure --enable-debug --enable-notifications; make clean; make;
./onedrive --version

This script will create a local folder called onedrive-pr3116 with the PR version.

To run the PR, you need to run the client from the PR build directory:

./onedrive <any other options needed>

To install the PR, you will need to perform sudo make install to install the PR version to your system.

When running the PR, your version should be: onedrive v2.5.4-5-gac84f90 or greater.

If you still encounter an issue, please generate a new verbose debug log following this process: https://github.com/abraunegg/onedrive/wiki/Generate-debug-log-for-support

@abraunegg
Copy link
Owner Author

@H76TWE , @murraybo

Please can you rebuild your PR client version to ensure you are running onedrive v2.5.4-14-g18e8ac6 or greater.

If you still encounter an issue, please generate a new verbose debug log following this process: https://github.com/abraunegg/onedrive/wiki/Generate-debug-log-for-support

@abraunegg
Copy link
Owner Author

@murraybo

Please can you respond

@martinreus
Copy link

martinreus commented Feb 23, 2025

Is this the same issue I seem to be getting?

fev 23 10:51:29 martin-GL65 onedrive[16608]: Fetching items from the OneDrive API for Drive ID: XXXXXXXXXXXXXXXX ..
fev 23 10:51:29 martin-GL65 onedrive[16608]: No changes or items that can be applied were discovered while processing the data received from Microsoft OneDrive
fev 23 10:51:48 martin-GL65 onedrive[16608]: Performing a database consistency and integrity check on locally stored data ....................Attempting to perform a database vacuum to optimise database
fev 23 10:51:49 martin-GL65 onedrive[16608]: Database vacuum is complete
fev 23 10:51:49 martin-GL65 onedrive[16608]: core.exception.AssertError@src/itemdb.d(892): Assertion failure
fev 23 10:51:49 martin-GL65 onedrive[16608]: ----------------
fev 23 10:51:49 martin-GL65 onedrive[16608]: ??:? _d_assert [0x7f2db656e942]
fev 23 10:51:49 martin-GL65 onedrive[16608]: ??:? [0x651604290f01]
fev 23 10:51:49 martin-GL65 onedrive[16608]: ??:? [0x65160429fd22]
fev 23 10:51:49 martin-GL65 onedrive[16608]: ??:? [0x6516042c2b40]
fev 23 10:51:49 martin-GL65 onedrive[16608]: ??:? [0x6516042c2155]
fev 23 10:51:49 martin-GL65 onedrive[16608]: ??:? [0x65160436768a]
fev 23 10:51:49 martin-GL65 onedrive[16608]: ??:? [0x6516043653cc]
fev 23 10:51:49 martin-GL65 onedrive[16608]: ??:? void rt.dmain2._d_run_main2(char[][], ulong, extern (C) int function(char[][])*).runAll() [0x7f2db65a5dcc]
fev 23 10:51:49 martin-GL65 onedrive[16608]: ??:? _d_run_main2 [0x7f2db65a5be6]
fev 23 10:51:49 martin-GL65 onedrive[16608]: ??:? _d_run_main [0x7f2db65a5a3c]
fev 23 10:51:49 martin-GL65 onedrive[16608]: ??:? [0x651604390f61]
fev 23 10:51:49 martin-GL65 onedrive[16608]: ??:? [0x7f2db622a1c9]
fev 23 10:51:49 martin-GL65 onedrive[16608]: ??:? __libc_start_main [0x7f2db622a28a]
fev 23 10:51:49 martin-GL65 onedrive[16608]: ??:? [0x65160425f294]
fev 23 10:51:49 martin-GL65 systemd[2678]: onedrive.service: Main process exited, code=exited, status=1/FAILURE

@murraybo
Copy link

I tested the new pr - onedrive v2.5.4-14-g18e8ac6. It still breaks:

Performing a database consistency and integrity check on locally stored data ....................The following generated a broken database tree query:
Drive ID: 065fb7c645f8339c
Item ID: 65FB7C645F8339C!55724
ERROR: A database consistency issue has been caught. A --resync is needed to rebuild the database.

Unfortunately I can not provide a debug log for privacy reasons.

@abraunegg
Copy link
Owner Author

@murraybo

Unfortunately I can not provide a debug log for privacy reasons.

The only item that is sensitive in a debug log are:

  • Filenames / filepath
  • driveid value
  • Microsoft account holder information

As per: https://github.com/abraunegg/onedrive?tab=readme-ov-file#reporting-an-issue-or-bug

Please read the highlighted sections:

Image

If you are worried about the privacy of your debug log, please send an NDA to be signed. I 100% understand data sensitivity and any potential privacy concerns that you might have.

This particular issue cannot be replicated. This issue can only be fixed by users experiencing this issue providing debug logs so that the Microsoft Graph API bug can be worked around.

@abraunegg
Copy link
Owner Author

abraunegg commented Feb 23, 2025

@martinreus
The only way to correctly attribute your 'crash' to this issue is to do the following:

  • Build from the PR codebase
  • Provide a verbose debug log using the PR for analysis to finish fixing this issue.

Looking at your crash output, your driveId is 'XX' and it is 16 characters long, so 100% potentially not this issue.

Please build your client manually from the PR and see where that leads.

@abraunegg
Copy link
Owner Author

@vikingtiger
Please - instead of a 'thumbs up' .. if you are experiencing this issue, please:

  • Build from the PR codebase
  • Provide a verbose debug log using the PR for analysis to finish fixing this issue.

@martinreus
Copy link

@abraunegg , thanks. Will try the build once I have some time. If the drive is sensitive information, can you please erase it from your comment?

Thanks 😊

@abraunegg
Copy link
Owner Author

@abraunegg , thanks. Will try the build once I have some time. If the drive is sensitive information, can you please erase it from your comment?

Thanks 😊

Done

@martinreus
Copy link

martinreus commented Feb 23, 2025

Done

And also the edit history, sorry 😅

Image

@vikingtiger
Copy link

@vikingtiger Please - instead of a 'thumbs up' .. if you are experiencing this issue, please:

  • Build from the PR codebase
  • Provide a verbose debug log using the PR for analysis to finish fixing this issue.

My apologies. On closer inspection, my circumstances are not identical to the original issue. My drive ID is 16 hex characters long. Perhaps it would be more proper for me to create a new issue in this case.

@abraunegg
Copy link
Owner Author

@vikingtiger

@vikingtiger Please - instead of a 'thumbs up' .. if you are experiencing this issue, please:

  • Build from the PR codebase
  • Provide a verbose debug log using the PR for analysis to finish fixing this issue.

My apologies. On closer inspection, my circumstances are not identical to the original issue. My drive ID is 16 hex characters long. Perhaps it would be more proper for me to create a new issue in this case.

Before you take that action, please manually build your client from 'master' and use that to raise your bug report if you are still experiencing an issue.

@abraunegg
Copy link
Owner Author

@H76TWE , @murraybo , @martinreus , @vikingtiger

Based on the latest debug logs, please can you rebuild your client to onedrive v2.5.4-28-gc803fb9 or greater from PR #3116

I sincerely appreciate your patience while we worked through this issue, which was particularly challenging as it could not be directly replicated. The problem arises when a Shared Folder has a drive ID of 16 characters starting with a zero, causing the OneDrive API to respond inconsistently by dropping the leading zero in some cases, turning the drive ID into a 15-character invalid item.

Please can you advise if this now resolves your issue or if there is still a further problem in your environment.

@elburgl69
Copy link

elburgl69 commented Feb 26, 2025

Did not sync, complained about Curl version. Upgrade Curl tp version 8.11.0.

Then got the same "Assertion Error". Output was exactly like the output shown above, with:

_d_assert [0x...]
...
void rt.dmain2._d_run_main2(char[][], ulong, extern (C) int function(char[][])*).runAll() [0x..]
...
__libc_start_main [0x...]
[0x...]
systemd[2678]: onedrive.service: Main process exited, code=exited, status=1/FAILURE

Did not save my output.

Installed onedrive v2.5.4-28-gc803fb9 with PR#3116. The issue above was solved, but it still does not function good. Now get error:

feb 26 17:33:44 LT-LEO-FINAL-22-04 systemd[2571]: onedrive.service: Scheduled restart job, restart counter is at 42.
feb 26 17:33:44 LT-LEO-FINAL-22-04 systemd[2571]: Stopped OneDrive Client for Linux.
feb 26 17:33:44 LT-LEO-FINAL-22-04 systemd[2571]: Starting OneDrive Client for Linux...
feb 26 17:33:44 LT-LEO-FINAL-22-04 sleep[7587]: onedrive.service: ProtectHostname=yes is configured, but UTS namespace setup is prohibited (container manager?), ignoring namespace setup.
feb 26 17:33:59 LT-LEO-FINAL-22-04 systemd[2571]: Started OneDrive Client for Linux.
feb 26 17:33:59 LT-LEO-FINAL-22-04 onedrive[7678]: onedrive.service: ProtectHostname=yes is configured, but UTS namespace setup is prohibited (container manager?), ignoring namespace setup.
feb 26 17:33:59 LT-LEO-FINAL-22-04 onedrive[7678]: D-Bus message bus daemon is available; GUI notifications are now enabled
feb 26 17:33:59 LT-LEO-FINAL-22-04 onedrive[7678]: Using IPv4 and IPv6 (if configured) for all network operations
feb 26 17:33:59 LT-LEO-FINAL-22-04 onedrive[7678]: Attempting to contact Microsoft OneDrive Login Service
feb 26 17:33:59 LT-LEO-FINAL-22-04 onedrive[7678]: Successfully reached Microsoft OneDrive Login Service
feb 26 17:33:59 LT-LEO-FINAL-22-04 onedrive[7678]: Configuring Global Azure AD Endpoints
feb 26 17:34:00 LT-LEO-FINAL-22-04 onedrive[7678]: OneDrive synchronisation interval (seconds): 300
feb 26 17:34:00 LT-LEO-FINAL-22-04 onedrive[7678]: Initialising filesystem inotify monitoring ...
feb 26 17:34:00 LT-LEO-FINAL-22-04 onedrive[7678]: Performing initial synchronisation to ensure consistent local state ...
feb 26 17:34:00 LT-LEO-FINAL-22-04 onedrive[7678]: Attempting to contact Microsoft OneDrive Login Service
feb 26 17:34:01 LT-LEO-FINAL-22-04 onedrive[7678]: Successfully reached Microsoft OneDrive Login Service
feb 26 17:34:01 LT-LEO-FINAL-22-04 onedrive[7678]: Starting a sync with Microsoft OneDrive
feb 26 17:34:01 LT-LEO-FINAL-22-04 onedrive[7678]: Fetching items from the OneDrive API for Drive ID: 93eae7b7db6cef53 ..
feb 26 17:34:01 LT-LEO-FINAL-22-04 onedrive[7678]: No changes or items that can be applied were discovered while processing the data received from Microsoft OneDrive
feb 26 17:34:01 LT-LEO-FINAL-22-04 onedrive[7678]: Syncing this OneDrive Personal Shared Folder: ./Muziek Madmess
feb 26 17:34:04 LT-LEO-FINAL-22-04 onedrive[7678]: Generating a /delta response from the OneDrive API for this Drive ID: e99ce85dfd52fea7 and Item ID: E99CE85DFD52FEA7!105 ..Attempting to perform a database vacuum to optimise database
feb 26 17:34:04 LT-LEO-FINAL-22-04 onedrive[7678]: Database vacuum is complete
feb 26 17:34:05 LT-LEO-FINAL-22-04 onedrive[7678]: std.json.JSONException@std/json.d(688): Key not found: remoteItem
feb 26 17:34:05 LT-LEO-FINAL-22-04 onedrive[7678]: ----------------
feb 26 17:34:05 LT-LEO-FINAL-22-04 onedrive[7678]: /usr/include/dmd/phobos/std/exception.d:521 pure @safe noreturn std.exception.bailOut!(std.json.JSONException).bailOut(immutable(char)[], ulong, scope const(char)[]) [0x5e48de06ded6]
feb 26 17:34:05 LT-LEO-FINAL-22-04 onedrive[7678]: ??:? pure @safe inout(std.json.JSONValue)* std.exception.enforce!(std.json.JSONException).enforce!(inout(std.json.JSONValue)*).enforce(inout(std.json.JSONValue)*, lazy const(char)[], immutable(char)[], ulong) [0x5e48de2219d0]
feb 26 17:34:05 LT-LEO-FINAL-22-04 onedrive[7678]: ??:? inout pure ref @safe inout(std.json.JSONValue) std.json.JSONValue.opIndex(return scope immutable(char)[]) [0x5e48de1d70f1]
feb 26 17:34:05 LT-LEO-FINAL-22-04 onedrive[7678]: src/sync.d:2912 void syncEngine.SyncEngine.createRequiredSharedFolderDatabaseRecords(std.json.JSONValue) [0x5e48de110447]
feb 26 17:34:05 LT-LEO-FINAL-22-04 onedrive[7678]: src/sync.d:5672 void syncEngine.SyncEngine.createLocalPathStructure(std.json.JSONValue, immutable(char)[]) [0x5e48de120f13]
feb 26 17:34:05 LT-LEO-FINAL-22-04 onedrive[7678]: src/sync.d:5693 void syncEngine.SyncEngine.createLocalPathStructure(std.json.JSONValue, immutable(char)[]) [0x5e48de1210b5]
feb 26 17:34:05 LT-LEO-FINAL-22-04 onedrive[7678]: src/sync.d:5542 bool syncEngine.SyncEngine.checkJSONAgainstClientSideFiltering(std.json.JSONValue) [0x5e48de1201f0]
feb 26 17:34:05 LT-LEO-FINAL-22-04 onedrive[7678]: src/sync.d:9597 std.json.JSONValue[] syncEngine.SyncEngine.queryForChildren(immutable(char)[], immutable(char)[], immutable(char)[], immutable(char)[]) [0x5e48de138000]
feb 26 17:34:05 LT-LEO-FINAL-22-04 onedrive[7678]: src/sync.d:9479 std.json.JSONValue syncEngine.SyncEngine.generateDeltaResponse(immutable(char)[]) [0x5e48de137697]
feb 26 17:34:05 LT-LEO-FINAL-22-04 onedrive[7678]: src/sync.d:1467 void syncEngine.SyncEngine.fetchOneDriveDeltaAPIResponse(immutable(char)[], immutable(char)[], immutable(char)[]) [0x5e48de106a66]
feb 26 17:34:05 LT-LEO-FINAL-22-04 onedrive[7678]: src/sync.d:865 void syncEngine.SyncEngine.syncOneDriveAccountToLocalDisk() [0x5e48de103ac0]
feb 26 17:34:05 LT-LEO-FINAL-22-04 onedrive[7678]: src/main.d:1369 void main.performStandardSyncProcess(immutable(char)[], monitor.Monitor) [0x5e48ddfaff49]
feb 26 17:34:05 LT-LEO-FINAL-22-04 onedrive[7678]: src/main.d:1094 _Dmain [0x5e48ddfade4e]
feb 26 17:34:05 LT-LEO-FINAL-22-04 systemd[2571]: onedrive.service: Main process exited, code=exited, status=1/FAILURE
feb 26 17:34:05 LT-LEO-FINAL-22-04 systemd[2571]: onedrive.service: Failed with result 'exit-code'.

Attached the logfile for: onedrive --sync --verbose --verbose --resync --resync-auth > debug_output.log 2>&1

debug_output.zip

@abraunegg
Copy link
Owner Author

@elburgl69
Unfortunately, the debug log does not show or indicate the issue for this std.json.JSONException@std/json.d(688): Key not found: remoteItem

However it highlights another issue with how Microsoft is changing Personal Accounts to include 'sea8cc6beffdb43d7976fbc7da445c639' for the Drive Id value, as what they are doing (and this is evidenced in your response) is that the data coming back from the API is now in UPPERCASE .. where as before all the data was in lowercase.

So this is why your Shared Folder is breaking - because the database entries and the database queries are now having a mis-match of data to search, which is why it is failing for you.

I need to think through how and where I solve this API inconsistency within the application ... sorry.

@abraunegg
Copy link
Owner Author

@vikingtiger
Thankyou for the feedback - but please be extremely cautious at this stage - as the data responses from the API are uppercase for some responses, and lowercase for others when 'sea8cc6beffdb43d7976fbc7da445c639' is present.

Currently trying to work around this response issue as well.

@abraunegg
Copy link
Owner Author

To those watching | impacted by this bug(s)

I was working on this issue heavily yesterday (1st March 2025) and the solution was working rather well with all testing.

This morning, when I was re validating the code, overnight there has been an account change to all of my OneDrive Personal accounts where the accounts now have the 'sea8cc6beffdb43d7976fbc7da445c639' Microsoft change.

As such, when I now query the API for all the folders online, the /delta query that this client heavily uses no longer is providing the Shared Folder JSON data that the /delta query was providing yesterday before the 'sea8cc6beffdb43d7976fbc7da445c639' account change.

I have raised a bug with Microsoft for this issue - but until this data quality issue from the Microsoft OneDrive API is fixed, a full resolution for this insideous series of bugs caused by this 'sea8cc6beffdb43d7976fbc7da445c639' change cannot be resolved.

The new API bug is listed here: OneDrive/onedrive-api-docs#1891

@abraunegg
Copy link
Owner Author

abraunegg commented Mar 2, 2025

To those watching | impacted by this bug(s)

Caution

This maybe is a 100% coding fix - however at the moment this needs a workaround to also be implemented by impacted users

Please can you test this updated PR and provide valuable feedback.

To test the PR, first install all the require platform dependencies to build the client on your respective platforms. Please read https://github.com/abraunegg/onedrive/blob/master/docs/install.md#building-from-source---high-level-requirements and then follow correctly for your platform.

Important

Currently there is an issue with installing the DMD or LDC compiler using the documentation instructions:
curl -fsS https://dlang.org/install.sh | bash -s dmd or curl -fsS https://dlang.org/install.sh | bash -s ldc

This is not something I can solve and I have emailed the appropriate folk and raised dlang/dmd#20830

Please augment the installation of DMD or LDC with your distribution version if it is available

Once this is done, to clone the PR to resolve your issue, you can use a script like the following:

#!/bin/bash

PR=3116

rm -rf ./onedrive-pr${PR}
git clone https://github.com/abraunegg/onedrive.git onedrive-pr${PR}
cd onedrive-pr${PR}
git fetch origin pull/${PR}/head:pr${PR}
git checkout pr${PR}

# Configure and Build
./configure --enable-debug --enable-notifications; make clean; make;
./onedrive --version

This script will create a local folder called onedrive-pr3116 with the PR version.

Important

Before running this PR please add to your configuration file force_children_scan = "true"

This will bypass the new OneDrive API /delta bug OneDrive/onedrive-api-docs#1891 where OneDrive Personal Folder details are no longer sent in the /delta response when your account has been migrated to the new Microsoft OneDrive platform. You can tell when you are impacted as when you run the application in verbose mode, it will look like this:

The OneDrive API was initialised successfully
Opening the item database ...
Forcing client to use /children API call rather than /delta API to retrieve objects from the OneDrive API
Application Version:   onedrive v2.5.4-29-g5d836ad
Account Type:          personal
Default Drive ID:      66D53BE8A5056ECA
Default Root ID:       66D53BE8A5056ECA!sea8cc6beffdb43d7976fbc7da445c639
Microsoft Data Centre: Australia Southeast

To run the PR, you need to run the client from the PR build directory:

./onedrive <any other options needed>

To install the PR, you will need to perform sudo make install to install the PR version to your system.

When running the PR, your version should be: onedrive v2.5.4-29-g5d836ad or greater.

If you still encounter an issue, please generate a new verbose debug log following this process: https://github.com/abraunegg/onedrive/wiki/Generate-debug-log-for-support

@aaaaalexis
Copy link

Can confirm this PR fixes the issue. Thanks for your hard work!

@abraunegg
Copy link
Owner Author

@aaaaalexis
Thanks for your feedback. Please monitor closely.

@abraunegg
Copy link
Owner Author

To those watching | impacted by this bug(s)

Please rebuild your PR client version to onedrive v2.5.4-30-g43ba76c

A further UPPERCASE / lowercase API inconsistency has been uncovered, that required remediation as part of this PR.

Please can you ensure you are running this version + apply the force_children_scan = "true" temporary work around to get your system back into an operational state.

Whilst your client will run slower due to manually building a /delta response, Microsoft need to fix their API to provide again the Shared Folder data in the /delta API query, that is now removed when your account is moved to their new backend platform.

Please read OneDrive/onedrive-api-docs#1891 for details.

@htw-ikt-noelle
Copy link

I tested the PR version onedrive v2.5.4-30-g43ba76c with the option force_children_scan = "true" and it appears to perform -in my case- a proper sync. However, as you mentioned, it is REALLY slow.
@abraunegg Thank you very much for your effort and endurance.

@abraunegg
Copy link
Owner Author

abraunegg commented Mar 7, 2025

To those watching | impacted by this bug(s)

Please rebuild your PR client version to onedrive v2.5.4-33-gd45ca81

It potentially appears that Microsoft has resolved the /delta API query bug that failed to send OneDrive Personal Shared Folder details, thus potentially you may be able to stop the use of the force_children_scan = "true" temporary workaround.

If you get this sort of error or similar without force_children_scan = "true" ..

ERROR: Microsoft OneDrive API returned an error with the following message:
  Error Message:    HTTP request returned status code 404 (Not Found)
  Error Reason:     Item not found
  Error Code:       itemNotFound
  Error Timestamp:  2025-03-07T04:17:05
  API Request ID:   65c928ec-97b5-4c63-9379-d905dedd9706
  Calling Function: syncEngine.performNewFileUpload()

You need to re-enable force_children_scan = "true"

When using this client version, please use --resync --resync-auth to ensure that your local database is cleaned up to remove any of the old database entries.

Please can you test this client version and advise.

@theh0lyc0w
Copy link

I build the PR client v2.5.4-33-gd45ca8 an ran it without the force_children_scan = "true".

Forced a resync.

Everything seems to work. Observed syncing of a shared folder.

Checking total items around 55k (no changes) took around 7 minutes.

@abraunegg abraunegg added Fixed and removed In Progress Currently being worked on labels Mar 7, 2025
@jaimeadf
Copy link

jaimeadf commented Mar 7, 2025

I'm a little confused.

Should I add the --resync --resync-auth options to systemd service or is it enough to sync the client once via the terminal with these options?

@abraunegg
Copy link
Owner Author

@jaimeadf

I'm a little confused.
I'm using the onedrive client with the "download_only" option to sync the files to my system.
In this is case, should I enable force_children_scan, or is it better to leave it off? Also, should I modify the systemd service to run OneDrive with --resync --resync-auth, or is it sufficient to run this command once manually via the terminal?

FYI .. please dont post something then delete it in the middle of a response back to you!

In this is case, should I enable force_children_scan, or is it better to leave it off?

First you must ask yourself am I actually impacted by the 2 x Microsoft OneDrive bugs. Are you using a 'personal' account as that is what this application reports based on what the client is advising.

Secondly, ask yourself, am I using any Shared Folder .. as in has another user shared a folder with me, and I have added this to my Microsoft OneDrive online.

If yes to both of these items, then you are impacted by the 2 x Microsoft OneDrive bugs.

Regardless of client use, the /delta bug is the biggest API regression item where data that used to be sent, is now no longer being sent (however, it also appears that Microsoft is potentially pushing out a fix for that)

To work around the /delta bug, this is where enabling 'force_children_scan' has been found to be effective.

Personally, I needed to use this option to sync OneDrive Personal Shared Folders up to 10am 7th March 2025 AEST, however after that, I have not needed to use 'force_children_scan' as the /delta API response is again sending Shared Folder data.

Other folk globally have tried to disable the option, and ran into the HTTP error above, re-enable 'force_children_scan' and they have resumed normal service - so your mileage will vary.

Also, should I modify the systemd service to run OneDrive with --resync --resync-auth, or is it sufficient to run this command once manually via the terminal?

When using the PR please stop any systemd service from running, and run and install the PR version if you are impacted by the 2 bugs - there is zero need to run this PR if you are not impacted by those bugs.

Once the PR version is installed, run once manually to bring your client state into good health and keep a close eye on things. Enable any systemd service again post that.

@jaimeadf
Copy link

jaimeadf commented Mar 7, 2025

Yes, I'm experiencing the personal account issue. However, I don’t believe I’m affected by the Shared Folders issue since I’ve only shared my folders to others but haven’t added any from others to my OneDrive account.

Right now, I’m synchronizing with --resync and force_children_scan disabled. I'll keep a close eye on things and let you know if I run into any issues.

Thanks so much for your help! Sorry for deleting the message and creating a new one. ❤️

@elburgl69
Copy link

elburgl69 commented Mar 7, 2025

It does not work for me. With force_children_scan = true, slow, but no errors. Without force_children_scan = true:

onedrive.OneDriveException@src/onedrive.d(1466): HTTP request returned status code 404 (Not Found)
{
    "error": {
        "code": "itemNotFound",
        "innerError": {
            "client-request-id": "eebd845f-e227-434a-a87a-fa21c05f7f17",
            "date": "2025-03-07T11:28:35",
            "request-id": "eebd845f-e227-434a-a87a-fa21c05f7f17"
        },
        "message": "The resource could not be found."
    }
}
----------------

Log file attached.

debug_output_wo_force_children_scan.zip

@abraunegg
Copy link
Owner Author

@elburgl69
You will need to use 'force_children_scan' and have a slower operating client as a result until the Microsoft /delta fix is pushes to your region.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment