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: Business shared folders with same basename get merged #2434

Closed
lgiannantoni opened this issue Jun 20, 2023 · 6 comments
Closed

Bug: Business shared folders with same basename get merged #2434

lgiannantoni opened this issue Jun 20, 2023 · 6 comments

Comments

@lgiannantoni
Copy link

Describe the bug

I have a OneDrive business account and I have been shared two folders with the same name, SharedFolder, but from two different paths, owned by a second OneDrive business account.

Here is the output of onedrive --list-shared-folders:

Using config option for Global Azure AD Endpoints
Configuration file successfully loaded
Using dry-run database copy for OneDrive API query
Configuring Global Azure AD Endpoints
User Configured Rate Limit: 131072
Initializing the Synchronization Engine ...

Listing available OneDrive Business Shared Folders:
---------------------------------------
Shared Folder:   SharedFolder
Shared By:       Name Surname (name.surname@domain.it)
---------------------------------------
Shared Folder:   SharedFolder
Shared By:       Name Surname (name.surname@domain.it)

The application cannot distinguish one folder from the other because, in the business_shared_folders config file, I can add the shared folders only by basename.
If I add the SharedFolder only once in the business_shared_folders config file, there is no warning about the ambiguity in the remote volume.
Then, one of the two folders (the one in Path2, in this case) is modified to be a merged version of the two. An example is shown in the attached image, where DocumentX comes from the other SharedFolder (in Path1) and is in my name (pink patch).

Operating System Details

Linux 5.19.0-45-generic #46~22.04.1-Ubuntu SMP PREEMPT_DYNAMIC

LSB Version:	core-11.1.0ubuntu4-noarch:security-11.1.0ubuntu4-noarch
Distributor ID:	Linuxmint
Description:	Linux Mint 21.1
Release:	21.1
Codename:	vera

Client Installation Method

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

OneDrive Account Type

Business | Office365

What is your OneDrive Application Version

v2.4.24-1+np1

What is your OneDrive Application Configuration

Using config option for Global Azure AD Endpoints
Configuration file successfully loaded
onedrive version                             = v2.4.24-1+np1
Config path                                  = /home/lg/.config/onedrive
Config file found in config path             = true
Config option 'sync_dir'                     = /home/lg/OneDrive
Config option 'enable_logging'               = false
Config option 'log_dir'                      = /var/log/onedrive/
Config option 'disable_notifications'        = false
Config option 'min_notify_changes'           = 1
Config option 'skip_dir'                     = 
Config option 'skip_dir_strict_match'        = false
Config option 'skip_file'                    = ~*|.~*|*.tmp
Config option 'skip_dotfiles'                = false
Config option 'skip_symlinks'                = false
Config option 'monitor_interval'             = 30
Config option 'monitor_log_frequency'        = 5
Config option 'monitor_fullscan_frequency'   = 10
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 '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'               = 
Config option 'azure_ad_endpoint'            = 
Config option 'azure_tenant_id'              = common
Config option 'user_agent'                   = 
Config option 'force_http_11'                = false
Config option 'debug_https'                  = false
Config option 'rate_limit'                   = 131072
Config option 'operation_timeout'            = 3600
Config option 'dns_timeout'                  = 60
Config option 'connect_timeout'              = 10
Config option 'data_timeout'                 = 600
Config option 'ip_protocol_version'          = 0
Config option 'sync_root_files'              = false
Selective sync 'sync_list' configured        = false
Config option 'sync_business_shared_folders' = true
Business Shared Folders configured           = true
business_shared_folders contents:
SharedFolder0
SharedFolder0
Config option 'webhook_enabled'              = false

What is your '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.4.8 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.14
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'

