[GH-ISSUE #983] Error when tilde in URL #641

Closed
opened 2026-02-25 22:37:43 +03:00 by kerem · 4 comments
Owner

Originally created by @gumida on GitHub (Oct 12, 2021).
Original GitHub issue: https://github.com/floccusaddon/floccus/issues/983

Describe the bug

The sync is no longer working, if there are bookmarks with a tilde in their URL.

To Reproduce

Steps to reproduce the behavior:

  1. Add this as a bookmark: "https://people.scs.carleton.ca/~paulv/toolsjewels.html"
  2. Sync
  3. See error

Expected behavior

Accept URLs with a tilde :)

Desktop

(please complete the following information)

  • OS: Windows 10
  • Browser: Firefox
  • Browser Version: 93
  • Floccus version: 4.8.2
  • Floccus sync method: not sure. "Nextcloud Bookmarks" I guess?

Server

  • OS: Linux, Docker
  • Nextcloud version: 22.2.0
  • Bookmarks app version: 10.0.0

Debug log

[...]
2021-10-12T07:48:51.400Z Checking failsafe: 0/364=0
2021-10-12T07:48:51.400Z (nextcloud-folders)CREATE     - #undefined[Tools and Jewels](https://people.scs.carleton.ca/~paulv/toolsjewels.html) parentId: 10
2021-10-12T07:48:51.409Z { [Error: E020: Could not parse server response. Is the bookmarks app installed on your server?]
  code: 20,
  response: 'JSON.parse: unexpected character at line 1 column 1 of the JSON data' }
2021-10-12T07:48:51.409Z Syncing failed with E020: Could not parse server response. Is the bookmarks app installed on your server?
  • Debug log provided
Originally created by @gumida on GitHub (Oct 12, 2021). Original GitHub issue: https://github.com/floccusaddon/floccus/issues/983 ### Describe the bug The sync is no longer working, if there are bookmarks with a tilde in their URL. ### To Reproduce Steps to reproduce the behavior: 1. Add this as a bookmark: "https://people.scs.carleton.ca/~paulv/toolsjewels.html" 2. Sync 3. See error ### Expected behavior Accept URLs with a tilde :) ### Desktop (please complete the following information) - OS: Windows 10 - Browser: Firefox - Browser Version: 93 - Floccus version: 4.8.2 - Floccus sync method: not sure. "Nextcloud Bookmarks" I guess? ### Server - OS: Linux, Docker - Nextcloud version: 22.2.0 - Bookmarks app version: 10.0.0 ### Debug log ``` [...] 2021-10-12T07:48:51.400Z Checking failsafe: 0/364=0 2021-10-12T07:48:51.400Z (nextcloud-folders)CREATE - #undefined[Tools and Jewels](https://people.scs.carleton.ca/~paulv/toolsjewels.html) parentId: 10 2021-10-12T07:48:51.409Z { [Error: E020: Could not parse server response. Is the bookmarks app installed on your server?] code: 20, response: 'JSON.parse: unexpected character at line 1 column 1 of the JSON data' } 2021-10-12T07:48:51.409Z Syncing failed with E020: Could not parse server response. Is the bookmarks app installed on your server? ``` - [x] Debug log provided
Author
Owner

@mnalis commented on GitHub (Oct 15, 2021):

Steps to reproduce the behavior:

1. Add this as a bookmark: "https://people.scs.carleton.ca/~paulv/toolsjewels.html"
2. Sync 
3. See error

@gumida Are you sure if does not also fail if you try to add and sync a bookmark without tilde character?
For me (little older versions of software then you) floccus seems to works just fine with URLs containing tildes.

It could be a bug introduced in newer versions of floccus/bookmark app, but I'd guess it is more likely to be wrong nextcloud URL (or some other option) in account config (because that error seems to happen when data returned by specified URL is not JSON, if I'm reading code correctly0

* Floccus sync method: not sure. "Nextcloud Bookmarks" I guess?

Yes, your error would indicate that you've setup account as using nextcloud bookmarks adapter.

However, maybe some of the setup parameters (like nextcloud URL) are not in exact format as floccus wants them.

