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: core.exception.ArrayIndexError@src/sync.d(8825): index [0] is out of bounds for array of length 0 #2883

Closed
datengraben opened this issue Oct 4, 2024 · 19 comments
Labels
Bug Something isn't working Fixed
Milestone

Comments

@datengraben
Copy link

Describe the bug

After upgrading to version 2.5.1 (from 2.4.25) of onedrive, I encountered the ArrayIndex out of bound exception, when either syncing normally or even resyncing the client state. I'm happy to help identifying the problem.

I've installed and upgrdaded via nix-env and the nixpkgs-unstable channel.

Operating System Details

uname:

Linux thinkpad-p14s 6.8.0-45-generic #45~22.04.1-Ubuntu SMP PREEMPT_DYNAMIC Wed Sep 11 15:25:05 UTC 2 x86_64 x86_64 x86_64 GNU/Linux

lsb_release

No LSB modules are available.
Distributor ID:	Ubuntu
Description:	Ubuntu 22.04.4 LTS
Release:	22.04
Codename:	jammy

Client Installation Method

From 3rd Party Source (PPA, OpenSuSE Build Service etc)

OneDrive Account Type

Business | Office365

What is your OneDrive Application Version

2.5.1

What is your OneDrive Application Configuration

D-Bus message bus daemon is available; GUI notifications are now enabled
Application version                          = onedrive v2.5.1
Compiled with                                = LDC 2109
User Application Config path                 = /home/chris/.config/onedrive
System Application Config path               = /etc/onedrive
Applicable Application 'config' location     = /home/chris/.config/onedrive/config
Configuration file found in config location  = false - using application defaults
Applicable 'sync_list' location              = /home/chris/.config/onedrive/sync_list
Applicable 'items.sqlite3' location          = /home/chris/.config/onedrive/items.sqlite3
Config option 'drive_id'                     = 
Config option 'sync_dir'                     = ~/OneDrive
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 '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 '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 '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.1
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
Environment var 'XDG_RUNTIME_DIR'            = true
Environment var 'DBUS_SESSION_BUS_ADDRESS'   = true
Config option 'notify_file_actions'          = false

Selective sync 'sync_list' configured        = true
sync_list config option 'sync_root_files'    = false
sync_list contents:


Config option 'sync_business_shared_items'   = false

Config option 'webhook_enabled'              = false

What is your 'curl' version

❯ curl --version
curl 7.81.0 (x86_64-pc-linux-gnu) libcurl/7.81.0 OpenSSL/3.0.2 zlib/1.2.11 brotli/1.0.9 zstd/1.5.5 libidn2/2.3.2 libpsl/0.21.0 (+libidn2/2.3.2) libssh/0.9.6/openssl/zlib nghttp2/1.43.0 librtmp/2.3 OpenLDAP/2.5.18
Release-Date: 2022-01-05
Protocols: dict file ftp ftps gopher gophers http https imap imaps ldap ldaps mqtt pop3 pop3s rtmp rtsp scp sftp smb smbs smtp smtps telnet tftp 
Features: alt-svc AsynchDNS brotli GSS-API HSTS HTTP2 HTTPS-proxy IDN IPv6 Kerberos Largefile libz NTLM NTLM_WB PSL SPNEGO SSL TLS-SRP UnixSockets zstd

Where is your 'sync_dir' located

Local

What are all your system 'mount points'

/dev/nvme0n1p3 on /home type ext4 (rw,relatime)
/dev/nvme0n1p2 on /boot/efi type vfat (rw,relatime,fmask=0077,dmask=0077,codepage=437,iocharset=iso8859-1,shortname=mixed,errors=remount-ro)
/dev/nvme0n1p1 on /var/snap/firefox/common/host-hunspell type ext4 (ro,noexec,noatime,errors=remount-ro)

What are all your local file system partition types

