desktop icon indicating copy to clipboard operation
desktop copied to clipboard

Crash during sync due to CLDAPI.dll error

Open burakkaraceylan opened this issue 4 years ago • 146 comments

Expected behaviour

Should sync the files.

Actual behaviour

Crashes.

Steps to reproduce

  1. Start nextcloud
  2. Press resume sync
  3. Crash

Client configuration

Client version: 3.2.1

Operating system: Windows 10 Build 19043

OS language: Turkish

Installation path of client: C:\Program Files\Nextcloud\nextcloud.exe

Logs

In the debugger the error comes down to:

cldapi.dll;IssueHsmControl()

"Unhandled exception at 0x00007FF8BFD24B2A (cldapi.dll) in nextcloud.exe: 0xC0000005: Access violation reading location 0xFFFFFFFFFFFFFFFE."

burakkaraceylan avatar May 22 '21 08:05 burakkaraceylan

Same issue here.

OS : Windows 10 (21390) Lang : English Nextcloud : Client 3.2.2 Server : Apache/docker 21.0.2.1

Windows Event vewer log

Faulting application name: nextcloud.exe, version: 3.2.2.25439, time stamp: 0x60af933e Faulting module name: CLDAPI.dll, version: 10.0.21390.1, time stamp: 0x7bcd084b Exception code: 0xc0000005 Fault offset: 0x00000000000157b7 Faulting process ID: 0x8924 Faulting application start time: 0x01d75b9493390e7d Faulting application path: C:\Program Files\Nextcloud\nextcloud.exe Faulting module path: C:\WINDOWS\SYSTEM32\CLDAPI.dll Report ID: 093b4e15-dbdf-4d2f-91a0-c2ed233b2379 Faulting package full name: Faulting package-relative application ID:

Nextcloud app log

2021-06-07 14:13:09:469 [ debug nextcloud.sync.database ] [ OCC::SyncJournalDb::commitInternal ]: Transaction commit "download file start2" and starting new transaction 2021-06-07 14:13:09:469 [ info nextcloud.sync.propagator ]: Completed propagation of "Elton John/One Night Only- The Greatest Hits [Live]/AlbumArt_{B5020207-474E-4720-9913-9C2E56BE0B00}Large.jpg" by OCC::PropagateDownloadFile(0x1cc7929fa00) with status OCC::SyncFileItem::Success 2021-06-07 14:13:09:469 [ debug nextcloud.sync.statustracker ] [ OCC::SyncFileStatusTracker::slotItemCompleted ]: Item completed "Elton John/One Night Only- The Greatest Hits [Live]/AlbumArt{B5020207-474E-4720-9913-9C2E56BE0B00}Large.jpg" OCC::SyncFileItem::Success CSyncEnums::CSYNC_INSTRUCTION_NEW 2021-06-07 14:13:09:469 [ debug nextcloud.sync.database.sql ] [ OCC::SqlQuery::bindValue ]: SQL bind 1 5918834552439107580 2021-06-07 14:13:09:470 [ debug nextcloud.sync.database.sql ] [ OCC::SqlQuery::exec ]: SQL exec "SELECT path, inode, modtime, type, md5, fileid, remotePerm, filesize, ignoredChildrenRemote, contentchecksumtype.name || ':' || contentChecksum, e2eMangledName, isE2eEncrypted FROM metadata LEFT JOIN checksumtype as contentchecksumtype ON metadata.contentChecksumTypeId == contentchecksumtype.id WHERE phash=?1" 2021-06-07 14:13:09:470 [ warning nextcloud.gui.activity ]: Item "Elton John/One Night Only- The Greatest Hits [Live]/AlbumArt{B5020207-474E-4720-9913-9C2E56BE0B00}Large.jpg" retrieved resulted in "" 2021-06-07 14:13:09:470 [ warning nextcloud.gui.activity ]: Item "Elton John/One Night Only- The Greatest Hits [Live]/AlbumArt{B5020207-474E-4720-9913-9C2E56BE0B00}_Large.jpg" retrieved successfully. 2021-06-07 14:13:09:470 [ info nextcloud.gui.activity ]: Successfully added to the activity list: "" 2021-06-07 14:13:09:471 [ debug nextcloud.gui.folderwatcher ] [ OCC::WatcherThread::watchChanges ]: Skipping syncing of "C:/Users/jay_m/Music/Elton John/One Night Only- The Greatest Hits [Live]"

