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: "A database statement execution error occurred: FOREIGN KEY constraint failed" #3122

Open
cyb3rko opened this issue Feb 15, 2025 · 12 comments · May be fixed by #3123
Open

Bug: "A database statement execution error occurred: FOREIGN KEY constraint failed" #3122

cyb3rko opened this issue Feb 15, 2025 · 12 comments · May be fixed by #3123

Comments

@cyb3rko
Copy link

cyb3rko commented Feb 15, 2025

Describe the bug

After months of not using a PC, I've come back to using this tool. But ever since I'm having issues doing a sync.
Most of the time the following error occurs (I suppose mostly for the .git/objects directories).

[2025-Feb-12 23:09:45.4180376] A database statement execution error occurred: FOREIGN KEY constraint failed
[2025-Feb-12 23:09:45.4180417] 
[2025-Feb-12 23:09:45.4180446] Please restart the application with --resync to potentially fix any local database issues.
[2025-Feb-12 23:09:45.4180513] Successfully created the remote directory ./Programming/Projects/Web/open-toolbox/.git/objects/d4 on Microsoft OneDrive
[2025-Feb-12 23:09:45.7944025] 
[2025-Feb-12 23:09:45.7944213] A database statement execution error occurred: FOREIGN KEY constraint failed
[2025-Feb-12 23:09:45.7944275] 
[2025-Feb-12 23:09:45.7944327] Please restart the application with --resync to potentially fix any local database issues.
[2025-Feb-12 23:09:45.7944430] Successfully created the remote directory ./Programming/Projects/Web/open-toolbox/.git/objects/00 on Microsoft OneDrive
[2025-Feb-12 23:09:46.1942501] 
[2025-Feb-12 23:09:46.1942686] A database statement execution error occurred: FOREIGN KEY constraint failed
[2025-Feb-12 23:09:46.1942745] 
[2025-Feb-12 23:09:46.1942791] Please restart the application with --resync to potentially fix any local database issues.
[2025-Feb-12 23:09:46.1942894] Successfully created the remote directory ./Programming/Projects/Web/open-toolbox/.git/objects/54 on Microsoft OneDrive

I always then do --resync which mostly works again until the next "normal" sync.
The OneDrive plan I'm part of is "Microsoft 365 Family".

Operating System Details

Linux niko-cachy 6.13.2-2-cachyos #1 SMP PREEMPT_DYNAMIC Sat, 08 Feb 2025 17:46:21 +0000 x86_64 GNU/Linux

LSB Version:    n/a
Distributor ID: cachyos
Description:    CachyOS
Release:        rolling
Codename:       n/a

Client Installation Method

From Distribution Package

OneDrive Account Type

Business | Office365

What is your OneDrive Application Version

onedrive --version

What is your OneDrive Application Configuration