NAME        FSTYPE   FSVER LABEL UUID                                 FSAVAIL FSUSE% MOUNTPOINTS
nvme0n1                                                                              
├─nvme0n1p1 ext4     1.0         9036fc00-2e98-427c-8dc5-5346cf803b86   12,2G    80% /var/snap/firefox/common/host-hunspell
│                                                                                    /
├─nvme0n1p2 vfat     FAT32       B7E7-1BEE                               470M     1% /boot/efi
└─nvme0n1p3 ext4     1.0         5ccd0465-830e-4371-883a-1cb9e8f9918d   61,2G    79% /home

I removed loop devices for readability.

How do you use 'onedrive'

Onedrive folder is not shared with any other system or platform at the same time.
I only use it on one device and sync on demand (no system service).

Steps to reproduce the behaviour

I don't have any specific steps. Just sync or resyncing the application state.

Complete Verbose Log Output

onedrive --synchronize --verbose     
No user or system config file found, using application defaults
Using 'user' configuration path for application config and state data: /home/chris/.config/onedrive
D-Bus message bus daemon is available; GUI notifications are now enabled

DEPRECIATION WARNING: --synchronize has been deprecated in favour of --sync or -s
DEPRECIATION WARNING: Deprecated commands will be removed in a future release.

Using IPv4 and IPv6 (if configured) for all network operations
Attempting to contact Microsoft OneDrive Login Service
Successfully reached Microsoft OneDrive Login Service
Checking Application Version ...

INFO: A new onedrive client version is available. Please upgrade your client version when possible.
Current Application Version: 2.5.1
Version Available:           2.5.2

Attempting to initialise the OneDrive API ...
Configuring Global Azure AD Endpoints
The OneDrive API was initialised successfully
Opening the item database ...
Application Version:  onedrive v2.5.1
Account Type:         business
Default Drive ID:     b!tuG4MnlEr0CKxbzbf_qhfrQ3pMo5M_9Hqt52rQwhnIn66JPDfTxCT6NkgQhYx0R5
Default Root ID:      01NIQHRKF6Y2GOVW7725BZO354PWSELRRZ
Remaining Free Space: 1023.99 GB (1099504899196 bytes)
Sync Engine Initialised with new Onedrive API instance
All application operations will be performed in the configured local 'sync_dir' directory: /home/chris/OneDrive
Fetching /delta response from the OneDrive API for Drive ID: b!tuG4MnlEr0CKxbzbf_qhfrQ3pMo5M_9Hqt52rQwhnIn66JPDfTxCT6NkgQhYx0R5
Processing API Response Bundle: 1 - Quantity of 'changes|items' in this bundle to process: 0
Finished processing /delta JSON response from the OneDrive API
No changes or items that can be applied were discovered while processing the data received from Microsoft OneDrive
Performing a database consistency and integrity check on locally stored data
Processing DB entries for this Drive ID: b!tuG4MnlEr0CKxbzbf_qhfrQ3pMo5M_9Hqt52rQwhnIn66JPDfTxCT6NkgQhYx0R5
Processing: ~/OneDrive
The directory has not changed
Scanning the local file system '~/OneDrive' for new data to upload
Skipping path - excluded by sync_list config: ./foobar
New directories to create on Microsoft OneDrive: 8
OneDrive Client requested to create this directory online: ./mydirectory
Attempting to perform a database vacuum to optimise database
Database vacuum is complete
core.exception.ArrayIndexError@src/sync.d(8825): index [0] is out of bounds for array of length 0
----------------
??:? [0x5abae6]
??:? [0x5ab752]
??:? [0x5cf52e]
??:? [0x5b5aaf]
??:? [0x5a9dad]
??:? [0x5aa18d]
??:? [0x4715a1]
??:? [0x46d382]
??:? [0x469f2c]
??:? [0x46948b]
??:? [0x4dbff3]
??:? [0x4d87ae]
??:? [0x5b578c]
??:? [0x5b5686]
??:? [0x5b54dc]
??:? [0x7fa40f56214d]
??:? __libc_start_main [0x7fa40f562208]
??:? [0x406ff4]

Screenshots

No response

Other Log Information or Details

