abraunegg / onedrive

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

Bug: An internal database error occurred: file is not a database #2335

Closed MalihaAshraf closed 1 year ago

MalihaAshraf commented 1 year ago

Describe the bug

I was able to successfully install and run onedrive on my Linux system. My files and folders were synchronised perfectly until today when I log into my Linux system via a ssh server. I get the error: An internal database error occurred: file is not a database.

Any help appreciated please!

Operating System Details

OS:
Linux uid 5.19.0-32-generic #33~22.04.1-Ubuntu SMP PREEMPT_DYNAMIC Mon Jan 30 17:03:34 UTC 2 x86_64 x86_64 x86_64 GNU/Linux

No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 22.04.2 LTS
Release:        22.04
Codename:       jammy

Client Installation Method

From Distribution Package

OneDrive Account Type

SharePoint

What is your OneDrive Application Version

onedrive v2.4.23-1+np1

What is your OneDrive Application Configuration

Configuration file successfully loaded
onedrive version                             = v2.4.23-1+np1
Config path                                  = /home/uid/.config/onedrive
Config file found in config path             = true
Config option 'sync_dir'                     = /home/uid/Documents/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'                     = Github_repos/calibration/datasets|Github_repos/GitHub_repos_2/Archive|Backup
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'             = 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'                = 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'         = 777
Config option 'sync_file_permissions'        = 666
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 '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'

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.13
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

Network

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=16333504k,nr_inodes=4083376,                                                           mode=755,inode64)
devpts on /dev/pts type devpts (rw,nosuid,noexec,relatime,gid=5,mode=620,ptmxmod                                                           e=000)
tmpfs on /run type tmpfs (rw,nosuid,nodev,noexec,relatime,size=3274400k,mode=755                                                           ,inode64)
/dev/nvme0n1p3 on / type ext4 (rw,relatime,errors=remount-ro)
securityfs on /sys/kernel/security type securityfs (rw,nosuid,nodev,noexec,relat                                                           ime)
tmpfs on /dev/shm type tmpfs (rw,nosuid,nodev,inode64)
tmpfs on /run/lock type tmpfs (rw,nosuid,nodev,noexec,relatime,size=5120k,inode6                                                           4)
cgroup2 on /sys/fs/cgroup type cgroup2 (rw,nosuid,nodev,noexec,relatime,nsdelega                                                           te,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,rela                                                           time)
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=30,pgrp=1,time                                                           out=0,minproto=5,maxproto=5,direct,pipe_ino=17403)
hugetlbfs on /dev/hugepages type hugetlbfs (rw,relatime,pagesize=2M)
mqueue on /dev/mqueue type mqueue (rw,nosuid,nodev,noexec,relatime)
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,relatim                                                           e)
configfs on /sys/kernel/config type configfs (rw,nosuid,nodev,noexec,relatime)
ramfs on /run/credentials/systemd-sysusers.service type ramfs (ro,nosuid,nodev,n                                                           oexec,relatime,mode=700)
/var/lib/snapd/snaps/core_14447.snap on /snap/core/14447 type squashfs (ro,nodev                                                           ,relatime,errors=continue,x-gdu.hide)
/var/lib/snapd/snaps/core_14784.snap on /snap/core/14784 type squashfs (ro,nodev                                                           ,relatime,errors=continue,x-gdu.hide)
/var/lib/snapd/snaps/hello-world_29.snap on /snap/hello-world/29 type squashfs (                                                           ro,nodev,relatime,errors=continue,x-gdu.hide)
/dev/nvme0n1p4 on /local/scratch type ext4 (rw,relatime)
/dev/nvme0n1p1 on /boot/efi type vfat (rw,relatime,fmask=0077,dmask=0077,codepag                                                           e=437,iocharset=iso8859-1,shortname=mixed,errors=remount-ro)
sunrpc on /run/rpc_pipefs type rpc_pipefs (rw,relatime)
-hosts on /net type autofs (rw,relatime,fd=6,pgrp=1042,timeout=300,minproto=5,ma                                                           xproto=5,indirect,pipe_ino=21086)
auto_homes on /auto/homes type autofs (rw,relatime,fd=12,pgrp=1042,timeout=300,m                                                           inproto=5,maxproto=5,indirect,pipe_ino=22384)
auto_userfiles on /auto/userfiles type autofs (rw,relatime,fd=18,pgrp=1042,timeo                                                           ut=300,minproto=5,maxproto=5,indirect,pipe_ino=25123)
auto_groups on /auto/groups type autofs (rw,relatime,fd=24,pgrp=1042,timeout=300                                                           ,minproto=5,maxproto=5,indirect,pipe_ino=24411)
auto_anfs on /auto/anfs type autofs (rw,relatime,fd=30,pgrp=1042,timeout=300,min                                                           proto=5,maxproto=5,indirect,pipe_ino=24414)
auto_a on /Nfs/Mounts type autofs (rw,relatime,fd=36,pgrp=1042,timeout=300,minpr                                                           oto=5,maxproto=5,indirect,pipe_ino=23514)
tmpfs on /run/user/127 type tmpfs (rw,nosuid,nodev,relatime,size=3274396k,nr_ino                                                           des=818599,mode=700,uid=127,gid=133,inode64)
gvfsd-fuse on /run/user/127/gvfs type fuse.gvfsd-fuse (rw,nosuid,nodev,relatime,                                                           user_id=127,group_id=133)
server:/userfiles/uid/unix_home on /auto/homes/uid type nfs4 (r                                                           w,relatime,vers=4.1,rsize=65536,wsize=65536,namlen=255,hard,proto=tcp6,timeo=600                                                           ,retrans=2,sec=krb5p,clientaddr=2001:630:212:238:6d4:c4ff:fe03:e045,local_lock=n                                                           one,addr=2a05:b400:110:a9::f:8e)
tmpfs on /run/user/4294 type tmpfs (rw,nosuid,nodev,relatime,size=3274396k,nr_in                                                           odes=818599,mode=700,uid=4294,gid=4294,inode64)