Nextcloud folder log

#=#=#=# Syncrun started 2021-06-07T13:12:59Z #=#=#=#=# Propagation starts 2021-06-07T13:13:05Z (last step: 6060 msec, total: 6060 msec) 13:13:05||Elton John/Greatest Hits 1970-2003 [Disc 2]/Folder.jpg|8|2|1622677925|906d73873b1d61672df4a215cb4c2b43|72762|00006438ocur7m1ooggd|4||200|0|0|1f56d3d2-3e20-4039-93d2-5cf06435ebd7| 13:13:06||Elton John/Greatest Hits 1970-2003 [Disc 2]/02 Levon.mp3|8|2|1622677884|484d9cabf09d4e0b8727a8de23ea706b|7777469|00976651ocur7m1ooggd|4||206|0|0|76bb7d97-81c9-43f1-a0c0-169288545cd2| 13:13:06||Elton John/One Night Only- The Greatest Hits [Live]/AlbumArtSmall.jpg|8|2|1622677965|ee84be59f32a8fdfb6356c83f3625f64|162014|00006422ocur7m1ooggd|4||200|0|0|9e61840a-0d56-4225-b246-409098f6881d| 13:13:06||Elton John/One Night Only- The Greatest Hits [Live]/17 I Guess That's Why They Call It The Blues.mp3|8|2|1622677954|93a1d64aca82a8d86748ce1456c39b5c|12388964|00006429ocur7m1ooggd|4||200|0|0|d5f110a6-f3d3-4aab-bff1-2dd3435d84a6| 13:13:06||Elton John/One Night Only- The Greatest Hits [Live]/14 Saturday Night's Alright (For Fighting).mp3|8|2|1622677936|61287127860985ee0ffae2e960ad3b4c|11162135|00976652ocur7m1ooggd|4||200|0|0|d7958547-859e-4d50-a69a-b2dd4d08a0d5| 13:13:09||Elton John/One Night Only- The Greatest Hits [Live]/AlbumArt_{B5020207-474E-4720-9913-9C2E56BE0B00}Small.jpg|8|2|1622677983|37868dcd101f012d8026389f4cb4a622|162014|00006426ocur7m1ooggd|4||200|0|0|3216f9ea-7b47-4297-9b81-3259e93c1f1f| 13:13:09||Elton John/One Night Only- The Greatest Hits [Live]/Folder.jpg|8|2|1622677993|e0220bda8b104ce915705867e98806b9|162014|00006427ocur7m1ooggd|4||200|0|0|38c14221-82f5-41fe-8dbd-2be9bc64b06b| 13:13:08||Elton John/One Night Only- The Greatest Hits [Live]/AlbumArt{B5020207-474E-4720-9913-9C2E56BE0B00}_Large.jpg|8|2|1622677974|0d824be0aaa36537417cd0fc4214d0ef|162014|00006423ocur7m1ooggd|4||200|0|0|5443b146-3713-4a75-9bfd-f7a983b8cd75|

My initial thought had been if the file had been i use or corrupt could have caused the issue. but ruled out corruption very quickly with another instance of the server and multiple folders and sizes of folders and files. i had noticed "folderwatcher" so had disabled AV but issue is still persistent. Even cleared the folder re setup the sync and added the files in one by one both from server and locally but issue was still persistent.

I have noticed that the DB can fail to write quite a lot although the app can crash before a DB write error occurs. @burakkaraceylan Do you get the "error writing metadata to database" error in the settings panel?