No response

Additional context

No response

@datengraben datengraben added the Bug Something isn't working label Oct 4, 2024
@abraunegg
Copy link
Owner

@datengraben

Application version = onedrive v2.5.1

This application version contains a serious bug and was replaced with v2.5.2. Please read: https://github.com/abraunegg/onedrive/releases/tag/v2.5.1

Please upgrade your version to v2.5.2 or build the client from source. Please follow the steps to prepare your system to build the client as detailed here: https://github.com/abraunegg/onedrive/blob/master/docs/install.md#building-from-source---high-level-requirements and compile following https://github.com/abraunegg/onedrive/blob/master/docs/install.md#building-using-dmd-reference-compiler

core.exception.ArrayIndexError@src/sync.d(8825): index [0] is out of bounds for array of length 0
----------------
??:? [0x5abae6]
??:? [0x5ab752]
??:? [0x5cf52e]
??:? [0x5b5aaf]
??:? [0x5a9dad]
??:? [0x5aa18d]
??:? [0x4715a1]
??:? [0x46d382]
??:? [0x469f2c]
??:? [0x46948b]
??:? [0x4dbff3]
??:? [0x4d87ae]
??:? [0x5b578c]
??:? [0x5b5686]
??:? [0x5b54dc]
??:? [0x7fa40f56214d]
??:? __libc_start_main [0x7fa40f562208]
??:? [0x406ff4]

Unfortunately, because of your choice of distribution (Ubuntu) the LDC compiler, despite having debugging enabled - these details get stripped because of how Ubuntu packages the compiler used.

The only way to resolve this is to manually compile the client using the instructions above and when recompiling use the following command:

./configure --enable-debug; make clean; make;

As you are using v2.5.1 please urgently upgrade your client.

@datengraben
Copy link
Author

@abraunegg Thank you for the detailed instructions.

Here is the verbose log output from onedrive --synchronize --verbose after compiling 2.5.2 from source.

❯ onedrive --synchronize --verbose                   
No user or system config file found, using application defaults
Using 'user' configuration path for application config and state data: /home/chris/.config/onedrive

DEPRECIATION WARNING: --synchronize has been deprecated in favour of --sync or -s
DEPRECIATION WARNING: Deprecated commands will be removed in a future release.

Using IPv4 and IPv6 (if configured) for all network operations
Attempting to contact Microsoft OneDrive Login Service
Successfully reached Microsoft OneDrive Login Service
Checking Application Version ...
Attempting to initialise the OneDrive API ...
Configuring Global Azure AD Endpoints
The OneDrive API was initialised successfully
Opening the item database ...
Application Version:  onedrive v2.5.2-2-g3ad139a
Account Type:         business
Default Drive ID:     b!tuG4MnlEr0CKxbzbf_qhfrQ3pMo5M_9Hqt52rQwhnIn66JPDfTxCT6NkgQhYx0R5
Default Root ID:      01NIQHRKF6Y2GOVW7725BZO354PWSELRRZ
Remaining Free Space: 1023.99 GB (1099504899190 bytes)
Sync Engine Initialised with new Onedrive API instance
All application operations will be performed in the configured local 'sync_dir' directory: /home/chris/OneDrive
Fetching /delta response from the OneDrive API for Drive ID: b!tuG4MnlEr0CKxbzbf_qhfrQ3pMo5M_9Hqt52rQwhnIn66JPDfTxCT6NkgQhYx0R5
Processing API Response Bundle: 1 - Quantity of 'changes|items' in this bundle to process: 14
Skipping path - excluded by sync_list config: ./Apps
Skipping path - excluded by sync_list config: ./Microsoft Teams-Chatdateien
Skipping path - excluded by sync_list config: ./Attachments
Finished processing /delta JSON response from the OneDrive API
No changes or items that can be applied were discovered while processing the data received from Microsoft OneDrive
Performing a database consistency and integrity check on locally stored data
Processing DB entries for this Drive ID: b!tuG4MnlEr0CKxbzbf_qhfrQ3pMo5M_9Hqt52rQwhnIn66JPDfTxCT6NkgQhYx0R5
Processing: ~/OneDrive
The directory has not changed
Scanning the local file system '~/OneDrive' for new data to upload
Skipping path - excluded by sync_list config: ./foobar
New directories to create on Microsoft OneDrive: 8
OneDrive Client requested to create this directory online: ./mydir
Attempting to perform a database vacuum to optimise database
Database vacuum is complete
core.exception.ArrayIndexError@src/sync.d(8827): index [0] is out of bounds for array of length 0
----------------
??:? onArrayIndexError [0x5f7ddfb184fe]
??:? _d_arraybounds_indexp [0x5f7ddfabae67]
src/sync.d:8827 void syncEngine.SyncEngine.createDatabaseTieRecordForOnlineSharedFolder(itemdb.Item) [0x5f7ddfa75c83]
src/sync.d:5163 void syncEngine.SyncEngine.createDirectoryOnline(immutable(char)[]) [0x5f7ddfa600bd]
src/sync.d:4687 void syncEngine.SyncEngine.processNewDirectoriesToCreateOnline() [0x5f7ddfa5d54c]
src/sync.d:4602 void syncEngine.SyncEngine.scanLocalFilesystemPathForNewData(immutable(char)[]) [0x5f7ddfa5ce92]
src/main.d:1250 void main.performStandardSyncProcess(immutable(char)[], monitor.Monitor) [0x5f7ddf8ff521]
src/main.d:789 _Dmain [0x5f7ddf8fc519]

