[GH-ISSUE #1184] Syncing failed with JSON.parse: expected ':' #791

Closed
opened 2026-02-25 22:38:07 +03:00 by kerem · 24 comments
Owner

Originally created by @houdini69 on GitHub (May 29, 2022).
Original GitHub issue: https://github.com/floccusaddon/floccus/issues/1184

Which version of floccus are you using?

4.14.0

Sync method

{"label"=>"Nextcloud Bookmarks"}

Which browser are you using? In case you are using the Android App, specify the Android version please.

LibreWolf

Which version of Nextcloud Bookmarks are you using? (if relevant)

10.3.1

Which version of Nextcloud? (if relevant)

24.0.1

What kind of WebDAV server are you using? (if relevant)

No response

Describe the Bug

Floccus sends a parse error after syncing:
2022-05-29T13:25:46.800Z Starting sync process for account xxxxx@xxxxx.xxxx.xxx
2022-05-29T13:25:49.400Z Syncing failed with JSON.parse: expected ':' after property name in object at line 1 column 96502 of the JSON data

Expected Behavior

synchro without error

To Reproduce

Start web browser. Floccus icon shows error after syncing.

Debug log provided

  • I have provided a debug log file
Originally created by @houdini69 on GitHub (May 29, 2022). Original GitHub issue: https://github.com/floccusaddon/floccus/issues/1184 ### Which version of floccus are you using? 4.14.0 ### Sync method {"label"=>"Nextcloud Bookmarks"} ### Which browser are you using? In case you are using the Android App, specify the Android version please. LibreWolf ### Which version of Nextcloud Bookmarks are you using? (if relevant) 10.3.1 ### Which version of Nextcloud? (if relevant) 24.0.1 ### What kind of WebDAV server are you using? (if relevant) _No response_ ### Describe the Bug Floccus sends a parse error after syncing: 2022-05-29T13:25:46.800Z Starting sync process for account xxxxx@xxxxx.xxxx.xxx 2022-05-29T13:25:49.400Z Syncing failed with JSON.parse: expected ':' after property name in object at line 1 column 96502 of the JSON data ### Expected Behavior synchro without error ### To Reproduce Start web browser. Floccus icon shows error after syncing. ### Debug log provided - [X] I have provided a debug log file
Author
Owner

@marcelklehr commented on GitHub (May 29, 2022):

Hello @houdini69

Please make sure you got the version information for Nextcloud Bookmarks correct. There is no version 100.0.2-1

<!-- gh-comment-id:1140457723 --> @marcelklehr commented on GitHub (May 29, 2022): Hello @houdini69 Please make sure you got the version information for Nextcloud Bookmarks correct. There is no version 100.0.2-1
Author
Owner

@houdini69 commented on GitHub (May 29, 2022):

Sorry about that! Corrected.

<!-- gh-comment-id:1140480168 --> @houdini69 commented on GitHub (May 29, 2022): Sorry about that! Corrected.
Author
Owner

@marcelklehr commented on GitHub (May 29, 2022):

Ok, this seems to be a problem with the response from the server. Can you check the nextcloud log for errors?

<!-- gh-comment-id:1140480805 --> @marcelklehr commented on GitHub (May 29, 2022): Ok, this seems to be a problem with the response from the server. Can you check the nextcloud log for errors?
Author
Owner

@houdini69 commented on GitHub (May 29, 2022):

Nothing wrong in nextcloud log.
In my web server nginx I got:
192.168.1.75 - - [29/May/2022:19:01:23 +0200] "GET /nextcloud/apps/logreader/poll?lastReqId=eCuujthFXprdOlY2fr5p HTTP/2.0" 200 22 "-" "Mozilla/5.0 (Windows NT 10.0; rv:91.0) Gecko/20100101 Firefox/91.0"
192.168.1.75 - xxxxxxxxx [29/May/2022:19:01:24 +0200] "GET /nextcloud/ocs/v2.php/apps/user_status/api/v1/user_status?format=json HTTP/1.1" 200 151 "-" "Mozilla/5.0 (Macintosh) mirall/3.5.0git (build 10063) (Nextcloud, osx-19.6.0 ClientArchitecture: x86_64 OsArchitecture: x86_64)"
192.168.1.75 - xxxxxxxxx [29/May/2022:19:01:24 +0200] "POST /nextcloud/index.php/apps/bookmarks/public/rest/v2/lock HTTP/2.0" 200 40 "-" "Mozilla/5.0 (Windows NT 10.0; rv:91.0) Gecko/20100101 Firefox/91.0"
192.168.1.75 - xxxxxxxxx [29/May/2022:19:01:24 +0200] "GET /nextcloud/ocs/v2.php/apps/notifications/api/v2/notifications?format=json HTTP/1.1" 304 0 "-" "Mozilla/5.0 (Macintosh) mirall/3.5.0git (build 10063) (Nextcloud, osx-19.6.0 ClientArchitecture: x86_64 OsArchitecture: x86_64)"

<!-- gh-comment-id:1140487674 --> @houdini69 commented on GitHub (May 29, 2022): Nothing wrong in nextcloud log. In my web server nginx I got: 192.168.1.75 - - [29/May/2022:19:01:23 +0200] "GET /nextcloud/apps/logreader/poll?lastReqId=eCuujthFXprdOlY2fr5p HTTP/2.0" 200 22 "-" "Mozilla/5.0 (Windows NT 10.0; rv:91.0) Gecko/20100101 Firefox/91.0" 192.168.1.75 - xxxxxxxxx [29/May/2022:19:01:24 +0200] "GET /nextcloud/ocs/v2.php/apps/user_status/api/v1/user_status?format=json HTTP/1.1" 200 151 "-" "Mozilla/5.0 (Macintosh) mirall/3.5.0git (build 10063) (Nextcloud, osx-19.6.0 ClientArchitecture: x86_64 OsArchitecture: x86_64)" 192.168.1.75 - xxxxxxxxx [29/May/2022:19:01:24 +0200] "POST /nextcloud/index.php/apps/bookmarks/public/rest/v2/lock HTTP/2.0" 200 40 "-" "Mozilla/5.0 (Windows NT 10.0; rv:91.0) Gecko/20100101 Firefox/91.0" 192.168.1.75 - xxxxxxxxx [29/May/2022:19:01:24 +0200] "GET /nextcloud/ocs/v2.php/apps/notifications/api/v2/notifications?format=json HTTP/1.1" 304 0 "-" "Mozilla/5.0 (Macintosh) mirall/3.5.0git (build 10063) (Nextcloud, osx-19.6.0 ClientArchitecture: x86_64 OsArchitecture: x86_64)"
Author
Owner

@marcelklehr commented on GitHub (May 30, 2022):

Is this the nextcloud log or the Apache/nginx log? Please check the nextcloud log: https://docs.nextcloud.com/server/19/admin_manual/issues/general_troubleshooting.html#logfiles

<!-- gh-comment-id:1141043486 --> @marcelklehr commented on GitHub (May 30, 2022): Is this the nextcloud log or the Apache/nginx log? Please check the nextcloud log: https://docs.nextcloud.com/server/19/admin_manual/issues/general_troubleshooting.html#logfiles
Author
Owner

@houdini69 commented on GitHub (May 30, 2022):

It's the nginx log.

In the nextcloud log there's nothing wrong. I'm going to reinstall Bookmarks app in netcloud as I could'nt connect to nextlcoud with Nextcloud Bookmark Manager client app too:
"there was an error retrieving:
https://xxxxxxxxx.xxxx.xxx/nextcloud/index.php/apps/bookmarks/public/rest/v2/bookmark?page=-1

TypeError: Cannot read property 'find' of null"

<!-- gh-comment-id:1141396872 --> @houdini69 commented on GitHub (May 30, 2022): It's the nginx log. In the nextcloud log there's nothing wrong. I'm going to reinstall Bookmarks app in netcloud as I could'nt connect to nextlcoud with Nextcloud Bookmark Manager client app too: "there was an error retrieving: https://xxxxxxxxx.xxxx.xxx/nextcloud/index.php/apps/bookmarks/public/rest/v2/bookmark?page=-1 TypeError: Cannot read property &#39;find&#39; of null"
Author
Owner

@houdini69 commented on GitHub (May 31, 2022):

Reinstalling Bookmarks app in Nextcloud doesn't solve this issue.

I noticed that synchro works on Android with the Bookmarks Android app after removing the bookmarks in this app.

<!-- gh-comment-id:1142093098 --> @houdini69 commented on GitHub (May 31, 2022): Reinstalling Bookmarks app in Nextcloud doesn't solve this issue. I noticed that synchro works on Android with the Bookmarks Android app after removing the bookmarks in this app.
Author
Owner

@marcelklehr commented on GitHub (Jun 1, 2022):

Can you post the returned content of https://xxxxxxxxx.xxxx.xxx/nextcloud/index.php/apps/bookmarks/public/rest/v2/bookmark?page=-1 with sensitive content redacted?

You can do this for example using curl

curl -u "yourusername:yourpassword" https://xxxxxxxxx.xxxx.xxx/nextcloud/index.php/apps/bookmarks/public/rest/v2/bookmark?page=-1
<!-- gh-comment-id:1143718438 --> @marcelklehr commented on GitHub (Jun 1, 2022): Can you post the returned content of `https://xxxxxxxxx.xxxx.xxx/nextcloud/index.php/apps/bookmarks/public/rest/v2/bookmark?page=-1` with sensitive content redacted? You can do this for example using curl ``` curl -u "yourusername:yourpassword" https://xxxxxxxxx.xxxx.xxx/nextcloud/index.php/apps/bookmarks/public/rest/v2/bookmark?page=-1 ```
Author
Owner

@houdini69 commented on GitHub (Jun 1, 2022):

I could'nt access the returned content of https://xxxxxxxxx.xxxx.xxx/nextcloud/index.php/apps/bookmarks/public/rest/v2/bookmark?page=-1. It's forbidden by rules by my nginx configuration.

<!-- gh-comment-id:1143986838 --> @houdini69 commented on GitHub (Jun 1, 2022): I could'nt access the returned content of https://xxxxxxxxx.xxxx.xxx/nextcloud/index.php/apps/bookmarks/public/rest/v2/bookmark?page=-1. It's forbidden by rules by my nginx configuration.
Author
Owner

@marcelklehr commented on GitHub (Jun 1, 2022):

Then floccus will have a hard time syncing with your server.

<!-- gh-comment-id:1144082680 --> @marcelklehr commented on GitHub (Jun 1, 2022): Then floccus will have a hard time syncing with your server.
Author
Owner

@houdini69 commented on GitHub (Jun 1, 2022):

Floccus was working nicely previously before Nextcloud update to version 24. Note that Bookmarks Android app still works.

<!-- gh-comment-id:1144092594 --> @houdini69 commented on GitHub (Jun 1, 2022): Floccus was working nicely previously before Nextcloud update to version 24. Note that Bookmarks Android app still works.
Author
Owner

@houdini69 commented on GitHub (Jun 1, 2022):

Ok. I've set my web server to allow access with your curl command and I got all bookmarks in a string:
{"data":[{"id":1955,"url":"....,"status":"success"}

<!-- gh-comment-id:1144100400 --> @houdini69 commented on GitHub (Jun 1, 2022): Ok. I've set my web server to allow access with your curl command and I got all bookmarks in a string: {"data":[{"id":1955,"url":"....,"status":"success"}
Author
Owner

@houdini69 commented on GitHub (Jun 1, 2022):

But unfortunately floccus is still not working.

<!-- gh-comment-id:1144103486 --> @houdini69 commented on GitHub (Jun 1, 2022): But unfortunately floccus is still not working.
Author
Owner

@marcelklehr commented on GitHub (Jun 2, 2022):

But unfortunately floccus is still not working.

What is the error message? Are there other routes that are blocked by your nginx config? If you are maintaining a white list, the URLs that are part of the Bookmarks API are listed here: https://nextcloud-bookmarks.readthedocs.io/en/latest/index.html

<!-- gh-comment-id:1144973844 --> @marcelklehr commented on GitHub (Jun 2, 2022): > But unfortunately floccus is still not working. What is the error message? Are there other routes that are blocked by your nginx config? If you are maintaining a white list, the URLs that are part of the Bookmarks API are listed here: https://nextcloud-bookmarks.readthedocs.io/en/latest/index.html
Author
Owner

@houdini69 commented on GitHub (Jun 2, 2022):

The error message is always the parse error indicated in my first message.

Rules set in my nginx config are only by IP addresses. Otherwise the nginx configuration for nextcloud is the recommended one.

<!-- gh-comment-id:1145019252 --> @houdini69 commented on GitHub (Jun 2, 2022): The error message is always the parse error indicated in my first message. Rules set in my nginx config are only by IP addresses. Otherwise the nginx configuration for nextcloud is the recommended one.
Author
Owner

@marcelklehr commented on GitHub (Jun 3, 2022):

Mh, then we need to dig a bit deeper:

Firefox

  • Go to about:debugging
  • go to "This firefox"
  • click on Inspect button next to floccus entry
  • go to the network tab in the inspector
  • trigger a sync by clicking on sync now for the account of your choice.
  • check the responses of the network requests

Chrome

  • Go to chrome://extensions
  • enable Developer mode
  • click on dist/html/background.html button in floccus' entry next to "Inspect views: "
  • go to the network tab in the inspector window
  • trigger a sync by clicking on sync now for the account of your choice
  • check the responses of the network requests
<!-- gh-comment-id:1145942192 --> @marcelklehr commented on GitHub (Jun 3, 2022): Mh, then we need to dig a bit deeper: #### Firefox * Go to `about:debugging` * go to "This firefox" * click on `Inspect` button next to floccus entry * go to the network tab in the inspector * trigger a sync by clicking on `sync now` for the account of your choice. * check the responses of the network requests #### Chrome * Go to `chrome://extensions` * enable `Developer mode` * click on `dist/html/background.html` button in floccus' entry next to "Inspect views: " * go to the network tab in the inspector window * trigger a sync by clicking on `sync now` for the account of your choice * check the responses of the network requests
Author
Owner

@houdini69 commented on GitHub (Jun 3, 2022):

Syncing failed with JSON.parse: expected ':' after property name in object at line 1 column 96502 of the JSON data background-script.js:2:210323
2022-06-03T16:03:50.300Z Syncing failed with JSON.parse: expected ':' after property name in object at line 1 column 96502 of the JSON data background-script.js:2:14224
2022-06-03T16:04:47.800Z Starting sync process for account xxxxxx@xxxxxxx.xxxx.xxx background-script.js:2:14224
SyntaxError: JSON.parse: expected ':' after property name in object at line 1 column 96502 of the JSON data
getEntry moz-extension://38c9843e-c185-491f-9164-2427d0896a79/dist/js/background-script.js:2
getCache moz-extension://38c9843e-c185-491f-9164-2427d0896a79/dist/js/background-script.js:2
v moz-extension://38c9843e-c185-491f-9164-2427d0896a79/dist/js/background-script.js:2
i moz-extension://38c9843e-c185-491f-9164-2427d0896a79/dist/js/background-script.js:2
i moz-extension://38c9843e-c185-491f-9164-2427d0896a79/dist/js/background-script.js:2
s moz-extension://38c9843e-c185-491f-9164-2427d0896a79/dist/js/background-script.js:2
promise callbackc moz-extension://38c9843e-c185-491f-9164-2427d0896a79/dist/js/background-script.js:2
s moz-extension://38c9843e-c185-491f-9164-2427d0896a79/dist/js/background-script.js:2
promise callback
c moz-extension://38c9843e-c185-491f-9164-2427d0896a79/dist/js/background-script.js:2
s moz-extension://38c9843e-c185-491f-9164-2427d0896a79/dist/js/background-script.js:2
promise callbackc moz-extension://38c9843e-c185-491f-9164-2427d0896a79/dist/js/background-script.js:2
s moz-extension://38c9843e-c185-491f-9164-2427d0896a79/dist/js/background-script.js:2
promise callback
c moz-extension://38c9843e-c185-491f-9164-2427d0896a79/dist/js/background-script.js:2
i moz-extension://38c9843e-c185-491f-9164-2427d0896a79/dist/js/background-script.js:2
i moz-extension://38c9843e-c185-491f-9164-2427d0896a79/dist/js/background-script.js:2
sync moz-extension://38c9843e-c185-491f-9164-2427d0896a79/dist/js/background-script.js:2
syncAccount moz-extension://38c9843e-c185-491f-9164-2427d0896a79/dist/js/background-script.js:2
scheduleSync moz-extension://38c9843e-c185-491f-9164-2427d0896a79/dist/js/background-script.js:2
add moz-extension://38c9843e-c185-491f-9164-2427d0896a79/dist/js/background-script.js:2
_tryToStartAnother moz-extension://38c9843e-c185-491f-9164-2427d0896a79/dist/js/background-script.js:2
add moz-extension://38c9843e-c185-491f-9164-2427d0896a79/dist/js/background-script.js:2
add moz-extension://38c9843e-c185-491f-9164-2427d0896a79/dist/js/background-script.js:2
scheduleSync moz-extension://38c9843e-c185-491f-9164-2427d0896a79/dist/js/background-script.js:2
checkSync moz-extension://38c9843e-c185-491f-9164-2427d0896a79/dist/js/background-script.js:2
controller moz-extension://38c9843e-c185-491f-9164-2427d0896a79/dist/js/background-script.js:2

<!-- gh-comment-id:1146136778 --> @houdini69 commented on GitHub (Jun 3, 2022): Syncing failed with JSON.parse: expected ':' after property name in object at line 1 column 96502 of the JSON data [background-script.js:2:210323](moz-extension://38c9843e-c185-491f-9164-2427d0896a79/dist/js/background-script.js) 2022-06-03T16:03:50.300Z Syncing failed with JSON.parse: expected ':' after property name in object at line 1 column 96502 of the JSON data [background-script.js:2:14224](moz-extension://38c9843e-c185-491f-9164-2427d0896a79/dist/js/background-script.js) 2022-06-03T16:04:47.800Z Starting sync process for account xxxxxx@xxxxxxx.xxxx.xxx [background-script.js:2:14224](moz-extension://38c9843e-c185-491f-9164-2427d0896a79/dist/js/background-script.js) SyntaxError: JSON.parse: expected ':' after property name in object at line 1 column 96502 of the JSON data getEntry moz-extension://38c9843e-c185-491f-9164-2427d0896a79/dist/js/background-script.js:2 getCache moz-extension://38c9843e-c185-491f-9164-2427d0896a79/dist/js/background-script.js:2 v moz-extension://38c9843e-c185-491f-9164-2427d0896a79/dist/js/background-script.js:2 i moz-extension://38c9843e-c185-491f-9164-2427d0896a79/dist/js/background-script.js:2 i moz-extension://38c9843e-c185-491f-9164-2427d0896a79/dist/js/background-script.js:2 s moz-extension://38c9843e-c185-491f-9164-2427d0896a79/dist/js/background-script.js:2 promise callback*c moz-extension://38c9843e-c185-491f-9164-2427d0896a79/dist/js/background-script.js:2 s moz-extension://38c9843e-c185-491f-9164-2427d0896a79/dist/js/background-script.js:2 promise callback*c moz-extension://38c9843e-c185-491f-9164-2427d0896a79/dist/js/background-script.js:2 s moz-extension://38c9843e-c185-491f-9164-2427d0896a79/dist/js/background-script.js:2 promise callback*c moz-extension://38c9843e-c185-491f-9164-2427d0896a79/dist/js/background-script.js:2 s moz-extension://38c9843e-c185-491f-9164-2427d0896a79/dist/js/background-script.js:2 promise callback*c moz-extension://38c9843e-c185-491f-9164-2427d0896a79/dist/js/background-script.js:2 i moz-extension://38c9843e-c185-491f-9164-2427d0896a79/dist/js/background-script.js:2 i moz-extension://38c9843e-c185-491f-9164-2427d0896a79/dist/js/background-script.js:2 sync moz-extension://38c9843e-c185-491f-9164-2427d0896a79/dist/js/background-script.js:2 syncAccount moz-extension://38c9843e-c185-491f-9164-2427d0896a79/dist/js/background-script.js:2 scheduleSync moz-extension://38c9843e-c185-491f-9164-2427d0896a79/dist/js/background-script.js:2 add moz-extension://38c9843e-c185-491f-9164-2427d0896a79/dist/js/background-script.js:2 _tryToStartAnother moz-extension://38c9843e-c185-491f-9164-2427d0896a79/dist/js/background-script.js:2 add moz-extension://38c9843e-c185-491f-9164-2427d0896a79/dist/js/background-script.js:2 add moz-extension://38c9843e-c185-491f-9164-2427d0896a79/dist/js/background-script.js:2 scheduleSync moz-extension://38c9843e-c185-491f-9164-2427d0896a79/dist/js/background-script.js:2 checkSync moz-extension://38c9843e-c185-491f-9164-2427d0896a79/dist/js/background-script.js:2 controller moz-extension://38c9843e-c185-491f-9164-2427d0896a79/dist/js/background-script.js:2
Author
Owner

@marcelklehr commented on GitHub (Jun 13, 2022):

I've set my web server to allow access with your curl command and I got all bookmarks in a string

Can you check whether what you get from the curl command is valid json (e.g. using https://duckduckgo.com/?q=validate+json)?

PS: sorry for the delay

<!-- gh-comment-id:1154261317 --> @marcelklehr commented on GitHub (Jun 13, 2022): > I've set my web server to allow access with your curl command and I got all bookmarks in a string Can you check whether what you get from the curl command is valid json (e.g. using https://duckduckgo.com/?q=validate+json)? PS: sorry for the delay
Author
Owner

@houdini69 commented on GitHub (Jun 13, 2022):

I got "JSON is valid!"

<!-- gh-comment-id:1154426326 --> @houdini69 commented on GitHub (Jun 13, 2022): I got "JSON is valid!"
Author
Owner

@marcelklehr commented on GitHub (Jun 14, 2022):

Can you go into the network tab in the inspector window and trigger a new sync to check the request the returns invalid json?

<!-- gh-comment-id:1155095733 --> @marcelklehr commented on GitHub (Jun 14, 2022): Can you go into the *network tab* in the inspector window and trigger a new sync to check the request the returns invalid json?
Author
Owner

@houdini69 commented on GitHub (Jun 14, 2022):

There's nothing populate (?) in the network tab when I trigger a new sync in Floccus. Sorry for the lack of infos allowing to fix this issue.

<!-- gh-comment-id:1155496053 --> @houdini69 commented on GitHub (Jun 14, 2022): There's nothing populate (?) in the network tab when I trigger a new sync in Floccus. Sorry for the lack of infos allowing to fix this issue.
Author
Owner

@marcelklehr commented on GitHub (Jun 17, 2022):

getCache

Aaah! I just saw this. It seems like your cache is corrupt. Can you try uninstalling the extension and reinstalling?

<!-- gh-comment-id:1158925740 --> @marcelklehr commented on GitHub (Jun 17, 2022): > getCache Aaah! I just saw this. It seems like your cache is corrupt. Can you try uninstalling the extension and reinstalling?
Author
Owner

@houdini69 commented on GitHub (Jun 17, 2022):

You're right! Reinstalling floccus fixed this issue.

<!-- gh-comment-id:1159030193 --> @houdini69 commented on GitHub (Jun 17, 2022): You're right! Reinstalling floccus fixed this issue.
Author
Owner

@github-actions[bot] commented on GitHub (Jun 18, 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:1595922888 --> @github-actions[bot] commented on GitHub (Jun 18, 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#791
No description provided.