2021-06-07 14:25:44:619 [ debug nextcloud.sync.networkjob ] [ OCC::AbstractNetworkJob::slotFinished ]: Network job OCC::LsColJob finished for "/Music/Paramore/Brand New Eyes" 2021-06-07 14:25:44:619 [ debug nextcloud.sync.database.sql ] [ OCC::SqlQuery::bindValue ]: SQL bind 1 "Paramore/Brand New Eyes" 2021-06-07 14:25:44:619 [ debug nextcloud.sync.database.sql ] [ OCC::SqlQuery::exec ]: SQL exec "SELECT lastTryEtag, lastTryModtime, retrycount, errorstring, lastTryTime, ignoreDuration, renameTarget, errorCategory, requestId FROM blacklist WHERE path=?1 COLLATE NOCASE" 2021-06-07 14:25:44:620 [ debug nextcloud.sync.database.sql ] [ OCC::SqlQuery::bindValue ]: SQL bind 1 "Paramore" 2021-06-07 14:25:44:620 [ debug nextcloud.sync.database.sql ] [ OCC::SqlQuery::exec ]: SQL exec "SELECT lastTryEtag, lastTryModtime, retrycount, errorstring, lastTryTime, ignoreDuration, renameTarget, errorCategory, requestId FROM blacklist WHERE path=?1 COLLATE NOCASE" 2021-06-07 14:25:44:621 [ info nextcloud.sync.engine ]: #### Discovery end #################################################### 6221 ms 2021-06-07 14:25:44:621 [ info nextcloud.gui.activity ]: Activity/Notification/Error successfully dismissed: "Error writing metadata to the database" 2021-06-07 14:25:44:621 [ info nextcloud.gui.activity ]: Trying to remove Activity/Notification/Error from view... 2021-06-07 14:25:44:621 [ info nextcloud.gui.activity ]: Activity/Notification/Error successfully removed from the list. 2021-06-07 14:25:44:621 [ info nextcloud.gui.activity ]: Updating Activity/Notification/Error view. 2021-06-07 14:25:44:622 [ debug nextcloud.sync.database.sql ] [ OCC::SqlQuery::exec ]: SQL exec "SELECT fingerprint FROM datafingerprint" 2021-06-07 14:25:44:622 [ info nextcloud.sync.engine ]: #### Reconcile (aboutToPropagate) #################################################### 6222 ms

Any ideas on what to try next? happy to try and help

j4ym0 avatar Jun 07 '21 13:06 j4ym0

I've run into this as well. Digging in a bit, it's crashing here: https://github.com/nextcloud/desktop/blob/6e41875fe1eb486813fb715c83aeaf59f5367d5d/src/libsync/vfs/cfapi/cfapiwrapper.cpp#L630

Here's a bit more debug info: image image

I tried building nextcloudsync.dll with optimizations disabled /Od to get more info but it's not crashing and instead giving sync errors: ||file/path.xxx|8|2|1590070825|60cb51720c7c5|21504386|00034415oc2h86xyea2m|1|Error writing metadata to the database|0|0|0||

mmdanggg2 avatar Jun 17 '21 13:06 mmdanggg2

Same issue on 3.2.3 for me:

Windows Event vewer log

Faulting application name: nextcloud.exe, version: 3.2.3.25536, time stamp: 0x60d461a4
Faulting module name: CLDAPI.dll, version: 10.0.22000.1, time stamp: 0x8f746c0f
Exception code: 0xc0000005
Fault offset: 0x00000000000157b7
Faulting process id: 0x5734
Faulting application start time: 0x01d76dc019beb92a
Faulting application path: C:\Program Files\Nextcloud\nextcloud.exe
Faulting module path: C:\WINDOWS\SYSTEM32\CLDAPI.dll
Report Id: 02ec1b70-bbca-4504-8c42-8c0e23523562
Faulting package full name: 
Faulting package-relative application ID: 