Do you need anything else?

@abraunegg
Copy link
Owner

@datengraben

Do you need anything else?

Not at this stage - this pinpoints exactly where the issue is - thankyou.

@abraunegg abraunegg added In Progress Currently being worked on and removed More Information Needed Waiting on Response Invalid - Old Code Version Invalid - Old Code Version labels Oct 5, 2024
@abraunegg abraunegg added this to the v2.5.3 milestone Oct 5, 2024
@abraunegg
Copy link
Owner

@datengraben
Actually - can you also send a debug log via email?

To generate the debug log, please use this command: onedrive --synchronize --verbose --verbose > debug_output.log 2>&1

From all the log output at the moment, it looks like it is trying to create a folder online, but the code 'thinks' this is being created on a Shared Folder .... but there is nothing in the log output thus far that would indicate this ... thus I would like to dig a little deeper.

When you email over the debug log, please can you also attach the items.sqlite3 file from /home/chris/.config/onedrive/items.sqlite3 .. as this will add reference to the above debug log file.

@abraunegg
Copy link
Owner

@datengraben
Another thought is:

  • This is a Business Account
  • The code that is being triggered ... is all about an Online Shared Folder path

Can you please provide, within reason, some online screenshots of the folder path tree online where this new local folder is supposed to be created?

This will also just nail down a working theory I have.

@abraunegg
Copy link
Owner

@datengraben
I can replicate this issue, but only if the folder I have created is in a path that is an 'online shared folder' - and when sync_business_shared_items = "false"

Are you trying to sync | create a new local folder to an online path that is actually a Shared Folder?

If you can confirm this that would be greatly appreciated.

@abraunegg
Copy link
Owner

@datengraben
Example - local file structure:

.
├── bad_url_decode
├── Bücher
├── New folder
├── random_500_files
│   └── LWxplg9XSOfXgKFwvIxGF10wY3fcfkX2
├── random_data
│   ├── random_files
│   │   ├── MDzH2jtgaip6wXQAiCVzoORoNdjdY801
│   │   └── RRCq205wPYsDHJfwEBV3hiUmig4rkZGF
│   ├── random_images
│   │   ├── 6WQZ6bwc61C6b5uNJatD1bXUpboCKMmp
│   │   └── A2CzdRzIJuuQgh2XGj7sqnx6E9I57U5u
│   └── updated_files
├── random_files
│   ├── 3bIs0ldJ8nUGq9r9ejdoPAFGQ4JB9StO
│   ├── 9QvqWPFvXuMWs7rrL6dk9Q4dk0bwl3pc
│   ├── FbusfS839knGZU0pQybw5jFd5DdCbcr2
│   ├── IKaIXuRXLWLAZzGVoX3oe5F5jATAZxps
│   └── MEufgHj9LDmte5sH8kV7GxEJbPf8R17w
├── Sub Folder 2    <---------- This is a Shared Folder Online
│   └── new_local_dir
├── α
└── เอกสาร