sysfs on /sys type sysfs (rw,nosuid,nodev,noexec,relatime)
proc on /proc type proc (rw,nosuid,nodev,noexec,relatime)
udev on /dev type devtmpfs (rw,nosuid,relatime,size=16007948k,nr_inodes=4001987,mode=755,inode64)
devpts on /dev/pts type devpts (rw,nosuid,noexec,relatime,gid=5,mode=620,ptmxmode=000)
tmpfs on /run type tmpfs (rw,nosuid,nodev,noexec,relatime,size=3214788k,mode=755,inode64)
/dev/nvme0n1p8 on / type ext4 (rw,relatime,errors=remount-ro)
securityfs on /sys/kernel/security type securityfs (rw,nosuid,nodev,noexec,relatime)
tmpfs on /dev/shm type tmpfs (rw,nosuid,nodev,inode64)
tmpfs on /run/lock type tmpfs (rw,nosuid,nodev,noexec,relatime,size=5120k,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)
efivarfs on /sys/firmware/efi/efivars type efivarfs (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=29,pgrp=1,timeout=0,minproto=5,maxproto=5,direct,pipe_ino=22121)
mqueue on /dev/mqueue type mqueue (rw,nosuid,nodev,noexec,relatime)
hugetlbfs on /dev/hugepages type hugetlbfs (rw,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)
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)
ramfs on /run/credentials/systemd-sysusers.service type ramfs (ro,nosuid,nodev,noexec,relatime,mode=700)
tmpfs on /run/qemu type tmpfs (rw,nosuid,nodev,relatime,mode=755,inode64)
/dev/nvme0n1p6 on /opt type ext4 (rw,relatime)
/dev/nvme0n1p5 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)
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=3214784k,nr_inodes=803696,mode=700,uid=1000,gid=1000,inode64)
gvfsd-fuse on /run/user/1000/gvfs type fuse.gvfsd-fuse (rw,nosuid,nodev,relatime,user_id=1000,group_id=1000)
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

lsblk -f
NAME FSTYPE FSVER LABEL UUID                                 FSAVAIL FSUSE% MOUNTPOINTS
nvme0n1
│                                                                           
├─nvme0n1p1
│                                                                           
├─nvme0n1p2
│    vfat   FAT32 SYSTEM
│                       7BFE-0726                             191,5M    26% /boot/efi
├─nvme0n1p3
│    ntfs         Windows
│                       BF8BD0ADE2D19CF1                                    
├─nvme0n1p4
│    ntfs         Windows RE tools
│                       E2A529D26145B33D                                    
├─nvme0n1p5
│    ext4   1.0         29a3de4a-7099-4e70-9852-812c3e733cae  106,3G    76% /home
├─nvme0n1p6
│    ext4   1.0         3f8d71ab-d74b-4342-a4c8-7c26ee2e645a   79,9G     7% /opt
├─nvme0n1p7
│    swap   1           a611bb7a-996c-48a7-9c98-eb79821adc9a                [SWAP]
└─nvme0n1p8
     ext4   1.0         fb1f07f7-d79c-4c4d-a591-a5cf466324c8   44,6G    51% /

How do you use 'onedrive'

I access the OneDrive folder from my Linux system and from an Android phone (no issues from the latter).

Steps to reproduce the behaviour

  1. In a remote OneDrive business folder owned by AccountOther, create two folders with the same name under two different paths: Path1/SharedFolder and Path2/SharedFolder, with a Document1 under Path1/SharedFolder and a Document2 under Path2/SharedFolder.
  2. Have the two SharedFolder shared with YourAccount (OneDrive business) path1_shared
    path2_shared onedrive_shared_folders
  3. Configure the onedrive application for YourAccount to synchronize those business shared folders:
    4.1. In ~/.config/onedrive create the business_shared_folders file having contents SharedFolder (once or twice, it does not matter)
    4.2. In ~/.config/onedrive/config set sync_business_shared_folders = true
  4. onedrive --synchronize --sync-shared-folders --verbose
  5. Observe what happens in the two remote SharedFolder folders
    6.1. In the images below, AccountOther is blue, MyAccount is pink. Document1 from Path1/SharedFolder is uploaded to Path2/SharedFolder
    bug_path1
    bug_path2

Complete Verbose Log Output