Reading configuration file: /home/niko/.config/onedrive/config
Configuration file successfully loaded
Application version                          = onedrive v2.5.4
Compiled with                                = LDC 2110
Curl version                                 = libcurl/8.12.1 OpenSSL/3.4.1 zlib/1.3.1 brotli/1.1.0 zstd/1.5.6 libidn2/2.3.7 libpsl/0.21.5 libssh2/1.11.1 nghttp2/1.64.0 nghttp3/1.7.0
User Application Config path                 = /home/niko/.config/onedrive
System Application Config path               = /etc/onedrive
Applicable Application 'config' location     = /home/niko/.config/onedrive/config
Configuration file found in config location  = true - using 'config' file values to override application defaults
Applicable 'sync_list' location              = /home/niko/.config/onedrive/sync_list
Applicable 'items.sqlite3' location          = /home/niko/.config/onedrive/items.sqlite3
Config option 'drive_id'                     = 
Config option 'sync_dir'                     = ~/OneDrive
Config option 'enable_logging'               = true
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 'permanent_delete'             = false
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.4
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
Config option 'max_curl_idle'                = 120
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:
------------------------------'sync_list'------------------------------
!build/kotlin/*
!.kotlin/*
!venv/*
!.venv/*
!.gradle/*
!.idea/libraries/*
!.idea/caches/*
!__pycache__/*
!node_modules/*
!.next/*
!/Programming/Projects/Android/**/build/*
!/Programming/Projects/Android/**/.cxx/*
!/Programming/Projects/Web/**/build/*

/Programming
-----------------------------------------------------------------------

Config option 'sync_business_shared_items'   = false

Config option 'webhook_enabled'              = false

What is your 'curl' version

curl 8.12.1 (x86_64-pc-linux-gnu) libcurl/8.12.1 OpenSSL/3.4.1 zlib/1.3.1.zlib-ng brotli/1.1.0 zstd/1.5.6 libidn2/2.3.7 libpsl/0.21.5 libssh2/1.11.1 nghttp2/1.64.0 nghttp3/1.7.0
Release-Date: 2025-02-13
Protocols: dict file ftp ftps gopher gophers http https imap imaps ipfs ipns mqtt pop3 pop3s 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'

proc on /proc type proc (rw,nosuid,nodev,noexec,relatime)
sys on /sys type sysfs (rw,nosuid,nodev,noexec,relatime)
dev on /dev type devtmpfs (rw,nosuid,relatime,size=16288756k,nr_inodes=4072189,mode=755,inode64)
run on /run type tmpfs (rw,nosuid,nodev,relatime,mode=755,inode64)
devpts on /dev/pts type devpts (rw,nosuid,noexec,relatime,gid=5,mode=620,ptmxmode=000)
/dev/nvme1n1p1 on / type btrfs (rw,noatime,compress=zstd:3,ssd,discard=async,space_cache=v2,commit=120,subvolid=256,subvol=/@)
securityfs on /sys/kernel/security type securityfs (rw,nosuid,nodev,noexec,relatime)
tmpfs on /dev/shm type tmpfs (rw,nosuid,nodev,inode64)
cgroup2 on /sys/fs/cgroup type cgroup2 (rw,nosuid,nodev,noexec,relatime,nsdelegate,memory_recursiveprot)
pstore on /sys/fs/pstore type pstore (rw,nosuid,nodev,noexec,relatime)
bpf on /sys/fs/bpf type bpf (rw,nosuid,nodev,noexec,relatime,mode=700)
systemd-1 on /proc/sys/fs/binfmt_misc type autofs (rw,relatime,fd=40,pgrp=1,timeout=0,minproto=5,maxproto=5,direct,pipe_ino=3454)
mqueue on /dev/mqueue type mqueue (rw,nosuid,nodev,noexec,relatime)
hugetlbfs on /dev/hugepages type hugetlbfs (rw,nosuid,nodev,relatime,pagesize=2M)
debugfs on /sys/kernel/debug type debugfs (rw,nosuid,nodev,noexec,relatime)
tracefs on /sys/kernel/tracing type tracefs (rw,nosuid,nodev,noexec,relatime)
tmpfs on /run/credentials/systemd-journald.service type tmpfs (ro,nosuid,nodev,noexec,relatime,nosymfollow,size=1024k,nr_inodes=1024,mode=700,inode64,noswap)
fusectl on /sys/fs/fuse/connections type fusectl (rw,nosuid,nodev,noexec,relatime)
configfs on /sys/kernel/config type configfs (rw,nosuid,nodev,noexec,relatime)
tmpfs on /run/credentials/systemd-resolved.service type tmpfs (ro,nosuid,nodev,noexec,relatime,nosymfollow,size=1024k,nr_inodes=1024,mode=700,inode64,noswap)
/dev/nvme1n1p1 on /home type btrfs (rw,noatime,compress=zstd:3,ssd,discard=async,space_cache=v2,commit=120,subvolid=257,subvol=/@home)
/dev/nvme1n1p1 on /srv type btrfs (rw,noatime,compress=zstd:3,ssd,discard=async,space_cache=v2,commit=120,subvolid=259,subvol=/@srv)
/dev/nvme1n1p1 on /root type btrfs (rw,noatime,compress=zstd:3,ssd,discard=async,space_cache=v2,commit=120,subvolid=258,subvol=/@root)
tmpfs on /tmp type tmpfs (rw,noatime,inode64)
/dev/nvme1n1p1 on /var/cache type btrfs (rw,noatime,compress=zstd:3,ssd,discard=async,space_cache=v2,commit=120,subvolid=260,subvol=/@cache)
/var/lib/snapd/snaps/bare_5.snap on /var/lib/snapd/snap/bare/5 type squashfs (ro,nodev,relatime,errors=continue,threads=single,x-gdu.hide,x-gvfs-hide)
/var/lib/snapd/snaps/dnsbench_14.snap on /var/lib/snapd/snap/dnsbench/14 type squashfs (ro,nodev,relatime,errors=continue,threads=single,x-gdu.hide,x-gvfs-hide)
/var/lib/snapd/snaps/core24_716.snap on /var/lib/snapd/snap/core24/716 type squashfs (ro,nodev,relatime,errors=continue,threads=single,x-gdu.hide,x-gvfs-hide)
/var/lib/snapd/snaps/core18_2846.snap on /var/lib/snapd/snap/core18/2846 type squashfs (ro,nodev,relatime,errors=continue,threads=single,x-gdu.hide,x-gvfs-hide)
/var/lib/snapd/snaps/gnome-3-28-1804_198.snap on /var/lib/snapd/snap/gnome-3-28-1804/198 type squashfs (ro,nodev,relatime,errors=continue,threads=single,x-gdu.hide,x-gvfs-hide)
/var/lib/snapd/snaps/gnome-46-2404_77.snap on /var/lib/snapd/snap/gnome-46-2404/77 type squashfs (ro,nodev,relatime,errors=continue,threads=single,x-gdu.hide,x-gvfs-hide)
/var/lib/snapd/snaps/gtk-common-themes_1535.snap on /var/lib/snapd/snap/gtk-common-themes/1535 type squashfs (ro,nodev,relatime,errors=continue,threads=single,x-gdu.hide,x-gvfs-hide)
/var/lib/snapd/snaps/gnome-46-2404_66.snap on /var/lib/snapd/snap/gnome-46-2404/66 type squashfs (ro,nodev,relatime,errors=continue,threads=single,x-gdu.hide,x-gvfs-hide)
/var/lib/snapd/snaps/snapd_23545.snap on /var/lib/snapd/snap/snapd/23545 type squashfs (ro,nodev,relatime,errors=continue,threads=single,x-gdu.hide,x-gvfs-hide)
/var/lib/snapd/snaps/mesa-2404_143.snap on /var/lib/snapd/snap/mesa-2404/143 type squashfs (ro,nodev,relatime,errors=continue,threads=single,x-gdu.hide,x-gvfs-hide)
/dev/nvme1n1p1 on /var/log type btrfs (rw,noatime,compress=zstd:3,ssd,discard=async,space_cache=v2,commit=120,subvolid=262,subvol=/@log)
/dev/nvme1n1p1 on /var/tmp type btrfs (rw,noatime,compress=zstd:3,ssd,discard=async,space_cache=v2,commit=120,subvolid=261,subvol=/@tmp)
/var/lib/snapd/snaps/wine-platform-6-stable_19.snap on /var/lib/snapd/snap/wine-platform-6-stable/19 type squashfs (ro,nodev,relatime,errors=continue,threads=single,x-gdu.hide,x-gvfs-hide)
/var/lib/snapd/snaps/wine-platform-runtime_397.snap on /var/lib/snapd/snap/wine-platform-runtime/397 type squashfs (ro,nodev,relatime,errors=continue,threads=single,x-gdu.hide,x-gvfs-hide)
binfmt_misc on /proc/sys/fs/binfmt_misc type binfmt_misc (rw,nosuid,nodev,noexec,relatime)
tmpfs on /run/user/1000 type tmpfs (rw,nosuid,nodev,relatime,size=3279276k,nr_inodes=819819,mode=700,uid=1000,gid=1000,inode64)
portal on /run/user/1000/doc type fuse.portal (rw,nosuid,nodev,relatime,user_id=1000,group_id=1000)

What are all your local file system partition types

NAME        FSTYPE      FSVER LABEL       UUID                                 FSAVAIL FSUSE% MOUNTPOINTS
loop0                                                                                0   100% /var/lib/snapd/snap/core24/716
loop1                                                                                0   100% /var/lib/snapd/snap/bare/5
loop2                                                                                0   100% /var/lib/snapd/snap/core18/2846
loop3                                                                                0   100% /var/lib/snapd/snap/dnsbench/14
loop4                                                                                0   100% /var/lib/snapd/snap/gnome-3-28-1804/198
loop5                                                                                0   100% /var/lib/snapd/snap/gtk-common-themes/1535
loop6                                                                                0   100% /var/lib/snapd/snap/gnome-46-2404/66
loop7                                                                                0   100% /var/lib/snapd/snap/gnome-46-2404/77
loop8                                                                                0   100% /var/lib/snapd/snap/snapd/23545
loop9                                                                                0   100% /var/lib/snapd/snap/mesa-2404/143
loop10                                                                               0   100% /var/lib/snapd/snap/wine-platform-6-stable/19
loop11                                                                               0   100% /var/lib/snapd/snap/wine-platform-runtime/397
sda                                                                                           
└─sda1      ext4        1.0   BackupDrive 558b149f-9262-44e1-b7d5-8d0f18ef82b1                
sdb                                                                                           
├─sdb1      vfat        FAT32             BBD4-0741                                           
├─sdb2      ext4        1.0               f6337a44-9ca0-438a-926c-a5da2952a224                
└─sdb3      crypto_LUKS 2                 2f4ba1d1-3b7f-4ffb-8971-162c9d4af638                
zram0       swap        1     zram0       58dc2b5a-0abe-4714-a688-15bd7bb3475b                [SWAP]
nvme1n1                                                                                       
└─nvme1n1p1 btrfs                         46da9937-c1d7-4b79-92c1-91e33f0ebc74  774,6G    16% /var/tmp
                                                                                              /var/log
                                                                                              /var/cache
                                                                                              /root
                                                                                              /srv
                                                                                              /home
                                                                                              /
nvme0n1                                                                                       
├─nvme0n1p1 vfat        FAT32 WINDOWS EFI 266C-B1C1                                           
├─nvme0n1p2                                                                                   
├─nvme0n1p3 ntfs3             Windows     AE106F73106F4207                                    
└─nvme0n1p4 ntfs3                         52BE36C8BE36A3FF

How do you use 'onedrive'

Mainly I am syncing my files to OneDrive as backup solution.
Every few weeks I'm syncing those back to a second computer, same OS and same setup.

Steps to reproduce the behaviour

  1. Executing onedrive --sync

Complete Verbose Log Output

Is it needed? If so, I will generate it.

Screenshots

No response

Other Log Information or Details

Additional context

No response

@cyb3rko cyb3rko added the Bug Something isn't working label Feb 15, 2025
@abraunegg
Copy link
Owner

@cyb3rko

Is it needed? If so, I will generate it.

This is always needed to identify where the issue is.

Please generate a verbose debug log as per https://github.com/abraunegg/onedrive/wiki/Generate-debug-log-for-support

@cyb3rko
Copy link
Author

cyb3rko commented Feb 15, 2025

Alright, that will take some time

@abraunegg
Copy link
Owner

abraunegg commented Feb 15, 2025

@cyb3rko
Please can you give an update on generating the debug log.

A second item I would like you to do is to 'search' for all 'onedrive' binaries on your system:

sudo find / -type f -name "onedrive" -executable

Reference: #2796

For each binary that comes back, please then run --version against it.

I suspect your issue might actually be you have an older version of the client in a default path somewhere given:

  • Zero other reports of this sort of issue
  • The way you are saying this manifests ... works then does not work ....

@cyb3rko
Copy link
Author

cyb3rko commented Feb 15, 2025

@abraunegg
Sure. The log is collected, I have to upload it somewhere now as it's grown to 1,2 GB. I will send you a link via mail when finished.

I scanned my system for executables, the only result is /usr/bin/onedrive with version 2.5.4 (it's a brand new system, I would be worried if there were other instances of onedrive).


Could the shell be another thing to consider? I'm using fish shell. After collecting the log I tried bash -c "onedrive --sync" which went through in like 5 seconds and uploaded the missing files, but maybe that's just coincidence.

@abraunegg
Copy link
Owner

@cyb3rko

Could the shell be another thing to consider? I'm using fish shell. After collecting the log I tried bash -c "onedrive --sync" which went through in like 5 seconds and uploaded the missing files, but maybe that's just coincidence.

Unsure, however the client has no concept of the shell it is running under ...

Please let me know when you have compressed the debug log and can provide the file for analysis.

@cyb3rko
Copy link
Author

cyb3rko commented Feb 16, 2025

@abraunegg I already sent you the link yesterday via mail (but uncompressed).
I can send it again as compressed.

@abraunegg
Copy link
Owner

@cyb3rko
Many thanks for the compressed debug log - I have downloaded and reviewed it this morning.

The root cause of this issue are your globbing rules:

DEBUG: ------------------------------ NEW RULE --------------------------------
DEBUG: Evaluation against EXCLUSION 'sync_list' rule: !/Programming/Projects/Android/**/build/*
DEBUG: wildcard (* or **) exclusion rule: !/Programming/Projects/Android/**/build/*
DEBUG: Evaluation against 'sync_list' rule result: globbing pattern match
DEBUG: Evaluation against 'sync_list' rule result: wildcard|globbing rule matched and must be excluded
DEBUG: ------------------------------ NEW RULE --------------------------------
DEBUG: Evaluation against EXCLUSION 'sync_list' rule: !/Programming/Projects/Android/**/.cxx/*
DEBUG: wildcard (* or **) exclusion rule: !/Programming/Projects/Android/**/.cxx/*
DEBUG: Evaluation against 'sync_list' rule result: globbing pattern match
DEBUG: Evaluation against 'sync_list' rule result: wildcard|globbing rule matched and must be excluded
DEBUG: ------------------------------ NEW RULE --------------------------------
DEBUG: Evaluation against EXCLUSION 'sync_list' rule: !/Programming/Projects/Web/**/build/*
DEBUG: wildcard (* or **) exclusion rule: !/Programming/Projects/Web/**/build/*
DEBUG: Evaluation against 'sync_list' rule result: globbing pattern match
DEBUG: Evaluation against 'sync_list' rule result: wildcard|globbing rule matched and must be excluded
DEBUG: ------------------------------ NEW RULE --------------------------------
DEBUG: Evaluation against INCLUSION 'sync_list' rule: /Programming
DEBUG: Running exactMatchRuleSegmentsToPathSegments()
DEBUG: Rule Segments: ["Programming"]
DEBUG: Input Segments: ["Programming"]
DEBUG: All segments matched: Rule Segments = ["Programming"], Input Segments = ["Programming"]
DEBUG: Exact path match with 'sync_list' rule entry
DEBUG: Evaluation against 'sync_list' rule result: direct match
DEBUG: ------------------------------------------------------------------------
DEBUG: [F]excludeExactMatch      = false
DEBUG: [F]excludeParentMatched   = false
DEBUG: [F]excludeAnywhereMatched = false
DEBUG: [F]excludeWildcardMatched = true
DEBUG: Evaluation against 'sync_list' final result: EXCLUDED as no rule included path

Essentially the globbing rule is being triggered, even when the number of path segments is less than the globbing rule - which is not correct, as the path up to the first wildcard must exist for that rule to apply.

Will work on a fix shortly for you to test.

@abraunegg abraunegg added In Progress Currently being worked on and removed Unable to reproduce labels Feb 16, 2025
@abraunegg abraunegg added this to the v2.5.5 milestone Feb 16, 2025
abraunegg added a commit that referenced this issue Feb 16, 2025
* Add check for 'globbing' and 'wildcard' rules, that the number of segments before the first wildcard character need to match before the actual rule can be applied
@abraunegg
Copy link
Owner

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

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=3123

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-pr3123 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-7-g1ebe02c 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

Using this PR, and replicating the tree structure, the application of globbing rules no longer occurs for paths less than where the globbing exists in the actual rule:

DEBUG: ******************* SYNC LIST RULES EVALUATION START *******************
DEBUG: Evaluation against 'sync_list' rules for this input path: /Programming
DEBUG: [S]excludeExactMatch      = false
DEBUG: [S]excludeParentMatched   = false
DEBUG: [S]excludeAnywhereMatched = false
DEBUG: [S]excludeWildcardMatched = false
DEBUG: ------------------------------ NEW RULE --------------------------------
DEBUG: Evaluation against EXCLUSION 'sync_list' rule: !build/kotlin/*
DEBUG: anywhere 'sync_list' exclusion rule: !build/kotlin/*
DEBUG: No anywhere rule 'canFind' MATCH .. trying a regex match
DEBUG: - This sync list wildcard rule should not be evaluated as the wildcard appears beyond the current input path
DEBUG: ------------------------------ NEW RULE --------------------------------
DEBUG: Evaluation against EXCLUSION 'sync_list' rule: !.kotlin/*
DEBUG: anywhere 'sync_list' exclusion rule: !.kotlin/*
DEBUG: No anywhere rule 'canFind' MATCH .. trying a regex match
DEBUG: wildcard (* or **) exclusion rule: !.kotlin/*
DEBUG: ------------------------------ NEW RULE --------------------------------
DEBUG: Evaluation against EXCLUSION 'sync_list' rule: !venv/*
DEBUG: anywhere 'sync_list' exclusion rule: !venv/*
DEBUG: No anywhere rule 'canFind' MATCH .. trying a regex match
DEBUG: wildcard (* or **) exclusion rule: !venv/*
DEBUG: ------------------------------ NEW RULE --------------------------------
DEBUG: Evaluation against EXCLUSION 'sync_list' rule: !.venv/*
DEBUG: anywhere 'sync_list' exclusion rule: !.venv/*
DEBUG: No anywhere rule 'canFind' MATCH .. trying a regex match
DEBUG: wildcard (* or **) exclusion rule: !.venv/*
DEBUG: ------------------------------ NEW RULE --------------------------------
DEBUG: Evaluation against EXCLUSION 'sync_list' rule: !.gradle/*
DEBUG: anywhere 'sync_list' exclusion rule: !.gradle/*
DEBUG: No anywhere rule 'canFind' MATCH .. trying a regex match
DEBUG: wildcard (* or **) exclusion rule: !.gradle/*
DEBUG: ------------------------------ NEW RULE --------------------------------
DEBUG: Evaluation against EXCLUSION 'sync_list' rule: !.idea/libraries/*
DEBUG: anywhere 'sync_list' exclusion rule: !.idea/libraries/*
DEBUG: No anywhere rule 'canFind' MATCH .. trying a regex match
DEBUG: - This sync list wildcard rule should not be evaluated as the wildcard appears beyond the current input path
DEBUG: ------------------------------ NEW RULE --------------------------------
DEBUG: Evaluation against EXCLUSION 'sync_list' rule: !.idea/caches/*
DEBUG: anywhere 'sync_list' exclusion rule: !.idea/caches/*
DEBUG: No anywhere rule 'canFind' MATCH .. trying a regex match
DEBUG: - This sync list wildcard rule should not be evaluated as the wildcard appears beyond the current input path
DEBUG: ------------------------------ NEW RULE --------------------------------
DEBUG: Evaluation against EXCLUSION 'sync_list' rule: !__pycache__/*
DEBUG: anywhere 'sync_list' exclusion rule: !__pycache__/*
DEBUG: No anywhere rule 'canFind' MATCH .. trying a regex match
DEBUG: wildcard (* or **) exclusion rule: !__pycache__/*
DEBUG: ------------------------------ NEW RULE --------------------------------
DEBUG: Evaluation against EXCLUSION 'sync_list' rule: !node_modules/*
DEBUG: anywhere 'sync_list' exclusion rule: !node_modules/*
DEBUG: No anywhere rule 'canFind' MATCH .. trying a regex match
DEBUG: wildcard (* or **) exclusion rule: !node_modules/*
DEBUG: ------------------------------ NEW RULE --------------------------------
DEBUG: Evaluation against EXCLUSION 'sync_list' rule: !.next/*
DEBUG: anywhere 'sync_list' exclusion rule: !.next/*
DEBUG: No anywhere rule 'canFind' MATCH .. trying a regex match
DEBUG: wildcard (* or **) exclusion rule: !.next/*
DEBUG: ------------------------------ NEW RULE --------------------------------
DEBUG: Evaluation against EXCLUSION 'sync_list' rule: !/Programming/Projects/Android/**/build/*
DEBUG: - This sync list wildcard rule should not be evaluated as the wildcard appears beyond the current input path
DEBUG: ------------------------------ NEW RULE --------------------------------
DEBUG: Evaluation against EXCLUSION 'sync_list' rule: !/Programming/Projects/Android/**/.cxx/*
DEBUG: - This sync list wildcard rule should not be evaluated as the wildcard appears beyond the current input path
DEBUG: ------------------------------ NEW RULE --------------------------------
DEBUG: Evaluation against EXCLUSION 'sync_list' rule: !/Programming/Projects/Web/**/build/*
DEBUG: - This sync list wildcard rule should not be evaluated as the wildcard appears beyond the current input path
DEBUG: ------------------------------ NEW RULE --------------------------------
DEBUG: Evaluation against INCLUSION 'sync_list' rule: /Programming
DEBUG: Running exactMatchRuleSegmentsToPathSegments()
DEBUG: Rule Segments: ["Programming"]
DEBUG: Input Segments: ["Programming"]
DEBUG: All segments matched: Rule Segments = ["Programming"], Input Segments = ["Programming"]
DEBUG: Exact path match with 'sync_list' rule entry
DEBUG: Evaluation against 'sync_list' rule result: direct match
DEBUG: ------------------------------------------------------------------------
DEBUG: [F]excludeExactMatch      = false
DEBUG: [F]excludeParentMatched   = false
DEBUG: [F]excludeAnywhereMatched = false
DEBUG: [F]excludeWildcardMatched = false
DEBUG: Evaluation against 'sync_list' final result: included for sync
DEBUG: ******************* SYNC LIST RULES EVALUATION END *********************

Rule use, but not matched:

DEBUG: ******************* SYNC LIST RULES EVALUATION START *******************
DEBUG: Evaluation against 'sync_list' rules for this input path: /Programming/Projects/Android/2/include/file8.data
DEBUG: [S]excludeExactMatch      = false
DEBUG: [S]excludeParentMatched   = false
DEBUG: [S]excludeAnywhereMatched = false
DEBUG: [S]excludeWildcardMatched = false
DEBUG: ------------------------------ NEW RULE --------------------------------
DEBUG: Evaluation against EXCLUSION 'sync_list' rule: !build/kotlin/*
DEBUG: anywhere 'sync_list' exclusion rule: !build/kotlin/*
DEBUG: No anywhere rule 'canFind' MATCH .. trying a regex match
DEBUG: wildcard (* or **) exclusion rule: !build/kotlin/*
DEBUG: ------------------------------ NEW RULE --------------------------------
DEBUG: Evaluation against EXCLUSION 'sync_list' rule: !.kotlin/*
DEBUG: anywhere 'sync_list' exclusion rule: !.kotlin/*
DEBUG: No anywhere rule 'canFind' MATCH .. trying a regex match
DEBUG: wildcard (* or **) exclusion rule: !.kotlin/*
DEBUG: ------------------------------ NEW RULE --------------------------------
DEBUG: Evaluation against EXCLUSION 'sync_list' rule: !venv/*
DEBUG: anywhere 'sync_list' exclusion rule: !venv/*
DEBUG: No anywhere rule 'canFind' MATCH .. trying a regex match
DEBUG: wildcard (* or **) exclusion rule: !venv/*
DEBUG: ------------------------------ NEW RULE --------------------------------
DEBUG: Evaluation against EXCLUSION 'sync_list' rule: !.venv/*
DEBUG: anywhere 'sync_list' exclusion rule: !.venv/*
DEBUG: No anywhere rule 'canFind' MATCH .. trying a regex match
DEBUG: wildcard (* or **) exclusion rule: !.venv/*
DEBUG: ------------------------------ NEW RULE --------------------------------
DEBUG: Evaluation against EXCLUSION 'sync_list' rule: !.gradle/*
DEBUG: anywhere 'sync_list' exclusion rule: !.gradle/*
DEBUG: No anywhere rule 'canFind' MATCH .. trying a regex match
DEBUG: wildcard (* or **) exclusion rule: !.gradle/*
DEBUG: ------------------------------ NEW RULE --------------------------------
DEBUG: Evaluation against EXCLUSION 'sync_list' rule: !.idea/libraries/*
DEBUG: anywhere 'sync_list' exclusion rule: !.idea/libraries/*
DEBUG: No anywhere rule 'canFind' MATCH .. trying a regex match
DEBUG: wildcard (* or **) exclusion rule: !.idea/libraries/*
DEBUG: ------------------------------ NEW RULE --------------------------------
DEBUG: Evaluation against EXCLUSION 'sync_list' rule: !.idea/caches/*
DEBUG: anywhere 'sync_list' exclusion rule: !.idea/caches/*
DEBUG: No anywhere rule 'canFind' MATCH .. trying a regex match
DEBUG: wildcard (* or **) exclusion rule: !.idea/caches/*
DEBUG: ------------------------------ NEW RULE --------------------------------
DEBUG: Evaluation against EXCLUSION 'sync_list' rule: !__pycache__/*
DEBUG: anywhere 'sync_list' exclusion rule: !__pycache__/*
DEBUG: No anywhere rule 'canFind' MATCH .. trying a regex match
DEBUG: wildcard (* or **) exclusion rule: !__pycache__/*
DEBUG: ------------------------------ NEW RULE --------------------------------
DEBUG: Evaluation against EXCLUSION 'sync_list' rule: !node_modules/*
DEBUG: anywhere 'sync_list' exclusion rule: !node_modules/*
DEBUG: No anywhere rule 'canFind' MATCH .. trying a regex match
DEBUG: wildcard (* or **) exclusion rule: !node_modules/*
DEBUG: ------------------------------ NEW RULE --------------------------------
DEBUG: Evaluation against EXCLUSION 'sync_list' rule: !.next/*
DEBUG: anywhere 'sync_list' exclusion rule: !.next/*
DEBUG: No anywhere rule 'canFind' MATCH .. trying a regex match
DEBUG: wildcard (* or **) exclusion rule: !.next/*
DEBUG: ------------------------------ NEW RULE --------------------------------
DEBUG: Evaluation against EXCLUSION 'sync_list' rule: !/Programming/Projects/Android/**/build/*
DEBUG: wildcard (* or **) exclusion rule: !/Programming/Projects/Android/**/build/*
DEBUG: ------------------------------ NEW RULE --------------------------------
DEBUG: Evaluation against EXCLUSION 'sync_list' rule: !/Programming/Projects/Android/**/.cxx/*
DEBUG: wildcard (* or **) exclusion rule: !/Programming/Projects/Android/**/.cxx/*
DEBUG: ------------------------------ NEW RULE --------------------------------
DEBUG: Evaluation against EXCLUSION 'sync_list' rule: !/Programming/Projects/Web/**/build/*
DEBUG: wildcard (* or **) exclusion rule: !/Programming/Projects/Web/**/build/*
DEBUG: ------------------------------ NEW RULE --------------------------------
DEBUG: Evaluation against INCLUSION 'sync_list' rule: /Programming
DEBUG: Running exactMatchRuleSegmentsToPathSegments()
DEBUG: Rule Segments: ["Programming"]
DEBUG: Input Segments: ["Programming", "Projects", "Android", "2", "include", "file8.data"]
DEBUG: Running matchFirstSegmentToPathFirstSegment()
DEBUG: Rule Segments: ["Programming"]
DEBUG: Input Segments: ["Programming", "Projects", "Android", "2", "include", "file8.data"]
DEBUG: Parent root path match with 'sync_list' rule entry
DEBUG: Running matchRuleSegmentsToPathSegments()
DEBUG: Rule Segments: ["Programming"]
DEBUG: Input Segments: ["Programming", "Projects", "Android", "2", "include", "file8.data"]
DEBUG: Parental path match with 'sync_list' rule entry
DEBUG: Evaluation against 'sync_list' rule result: parental path match
DEBUG: ------------------------------------------------------------------------
DEBUG: [F]excludeExactMatch      = false
DEBUG: [F]excludeParentMatched   = false
DEBUG: [F]excludeAnywhereMatched = false
DEBUG: [F]excludeWildcardMatched = false
DEBUG: Evaluation against 'sync_list' final result: included for sync
DEBUG: ******************* SYNC LIST RULES EVALUATION END *********************

Rule use and matched:

DEBUG: ******************* SYNC LIST RULES EVALUATION START *******************
DEBUG: Evaluation against 'sync_list' rules for this input path: /Programming/Projects/Android/1/.cxx
DEBUG: [S]excludeExactMatch      = false
DEBUG: [S]excludeParentMatched   = false
DEBUG: [S]excludeAnywhereMatched = false
DEBUG: [S]excludeWildcardMatched = false
DEBUG: ------------------------------ NEW RULE --------------------------------
DEBUG: Evaluation against EXCLUSION 'sync_list' rule: !build/kotlin/*
DEBUG: anywhere 'sync_list' exclusion rule: !build/kotlin/*
DEBUG: No anywhere rule 'canFind' MATCH .. trying a regex match
DEBUG: wildcard (* or **) exclusion rule: !build/kotlin/*
DEBUG: ------------------------------ NEW RULE --------------------------------
DEBUG: Evaluation against EXCLUSION 'sync_list' rule: !.kotlin/*
DEBUG: anywhere 'sync_list' exclusion rule: !.kotlin/*
DEBUG: No anywhere rule 'canFind' MATCH .. trying a regex match
DEBUG: wildcard (* or **) exclusion rule: !.kotlin/*
DEBUG: ------------------------------ NEW RULE --------------------------------
DEBUG: Evaluation against EXCLUSION 'sync_list' rule: !venv/*
DEBUG: anywhere 'sync_list' exclusion rule: !venv/*
DEBUG: No anywhere rule 'canFind' MATCH .. trying a regex match
DEBUG: wildcard (* or **) exclusion rule: !venv/*
DEBUG: ------------------------------ NEW RULE --------------------------------
DEBUG: Evaluation against EXCLUSION 'sync_list' rule: !.venv/*
DEBUG: anywhere 'sync_list' exclusion rule: !.venv/*
DEBUG: No anywhere rule 'canFind' MATCH .. trying a regex match
DEBUG: wildcard (* or **) exclusion rule: !.venv/*
DEBUG: ------------------------------ NEW RULE --------------------------------
DEBUG: Evaluation against EXCLUSION 'sync_list' rule: !.gradle/*
DEBUG: anywhere 'sync_list' exclusion rule: !.gradle/*
DEBUG: No anywhere rule 'canFind' MATCH .. trying a regex match
DEBUG: wildcard (* or **) exclusion rule: !.gradle/*
DEBUG: ------------------------------ NEW RULE --------------------------------
DEBUG: Evaluation against EXCLUSION 'sync_list' rule: !.idea/libraries/*
DEBUG: anywhere 'sync_list' exclusion rule: !.idea/libraries/*
DEBUG: No anywhere rule 'canFind' MATCH .. trying a regex match
DEBUG: wildcard (* or **) exclusion rule: !.idea/libraries/*
DEBUG: ------------------------------ NEW RULE --------------------------------
DEBUG: Evaluation against EXCLUSION 'sync_list' rule: !.idea/caches/*
DEBUG: anywhere 'sync_list' exclusion rule: !.idea/caches/*
DEBUG: No anywhere rule 'canFind' MATCH .. trying a regex match
DEBUG: wildcard (* or **) exclusion rule: !.idea/caches/*
DEBUG: ------------------------------ NEW RULE --------------------------------
DEBUG: Evaluation against EXCLUSION 'sync_list' rule: !__pycache__/*
DEBUG: anywhere 'sync_list' exclusion rule: !__pycache__/*
DEBUG: No anywhere rule 'canFind' MATCH .. trying a regex match
DEBUG: wildcard (* or **) exclusion rule: !__pycache__/*
DEBUG: ------------------------------ NEW RULE --------------------------------
DEBUG: Evaluation against EXCLUSION 'sync_list' rule: !node_modules/*
DEBUG: anywhere 'sync_list' exclusion rule: !node_modules/*
DEBUG: No anywhere rule 'canFind' MATCH .. trying a regex match
DEBUG: wildcard (* or **) exclusion rule: !node_modules/*
DEBUG: ------------------------------ NEW RULE --------------------------------
DEBUG: Evaluation against EXCLUSION 'sync_list' rule: !.next/*
DEBUG: anywhere 'sync_list' exclusion rule: !.next/*
DEBUG: No anywhere rule 'canFind' MATCH .. trying a regex match
DEBUG: wildcard (* or **) exclusion rule: !.next/*
DEBUG: ------------------------------ NEW RULE --------------------------------
DEBUG: Evaluation against EXCLUSION 'sync_list' rule: !/Programming/Projects/Android/**/build/*
DEBUG: wildcard (* or **) exclusion rule: !/Programming/Projects/Android/**/build/*
DEBUG: ------------------------------ NEW RULE --------------------------------
DEBUG: Evaluation against EXCLUSION 'sync_list' rule: !/Programming/Projects/Android/**/.cxx/*
DEBUG: wildcard (* or **) exclusion rule: !/Programming/Projects/Android/**/.cxx/*
DEBUG: Evaluation against 'sync_list' rule result: globbing pattern match using segment matching
DEBUG: Evaluation against 'sync_list' rule result: wildcard|globbing rule matched and must be excluded
DEBUG: ------------------------------ NEW RULE --------------------------------
DEBUG: Evaluation against EXCLUSION 'sync_list' rule: !/Programming/Projects/Web/**/build/*
DEBUG: wildcard (* or **) exclusion rule: !/Programming/Projects/Web/**/build/*
DEBUG: ------------------------------ NEW RULE --------------------------------
DEBUG: Evaluation against INCLUSION 'sync_list' rule: /Programming
DEBUG: Running exactMatchRuleSegmentsToPathSegments()
DEBUG: Rule Segments: ["Programming"]
DEBUG: Input Segments: ["Programming", "Projects", "Android", "1", ".cxx"]
DEBUG: Running matchFirstSegmentToPathFirstSegment()
DEBUG: Rule Segments: ["Programming"]
DEBUG: Input Segments: ["Programming", "Projects", "Android", "1", ".cxx"]
DEBUG: Parent root path match with 'sync_list' rule entry
DEBUG: Running matchRuleSegmentsToPathSegments()
DEBUG: Rule Segments: ["Programming"]
DEBUG: Input Segments: ["Programming", "Projects", "Android", "1", ".cxx"]
DEBUG: Parental path match with 'sync_list' rule entry
DEBUG: Evaluation against 'sync_list' rule result: parental path match
DEBUG: ------------------------------------------------------------------------
DEBUG: [F]excludeExactMatch      = false
DEBUG: [F]excludeParentMatched   = false
DEBUG: [F]excludeAnywhereMatched = false
DEBUG: [F]excludeWildcardMatched = true
DEBUG: Evaluation against 'sync_list' final result: EXCLUDED as no rule included path
DEBUG: ******************* SYNC LIST RULES EVALUATION END *********************

@cyb3rko
Copy link
Author

cyb3rko commented Feb 17, 2025

Interesting, I will test it over the next few days (if I find some time).
Do you know, why I am the only one with this issue? I'm sure I'm not the only one using glob rules.

@abraunegg
Copy link
Owner

@cyb3rko

Interesting, I will test it over the next few days (if I find some time). Do you know, why I am the only one with this issue? I'm sure I'm not the only one using glob rules.

Given that the use of globbing (**) is not exactly documented and/or example(s) given, I am not surprised that this issue has not been hit before.

Please can you test this PR as soon as possible so that this bug can be marked as fixed and resolved.

@cyb3rko
Copy link
Author

cyb3rko commented Feb 17, 2025

I will test it out soon (but for a few days, as it was not always happening on every sync).

Didn't you also use folder/* syntax here?
https://github.com/abraunegg/onedrive/blob/master/docs/usage.md#performing-a-selective-synchronisation-via-sync_list-file

@abraunegg
Copy link
Owner

The syntax:

/folder/*

Or

Folder/*

Is vastly different to:

!/Folder/path/path/**/path/*

That you are using.

All 3 examples are handled and processed with different code to ensure things are matched correctly.

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

Successfully merging a pull request may close this issue.

2 participants