Online Structure:
image

This is the crash I get - which the output is slightly different to you, however, hitting the same point code:

New directories to create on Microsoft OneDrive: 2
OneDrive Client requested to create this directory online: ./Sub Folder 2
OneDrive Client requested to create this directory online: ./Sub Folder 2/new_local_dir
WARNING: OneDrive quota information is being restricted. Please fix by speaking to your OneDrive / Office 365 Administrator.
Attempting to perform a database vacuum to optimise database
Database vacuum is complete
core.exception.ArrayIndexError@src/sync.d(8827): index [0] exceeds array of length 0
----------------
.....

This is is why having your debug log will be helpful - as, if this is a shared folder - then great, if not, then why is this code being triggered for you, and the resulting response, which is a bug, but technically is not as this is not a shared folder thus there will never be that DB entry in there, thus that is why the code is failing.

If you can get me:

  • Verbose Debug Log
  • Visualisation of things online as to where this directory is supposed to be created
  • The items.sqlite3 file

That would be greatly appreciated

@elburgl69
Copy link

elburgl69 commented Oct 7, 2024

I have the same problem after some Ubuntu 22.04 updates were installed this morning on version onedrive v2.5.2-1+np1+1.1.
File changes made on another device we synced to my Ubuntu machine this morning. Nothing anymore after the updates were installed. Keep running into "array of length 0" error.

@datengraben
Copy link
Author

This is is why having your debug log will be helpful - as, if this is a shared folder - then great, if not, then why is this code being triggered for you, and the resulting response, which is a bug, but technically is not as this is not a shared folder thus there will never be that DB entry in there, thus that is why the code is failing.

Yes I have a shared folder, which is shared by another user with me. This shared folder is in my onedrive root tree view.

If you can get me:

  • Verbose Debug Log
  • Visualisation of things online as to where this directory is supposed to be created
  • The items.sqlite3 file

That would be greatly appreciated

You should got mail from datengraben@gmx.de

Thank you! Where can I appreciate you work with some money? GH Sponsors?

abraunegg added a commit that referenced this issue Oct 8, 2024
* Fix issue when attempting to create a new folder online, but this is in a Shared Folder, and 'sync_business_shared_items' is not being used
@abraunegg
Copy link
Owner

@datengraben , @elburgl69

Please can you compile the following PR to potentially resolve your issue:

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

To build the PR, please follow the steps to prepare your system to build the client as detailed here: https://github.com/abraunegg/onedrive/blob/master/docs/install.md#building-from-source---high-level-requirements

When building the client, please use the following:

./configure --enable-debug make clean; make;

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.2-6-gc9b51ac or greater.

When encountering the issue, the client should now respond in the following manner:

......
Scanning the local file system '~/OneDrive' for new data to upload
New directories to create on Microsoft OneDrive: 1
OneDrive Client requested to create this directory online: ./Sub Folder 2/new_local_dir
ERROR: Unable to create directory online as 'sync_business_shared_items' is not enabled
New items to upload to Microsoft OneDrive: 1
Total New Data to Upload:        13 Bytes
ERROR: Parent path is not in the database or online.
ERROR: Unable to upload this file: ./Sub Folder 2/new_local_dir/new_file_remote_dir.txt
Performing a last examination of the most recent online data within Microsoft OneDrive to complete the reconciliation process
Fetching /delta response from the OneDrive API for Drive ID: b!bO8V7s9SSk6r7mWHpIjURotN33W1W2tEv3OXV_oFIdQimEdOHR-1So7CqeT1MfHA
Processing API Response Bundle: 1 - Quantity of 'changes|items' in this bundle to process: 0
Finished processing /delta JSON response from the OneDrive API
No changes or items that can be applied were discovered while processing the data received from Microsoft OneDrive

