abraunegg / onedrive

OneDrive Client for Linux
https://abraunegg.github.io
GNU General Public License v3.0
9.91k stars 856 forks source link

Bug: Relocating OneDrive Business Shared Folders triggers itemNotFound #2821

Closed divico closed 1 day ago

divico commented 1 day ago

Describe the bug

Syncing OneDrive Business Shared Folders works as long as the folder (i.e. the shortcut) is left in the default location, that is at the root of its own OneDrive folder structure (i.e. "My Files")

Moving the Shared Folder (i.e. the shortcut) to another location in its own OneDrive folder structure will make the sync fail with

Syncing this OneDrive Business Shared Folder: Meetings

ERROR: Microsoft OneDrive API returned an error with the following message:
  Error Message:    HTTP request returned status code 404 (Not Found)
  Error Reason:     The resource could not be found.
  Error Code:       itemNotFound
  Calling Function: generateDeltaResponse()

Operating System Details

Linux 6.10.10-arch1-1 #1 SMP PREEMPT_DYNAMIC

Client Installation Method

From Source

OneDrive Account Type

Business | Office365

What is your OneDrive Application Version

onedrive v2.5.0

What is your OneDrive Application Configuration

Configuration file successfully loaded
Application version                          = onedrive v2.5.0
Compiled with                                = DMD 2109
User Application Config path                 = /home/xx/.config/onedrive
System Application Config path               = /etc/onedrive
Applicable Application 'config' location     = /home/xx/.config/onedrive/config
Configuration file found in config location  = true - using 'config' file values to override application defaults
Applicable 'sync_list' location              = /home/xx/.config/onedrive/sync_list
Applicable 'items.sqlite3' location          = /home/xx/.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.0
Config option 'force_http_11'                = true
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'          = 1
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        = false

Config option 'sync_business_shared_items'   = true
Config option 'Shared Files Directory'       = /home/xx/OneDrive/Files Shared With Me

Config option 'webhook_enabled'              = false

What is your 'curl' version

curl 8.10.0 (x86_64-pc-linux-gnu) libcurl/8.10.0 OpenSSL/3.3.2 zlib/1.3.1 brotli/1.1.0 zstd/1.5.6 libidn2/2.3.7 libpsl/0.21.5 libssh2/1.11.0 nghttp2/1.63.0 nghttp3/1.5.0
Release-Date: 2024-09-11
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
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'

/dev/mapper/cryptroot on /home type btrfs (rw,noatime,compress-force=zstd:3,ssd,discard=async,space_cache=v2,subvolid=257,subvol=/@home)

What are all your local file system partition types

btrfs

How do you use 'onedrive'

Steps to reproduce the behaviour

  1. On OneDrive online, select a shared folder from the "Shared" section and click the 'Add shortcut to My files'
  2. On OneDrive online, move the created shortcut from "My files" to another folder in your OneDrive
  3. run onedrive --sync

Complete Verbose Log Output

Fetching /delta response from the OneDrive API for Drive ID: b!ED7eq9U1NE-u0c3pbrncgOnK4QX61a5ErkAoCSKgZ2hwIPbxDGeVT6GXlXZTnjfb
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
Syncing this OneDrive Business Shared Folder: Meetings

ERROR: Microsoft OneDrive API returned an error with the following message:
  Error Message:    HTTP request returned status code 404 (Not Found)
  Error Reason:     The resource could not be found.
  Error Code:       itemNotFound
  Calling Function: generateDeltaResponse()

where Meetings is a shared folder shortcut moved from My Files to another folder (a folder Test A) using OneDrive online



### Screenshots

This is the how it looks in the Windows client after moving the shared folder `Meetings` into the folder `Test A`

![image](https://github.com/user-attachments/assets/aca1e2b5-4b34-481d-a4d2-a187598aa36c)

### Other Log Information or Details

_No response_

### Additional context

_No response_
abraunegg commented 1 day ago

@divico Unfortunatly this is not a bug - the documentation details where those shortcuts need to live.

Clossing this issue as it is not a bug.

To support relocating shortcuts to something other than the location as detailed in the documentation please raise a feature requesf.