Using 'user' Config Dir: /home/lg/.config/onedrive
Using 'system' Config Dir: /etc/onedrive
Using config option for Global Azure AD Endpoints
Configuration file successfully loaded
Checking Application Version ...
Initializing the OneDrive API ...
Configuring Global Azure AD Endpoints
Using Curl defaults for all HTTP operations
User Configured Rate Limit: 131072
Opening the item database ...
All operations will be performed in: /home/lg/OneDrive
Application version: v2.4.24-1+np1
Account Type: business
Default Drive ID: b!Z6XNq1duDEOb5jfqbiNPgJOrRN2Rs-dDvHNst5tNHJ4Jo45CkldIQahK3wSPRdFs
Default Root ID: 01LT4XXE56Y2GOVW7725BZO354PWSELRRZ
Remaining Free Space: 5470337888802
Fetching details for OneDrive Root
OneDrive Root exists in the database
Initializing the Synchronization Engine ...
Syncing changes and items from OneDrive ...
Applying changes of Path ID: 01LT4XXE56Y2GOVW7725BZO354PWSELRRZ
Updated Remaining Free Space: 5470337888802
Processing 210 OneDrive items to ensure consistent local state
Skipping item - excluded by skip_file config: ...
Downloading file ... ... done.
Skipping item - excluded by skip_dir config: ...
Attempting to sync OneDrive Business Shared Folders
Syncing this OneDrive Business Shared Folder: SharedFolder
OneDrive Business Shared Folder - Shared By:  AccountOther (name.surname@domain.it)
Applying changes of Path ID: 01MMY7K7LEOY7MMB2JBFELAJOYNL2WI3RF
Processing 2 OneDrive items to ensure consistent local state
Downloading file SharedFolder/Document2.docx ... done.
Syncing this OneDrive Business Shared Folder: SharedFolder
OneDrive Business Shared Folder - Shared By:  AccountOther (name.surname@domain.it)
Applying changes of Path ID: 01MMY7K7OLWM7MULVIKVHL7SWOHBEJLOEE
Processing 2 OneDrive items to ensure consistent local state
Downloading file SharedFolder/Document1.docx ... done.
WARNING: Not syncing this OneDrive Business Shared File: doc02749920230417142321.pdf
OneDrive Business Shared File - Shared By:  AccountOther (name.surname@domain.it)
Performing a database consistency and integrity check on locally stored data ... 
Uploading differences of ~/OneDrive
Processing .
The directory has not changed
Processing ...
The directory has not changed
Processing ...
The file has not changed
Processing .
The directory has not changed
Processing SharedFolder
The directory has not changed
Processing SharedFolder/Document2.docx
The file has not changed
Processing SharedFolder
The directory has not changed
Processing SharedFolder/Document1.docx
The file has not changed
Uploading new items of ~/OneDrive
Uploading new file ./SharedFolder/Document1.docx ... 

                                                                                
Uploading   0% |                                        |   ETA   --:--:--:
                                                                                
Uploading 100% |oooooooooooooooooooooooooooooooooooooooo| DONE IN 00:00:00 
                                                                                
Uploading 100% |oooooooooooooooooooooooooooooooooooooooo| DONE IN 00:00:01 
done.
Applying changes of Path ID: 01LT4XXE56Y2GOVW7725BZO354PWSELRRZ
Updated Remaining Free Space: 5470337888802
Number of items from OneDrive to process: 0
Attempting to sync OneDrive Business Shared Folders
Syncing this OneDrive Business Shared Folder: SharedFolder
OneDrive Business Shared Folder - Shared By:  AccountOther (name.surname@domain.it)
Applying changes of Path ID: 01MMY7K7LEOY7MMB2JBFELAJOYNL2WI3RF
Processing 2 OneDrive items to ensure consistent local state
WARNING: Skipping shared folder due to existing name conflict: SharedFolder
WARNING: Skipping changes of Path ID: 01MMY7K7OLWM7MULVIKVHL7SWOHBEJLOEE
WARNING: To sync this shared folder, this shared folder needs to be renamed
WARNING: Conflict Shared By:          AccountOther (name.surname@domain.it)
WARNING: Not syncing this OneDrive Business Shared File: doc02749920230417142321.pdf
OneDrive Business Shared File - Shared By:  AccountOther (name.surname@domain.it)
Sync with OneDrive is complete

Screenshots

No response

Other Log Information or Details

No response

Additional context

No response

@lgiannantoni lgiannantoni added the Bug Something isn't working label Jun 20, 2023
@abraunegg
Copy link
Owner

@lgiannantoni
Unfortunately this is not a bug - more like a Feature Request as per #1251

The detail you have provided is great, but there is nothing I can do in the short term on this - but this will be fixed with the v2.5.x release.