Failed items to upload to/from Microsoft OneDrive: 1
Failed to upload: ./Sub Folder 2/new_local_dir/new_file_remote_dir.txt

Sync with Microsoft OneDrive has completed, however there are items that failed to sync.
To fix any upload failures you may need to perform a --resync to ensure this system is correctly synced with your Microsoft OneDrive Account

Attempting to perform a database vacuum to optimise database
Database vacuum is complete
......

@elburgl69
Copy link

Does not work. Get the following:

./onedrive --version
onedrive v2.5.2-6-gc9b51ac

Then:

./onedrive --monitor
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
OneDrive synchronisation interval (seconds): 300
Initialising filesystem inotify monitoring ...
Attempting to perform a database vacuum to optimise database
Database vacuum is complete
core.exception.ArrayIndexError@src/clientSideFiltering.d(667): index [0] is out of bounds for array of length 0
----------------
??:? onArrayIndexError [0x5c2878d972ee]
??:? _d_arraybounds_indexp [0x5c2878d39c57]
src/clientSideFiltering.d:667 bool clientSideFiltering.ClientSideFiltering.matchFirstSegmentToPathFirstSegment(immutable(char)[], immutable(char)[]) [0x5c2878d080b0]
src/clientSideFiltering.d:337 bool clientSideFiltering.ClientSideFiltering.isPathExcluded(immutable(char)[]) [0x5c2878d05844]
src/clientSideFiltering.d:152 bool clientSideFiltering.ClientSideFiltering.isPathExcludedViaSyncList(immutable(char)[]) [0x5c2878d045ec]
src/monitor.d:369 void monitor.Monitor.addRecursive(immutable(char)[]) [0x5c2878d0c2f1]
src/monitor.d:418 void monitor.Monitor.addRecursive(immutable(char)[]) [0x5c2878d0c7fb]
src/monitor.d:312 void monitor.Monitor.initialise() [0x5c2878d0bf68]
src/main.d:888 _Dmain [0x5c2878b78abf]

Or:

./onedrive --sync
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
Fetching items from the OneDrive API for Drive ID: 93eae7b7db6cef53 ..Attempting to perform a database vacuum to optimise database
Database vacuum is complete
core.exception.ArrayIndexError@src/clientSideFiltering.d(667): index [0] is out of bounds for array of length 0
----------------
??:? onArrayIndexError [0x622c8f4af2ee]
??:? _d_arraybounds_indexp [0x622c8f451c57]
src/clientSideFiltering.d:667 bool clientSideFiltering.ClientSideFiltering.matchFirstSegmentToPathFirstSegment(immutable(char)[], immutable(char)[]) [0x622c8f4200b0]
src/clientSideFiltering.d:337 bool clientSideFiltering.ClientSideFiltering.isPathExcluded(immutable(char)[]) [0x622c8f41d844]
src/clientSideFiltering.d:152 bool clientSideFiltering.ClientSideFiltering.isPathExcludedViaSyncList(immutable(char)[]) [0x622c8f41c5ec]
src/sync.d:3983 bool syncEngine.SyncEngine.checkJSONAgainstClientSideFiltering(std.json.JSONValue) [0x622c8f3ef1fa]
src/sync.d:1335 void syncEngine.SyncEngine.processDeltaJSONItem(std.json.JSONValue, ulong, int, ulong, bool) [0x622c8f3ded1a]
src/sync.d:1021 void syncEngine.SyncEngine.fetchOneDriveDeltaAPIResponse(immutable(char)[], immutable(char)[], immutable(char)[]) [0x622c8f3dca4d]
src/sync.d:568 void syncEngine.SyncEngine.syncOneDriveAccountToLocalDisk() [0x622c8f3da8a1]
src/main.d:1239 void main.performStandardSyncProcess(immutable(char)[], monitor.Monitor) [0x622c8f2936f9]
src/main.d:787 _Dmain [0x622c8f290604]

