Sync error: "Missing required property: type_:"

I have to buy groceries, but will be back in about 1h. Until then, you could try the following on one .md file that doesn’t sync (on the sync target):

truncate -s -1 filename.md

If it syncs, your files on the sync target have a problem. For what reason ever and we have to figure out why that is.

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

Hope for the best!

This is really odd. Your steps to move the notes are fine and valid.

Since my truncate command removed the 1 your file had no EOL at EOF, so your test file should have synced normally.

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.

A few more bits of detail after some testing.

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.

gamejunkie, at this step:

2.) Edit it. This seems to sync with the server normally and I get a log message indicating one file synced.

Could you get the file on the sync target and see if it is valid or not (you can upload it somewhere and we can check too).

That will help determine if the file is corrupted when it’s uploaded or later, when it’s downloaded.

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.

Here is some more info. I checked my test file on the server and here is what I could see in VI.

I then did a RAW EXPORT from my windows client and checked the same .md file. Here is what appears locally.

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

Finally, here is what appears in the logs.

Here is a sanitized version of the log. I removed the actual note text and left the log messages.

log_error_example.txt (2.5 KB)

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?

Actually, just after you get this corrupted file in Joplin, if you check again on Nextcloud is the final byte missing there too?

I am not able to reproduce the error following these steps.

Perhaps it’s something wrong with the server. @gamejunkie, would you be able to provide test credentials so that I can give it a try?

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?

Yes if you could send me a PM that would work (just click on my name)

I also downloaded the file directly from the NextCloud web UI and it appears to be complete (no missing type).

Interesting, the problematic file looked fine in Vi for me. I accidentally open in another editor and notice an extra line.
Have you tried to expose both Carriage Return (CR) and Line Feed (LF) and https://stackoverflow.com/questions/3860519/see-line-breaks-and-carriage-returns-in-editor