abraunegg / onedrive

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

Bug: Download only not working #2739

Closed codergitrf closed 1 month ago

codergitrf commented 1 month ago

Describe the bug

I set the download only flag to true in the config file however when I test it by placing a new file into the local directory, it eventually uploads. I'm running it as a service and yes I restart it after setting the config file etc.

I'm actually only doing this because of another bug, which is when I unplug my external hdd's (which my onedrive resides on) it deleted everything from my online onedrive, I guess it made the assumption that because drive was gone everything was deleted, seems like a bit of an issue.

Operating System Details

Raspberry pi operating system

Client Installation Method

From Source

OneDrive Account Type

Personal

What is your OneDrive Application Version

2.4.25

What is your OneDrive Application Configuration

onedrive version                             = v2.4.25-1+np1
Config path                                  = /home/pi/.config/onedrive
Config file found in config path             = true
Config option 'sync_dir'                     = /media/pi/New Volume/OneDrive
Config option 'enable_logging'               = false
Config option 'log_dir'                      = /var/log/onedrive/
Config option 'disable_notifications'        = false
Config option 'min_notify_changes'           = 5
Config option 'skip_dir'                     = 
Config option 'skip_dir_strict_match'        = false
Config option 'skip_file'                    = ~*|*.db|*.ini
Config option 'skip_dotfiles'                = false
Config option 'skip_symlinks'                = false
Config option 'monitor_interval'             = 300
Config option 'monitor_log_frequency'        = 6
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'                = true
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'                   = 0
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' = false
Business Shared Folders configured           = false
Config option 'webhook_enabled'              = false

What is your 'curl' version

curl 7.74.0 (arm-unknown-linux-gnueabihf) libcurl/7.74.0 OpenSSL/1.1.1w zlib/1.2.11 brotli/1.0.9 libidn2/2.3.0 libpsl/0.21.0 (+libidn2/2.3.0) libssh2/1.9.0 nghttp2/1.43.0 librtmp/2.3
Release-Date: 2020-12-09, security patched: 7.74.0-1.3+deb11u11
Protocols: dict file ftp ftps gopher 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 HTTP2 HTTPS-proxy IDN IPv6 Kerberos Largefile libz NTLM NTLM_WB PSL SPNEGO SSL TLS-SRP UnixSockets

Where is your 'sync_dir' located

Local

What are all your system 'mount points'

na

What are all your local file system partition types

na

How do you use 'onedrive'

na

Steps to reproduce the behaviour

na

Complete Verbose Log Output

na

Screenshots

No response

Other Log Information or Details

No response

Additional context

No response

abraunegg commented 1 month ago

@codergitrf

I set the download only flag to true in the config file however when I test it by placing a new file into the local directory, it eventually uploads. I'm running it as a service and yes I restart it after setting the config file etc.

This is 100% impossible due to how the client code works.

The only scenario here is if you have 2 running systemd services running - which if you ever installed via a package, you would have a hidden systemd service running with a default configuration.

I suspect you 99.99% have a mis-configuration going on here and I can 100% say that there is no 'download only' bug that stuff gets uploaded with - as this is 100% technically impossible when 'download only' is correctly set.

I'm actually only doing this because of another bug, which is when I unplug my external hdd's (which my onedrive resides on) it deleted everything from my online onedrive, I guess it made the assumption that because drive was gone everything was deleted, seems like a bit of an issue.

Correct - if you are mounting a drive and storing your data on a second drive, and this drive disappears the client has zero knowledge that the drive disappeared and assumes you deleted your data.

Please read the documentation regarding this situation and how to configure your system and the application to prevent a drive removal causing deletion:

Closing this issue as this is 99.9999999% not a bug but end-user configuration issue, and the data on a mounted external drive needs to be setup correctly.

codergitrf commented 1 month ago

Some of the other parameters seem to work such as sync directory etc. How would I check and turn this hidden service off?

I just interact with the service normally using commands like systemctl --user status onedrive

abraunegg commented 1 month ago

Please read all documents and install the client correctly for your platform

codergitrf commented 1 month ago

Are you saying I need to reinstall it? I installed for rpi previously following your instructions https://github.com/abraunegg/onedrive/blob/master/docs/INSTALL.md

And then I interact with the service as described.

I don't think this is the issue, because like I said some of the other commands work such as path location. If there was another config file then the path I set on the external drive wouldn't have worked and the data is there.

abraunegg commented 1 month ago

Are you saying I need to reinstall it? I installed for rpi previously following your instructions https://github.com/abraunegg/onedrive/blob/master/docs/INSTALL.md

So .. for an RPi platform you have 2 methods:

  1. Compile from source by following https://github.com/abraunegg/onedrive/blob/master/docs/INSTALL.md
  2. Install from the OpenSuSE packages by following https://github.com/abraunegg/onedrive/blob/master/docs/ubuntu-package-install.md

Now .. what many folk do is that they always seem to install the distribution package of the client first, then realise something is not working. It is this package that causes the hidden systemd service.

Please read all the available documentation.

Steps to resolve

  1. Install the client the correct way, which also means removing any existing package / install / systemd configuration & then reboot to ensure there is no lurking zombie process
  2. Install the client the correct way
  3. Configure the client the correct way for using external disks as your location for your data
abraunegg commented 1 month ago

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.