We all seem to be on Insider Preview Builds seems like the app doesn't like newer versions of CLDAPI.dll

jctace avatar Jun 30 '21 15:06 jctace

We all seem to be on Insider Preview Builds seems like the app doesn't like newer versions of CLDAPI.dll

I was running into this issue when I was on Windows 10 as well. My account was part of the Windows Insider program, but my machine was not subscribed to any flights at the time. Problem persists into Windows 11.

urbenlegend avatar Jun 30 '21 19:06 urbenlegend

Still an issue for me with 3.2.4

jctace avatar Jul 07 '21 21:07 jctace

Also an issue on my Win 10

Faulting application name: nextcloud.exe, version: 3.2.3.25536, time stamp: 0x60d461a4
Faulting module name: CLDAPI.dll, version: 10.0.19041.1081, time stamp: 0xadcd83c9
Exception code: 0xc0000005
Fault offset: 0x00000000000159ba
Faulting process id: 0x250c
Faulting application start time: 0x01d7747922a035ab
Faulting application path: C:\Program Files\Nextcloud\nextcloud.exe
Faulting module path: C:\WINDOWS\SYSTEM32\CLDAPI.dll
Report Id: 5572d573-e799-47e5-b750-3e2bfccbfa57
Faulting package full name: 
Faulting package-relative application ID: 

I tried looking at the nextcloud desktop client log file, after reaching some 500MB of logs checking files upon startup, the client crashes and there is nothing in the log that looks to be helpful, it just stops.

Doesn't look like there are relevant messages on the server either.

This is a reliable crash on the most recent desktop client.

jbruck avatar Jul 09 '21 06:07 jbruck

same here: Windows 10 21H1 (build 19043.1147) Nexcloud desktop client version: 3.2.4-x64

Name der fehlerhaften Anwendung: nextcloud.exe, Version: 3.2.4.25618, Zeitstempel: 0x60e484a1 Name des fehlerhaften Moduls: CLDAPI.dll, Version: 10.0.19041.1081, Zeitstempel: 0xadcd83c9 Ausnahmecode: 0xc0000005 Fehleroffset: 0x00000000000159ba ID des fehlerhaften Prozesses: 0x4c60 Startzeit der fehlerhaften Anwendung: 0x01d7816b76d981be Pfad der fehlerhaften Anwendung: C:\Program Files\Nextcloud\nextcloud.exe Pfad des fehlerhaften Moduls: C:\WINDOWS\SYSTEM32\CLDAPI.dll

4iter4life avatar Jul 25 '21 15:07 4iter4life

(Same)

pwnorbitals avatar Jul 27 '21 08:07 pwnorbitals

Just installed the client on W11 and yeah, crashes for me after creating some virtual files...

dawid-woitaschek avatar Jul 28 '21 05:07 dawid-woitaschek

I had the same behavior of the app on stable w10. But maybe it had another reason? Can someone still confirm this bug on a regular w10 build? Im Running the dev w11 as well.

LucaOverflow avatar Jul 28 '21 07:07 LucaOverflow

@LucaOverflow yes its on regular Windows 10 2H1 (build 19043.1147)

4iter4life avatar Jul 30 '21 15:07 4iter4life

You may want to try this build with a potential fix to CLDAPI from @mmdanggg2 ~~https://cloud.nextcloud.com/s/9CiRxYQaFnXcwqK?~~

Updated Link: https://cloud.nextcloud.com/s/JGj2FXW5mTGqmPj

allexzander avatar Aug 03 '21 13:08 allexzander

The Client isn't crashing anymore. But at least for the last 30 minutes it isn't syncing as well. It searches for changes and after that i get the following error code: image after a while it starts scanning for changes again.

I will let it run for now.. maybe it will sync after a while. I tried deleting the sync.db with no luck. Anything I can debug to help?