in Contrast to:

onedrive --version
onedrive v2.5.2-1+np1+1.1
onedrive --monitor
D-Bus message bus daemon is available; GUI notifications are now enabled
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
OneDrive synchronisation interval (seconds): 300
Initialising filesystem inotify monitoring ...
Attempting to perform a database vacuum to optimise database
Database vacuum is complete
core.exception.ArrayIndexError@src/clientSideFiltering.d(651): index [0] exceeds array of length 0
----------------
??:? onArrayIndexError [0x7d4ca9fa8d3f]
??:? _d_arraybounds_index [0x7d4ca9fa933d]
??:? [0x60fc2be01181]
??:? [0x60fc2bdfecf4]
??:? [0x60fc2bdf9f04]
??:? [0x60fc2bdf8b77]
??:? [0x60fc2bdf917c]
??:? [0x60fc2bdf846a]
??:? [0x60fc2bee35a6]
??:? void rt.dmain2._d_run_main2(char[][], ulong, extern (C) int function(char[][])*).runAll() [0x7d4ca9fdea4b]
??:? _d_run_main2 [0x7d4ca9fde867]
??:? _d_run_main [0x7d4ca9fde6bd]
??:? [0x60fc2bf1ace4]
??:? [0x7d4ca9629d8f]
??:? __libc_start_main [0x7d4ca9629e3f]
??:? [0x60fc2bdd92c4]
onedrive --sync
D-Bus message bus daemon is available; GUI notifications are now enabled
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
Fetching items from the OneDrive API for Drive ID: 93eae7b7db6cef53 ..Attempting to perform a database vacuum to optimise database
Database vacuum is complete
core.exception.ArrayIndexError@src/clientSideFiltering.d(651): index [0] exceeds array of length 0
----------------
??:? onArrayIndexError [0x7e1dce179d3f]
??:? _d_arraybounds_index [0x7e1dce17a33d]
??:? [0x5dc6eca1f181]
??:? [0x5dc6eca1ccf4]
??:? [0x5dc6eca17f04]
??:? [0x5dc6eca4b09b]
??:? [0x5dc6eca41bc3]
??:? [0x5dc6eca383b4]
??:? [0x5dc6eca3636f]
??:? [0x5dc6ecb04d3e]
??:? [0x5dc6ecb00ff4]
??:? void rt.dmain2._d_run_main2(char[][], ulong, extern (C) int function(char[][])*).runAll() [0x7e1dce1afa4b]
??:? _d_run_main2 [0x7e1dce1af867]
??:? _d_run_main [0x7e1dce1af6bd]
??:? [0x5dc6ecb38ce4]
??:? [0x7e1dcd829d8f]
??:? __libc_start_main [0x7e1dcd829e3f]
??:? [0x5dc6ec9f72c4]

rg,
Leo

@datengraben
Copy link
Author

@abraunegg

Thanks it seems to work! But the client does not respond in the assumed manner.

❯ ./onedrive --synchronize --single-directory 'Company Name'

DEPRECIATION WARNING: --synchronize has been deprecated in favour of --sync or -s
DEPRECIATION WARNING: Deprecated commands will be removed in a future release.

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
The OneDrive Client was asked to search for this directory online and create it if it's not located: ./Company Name
zsh: segmentation fault (core dumped)  ./onedrive --synchronize --single-directory 'Company Name'
~/Code/onedrive on pr2895 ?4                                                                                                                                                                         х SEGV took 4s Py base ∆ 34 at 10:01:41

Without the single directory flag (which is not really needed, I found out), it works and does not fail.

❯ ./onedrive --synchronize                                    

