Unexpected character: H

Operating system

Android

Joplin version

3.3.3

Desktop version info

Joplin 3.2.12 (prod, win32)

Client ID: 16f7dc7efe7345ce975aad0929a3dc9a
Sync Version: 3
Profile Version: 47
Keychain Supported: Yes

Revision: d6f1ca4

Backup: 1.4.2
Conflict Resolution: 1.2.3
Freehand Drawing: 2.14.0

Sync target

Nextcloud

What issue do you have?

I am getting roughly the same sync errors on both Desktop and Android. They are:
On Windows Desktop - Syntax error: Unexpected token 'H', HBegin:oc_"...is not valid JSON
On Android - SyntaxError: JSON Parse error: Unexpected character H

When I go to Configuration and Check Synchronization Configuration they test fine on both.

I should note - I have tired to update to 3.2.12 on desktop but it is not working.

Any ideas?

35 views and no replies. Darn. was hoping somebody would be able to help me get synchronizing again.
Let me add -
I am getting the same error on Joplin on Linux Mint too.
Synchronizing had been working fine for months. Just stopped recently

Are you sure it's about sync ?
"The JSON parse error" is something that you should look at on Google (or other web search engine).

The error message does not provide enough information to determine the issue unfortunately. Can you provide a snippet from the log file after you have produced the error, which includes the full error stack relating to the error?

Cool - thanks.
Here is the end of the log file - Hopefully what you need:

2025-03-31 17:46:14: Synchronizer: [warn] There was some errors:
2025-03-31 17:46:14: Synchronizer: [warn] SyntaxError: Unexpected token 'H', "HBEGIN:oc_"... is not valid JSON
SyntaxError: Unexpected token 'H', "HBEGIN:oc_"... is not valid JSON
at JSON.parse ()
at fetchSyncInfo (C:\Users\Owner\AppData\Local\Programs\Joplin\resources\app.asar\node_modules@joplin\lib\services\synchronizer\syncInfoUtils.js:67:23)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async Synchronizer.start (C:\Users\Owner\AppData\Local\Programs\Joplin\resources\app.asar\node_modules@joplin\lib\Synchronizer.js:430:34)
at async timeoutCallback (C:\Users\Owner\AppData\Local\Programs\Joplin\resources\app.asar\node_modules@joplin\lib\registry.js:125:52)
2025-03-31 17:46:14: checkDisabledSyncItemsNotification: No errors: Hiding notification
2025-03-31 17:46:15: DecryptionWorker: cannot start because no master key is currently loaded.
2025-03-31 17:46:22: SearchEngine: Updating FTS table...
2025-03-31 17:46:22: Updating items_normalized from {"updated_time":0,"id":""}
2025-03-31 17:46:22: SearchEngine: Updated FTS table in 7ms. Inserted: 0. Deleted: 0

So it looks like either your Joplin directory on Nextcloud/WebDav has become corrupted, or the path on the sync settings is not set correctly.

The error indicates an issue in the fetchSyncInfo function, and indicates when it tries to read the info.json file at the defined Joplin directory, the file exists but is in an incorrect format (it should be a json file).

It may be possible that the provider may have changed configuration and caused the defined WebDav path to no longer work correctly, so check first that the path still matches correctly. You can also find the info.json file on your Nextcloud account and upload it here for me to have a look.

But if the config is all fine and the info.json does not shed any light, to get things working again you will need to do a full reset. This would involve making backup all your notes (making a full jex backup on your most up to date client, and combining any unsynced notes on other clients if any), resetting all of your clients and the server, and then start syncing your notes afresh starting from the jex backup. Note that all note history will be lost by doing this process, but everything else is retained in a jex backup

1 Like

also with this issue after updating.. can't sync due to the same error but the sync configuration is correct according to the "check synchronisation configuration".

tried installing older versions but 3.0 above shows the same issue.. thank you in advance for your help!

I also get - Success! Synchronisation configuration appears to be correct.Success! Synchronisation configuration appears to be correct. When I run Check synchronization configuration.
I also double checked the Nextcloud WebDAV URL and it has not changed

Are you able to find the info.json on your Nextcloud account and check the contents?

Yes
Attaching it here.
info.json (227 Bytes)
When I open it to look at it I see the same error - "SyntaxError: JSON.parse: unexpected character at line 1 column 1 of the JSON data"
So maybe it got corrupted somehow?
Can it be fixed? replaced? or?

A quick google of oc_encryption_module suggests that the info.json file contains something Nextcloud specific. A couple of links I found:

It sounds to me that E2E or server side encryption has been enabled on your Nextcloud account either by yourself or possibly automatically if you did not do it. Because of this, Joplin is unable to read it's configuration file. If you want to use E2E encryption you should only enable this within Joplin, as Joplin wont work if you enable it in Nextcloud

Thanks for this.
I looked at my Nextcloud Settings and I find that encryption is off. Se attached image.

Can I delete or edit the info.json file?

If you have a look in the md files alongside the info.json in your Nextcloud, do they all start with the same contents as the info.json you provided, or they just contain note contents and metadata something like this?

Welcome!

id: 7825b33611b94eeea3c04a81e0e5d538
created_time: 2025-04-01T20:57:29.813Z
updated_time: 2025-04-01T20:57:29.813Z

Also, are there any non .md file in the same directory, other than info.json and the following folders?: .lock, .resource, .sync, locks, temp

Also have a look in the Security tab of the Nextcloud admin, if there are any encryption options set there

Here is the Security Tab:

Re other md and other files - they do start with the same - "HBEGIN:oc_encryption_module:OC_DEFAULT_MODULE:cipher:AES-256-CTR:signed:true:useLegacyFileKey:false:encoding:binary:HEND"

Also, are there any non .md file in the same directory, other than info.json and the following folders?: .lock, .resource, .sync, locks, temp - No - just folders temp and locks and info.json and 1700 plus .md files

Ok, Nextcloud is definitely doing something to your Joplin files, which is not just isolated to the config file then. If you can't figure out why Nextcloud has either encrypted your files or added encryption headers to them, I think you'll have to resort to a full reset as mentioned in my previous post.

In Joplin are you connecting sync via the Nextcloud or the Webdav option? If you're using the Nextcloud option, maybe you could try using the Webdav option instead, following a full reset

On my Android phone I use WebDav to connect the Joplin App to the Joplin folder on Nextcloud .
On Linux Mint and Windows PC I am not using WebDav I am pointing the Joplin Desktop Apps as shows here -

I see from your screenshots that your Nextcloud provider is Tab digital. It looks like it could be an issue with your specific provider as I found someone has raised a bug today for the same issue that you have and they are also using Tab digital My files got encrypted even though I didn't turn encryption on - â„šī¸ Support - Nextcloud community

1 Like

@mrjo118
Thank you so much for all of your help. I just replied to that post.
Fingers crossed . . .

1 Like

As you're just using the free tier of Tab Digital and you only have about 1700 objects (so shouldn't take that long to do the initial upload and sync), you might want to consider doing a full reset and switching to an alternative sync method either temporarily or permanently, if it's going to take weeks to get a reply from support on the free tier. If you're wanting to keep it free I've found the Dropbox sync to be very reliable