Edit: I tried it on a smaller folder so it doesn't need to scan for 15 minutes all the time. Eventually all virtual files are synced and the client downloads them on demand. But in the process i get a lot of those error messages above and after every message it starts scanning again. Right now i can just let it do it's thing in the background. I will take a deeper look into this issue when i have more time. I already found some issues related to this message.

LucaOverflow avatar Aug 03 '21 14:08 LucaOverflow

fixed for me. Thx for sharing. Yes its resync after start (but was expected behavior for me).

Runs for half hour stable. Can u provide a MergeRequest for this Build?

4iter4life avatar Aug 03 '21 14:08 4iter4life

@LucaOverflow I am wondering if there is a pattern for those files. Do they have something in common? Those with Couldn't update placeholder info I will check it again tomorrow to see if I am getting the same error and if the issue is present in a normal build or is it something new with this build that's fixing a cras.

allexzander avatar Aug 03 '21 15:08 allexzander

@4iter4life This is the original PR by @mmdanggg2 https://github.com/nextcloud/desktop/pull/3461 Currently it is under review and I hope we can merge it sooner as I can see it does fix an issue for you and for @LucaOverflow. I will just need to dig deeper into an issue that @LucaOverflow is having.

allexzander avatar Aug 03 '21 15:08 allexzander

You may want to try this build with a potential fix to CLDAPI from @mmdanggg2 https://cloud.nextcloud.com/s/9CiRxYQaFnXcwqK?

This fix seems to fix the issue on 21H2 (22000.100) tested with a 10,000 file folder with multi updates on both sides. thank @mmdanggg2

seems a bit noisy on the notifications from conflicts that will be cleared

j4ym0 avatar Aug 04 '21 09:08 j4ym0

@LucaOverflow I am wondering if there is a pattern for those files. Do they have something in common? Those with Couldn't update placeholder info I will check it again tomorrow to see if I am getting the same error and if the issue is present in a normal build or is it something new with this build that's fixing a cras.

It's weired. I created a new emty folder to test this. I created some files one by one while nextcloud was running. Im pretty sure creating files on the local machine is not causing this error. Folders do however. When i create a new folder on the local machine nextcloud syncs even before i give it a name. If i name it before this first sync everything is fine. But when i take my time and name it after that it will lead to that error. This shouldn't be like this however in the real world it doesnt really effect the functionality since the new folder you create is emtpty so the client just scans it again and syncs it at the second attempt. Thats the weired thing for me... After a while every file and folder gets synced. The client just needs to scan after every error. When I copy a big folder with thousands of files in the local directory the clients syncs it with no error.

The actual error source for me is something else though. When the client needs to sync (big) server side chanages it creates an error for each file synced but syncs it anyways. Big is in braces since it just means more than one file at a time. For example I had a folder with two files in it. If I would copy it in the web interface or just rename it the client will freak out. When I create new folders and files one by one in the web interface everything works fine.

So i guess after a sucsessful first sync it should work, just with a lot of error messages.

I will read some of the other issues related to meta data and placeholder info errors. Maybe this will shine some light in the dark.

Thank you everyone for working on this 👍

Edit: I couldn't really find something useful reagrding the error message.

LucaOverflow avatar Aug 04 '21 09:08 LucaOverflow

I tried with the fix linked above and am no longer crashing during sync, however I am facing the same issue now as @LucaOverflow; I can get through syncing the first couple folders on my server easily, but then there is a larger folder which consistently gives me Couldn't update placeholder info. I have been unsuccessful trying to push past those errors; there are over 200 files in that folder, and it seems random which files trigger the error each time I sync.

bmundt6 avatar Aug 04 '21 23:08 bmundt6

@bmundt6 Thx. I am now wondering if the Couldn't update placeholder info is in the original release or is in the test build only. But, I guess you can't test that as the original build would crash for you. We will have to spend more time investigating that.

allexzander avatar Aug 05 '21 07:08 allexzander

I was getting the 'Couldn't update placeholder info' in the original release. Although it was less frequent as the app would crash before getting to that point. I found it was when you were adding the sync to a folder that was not empty. Also would give a profindxml error in the settings gui

j4ym0 avatar Aug 05 '21 11:08 j4ym0

I was getting the 'Couldn't update placeholder info' in the original release. Although it was less frequent as the app would crash before getting to that point. I found it was when you were adding the sync to a folder that was not empty. Also would give a profindxml error in the settings gui

Do you mean to a not empty local or server folder? I only experience errors with non empty folder from the server side regardless of the local sync folder. The other way around works fine for me.

LucaOverflow avatar Aug 05 '21 12:08 LucaOverflow

When I build bugfix/mmdanggg2-fix-cldapi-crash in x64-Debug configuration locally in VisualStudio, that is able to sync for me without crashing and without Couldn't update placeholder info; not sure what is different about the build from @allexzander, besides maybe being a release config.

bmundt6 avatar Aug 06 '21 00:08 bmundt6

I was getting the 'Couldn't update placeholder info' in the original release. Although it was less frequent as the app would crash before getting to that point. I found it was when you were adding the sync to a folder that was not empty. Also would give a profindxml error in the settings gui

Do you mean to a not empty local or server folder? I only experience errors with non empty folder from the server side regardless of the local sync folder. The other way around works fine for me.

i have just been re testing and it seems that for me it is happening on both ways. empty and filled on server with empty locally.

j4ym0 avatar Aug 06 '21 14:08 j4ym0

The Client isn't crashing anymore. But at least for the last 30 minutes it isn't syncing as well. It searches for changes and after that i get the following error code: image after a while it starts scanning for changes again.

I will let it run for now.. maybe it will sync after a while. I tried deleting the sync.db with no luck. Anything I can debug to help?

Edit: I tried it on a smaller folder so it doesn't need to scan for 15 minutes all the time. Eventually all virtual files are synced and the client downloads them on demand. But in the process i get a lot of those error messages above and after every message it starts scanning again. Right now i can just let it do it's thing in the background. I will take a deeper look into this issue when i have more time. I already found some issues related to this message.

could you manage to find the exact version of this dll from Windows ? I am still wondering why only some people are affected and what we can do to find a way to also reproduce the issue on our side

mgallien avatar Aug 09 '21 13:08 mgallien

Yes sure. I'm running the current Windows 11 Beta but had the same issue with a stable Windows 10 build before the switch. The current Windows build is: 21H2 22000.120 The current cldapi.dll version is: 10.0.22000.1

Edit: I attached the dll's from my system to the post in case this helps cldapis.zip

LucaOverflow avatar Aug 09 '21 13:08 LucaOverflow

Updated installer works for me, doesn't crash on sync now. Win 11 21H2 22000.120

cldapi.dll version 10.0.22000.1 (file version 6.2.22000.1)

le-taff avatar Aug 12 '21 11:08 le-taff

Keeps happening to me.

Faulting application name: nextcloud.exe, version: 3.3.1.25724, time stamp: 0x611562cc
Faulting module name: CLDAPI.dll, version: 10.0.19041.1081, time stamp: 0xadcd83c9
Exception code: 0xc0000005
Fault offset: 0x00000000000159ba

Windows 10, 21H1 (19043.1165).

charabaruk avatar Aug 22 '21 06:08 charabaruk

Updated installer works for me, doesn't crash on sync now. Win 11 21H2 22000.120

cldapi.dll version 10.0.22000.1 (file version 6.2.22000.1)

if I understand correctly you had the crash and by upgrading the desktop client and not your windows, you ended up no longer having it ?

mgallien avatar Aug 25 '21 09:08 mgallien

if I understand correctly you had the crash and by upgrading the desktop client and not your windows, you ended up no longer having it ?

Correct. I was running Win10 21H1 (client didn't work), upgraded to Win11 21H2 (client didn't work). Put on the new client from this thread and all is fine (apart from the hundreds of messages saying 'Couldn't update placeholder info').

le-taff avatar Aug 26 '21 10:08 le-taff