nextcloud / desktop

💻 Desktop sync client for Nextcloud
https://nextcloud.com/install/#install-clients
GNU General Public License v2.0
2.99k stars 785 forks source link

[Bug]: ICE default IO error handler doing an exit(), pid = XXXX, errno = 32 #5190

Open forys7 opened 1 year ago

forys7 commented 1 year ago

⚠️ Before submitting, please verify the following: ⚠️

Bug description

Desktop Client fails to start with following error code: ICE default IO error handler doing an exit(), pid = XXXX, errno = 32

Steps to reproduce

  1. get latest release (in my case 3.6.2)
  2. build with given instructions from github
  3. run "nextcloud" inside the bin folder of the installation

Expected behavior

Normal start of nextcloud, system tray icon should show and sync should start.

Which files are affected by this bug

unsure, probably gui/main.cpp

Operating system

Linux

Which version of the operating system you are running.

Debian 11 Bullseye

Package

Compiled it myself

Nextcloud Server version

24.0.0

Nextcloud Desktop Client version

3.6.2

Is this bug present after an update or on a fresh install?

Fresh desktop client install

Are you using the Nextcloud Server Encryption module?

Encryption is Disabled

Are you using an external user-backend?

Nextcloud Server logs

I think it has nothing to do with server side.

Additional info

The sync folders are on separate HDDs and not on the installation disk.

I troubleshooted the problem with gdb finding the following: 1) The Updater seemed to cause the issue, here is a part of the output:

Thread 1 "nextcloud" hit Breakpoint 1, OCC::Application::Application (this=0x7fffffffdfc0, argc=@0x7fffffffdf4c: 1, argv=0x7fffffffe1c8)
    at ~/NextcloudNew/desktop-3.6.2/src/gui/application.cpp:397
397     auto *updaterScheduler = new UpdaterScheduler(this);
(gdb) bt
#0  OCC::Application::Application(int&, char**) (this=0x7fffffffdfc0, argc=@0x7fffffffdf4c: 1, argv=0x7fffffffe1c8) at ~/NextcloudNew/desktop-3.6.2/src/gui/application.cpp:397
#1  0x00005555555ec4d7 in main(int, char**) (argc=1, argv=0x7fffffffe1c8) at ~/NextcloudNew/desktop-3.6.2/src/gui/main.cpp:105
(gdb) next
[Attaching after Thread 0x7fffe3350440 (LWP 6050) fork to child process 6078]
[New inferior 2 (process 6078)]
[Detaching after fork from parent process 6050]
[Inferior 1 (process 6050) detached]
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
process 6078 is executing new program: /usr/bin/python3.9
Error in re-setting breakpoint 1: No source file named application.cpp.
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
[Inferior 2 (process 6078) exited normally]
(gdb) ICE default IO error handler doing an exit(), pid = 6050, errno = 32

I compiled it with the updater disabled (adapted NEXTCLOUD.cmake) but the problem persisted.