@abraunegg abraunegg added Feature Request and removed Bug Something isn't working labels Jun 20, 2023
@abraunegg abraunegg added this to the v2.5.0 milestone Jun 20, 2023
@abraunegg abraunegg added the In Progress Currently being worked on label Sep 21, 2023
@abraunegg
Copy link
Owner

@lgiannantoni
I am currently putting the finishing touches to onedrive v2.5.0-alpha-1 where this capability is being added|fixed

Example: Online Folder State
image

Example: Windows Folder State
image

Example: Local Linux Folder State

total 4
drwxrwxr-x.  7 alex alex  141 Sep 21 18:03  .
drwx------. 31 alex alex 4096 Sep 21 16:40  ..
drwx------.  2 alex alex    6 Sep 16 10:27  Attachments
drwx------.  4 alex alex   52 Sep 21 17:22 'Documents - testteamsite'
drwx------.  4 alex alex   43 Sep 21 17:02  Jenkins
drwx------.  6 alex alex  126 Sep 21 17:02 "Jenkins - testuser2 testuser2's files"
drwxrwxr-x.  2 alex alex   47 Jun  6 05:30  random_25k_files

Sync Process:

Reading configuration file: /home/alex/.config/onedrive/config
Invalid value for key in config file - using default value: application_id
Configuration file successfully loaded
Configuring Global Azure AD Endpoints
Sync Engine Initialised with new Onedrive API instance
All application operations will be performed in: /home/alex/OneDrive
Fetching items from the OneDrive API for Drive ID: b!bO8V7s9SSk6r7mWHpIjURotN33W1W2tEv3OXV_oFIdQimEdOHR-1So7CqeT1MfHA ..
Processing changes and items received from OneDrive ...
Syncing this OneDrive Business Shared Folder: Jenkins
Fetching items from the OneDrive API for Drive ID: b!fZgJhK-pU0eTQpylvmoYCkE4YgH_KRNDlxjRx9OWNqmV9Q_E_uWdRJKIB5L_ruPN ..
Processing changes and items received from OneDrive ...
Syncing this OneDrive Business Shared Folder: Jenkins - testuser2 testuser2's files
Fetching items from the OneDrive API for Drive ID: b!BhWyqa7K_kqXqHtSIlsqjR5iJogxpWxDradnpVGTU2VxBOJh82Y6S4he4rdnGPBT ..
Processing changes and items received from OneDrive ...
Syncing this OneDrive Business Shared Folder: Documents - testteamsite
Fetching items from the OneDrive API for Drive ID: b!knrQ8K6YIkqi-IrggfGWyi6Bu-HVzjxMpA7qvZX7Gy6-dlZIIb6fSo7k4cc0dlrV ..
Processing changes and items received from OneDrive ...
Performing a database consistency and integrity check on locally stored data ... 
Scanning local filesystem '~/OneDrive' for new data to upload ...
Perfoming final true up scan of online data from OneDrive
Fetching items from the OneDrive API for Drive ID: b!bO8V7s9SSk6r7mWHpIjURotN33W1W2tEv3OXV_oFIdQimEdOHR-1So7CqeT1MfHA ..
Processing changes and items received from OneDrive ...
Syncing this OneDrive Business Shared Folder: Jenkins
Fetching items from the OneDrive API for Drive ID: b!fZgJhK-pU0eTQpylvmoYCkE4YgH_KRNDlxjRx9OWNqmV9Q_E_uWdRJKIB5L_ruPN ..
Processing changes and items received from OneDrive ...
Syncing this OneDrive Business Shared Folder: Jenkins - testuser2 testuser2's files
Fetching items from the OneDrive API for Drive ID: b!BhWyqa7K_kqXqHtSIlsqjR5iJogxpWxDradnpVGTU2VxBOJh82Y6S4he4rdnGPBT ..
Processing changes and items received from OneDrive ...
Syncing this OneDrive Business Shared Folder: Documents - testteamsite
Fetching items from the OneDrive API for Drive ID: b!knrQ8K6YIkqi-IrggfGWyi6Bu-HVzjxMpA7qvZX7Gy6-dlZIIb6fSo7k4cc0dlrV ..
Processing changes and items received from OneDrive ...

