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: Problems moving online files inside directories when using 'sync_list' #3041

Open
amelcon-dot opened this issue Dec 11, 2024 · 1 comment · May be fixed by #3042
Open

Bug: Problems moving online files inside directories when using 'sync_list' #3041

amelcon-dot opened this issue Dec 11, 2024 · 1 comment · May be fixed by #3042

Comments

@amelcon-dot
Copy link

amelcon-dot commented Dec 11, 2024

Describe the bug

When you move online a file into a new subdirectory, the file does not get moved. It is deleted, both the original file and the subdirectory.

Operating System Details

uname -a
 pcaamelcon 5.14.21-150500.55.83-default #1 SMP PREEMPT_DYNAMIC Wed Oct 2 08:09:07 UTC 2024 (0d53847) x86_64 x86_64 x86_64 GNU/Linux
lsb_release -a

LSB Version:    core-2.0-noarch:core-3.2-noarch:core-4.0-noarch:core-2.0-x86_64:core-3.2-x86_64:core-4.0-x86_64:desktop-4.0.fake-amd64:desktop-4.0.fake-noarch:graphics-2.0-amd64:graphics-2.0-noarch:graphics-3.2-amd64:graphics-3.2-noarch:graphics-4.0.fake-amd64:graphics-4.0.fake-noarch
Distributor ID: openSUSE
Description:    openSUSE Leap 15.5
Release:        15.5
Codename:       n/a

Client Installation Method

From Distribution Package

OneDrive Account Type

Business | Office365

What is your OneDrive Application Version

onedrive v2.5.3

What is your OneDrive Application Configuration

Reading configuration file: /home/amelcon/.config/onedriveAMELCON/config
Configuration file successfully loaded

WARNING: Your OpenSSL version (1.1.1l) may cause stability issues with this client.
         Please report this to your distribution, requesting an update to a newer OpenSSL version, or consider upgrading it yourself for optimal stability.

Application version                          = onedrive v2.5.3
Compiled with                                = DMD 2098
Curl version                                 = libcurl/8.0.1 OpenSSL/1.1.1l-fips zlib/1.2.11 brotli/1.0.7 zstd/1.5.0 libidn2/2.2.0 libpsl/0.20.1 (+libidn2/2.2.0) libssh/0.9.8/openssl/zlib nghttp2/1.40.0
User Application Config path                 = /home/amelcon/.config/onedriveAMELCON
System Application Config path               = /etc/onedrive
Applicable Application 'config' location     = /home/amelcon/.config/onedriveAMELCON/config
Configuration file found in config location  = true - using 'config' file values to override application defaults
Applicable 'sync_list' location              = /home/amelcon/.config/onedriveAMELCON/sync_list
Applicable 'items.sqlite3' location          = /home/amelcon/.config/onedriveAMELCON/items.sqlite3
Config option 'drive_id'                     = 
Config option 'sync_dir'                     = ~/OneDriveLocal
Config option 'enable_logging'               = false
Config option 'log_dir'                      = ~/logs/onedriveAMELCON/
Config option 'disable_notifications'        = false
Config option 'skip_dir'                     = *.aedtresults|*_lib
Config option 'skip_dir_strict_match'        = false
Config option 'skip_file'                    = ~*|.~*|octave-workspace|*.spl|*.snm|*.msf|*.tmp|*.aux|*.out|*.bbl|*.blg|*.dvi|*.log|*.soc|Thumbs.db*
Config option 'skip_dotfiles'                = true
Config option 'skip_symlinks'                = true
Config option 'monitor_interval'             = 600
Config option 'monitor_log_frequency'        = 30
Config option 'monitor_fullscan_frequency'   = 30
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'                 = true
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'       = 3000
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.3
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:
#
# Directory to sync:
#
/v1/amelcon/

Config option 'sync_business_shared_items'   = false

Config option 'webhook_enabled'              = false

What is your 'curl' version