2) I found that the line signal(SIGPIPE, SIG_IGN); in src/gui/main.cpp did apparently not disable SIGPIPE errors. But this is what it should do if I understood it right (according to https://stackoverflow.com/questions/30799296/what-does-signalsigpipe-sig-ign-do) I tried it with (gdb) handle SIGPIPE nostop from here: https://stackoverflow.com/a/30197104 and the client started as intended.

For a workaround I added the following lines to src/gui/main.cpp (from here: https://stackoverflow.com/a/21956613)

void signal_callback_handler(int signum){
     return;
}       

and replaced signal(SIGPIPE, SIG_IGN);with signal(SIGPIPE, signal_callback_handler);

for me this seemed to have fixed the problem, but I doubt it is a permanent solution.

NOTE: I have no clue about cpp and this is my first time compiling myself and debugging an app on linux. If I am completely wrong, pls don't ban me :P

NOTE2: this may be linked to #342 and the suggested workaround there with umount, start nextcloud, mount did work, tho it also caused the tray icon to vanish after a few minutes.

UPDATE: the problem still persists, it seems to be random. Sometimes it works, sometimes not. I wasn't able to reproduce it yet. I am running the appimage now (one from a previous version did not work properly, thats why I compiled it myself) and till now it runs as expected.

UPDATE2: here are the last lines of the client log before it crashes (version where updater is installed):

2022-11-13 18:30:13:023 [ debug nextcloud.sync.database.sql ~/NextcloudClientBuild/desktop/src/common/ownsql.cpp:295 ]  [ OCC::SqlQuery::exec ]:    SQL exec "CREATE INDEX IF NOT EXISTS metadata_e2e_id ON metadata(e2eMangledName);"
2022-11-13 18:30:13:023 [ debug nextcloud.sync.database.sql ~/NextcloudClientBuild/desktop/src/common/ownsql.cpp:328 ]  [ OCC::SqlQuery::exec ]:    Last exec affected 0 rows.
2022-11-13 18:30:13:023 [ debug nextcloud.sync.database ~/NextcloudClientBuild/desktop/src/common/syncjournaldb.cpp:2449 ]  [ OCC::SyncJournalDb::commitInternal ]: Transaction commit "update database structure: add e2eMangledName index" and starting new transaction
2022-11-13 18:30:13:024 [ debug nextcloud.sync.database.sql ~/NextcloudClientBuild/desktop/src/common/ownsql.cpp:295 ]  [ OCC::SqlQuery::exec ]:    SQL exec "PRAGMA table_info('blacklist');"
2022-11-13 18:30:13:024 [ debug nextcloud.sync.database ~/NextcloudClientBuild/desktop/src/common/syncjournaldb.cpp:853 ]   [ OCC::SyncJournalDb::tableColumns ]:   Columns in the current journal: QVector("path", "lastTryEtag", "lastTryModtime", "retrycount", "errorstring", "lastTryTime", "ignoreDuration", "renameTarget", "errorCategory", "requestId")
2022-11-13 18:30:13:024 [ debug nextcloud.sync.database.sql ~/NextcloudClientBuild/desktop/src/common/ownsql.cpp:295 ]  [ OCC::SqlQuery::exec ]:    SQL exec "CREATE INDEX IF NOT EXISTS blacklist_index ON blacklist(path collate nocase);"
2022-11-13 18:30:13:024 [ debug nextcloud.sync.database.sql ~/NextcloudClientBuild/desktop/src/common/ownsql.cpp:328 ]  [ OCC::SqlQuery::exec ]:    Last exec affected 0 rows.
2022-11-13 18:30:13:024 [ debug nextcloud.sync.database ~/NextcloudClientBuild/desktop/src/common/syncjournaldb.cpp:2449 ]  [ OCC::SyncJournalDb::commitInternal ]: Transaction commit "checkConnect End" 
2022-11-13 18:30:13:024 [ debug nextcloud.sync.database.sql ~/NextcloudClientBuild/desktop/src/common/ownsql.cpp:295 ]  [ OCC::SqlQuery::exec ]:    SQL exec "SELECT COUNT(*) FROM metadata"
2022-11-13 18:30:13:025 [ info nextcloud.gui.folder.manager ~/NextcloudClientBuild/desktop/src/gui/folderman.cpp:1161 ]:    Adding folder to Folder Map  OCC::Folder(0x561e2543de70) "8"
2022-11-13 18:30:13:025 [ debug nextcloud.gui.folderwatcher ~/NextcloudClientBuild/desktop/src/gui/folderwatcher_linux.cpp:100 ]    [ OCC::FolderWatcherPrivate::slotAddFolderRecursive ]:  (+) Watcher: "pathtoonesyncfolder"
2022-11-13 18:30:29:784 [ debug nextcloud.gui.folderwatcher ~/NextcloudClientBuild/desktop/src/gui/folderwatcher_linux.cpp:126 ]    [ OCC::FolderWatcherPrivate::slotAddFolderRecursive ]:      `-> and 10287 subdirectories
2022-11-13 18:30:29:785 [ info nextcloud.gui.folder.manager ~/NextcloudClientBuild/desktop/src/gui/folderman.cpp:627 ]: Schedule folder  "8"  to sync!
2022-11-13 18:30:29:786 [ info nextcloud.gui.folder.manager ~/NextcloudClientBuild/desktop/src/gui/folderman.cpp:631 ]: Folder is not ready to sync, not scheduled!
2022-11-13 18:30:29:786 [ info nextcloud.gui.application ~/NextcloudClientBuild/desktop/src/gui/owncloudgui.cpp:230 ]:  Sync state changed for folder  "https://someip/remote.php/dav/files/somefolder" :  "Not yet started"
2022-11-13 18:30:29:786 [ info nextcloud.sync.clientproxy ~/NextcloudClientBuild/desktop/src/libsync/clientproxy.cpp:103 ]: Set proxy configuration to use the preferred system proxy for http tcp connections
2022-11-13 18:30:29:882 [ debug nextcloud.gui.updater ~/NextcloudClientBuild/desktop/src/gui/updater/updater.cpp:124 ]  [ OCC::Updater::getSystemInfo ]:    Sys Info size:  98
2022-11-13 18:30:29:883 [ debug nextcloud.gui.updater ~/NextcloudClientBuild/desktop/src/gui/updater/updater.cpp:138 ]  [ OCC::Updater::create ]:   QUrl("https://updates.nextcloud.org/client/?client=RGlzdHJpYnV0b3IgSUQ6CURlYmlhbgpEZXNjcmlwdGlvbjoJRGViaWFuIEdOVS9MaW51eCAxMSAoYnVsbHNleWUpClJlbGVhc2U6CTExCkNvZGVuYW1lOglidWxsc2V5ZQo%3D&version=3.6.50.0&platform=linux&osRelease=debian&osVersion=11&kernelVersion=5.10.0-16-amd64&oem=Nextcloud&buildArch=x86_64&currentArch=x86_64&versionsuffix=git&updatesegment=31")
2022-11-13 18:30:30:520 [ info nextcloud.gui.account.state ~/NextcloudClientBuild/desktop/src/gui/accountstate.cpp:270 ]:   check connectivity
2022-11-13 18:30:30:520 [ info nextcloud.sync.credentials.webflow ~/NextcloudClientBuild/desktop/src/gui/creds/webflowcredentials.cpp:139 ]:    Fetch from keychain!
joshtrichards commented 1 month ago

Hi @forys7:

  1. Is this still occurring with newer versions of the client?
  2. Can you reproduce this problem with the officially distributed AppImage?