Item cannot be null error

Can you post the content of ef6f9cb65c9840e3adc6e9dc0f5852ce.md here? It should be somewhere on your sync target.

had to redact a bunch of stuff, hoping I didn’t eliminate any text/formatting that might have been the source of the error(s)

DAILY TO DO

rayfield XXXX


work on XXXX
find XXXX bio

install resilio sync on doze side 

Retia
filing
garbage
XXX

note to XXXXX


before operation:
copy Weininger to thing Kindle?
copy audiobooks!!! to player

rig Joplin on other laptops

 get newspapers?

2019-11-06 09:32
XXXXXX?

work on RP
play with tethering, only to check shit out

Greg & XXXX

XXX

XXX

XXXX

XXXX people 
XXX
XXXX tutorial adding fade ins dissolves, titles
edit video 
write XXXX

artwork for Faile
do that XXX access thing that stupid $35 thing eh
XXXXe

PO
DD
MARISA
MARTHA H

Gail 
https://voxpopulisphere.com/2015/09/27/audio-flannery-oconnor-reads-a-good-man-is-hard-to-find-rare-recording0/?fbclid=IwAR239YbwO-zLOuKkH5cFoKg1j487Gc-x9AOs_4awMv9mavjxxXEEPrZPAYA
Brett's 
https://www.youtube.com/watch?v=6PhedkQsvX8&fbclid=IwAR2eaQND0zjtzD69Y1Ymxo2ejce3wEgmTKAhNU_3I0e_bd81bI_wDElrHlI Quit
 https://vimeo.com/292665390



look at script
YS
weeder please 
take up kraut
	find out how long you can leave it down there as well

XXX

change the conflicted copies dealie with Dropbox, or maybe just stop using it

call XXX

get popel bars

http://www.retiamedical.com/how-it-works/

HOUSE
	cXXXX

check Met HD for dates

find old set lists please 

XXX

fix vim thingie

XXX

write Teddy B

vote SAG

XXXX.com


XXX

buy lXXX

today - submit to more festivals
SELL XXXXXXX

Regina
Regina?

CONSTANTS
	 XXXX

note to 
XXXX

write Al B

archive MGA stuff onto website

XXXXXX

XXXXXtickets
XXXXXX

id: ef6f9cb65c9840e3adc6e9dc0f5852ce
parent_id: f682e6a79362407fae56f34d73e44a2f
created_time: 2019-11-05T16:23:13.286Z
updated_time: 2019-11-25T16:37:39.956Z
is_conflict: 0
latitude: 0.00000000
longitude: 0.00000000
altitude: 0.0000
author: 
source_url: 
is_todo: 0
todo_due: 0
todo_completed: 0
source: joplin-desktop
source_application: net.cozic.joplin-desktop
application_data: 
order: 0
user_created_time: 2019-11-05T16:23:13.286Z
user_updated_time: 2019-11-25T16:37:39.956Z
encryption_cipher_text: 
encryption_applied: 0
markup_language: 1
type_: 1: 1
type_: 1

At the end it says:

type_: 1: 1
type_: 1

but that’s not valid. It should be just type_: 1. Did you manually edit the file? Or is it Syncthing that can corrupt files like this?

I don’t believe I did, at least until the error appeared: I think I removed a line near the very top because I thought it might have been the source of the Joplin error, but it’s highly unlikely I would have added that line.

  1. The Android version of ResilioSync – that’s what Syncthing is called now – seems to me not as reliable as the Linux or Windows versions: for instance, I believe I have to go into the app to get it to perform a sync. While I have only been using it for several weeks – likewise, I am also very new to Joplin – I haven’t experienced any issues, apart from this

Don’t know if it’s pertinent, but I have seen conflicts arise thanks to my multiple backup strategies: DropBox as well as pCloud, though usually these create copies with filenames containing [conflicted]. Possibly a problem created by edited the same file in different sessions?

Can I just remove the line containing “type_: 1: 1” and proceed?

Yes but make sure there's no newline after it.

The way your file looks now is as if something had overwritten the file, but left the previous content at the end. Not sure if it's syncthing but I'd be careful and try to find the cause, if you don't want to lose your data.

1 Like