curl 8.0.1 (x86_64-suse-linux-gnu) libcurl/8.0.1 OpenSSL/1.1.1l-fips zlib/1.2.13 brotli/1.0.7 zstd/1.5.0 libidn2/2.2.0 libpsl/0.20.1 (+libidn2/2.2.0) libssh/0.9.8/openssl/zlib nghttp2/1.40.0
Release-Date: 2023-03-20
Protocols: dict file ftp ftps gopher gophers http https imap imaps ldap ldaps mqtt pop3 pop3s 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 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)
sysfs on /sys type sysfs (rw,nosuid,nodev,noexec,relatime)
devtmpfs on /dev type devtmpfs (rw,nosuid,size=4096k,nr_inodes=1048576,mode=755,inode64)
securityfs on /sys/kernel/security type securityfs (rw,nosuid,nodev,noexec,relatime)
tmpfs on /dev/shm type tmpfs (rw,nosuid,nodev,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,size=2431356k,nr_inodes=819200,mode=755,inode64)
tmpfs on /sys/fs/cgroup type tmpfs (ro,nosuid,nodev,noexec,size=4096k,nr_inodes=1024,mode=755,inode64)
cgroup2 on /sys/fs/cgroup/unified type cgroup2 (rw,nosuid,nodev,noexec,relatime,nsdelegate)
cgroup on /sys/fs/cgroup/systemd type cgroup (rw,nosuid,nodev,noexec,relatime,xattr,name=systemd)
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)
cgroup on /sys/fs/cgroup/net_cls,net_prio type cgroup (rw,nosuid,nodev,noexec,relatime,net_cls,net_prio)
cgroup on /sys/fs/cgroup/hugetlb type cgroup (rw,nosuid,nodev,noexec,relatime,hugetlb)
cgroup on /sys/fs/cgroup/cpu,cpuacct type cgroup (rw,nosuid,nodev,noexec,relatime,cpu,cpuacct)
cgroup on /sys/fs/cgroup/blkio type cgroup (rw,nosuid,nodev,noexec,relatime,blkio)
cgroup on /sys/fs/cgroup/devices type cgroup (rw,nosuid,nodev,noexec,relatime,devices)
cgroup on /sys/fs/cgroup/memory type cgroup (rw,nosuid,nodev,noexec,relatime,memory)
cgroup on /sys/fs/cgroup/cpuset type cgroup (rw,nosuid,nodev,noexec,relatime,cpuset)
cgroup on /sys/fs/cgroup/perf_event type cgroup (rw,nosuid,nodev,noexec,relatime,perf_event)
cgroup on /sys/fs/cgroup/rdma type cgroup (rw,nosuid,nodev,noexec,relatime,rdma)
cgroup on /sys/fs/cgroup/freezer type cgroup (rw,nosuid,nodev,noexec,relatime,freezer)
cgroup on /sys/fs/cgroup/misc type cgroup (rw,nosuid,nodev,noexec,relatime,misc)
cgroup on /sys/fs/cgroup/pids type cgroup (rw,nosuid,nodev,noexec,relatime,pids)
/dev/sdb3 on / type btrfs (rw,relatime,ssd,space_cache,subvolid=265,subvol=/@/.snapshots/1/snapshot)
systemd-1 on /proc/sys/fs/binfmt_misc type autofs (rw,relatime,fd=30,pgrp=1,timeout=0,minproto=5,maxproto=5,direct,pipe_ino=383)
debugfs on /sys/kernel/debug type debugfs (rw,nosuid,nodev,noexec,relatime)
hugetlbfs on /dev/hugepages type hugetlbfs (rw,relatime,pagesize=2M)
tracefs on /sys/kernel/tracing type tracefs (rw,nosuid,nodev,noexec,relatime)
mqueue on /dev/mqueue type mqueue (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)
/dev/sdb3 on /opt type btrfs (rw,relatime,ssd,space_cache,subvolid=263,subvol=/@/opt)
/dev/sdb3 on /root type btrfs (rw,relatime,ssd,space_cache,subvolid=262,subvol=/@/root)
/dev/sdb2 on /boot type btrfs (rw,relatime,ssd,space_cache,subvolid=5,subvol=/)
/dev/sdb3 on /.snapshots type btrfs (rw,relatime,ssd,space_cache,subvolid=264,subvol=/@/.snapshots)
/dev/sdb3 on /srv type btrfs (rw,relatime,ssd,space_cache,subvolid=261,subvol=/@/srv)
/dev/sdb3 on /usr/local type btrfs (rw,relatime,ssd,space_cache,subvolid=259,subvol=/@/usr/local)
/dev/sdb3 on /tmp type btrfs (rw,relatime,ssd,space_cache,subvolid=260,subvol=/@/tmp)
/dev/sdb3 on /var type btrfs (rw,relatime,ssd,space_cache,subvolid=258,subvol=/@/var)
/dev/sda1 on /home type ext4 (rw,relatime,data=ordered)
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=1215676k,nr_inodes=303919,mode=700,uid=1000,gid=100,inode64)
gvfsd-fuse on /run/user/1000/gvfs type fuse.gvfsd-fuse (rw,nosuid,nodev,relatime,user_id=1000,group_id=100)
portal on /run/user/1000/doc type fuse.portal (rw,nosuid,nodev,relatime,user_id=1000,group_id=100)
tracefs on /sys/kernel/debug/tracing type tracefs (rw,nosuid,nodev,noexec,relatime)

What are all your local file system partition types

NAME FSTYPE FSVER LABEL UUID                                 FSAVAIL FSUSE% MOUNTPOINTS
sda                                                                         
└─sda1
     ext4   1.0         0217a526-1173-4764-be10-946d77658553  153.8G    66% /home