What are all your local file system partition types

NAME        FSTYPE   FSVER LABEL            UUID                                 FSAVAIL FSUSE% MOUNTPOINTS
loop0       squashfs 4.0                                                               0   100% /snap/core/14447
loop1       squashfs 4.0                                                               0   100% /snap/core/14784
loop2       squashfs 4.0                                                               0   100% /snap/hello-world/29
sda
sdb
sdc
sdd
sr0
nvme0n1
├─nvme0n1p1 vfat     FAT32                  9CA4-E051                             505.7M     1% /boot/efi
├─nvme0n1p2 ext4     1.0   vanadium_U18.4_s 80e8e87e-0002-1604-c1c1-00005db98773
├─nvme0n1p3 ext4     1.0   vanadium_U22.04_ 80e8e87e-3002-2204-c1c1-000063765fc6    2.8G    81% /
└─nvme0n1p4 ext4     1.0   scratch          84875cb1-8f49-4dda-8929-89179e9f39e7    267G    27% /local/scratch

How do you use 'onedrive'

I use my Onedrive folder across a Linux and Windows OS.

Steps to reproduce the behaviour

Run the command: onedrive --monitor Or onedrive --synchronize`

Complete Verbose Log Output

Using 'user' Config Dir: /home/ma905/.config/onedrive
Using 'system' Config Dir: /etc/onedrive
Configuration file successfully loaded
Checking Application Version ...
Initializing the OneDrive API ...
Configuring Global Azure AD Endpoints
Using Curl defaults for all HTTP operations
Opening the item database ...

ERROR: An internal database error occurred: file is not a database

Screenshots

No response

Other Log Information or Details

No response

Additional context

No response

abraunegg commented 1 year ago

@MalihaAshraf

ERROR: An internal database error occurred: file is not a database

This is not a bug or application issue.

The database the client uses on your local system has been fouled up and/or mangled with outside of the application process which is why you are getting this error.

You need to investigate what has caused your /home/uid/.config/onedrive/items.sqlite3 to no longer be a valid database file.

MalihaAshraf commented 1 year ago

Thank you! I deleted the sqlite3 file and then restart the service. That fixed it.

abraunegg commented 1 year ago

@MalihaAshraf Whilst a --resync would have also done the same fix - you need to determine what application or activity you did on your system to cause the file to be no longer a file.

Potential issues:

abraunegg commented 1 year 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.