Deleting that line seemed to fix things for a while, but I'm having numerous other problems trying to get the Android version running with Resilio Sync -- I suspect it's essentially this issue

The Linux versions sync well with Resilio Sync -- for those of us trying to get away from commercial services, Resilio (which used to be called Syncthing) is a great solution, it uses BitTorrent to sync directories.

This morning I tried to see if I could get Joplin/Android working with Dropbox, but failed, unfortunately. If there is a recommended way to get this working, I'd be happy to try it.

Fyi syncthing is a separate service and not related to resilio, resilio was previously called bittorent sync and before that it was just called SyncApp

I’ve been having the same issue. I’m using syncthing between joplin on android and linux. The problem is on the android side. I think syncthing and joplin are trying to write to the same file at once. I’m doing some further testing.

I am also having the same issue. I am using Syncthing and Joplin on Android. I really like Joplin so far, but this bug makes it hard to be completely confident that my data will stay intact.

Edit: I have searched Syncthing’s issues and forum and no one seems to have mentioned this over there. I would try create a post, but not sure I can gather enough info to make a meaningful bug report.

Edit2: After thinking about what @laurent said about leaving previous content at the end, I tried making a simple note in Joplin and then deleting a line to make the note shorter. This immediately triggered the problem.

Test syncthing and joplin

This is a note to test what is corrupting my notes.

1




id: e393a5186da742899147eb516d0c3ddd
parent_id: 132f72eb544549378dc8f7222e47fef8
created_time: 2019-12-05T13:46:36.923Z
updated_time: 2019-12-05T13:47:30.865Z
is_conflict: 0
latitude: 0.00000000
longitude: 0.00000000
altitude: 0.0000
author: 
source_url: 
is_todo: 0
todo_due: 0
todo_completed: 0
source: joplin
source_application: net.cozic.joplin-mobile
application_data: 
order: 0
user_created_time: 2019-12-05T13:46:36.923Z
user_updated_time: 2019-12-05T13:47:30.865Z
encryption_cipher_text: 
encryption_applied: 0
markup_language: 1
type_: 1: 1

Joplin writes the complete content to the file then closes it. If Syncthings keeps open handles on file and doesn’t watch them for changes this could happen.

It would probably be worth reporting this on Syncthing forum as it’s unlikely we can do something on our side.

1 Like

@laurent, Thanks for your replies. I have started a thread in the syncthing forum and one of the syncthing maintainers has responded. I will try do my part to go between as needed, but I am not certain I can answer the questions accurately.

What does “Synchronize” in Joplin do, precisely?

One important point is that Joplin has been used with many sync clients, such as Dropbox, OneDrive, Nextcloud and many others for several years, and this particular issue only happens with Syncthing. I’m mentioning this because it would be easy to assume Joplin writes to the files in a strange way, but it’s not like this, or it would happen with all the other backends too.

Syncthing triggers when android announces that a file has been changed. Then it syncs it with the other devices. Does anyone know how android handles file updates? Does it announce when a edited file is closed or when data is written to a file? Because the issue only happens on an android device.

@laurent, do you mind if I copy and paste some of your response over to the syncthing forum?

(from calmh, a syncthing maintainer)

When Syncthing writes to a file it first writes it out to a temporary file, all the while verifying the checksum of the data. It then moves that temp file in place over the old file. It doesn’t write in place, but what looks like it has happened here is that something has written a slightly smaller note on top of a larger one, leaving the old extra data in place at the end. I don’t know what would cause that but I have a hard time imagining Syncthing doing it.

Yes sure

This seems to not actually be related to syncthing.

I tested this on my old phone (a Pixel XL running Android 10). I uninstalled syncthing completely and changed the Joplin local sync folder to a new folder in the phone storage.

I can still cause the problem by doing the following:

  1. Create a new note with several lines.
  2. Hit Synchronize in Joplin. Returns just fine.
  3. Delete a line from the note.
  4. Hit Synchronize again.

For me, this will bring up the “Item cannot be null error”. @lerker100, is there any chance you can try something like this?

I had the same thing happen. When following your steps. I also have a pixel running Android 10

I just tested it on Linux and it works just fine. So it’s only on the app.