DEPRECIATION WARNING: --synchronize has been deprecated in favour of --sync or -s
DEPRECIATION WARNING: Deprecated commands will be removed in a future release.

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
Fetching items from the OneDrive API for Drive ID: b!tuG4MnlEr0CKxbzbf_qhfrQ3pMo5M_9Hqt52rQwhnIn66JPDfTxCT6NkgQhYx0R5 .. 
No changes or items that can be applied were discovered while processing the data received from Microsoft OneDrive
Performing a database consistency and integrity check on locally stored data . 
Scanning the local file system '~/OneDrive' for new data to upload . 
New directories to create on Microsoft OneDrive: 8
New items to upload to Microsoft OneDrive: 86
Performing a last examination of the most recent online data within Microsoft OneDrive to complete the reconciliation process
Fetching items from the OneDrive API for Drive ID: b!tuG4MnlEr0CKxbzbf_qhfrQ3pMo5M_9Hqt52rQwhnIn66JPDfTxCT6NkgQhYx0R5 .. 
No changes or items that can be applied were discovered while processing the data received from Microsoft OneDrive

Sync with Microsoft OneDrive is complete
Attempting to perform a database vacuum to optimise database
Database vacuum is complete

But anyhow it works now. In the 2.5.2 version (tagged) it wouldn't work, either with or without the flag.

I can open a new issue for the --single-directory issue, when the name of the directory is an shared forlder.

@abraunegg
Copy link
Owner

@datengraben

Thanks it seems to work! But the client does not respond in the assumed manner.

OK so this is now a different but related issue when using --single-directory usage.

For this usage: ./onedrive --synchronize --single-directory 'Agrario Energy' please generate a new verbose debug log and please do not redact this out so that the data in the debug log can be correctly followed.

@elburgl69

So your issue - is not the same as the issue reported here - it is 100% different by the looks of it, and it is to do with Client Side Filtering. It has a similar failure, but is not the same bug.

Please raise a new bug report and email a verbose debug log.

@elburgl69
Copy link

Should I baseline the new bug report and debug log on version:

onedrive v2.5.2-1+np1+1.1

or version:

onedrive v2.5.2-6-gc9b51ac
?

@abraunegg
Copy link
Owner

Should I baseline the new bug report and debug log on version:

onedrive v2.5.2-1+np1+1.1

or version:

onedrive v2.5.2-6-gc9b51ac
?

Please use the PR to generate the debug log as this gives the correct details. Because you use the OpenSuse Packages for Debian / Ubuntu platforms - those packages lack the correct details to debug properly .. the joys of using those platforms.

@abraunegg abraunegg added the In Progress Currently being worked on label Oct 8, 2024
@abraunegg
Copy link
Owner

@datengraben
I have updated the PR to cater for the --single-directory use and the crash you were seeing.

As tested:

alex@ubuntu-22-04:~/onedrive-pr2895$ ./onedrive -s --single-directory 'Sub Folder 2'
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
The OneDrive Client was asked to search for this directory online and create it if it's not located: ./Sub Folder 2

ERROR: The requested --single-directory path to sync is a Shared Folder online and 'sync_business_shared_items' is not enabled

alex@ubuntu-22-04:~/onedrive-pr2895$ 

The updated PR application version should be: onedrive v2.5.2-7-g84b2533

Please can you validate this in your environment.

@datengraben
Copy link
Author

datengraben commented Oct 9, 2024 via email

@abraunegg
Copy link
Owner

@datengraben
Thanks for the confirmation - will mark this as fixed and merge this into 'master'

abraunegg added a commit that referenced this issue Oct 9, 2024
…tion as it is in a Shared Online Folder (#2895)

* Fix issue when attempting to create a new folder online, but this is in a Shared Folder, and 'sync_business_shared_items' is not being used
* Add same check to ensure that if this is a Business Account and an online shared folder, 'sync_business_shared_items' needs to be enabled when using --single-directory flag
@abraunegg
Copy link
Owner

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.

Repository owner locked as resolved and limited conversation to collaborators Oct 17, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Bug Something isn't working Fixed
Projects
None yet
Development

No branches or pull requests

3 participants