sdb                                                                         
├─sdb1
│    swap   1           a87b22ae-7d55-4a17-a9da-d05a3ba1aefd                [SWAP]
├─sdb2
│    btrfs              376d69ef-2721-418d-919d-44e2d98f4355  776.4M    12% /boot
└─sdb3
     btrfs              39fdcf7c-f171-49b6-b96d-5e7e0199a25d   87.3G    60% /var
                                                                            /tmp
                                                                            /usr/local
                                                                            /srv
                                                                            /.snapshots
                                                                            /root
                                                                            /opt
                                                                            /
sdc                                                                         
sr0                                                 

How do you use 'onedrive'

I use a windows machine with Microsoft Onedrive client and a Linux machine with this client, to have the files in sync. I also use another Linux machine to sync locally the same files as a backup device (same Linux system and version as the main Linux).

Steps to reproduce the behaviour

Hello,
I send the log file with --verbose --verbose and a brief explanation via E-mail, as requested.

I explain what I did:

I start with a fresh file in:

v1/amelcon/upct/PhdThesis/AOliva/mttJ24/Graphical_Abstract_TMTT.pptx

I start the client in --monitor mode and wait to finish the first sync cycle.

While the client in waiting, I do in a windows machine:

create directory test5
create directory test6
copy the file Graphical_Abstract_TMTT.pptx to test5
move the file Graphical_Abstract_TMTT.pptx to test6

The microsoft Onedrive is running in the windows machine, so the online version is updated with these modifications.

Note that test5 and test6 only exist online. They are not created locally yet.

Wait for the client to perform the next sync cycle.
Result locally is:
The file is correctly copied in test5

The folder test6 is removed
The original file v1/amelcon/upct/PhdThesis/AOliva/mttJ24/Graphical_Abstract_TMTT.pptx is removed.

Complete Verbose Log Output

I sent the log file of the above test to this Email (in monitor mode though).

Screenshots

No response

Other Log Information or Details

No response

Additional context

No response

@amelcon-dot amelcon-dot added the Bug Something isn't working label Dec 11, 2024
@abraunegg abraunegg added this to the v2.5.4 milestone Dec 11, 2024
@abraunegg abraunegg changed the title Bug: Problems moving online files inside directories Bug: Problems moving online files inside directories when using 'sync_list' Dec 11, 2024
@abraunegg
Copy link
Owner

abraunegg commented Dec 11, 2024

@amelcon-dot

Please can you test the PR below.

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.

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

#!/bin/bash

PR=3042

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-pr3042 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.3-25-g6e389e1 or greater.

Validation with PR

Sync Engine Initialised with new Onedrive API instance
All application operations will be performed in the configured local 'sync_dir' directory: /home/alex/OneDrive
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: 9
Including path - included by sync_list config: ./v1
Including path - included by sync_list config: v1/amelcon
Including path - included by sync_list config: v1/amelcon/upct
Including path - included by sync_list config: v1/amelcon/upct/PhdThesis
Including path - included by sync_list config: v1/amelcon/upct/PhdThesis/AOliva
Including path - included by sync_list config: v1/amelcon/upct/PhdThesis/AOliva/mttJ24
Including path - included by sync_list config: v1/amelcon/upct/PhdThesis/AOliva/mttJ24/test7
Including file - included by sync_list config: v1/amelcon/upct/PhdThesis/AOliva/mttJ24/test7/Graphical_Abstract_TMTT.pptx
Parental Path structure needs to be created to support included file: v1/amelcon/upct/PhdThesis/AOliva/mttJ24/test7/Graphical_Abstract_TMTT.pptx
Creating local directory: ./v1/amelcon/upct/PhdThesis/AOliva/mttJ24/test7
Finished processing /delta JSON response from the OneDrive API
Processing 8 applicable changes and items received from Microsoft OneDrive
Processing OneDrive JSON item batch [1/1] to ensure consistent local state
WARNING: OneDrive API inconsistency – the API JSON response for this file is missing a hash value: v1/amelcon/upct/PhdThesis/AOliva/mttJ24/test7/Graphical_Abstract_TMTT.pptx
Moving v1/amelcon/upct/PhdThesis/AOliva/mttJ24/test6/Graphical_Abstract_TMTT.pptx to v1/amelcon/upct/PhdThesis/AOliva/mttJ24/test7/Graphical_Abstract_TMTT.pptx
WARNING: OneDrive API inconsistency – the API JSON response for this file is missing a hash value: v1/amelcon/upct/PhdThesis/AOliva/mttJ24/test7/Graphical_Abstract_TMTT.pptx
Performing a database consistency and integrity check on locally stored data
Processing DB entries for this Drive ID: b!bO8V7s9SSk6r7mWHpIjURotN33W1W2tEv3OXV_oFIdQimEdOHR-1So7CqeT1MfHA
Processing: ~/OneDrive
The directory has not changed
Processing: v1
The directory has not changed
Processing: v1/amelcon
The directory has not changed
Processing: v1/amelcon/upct
  • Folder is correctly created locally before file move
  • File is moved to local folder

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