[GH-ISSUE #443] [Bug] [v3] JSON.parse: unexpected character at line 1 column 1 of the JSON data #331

Closed
opened 2026-02-25 22:36:50 +03:00 by kerem · 16 comments
Owner

Originally created by @Crow-Control on GitHub (Feb 2, 2020).
Original GitHub issue: https://github.com/floccusaddon/floccus/issues/443

Describe the bug
When syncing using Nextcloud-Folders (non-legacy) it throws the following error:
JSON.parse: unexpected character at line 1 column 1 of the JSON data

To Reproduce
Steps to reproduce the behavior:

  1. Install latest on firefox.
  2. Try syncing 200 bookmarks multiple layers of subfolders.
  3. Get error

Expected behavior
Should, you know, work and such.

Desktop (please complete the following information):

  • OS: Windows
  • Browser Firefox
  • Browser Version Latest, esr, dev etc
  • Floccus version: v3 (latest)
  • Floccus sync method: nextcloud folders

Server (please complete the following information):

  • OS: FreeBSD
  • Nextcloud version: 7.0.3
  • Bookmarks app version: Latest

Note: Please write down the actual version numbers instead of writing 'latest'.

Debug log

2020-02-02T20:00:38.464Z (nextcloud-folders)CREATE     - #undefined[Shakira - Whenever, Wherever - YouTube](https://www.youtube.com/watch?v=weRHyjj34ZE) parentId: 55
2020-02-02T20:00:39.287Z COMPARE { localItem:   - #PTfKYaTuNT9-[Over the Misty Mountains Cold | The Mary Sue](http://www.themarysue.com/song-from-the-hobbit-trailer/) parentId: kK5AaWRa_wGI,
  cacheItem: undefined,
  serverItem: undefined }
2020-02-02T20:00:39.288Z (nextcloud-folders)CREATE     - #undefined[Over the Misty Mountains Cold | The Mary Sue](http://www.themarysue.com/song-from-the-hobbit-trailer/) parentId: 55
2020-02-02T20:00:40.344Z Syncing failed with E020: Could not parse server response. Is the bookmarks app installed on your server?
JSON.parse: unexpected character at line 1 column 1 of the JSON data
E020: Could not parse server response. Is the bookmarks app installed on your server?
JSON.parse: unexpected character at line 1 column 1 of the JSON data
E020: Could not parse server response. Is the bookmarks app installed on your server?
JSON.parse: unexpected character at line 1 column 1 of the JSON data
  • Debug log provided

Additional context
Also happens on V4 (when not running it on root, see #444 ).
Legacy sync works fine (as far as one could call that "fine".

Originally created by @Crow-Control on GitHub (Feb 2, 2020). Original GitHub issue: https://github.com/floccusaddon/floccus/issues/443 **Describe the bug** When syncing using Nextcloud-Folders (non-legacy) it throws the following error: `JSON.parse: unexpected character at line 1 column 1 of the JSON data` **To Reproduce** Steps to reproduce the behavior: 1. Install latest on firefox. 2. Try syncing 200 bookmarks multiple layers of subfolders. 3. Get error **Expected behavior** Should, you know, work and such. **Desktop (please complete the following information):** - OS: Windows - Browser Firefox - Browser Version Latest, esr, dev etc - Floccus version: v3 (latest) - Floccus sync method: nextcloud folders **Server (please complete the following information):** - OS: FreeBSD - Nextcloud version: 7.0.3 - Bookmarks app version: Latest Note: Please write down the actual version numbers instead of writing 'latest'. **Debug log** ``` 2020-02-02T20:00:38.464Z (nextcloud-folders)CREATE - #undefined[Shakira - Whenever, Wherever - YouTube](https://www.youtube.com/watch?v=weRHyjj34ZE) parentId: 55 2020-02-02T20:00:39.287Z COMPARE { localItem: - #PTfKYaTuNT9-[Over the Misty Mountains Cold | The Mary Sue](http://www.themarysue.com/song-from-the-hobbit-trailer/) parentId: kK5AaWRa_wGI, cacheItem: undefined, serverItem: undefined } 2020-02-02T20:00:39.288Z (nextcloud-folders)CREATE - #undefined[Over the Misty Mountains Cold | The Mary Sue](http://www.themarysue.com/song-from-the-hobbit-trailer/) parentId: 55 2020-02-02T20:00:40.344Z Syncing failed with E020: Could not parse server response. Is the bookmarks app installed on your server? JSON.parse: unexpected character at line 1 column 1 of the JSON data E020: Could not parse server response. Is the bookmarks app installed on your server? JSON.parse: unexpected character at line 1 column 1 of the JSON data E020: Could not parse server response. Is the bookmarks app installed on your server? JSON.parse: unexpected character at line 1 column 1 of the JSON data ``` - [x] Debug log provided **Additional context** Also happens on V4 (when not running it on root, see #444 ). Legacy sync works fine (as far as one could call that "fine".
kerem 2026-02-25 22:36:50 +03:00
  • closed this issue
  • added the
    bug
    label
Author
Owner

@marcelklehr commented on GitHub (Feb 11, 2020):

Nextcloud version 7.0.3

Floccus doesn't support this version of nextcloud. In any case, it would be helpful to know the actual version of your bookmarks app install, as the latest available version varies across nextcloud versions.

<!-- gh-comment-id:584645993 --> @marcelklehr commented on GitHub (Feb 11, 2020): > Nextcloud version 7.0.3 Floccus doesn't support this version of nextcloud. In any case, it would be helpful to know the actual version of your bookmarks app install, as the latest available version varies across nextcloud versions.
Author
Owner

@Crow-Control commented on GitHub (Feb 11, 2020):

Floccus doesn't support this version of nextcloud

is there any documentation what is and isn't supported?

<!-- gh-comment-id:584664550 --> @Crow-Control commented on GitHub (Feb 11, 2020): > Floccus doesn't support this version of nextcloud is there any documentation what is and isn't supported?
Author
Owner

@marcelklehr commented on GitHub (Feb 11, 2020):

The addon pages cite nextcloud bookmarks v0.11 or greater. However, when using the nextcloud-folders sync methods, v1.x or greater is supported (this is not documented indeed). Any nextcloud versions that these app versions support is implicitly supported. Nextcloud 7.x is very old.

Update: The add-account screen in the addon itself actually declares the dependencies:

The option 'Nextcloud Bookmarks' is compatible with at least version v0.14 of the Bookmarks app.

<!-- gh-comment-id:584779655 --> @marcelklehr commented on GitHub (Feb 11, 2020): The addon pages [cite](https://addons.mozilla.org/en-US/firefox/addon/floccus/) nextcloud bookmarks v0.11 or greater. ~~However, when using the nextcloud-folders sync methods, v1.x or greater is supported (this is not documented indeed).~~ Any nextcloud versions that these app versions support is implicitly supported. Nextcloud 7.x is *very* old. Update: The add-account screen in the addon itself actually declares the dependencies: > The option 'Nextcloud Bookmarks' is compatible with at least version v0.14 of the Bookmarks app.
Author
Owner

@Crow-Control commented on GitHub (Feb 11, 2020):

Shoot, Thats a typo from my side: Its: 17.0.3

<!-- gh-comment-id:584818538 --> @Crow-Control commented on GitHub (Feb 11, 2020): Shoot, Thats a typo from my side: Its: 17.0.3
Author
Owner

@marcelklehr commented on GitHub (Feb 12, 2020):

I see. It would be interesting to know, which endpoint is responsible for that non-json output, and what the actual response is. Do you think you can find out? (about:debugging and then inspect thte network tab of the addon)

<!-- gh-comment-id:585168286 --> @marcelklehr commented on GitHub (Feb 12, 2020): I see. It would be interesting to know, which endpoint is responsible for that non-json output, and what the actual response is. Do you think you can find out? (`about:debugging` and then inspect thte network tab of the addon)
Author
Owner

@funkmastergst commented on GitHub (Apr 10, 2020):

The same error occured at my instance.
I used this howto:
https://decatec.de/home-server/nextcloud-lesezeichen-synchronisieren-mit-chrome-firefox/

The error occured because I used the wrong server-path mentioned in the howto.
false: https://mydomain.de/nextcloud
correct: https://mydomain.de

After correcting the path everything worked alright.

<!-- gh-comment-id:612165454 --> @funkmastergst commented on GitHub (Apr 10, 2020): The same error occured at my instance. I used this howto: [https://decatec.de/home-server/nextcloud-lesezeichen-synchronisieren-mit-chrome-firefox/](url) The error occured because I used the wrong server-path mentioned in the howto. false: https://mydomain.de/nextcloud correct: https://mydomain.de After correcting the path everything worked alright.
Author
Owner

@Crow-Control commented on GitHub (Apr 11, 2020):

@funkmastergst That wasn't the case with my issue sadly enough.

<!-- gh-comment-id:612368793 --> @Crow-Control commented on GitHub (Apr 11, 2020): @funkmastergst That wasn't the case with my issue sadly enough.
Author
Owner

@marcelklehr commented on GitHub (Apr 11, 2020):

@Ornias1993 Did you get it sorted out?

<!-- gh-comment-id:612513226 --> @marcelklehr commented on GitHub (Apr 11, 2020): @Ornias1993 Did you get it sorted out?
Author
Owner

@Schlecki commented on GitHub (Apr 12, 2020):

I'm having the same problem. I debugged the sync via about:debugging and noticed that I kept getting redirected to the login page, even though I was already logged in:

https://mydomain.de/index.php/apps/bookmarks/public/rest/v2/folder/-1/hash:

HTTP/1.1 302 Found
Server: nginx/1.14.2
Date: Sun, 12 Apr 2020 17:46:22 GMT
Content-Type: text/html; charset=UTF-8
Content-Length: 0
Connection: keep-alive
Referrer-Policy: no-referrer
X-Content-Type-Options: nosniff
X-Download-Options: noopen
X-Frame-Options: SAMEORIGIN
X-Permitted-Cross-Domain-Policies: none
X-Robots-Tag: none
X-XSS-Protection: 1; mode=block
Expires: Thu, 19 Nov 1981 08:52:00 GMT
Cache-Control: no-store, no-cache, must-revalidate
Pragma: no-cache

...

Location: https://mydomain.de/index.php/login?noredir=1

I don't know about the others, but in my case it seems to be a problem with the openid-connect plugin I'm using (https://github.com/pulsejet/nextcloud-oidc-login). Once I deactivated it, it worked.

<!-- gh-comment-id:612653864 --> @Schlecki commented on GitHub (Apr 12, 2020): I'm having the same problem. I debugged the sync via about:debugging and noticed that I kept getting redirected to the login page, even though I was already logged in: ``` https://mydomain.de/index.php/apps/bookmarks/public/rest/v2/folder/-1/hash: HTTP/1.1 302 Found Server: nginx/1.14.2 Date: Sun, 12 Apr 2020 17:46:22 GMT Content-Type: text/html; charset=UTF-8 Content-Length: 0 Connection: keep-alive Referrer-Policy: no-referrer X-Content-Type-Options: nosniff X-Download-Options: noopen X-Frame-Options: SAMEORIGIN X-Permitted-Cross-Domain-Policies: none X-Robots-Tag: none X-XSS-Protection: 1; mode=block Expires: Thu, 19 Nov 1981 08:52:00 GMT Cache-Control: no-store, no-cache, must-revalidate Pragma: no-cache ... Location: https://mydomain.de/index.php/login?noredir=1 ``` I don't know about the others, but in my case it seems to be a problem with the openid-connect plugin I'm using (https://github.com/pulsejet/nextcloud-oidc-login). Once I deactivated it, it worked.
Author
Owner

@Crow-Control commented on GitHub (Apr 14, 2020):

@Ornias1993 Did you get it sorted out?

As I didn't get any support from you on this issue, I stopped using this extention completely.

<!-- gh-comment-id:613289427 --> @Crow-Control commented on GitHub (Apr 14, 2020): > @Ornias1993 Did you get it sorted out? As I didn't get any support from you on this issue, I stopped using this extention completely.
Author
Owner

@marcelklehr commented on GitHub (Apr 14, 2020):

I see. I did offer a way to find out more about the problem. Unless you want to investigate further, I'll close this.

<!-- gh-comment-id:613346178 --> @marcelklehr commented on GitHub (Apr 14, 2020): I see. I did offer [a way to find out more about the problem](https://github.com/marcelklehr/floccus/issues/443#issuecomment-585168286). Unless you want to investigate further, I'll close this.
Author
Owner

@albert-gee commented on GitHub (Aug 2, 2020):

@Ornias1993 Did you get it sorted out?

As I didn't get any support from you on this issue, I stopped using this extention completely.

Hi marcelklehr, I had the same issue. In order to fix it, try not using your Nextcloud password. Instead, create a new app password:

  1. In your Nextcloud account, please go to Settings -> Personal -> Security -> Devices & sessions
  2. Enter any "App name", e.g. "Floccus on Ubuntu"
  3. Copy the password and use it in Floccus

Hopefully, it will help. Cheers.

<!-- gh-comment-id:667606031 --> @albert-gee commented on GitHub (Aug 2, 2020): > > @Ornias1993 Did you get it sorted out? > > As I didn't get any support from you on this issue, I stopped using this extention completely. Hi marcelklehr, I had the same issue. In order to fix it, try not using your Nextcloud password. Instead, create a new **app password**: 1. In your Nextcloud account, please go to **Settings** -> **Personal** -> **Security** -> **Devices & sessions** 2. Enter any "App name", e.g. "Floccus on Ubuntu" 3. Copy the password and use it in Floccus Hopefully, it will help. Cheers.
Author
Owner

@JoergOswald commented on GitHub (Jan 1, 2021):

I see. It would be interesting to know, which endpoint is responsible for that non-json output, and what the actual response is. Do you think you can find out? (about:debugging and then inspect thte network tab of the addon)

Hey @marcelklehr. I had the same issue and started to debug the problem. In netwerk view I found some errors which were related with the creation of new Bookmarks (PUT). Though not all bookmarks had problems I investigated the ones who had. My solution was the title length of the bookmarks. By shrinking it down (the bookmark itself) the sync worked.

Hope that can help you either by fixing the length or thowing a better error message.

<!-- gh-comment-id:753326911 --> @JoergOswald commented on GitHub (Jan 1, 2021): > I see. It would be interesting to know, which endpoint is responsible for that non-json output, and what the actual response is. Do you think you can find out? (`about:debugging` and then inspect thte network tab of the addon) Hey @marcelklehr. I had the same issue and started to debug the problem. In netwerk view I found some errors which were related with the creation of new Bookmarks (PUT). Though not all bookmarks had problems I investigated the ones who had. My solution was the title length of the bookmarks. By shrinking it down (the bookmark itself) the sync worked. Hope that can help you either by fixing the length or thowing a better error message.
Author
Owner

@sixtyfive commented on GitHub (Feb 19, 2021):

Although this has been closed for almost a year, I'd like to comment that I keep getting the error message from the Issue's title every couple of seconds. I.e., Floccus tries to sync, fails, tries, fails, etc. For the sheer number of bookmarks (I've kept moving them along as old devices went and new devices came since around 1999) what @JoergOswald did isn't an option to me.

<!-- gh-comment-id:781976344 --> @sixtyfive commented on GitHub (Feb 19, 2021): Although this has been closed for almost a year, I'd like to comment that I keep getting the error message from the Issue's title every couple of seconds. I.e., Floccus tries to sync, fails, tries, fails, etc. For the sheer number of bookmarks (I've kept moving them along as old devices went and new devices came since around 1999) what @JoergOswald did isn't an option to me.
Author
Owner

@marcelklehr commented on GitHub (Feb 19, 2021):

@sixtyfive You could still investigate what causes the error. Failed JSON parse may happen because of bookmarks not being installed on nextcloud, or a server-side error. Checking the nextcloud log for errors would yield more information. I encourage you to open a new issue for this, though.

<!-- gh-comment-id:781989192 --> @marcelklehr commented on GitHub (Feb 19, 2021): @sixtyfive You could still investigate what causes the error. Failed JSON parse may happen because of bookmarks not being installed on nextcloud, or a server-side error. Checking the nextcloud log for errors would yield more information. I encourage you to open a new issue for this, though.
Author
Owner

@github-actions[bot] commented on GitHub (Mar 21, 2023):

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

<!-- gh-comment-id:1477135277 --> @github-actions[bot] commented on GitHub (Mar 21, 2023): This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/floccus#331
No description provided.