Few questions / ideas:

  • have floccus ever worked for you before, or are you trying it now for the first time?
  • if this is first time using floccus, are you sure you've setup the account correctly? I'd double check the information, or (after backing up your bookmarks - which is always a good idea), remove the account and recreate it according to instructions at https://floccus.org/start - take special care that Nextcloud URL is entered correctly (in my case for example, it looks like https://nextcloud.example.com/nextcloud, and when I click on my nextcloud bookmarks web interface, the URL bar shows https://nextcloud.example.com/nextcloud/index.php/apps/bookmarks/ and I remove everything from index.php to the end to get Nextcloud URL)

Debug log

  response: 'JSON.parse: unexpected character at line 1 column 1 of the JSON data' }
2021-10-12T07:48:51.409Z Syncing failed with E020: Could not parse server response. Is the bookmarks app installed on your server?

If you have access, and above suggestion does not help, you could also look what gets written at server nextcloud log (in my case, it is located at /var/lib/nextcloud/data/nextcloud.log)

<!-- gh-comment-id:943956283 --> @mnalis commented on GitHub (Oct 15, 2021): > Steps to reproduce the behavior: > > 1. Add this as a bookmark: "https://people.scs.carleton.ca/~paulv/toolsjewels.html" > 2. Sync > 3. See error @gumida Are you sure if **does not also fail** if you try to add and sync a bookmark **_without_** tilde character? For me (little older versions of software then you) floccus seems to works just fine with URLs containing tildes. It _could_ be a bug introduced in newer versions of floccus/bookmark app, but I'd guess it is more likely to be wrong `nextcloud URL` (or some other option) in account config (because that error seems to happen when data returned by specified URL is not JSON, if I'm reading code correctly0 > * Floccus sync method: not sure. "Nextcloud Bookmarks" I guess? Yes, your error would indicate that you've setup account as using `nextcloud bookmarks` adapter. However, maybe some of the setup parameters (like `nextcloud URL`) are not in exact format as floccus wants them. Few questions / ideas: - have floccus ever worked for you before, or are you trying it now for the first time? - if this is first time using floccus, are you sure you've setup the account correctly? I'd double check the information, or (after backing up your bookmarks - which is always a good idea), remove the account and recreate it according to instructions at https://floccus.org/start - take special care that `Nextcloud URL` is entered correctly (in my case for example, it looks like `https://nextcloud.example.com/nextcloud`, and when I click on my nextcloud bookmarks web interface, the URL bar shows `https://nextcloud.example.com/nextcloud/index.php/apps/bookmarks/` and I remove everything from `index.php` to the end to get `Nextcloud URL`) > ### Debug log > > ``` > response: 'JSON.parse: unexpected character at line 1 column 1 of the JSON data' } > 2021-10-12T07:48:51.409Z Syncing failed with E020: Could not parse server response. Is the bookmarks app installed on your server? > ``` If you have access, and above suggestion does not help, you could also look what gets written at server nextcloud log (in my case, it is located at `/var/lib/nextcloud/data/nextcloud.log`)
Author
Owner

@marcelklehr commented on GitHub (Nov 2, 2021):

I can confirm not being able to reproduce this. Updating the bookmarks app on nextcloud may help, as the latest patch fixes some bugs that may have caused this, but in general you should check your nextcloud logs as @mnalis suggested.

<!-- gh-comment-id:957390660 --> @marcelklehr commented on GitHub (Nov 2, 2021): I can confirm not being able to reproduce this. Updating the bookmarks app on nextcloud may help, as the latest patch fixes some bugs that may have caused this, but in general you should check your nextcloud logs as @mnalis suggested.
Author
Owner

@gumida commented on GitHub (Nov 3, 2021):

Thanks for your help.
I was able to use your input to talk to my webhoster. After some research, it turned out to be an issue with his web application firewall. For some reason it was blocking requests containing a tilde - for "security reasons", I suppose 😄
Sorry for the trouble :)

<!-- gh-comment-id:959830469 --> @gumida commented on GitHub (Nov 3, 2021): Thanks for your help. I was able to use your input to talk to my webhoster. After some research, it turned out to be an issue with his web application firewall. For some reason it was blocking requests containing a tilde - for "security reasons", I suppose :smile: Sorry for the trouble :)
Author
Owner

@github-actions[bot] commented on GitHub (Mar 20, 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:1476410359 --> @github-actions[bot] commented on GitHub (Mar 20, 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#641
No description provided.