Sync with Microsoft OneDrive is complete

A rename of a folder online, triggers a rename locally:

Reading configuration file: /home/alex/.config/onedrive/config
Invalid value for key in config file - using default value: application_id
Configuration file successfully loaded
Configuring Global Azure AD Endpoints
Sync Engine Initialised with new Onedrive API instance
All application operations will be performed in: /home/alex/OneDrive
Fetching items from the OneDrive API for Drive ID: b!bO8V7s9SSk6r7mWHpIjURotN33W1W2tEv3OXV_oFIdQimEdOHR-1So7CqeT1MfHA ..
Processing changes and items received from OneDrive ...
Moving ./Jenkins to ./Jenkins - RENAMED
Syncing this OneDrive Business Shared Folder: Jenkins - RENAMED
Fetching items from the OneDrive API for Drive ID: b!fZgJhK-pU0eTQpylvmoYCkE4YgH_KRNDlxjRx9OWNqmV9Q_E_uWdRJKIB5L_ruPN ..
Processing changes and items received from OneDrive ...
Syncing this OneDrive Business Shared Folder: Jenkins - testuser2 testuser2's files
Fetching items from the OneDrive API for Drive ID: b!BhWyqa7K_kqXqHtSIlsqjR5iJogxpWxDradnpVGTU2VxBOJh82Y6S4he4rdnGPBT ..
Processing changes and items received from OneDrive ...
Syncing this OneDrive Business Shared Folder: Documents - testteamsite
Fetching items from the OneDrive API for Drive ID: b!knrQ8K6YIkqi-IrggfGWyi6Bu-HVzjxMpA7qvZX7Gy6-dlZIIb6fSo7k4cc0dlrV ..
Processing changes and items received from OneDrive ...
Performing a database consistency and integrity check on locally stored data ... 
Scanning local filesystem '~/OneDrive' for new data to upload ...
Perfoming final true up scan of online data from OneDrive
Fetching items from the OneDrive API for Drive ID: b!bO8V7s9SSk6r7mWHpIjURotN33W1W2tEv3OXV_oFIdQimEdOHR-1So7CqeT1MfHA ..
Processing changes and items received from OneDrive ...
Syncing this OneDrive Business Shared Folder: Jenkins - RENAMED
Fetching items from the OneDrive API for Drive ID: b!fZgJhK-pU0eTQpylvmoYCkE4YgH_KRNDlxjRx9OWNqmV9Q_E_uWdRJKIB5L_ruPN ..
Processing changes and items received from OneDrive ...
Syncing this OneDrive Business Shared Folder: Jenkins - testuser2 testuser2's files
Fetching items from the OneDrive API for Drive ID: b!BhWyqa7K_kqXqHtSIlsqjR5iJogxpWxDradnpVGTU2VxBOJh82Y6S4he4rdnGPBT ..
Processing changes and items received from OneDrive ...
Syncing this OneDrive Business Shared Folder: Documents - testteamsite
Fetching items from the OneDrive API for Drive ID: b!knrQ8K6YIkqi-IrggfGWyi6Bu-HVzjxMpA7qvZX7Gy6-dlZIIb6fSo7k4cc0dlrV ..
Processing changes and items received from OneDrive ...

Sync with Microsoft OneDrive is complete

If you could review the above and provide feedback that would be greatly appreciated.

When onedrive v2.5.0-alpha-1 also lands, if you could please help test that would also be greatly appreciated.

@abraunegg
Copy link
Owner

@lgiannantoni
OneDrive Client Version v2.5.0-alpha-1 is now available for testing - please review #2495 for details.

@abraunegg
Copy link
Owner

@lgiannantoni
Please could you respond here regarding this PR and testing.

@abraunegg abraunegg linked a pull request Jan 2, 2024 that will close this issue
This was unlinked from pull requests Jan 26, 2024
@abraunegg abraunegg linked a pull request Jan 26, 2024 that will close this issue
@abraunegg abraunegg added Fixed Bug Something isn't working and removed In Progress Currently being worked on PR Provided - Needs Testing Waiting on Response labels Feb 11, 2024
@abraunegg
Copy link
Owner

Marking as Fixed | Implemented as this is included in v2.5.0 alpha series codebase.

@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 Feb 19, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants