laurent22 / joplin

Joplin - the privacy-focused note taking app with sync capabilities for Windows, macOS, Linux, Android and iOS.
https://joplinapp.org
Other
46.35k stars 5.04k forks source link

Error synching via NextCloud on Android #209

Closed okoetter closed 6 years ago

okoetter commented 6 years ago

Operating system

Application

I imported a Evernote .enex file on the Windows app using the NextCloud provider. This worked perfectly fine. I then wanted to sync this to the fresh installed Android app 0.10.86. No single note was synced, I got this error:

Logfile

No encryption is involved.

laurent22 commented 6 years ago

Which version of the Windows app are you using? There's a bug in older versions which could result in a file being left half uploaded on Nextcloud (which is what happened in your case), but it's normally fixed in recent versions. Also which Nextcloud provider are you using? Is it self-hosted or an existing provider?

okoetter commented 6 years ago

Current Windows app 0.10.61. Fresh updated and resynced, I think the initial import and sync of the enex file was a slightly older but not very old. Self hosted Nextcloud 12.0.4.3

Can I simply delete the half uploaded md on the server and then resync?

laurent22 commented 6 years ago

Ok hopefully it was a bug in the older version and not in the new one, but if happens again please post here. I'm also using Nextcloud sync and haven't seen this bug since I've implemented the fix.

Yes if you delete the file 55104b4322bc404c85010079e4821b20.md it will resume the sync. Note that this item will then be deleted from your desktop so keep a copy of it somewhere and manually recreate it.

okoetter commented 6 years ago

OK, I deleted the one md, resynced and the second one was also damaged. I guess I suffer from the old bug, so I will delete all 500 notes and start from scratch :-)

okoetter commented 6 years ago

Sorry, but I cannot make it work.

Log: https://pastebin.com/raw/LJThYJf3

laurent22 commented 6 years ago

Did you also delete the data in Nextcloud? As this is where the corrupted data is.

okoetter commented 6 years ago

Sorry, forgot to mention. Yes, the folder was completely empty.

laurent22 commented 6 years ago

Oh that's right, the item is corrupted at the exact same spot so I thought it was still the same data, but it's indeed a different ID. If you check on Nextcloud, how does the file e1396f3f07b34843910cc6b51f0685b9.md look? Does it end with just "type"? Just to know if it's the data that is corrupted or the app not being able to read it for some reason.

okoetter commented 6 years ago

yes, it ends with "type". But that's not the only note, I found some ending with "type", some with "type:", "type_: 1", even "encrypti" Seem like truncated.

laurent22 commented 6 years ago

Ok it seems there's something not right with the Nextcloud installation as it shouldn't be storing half uploaded files. I wonder if it might be linked to the PHP config? What are the values of upload_max_filesize and post_max_size?

Actually if you upload a text file to Nextcloud via the UI, does it end up corrupted too?

okoetter commented 6 years ago

PHP 7.1.14 upload_max_filesize: 2M post_max_size: 8M

I could increase the values, but the corrupted text files are rather small (1KB).

I uploaded one 3.7MB file via Nextcloud GUI, that worked fine and the file was complete.

okoetter commented 6 years ago

OK, I created a small test.enex with only 8 notes and some images I could share with you. This triggers the error. I could also create a Nextcloud account for you if you want to test.

laurent22 commented 6 years ago

Yes if you could share this that would be great, either here or you can send to my email . The Nextcloud team might be interested in the results of these tests as I suspect it's at least partially a Nextcloud bug.

laurent22 commented 6 years ago

I've indeed managed to replicate and fix this issue using the test file you provided, so please download the latest version. Thanks for the help debugging this!

okoetter commented 6 years ago

I can confirm that it works now for me. Thanks for fixing this!