No worries! Thanks for the help. I did not even install the NextCloud sync on my windows machine because that NextCloud instance is solely for Joplin. What did happen is I was forced to move away from ServiceMetric as a NextCloud provider. I guess the $5/year was too good to be true and they shut down. This forced me to set up a small Ubuntu 20.04 droplet on Digital Ocean. I installed Snap version of NextCloud, configured it, and installed the Jopin Web App on it to support sync.
I then went to my Windows machine and did the following:
1.) Made a JEX backup
2.) Deleted everything in Joplin. NOTE: I did not delete my JoplinProfile folder, which I probably should have.
3.) Changed the Sync endpoint.
4.) Did a restore of the JEX file.
5.) Synchronized all files to NextCloud.
6.) On my phone, I deleted everything, udpated the endpoint, and resynced.
Everything seemed to work great. All content was pushed up to the server and came back down to the phone. No problem. That was Sunday.
What I noticed today was that any edits all stopped syncing with the errors I posted. New file creations sync fine. Any subsequent edits break. ALso, any attempt to edit an existing note also renders it broken.
I tried your suggesting of truncating one character from my test .md file. After examining it in vi, but not saving, the last character was a 1. type-:1
After truncating, the one was gone. I then attempted my local sync and I get the same error, but now the log no longer shows the 1. Seems like the EOL may not be the issue…
I also tried restoring the Joplin version from 1.0.220 as 1.0.224 dropped today. That displayed the same issue.
What I am going to do now is start from scratch.
1.) Delete my Joplin Profile
2.) Delete everything in NextCloud
3.) Restore my JEX backup on Windows
4.) Sync to NextCloud
Same exact problem. Here is the sequence that led to the error.
1.) Fresh import from JEX after deleting Joplin Profile and everything on the NextCloud server.
2.) Sync with NextCloud. All seemed to work normally.
3.) Edit a single note via the Windows Joplin UI (1.0.224)
4.) Sync to the server (appeared successful).
5.) Hit synchronize again and receive same type_: missing error.
Ugh. Not sure what my next steps should be. The only thing materially different from the past two years is I am hosting my own instance of NextCloud.
The following steps seem to lead up to the corruption:
1.) Take an existing note that has not been edited since I noticed this behavior.
2.) Edit it. This seems to sync with the server normally and I get a log message indicating one file synced.
3.) Attempt to Edit again. Synchronization produces the type missing error.
The other thing I noted is that I can take a corrupt file and delete. This seems to be synced to the server properly and i do not receive any more failures until I attempt to edit using the steps I mentioned above.
Hi Laurent - I definitely looked at it and it seemed correct. There was a type_id there and it was of type “1”. @tessus asked that I run a truncate of one char on it from the command line, which I did, and what remained was type_: , which indicates the “1” was the last char and there was no extraneous EOL.
Thanks for checking. So it seems the file is indeed correct on server, but then it’s on download that it somehow gets truncated? That’s very strange. Could you post the log before and after this bug happens? https://joplinapp.org/debugging
Hmm, ok that’s quite incredible it seems one byte is missing from the file then. Are you able to inspect the requests being made with Wireshark or similar?
If you go to Nextcloud and download the file there directly, is the file complete?
First - my replies are being severely throttled by Discourse because it views me as a noob!
I was able to grab a Wireshark capture, but then realized that all interactions with NetCloud are via TLS, which seems to make a capture less than useful.
What is interesting is upon inspection of the file in both places (NextCloud and the local RAW JEX backup), there does not appear to be any corruption. The type field is there in both locations. It is almost as if there is a potential off-by-one error when processing/diffing the file post-edit.
One other thing I did in order to reduce the overall complexity is to remove the beta version of the Joplin Web App for NextCloud.
Finally, per your last comment, let me set up a NextCloud user for you so you can create a folder and set up sync. Maybe it is something with the NextCloud instance I installed. Is there a way I can privately get you the credentials?