[GH-ISSUE #1181] JSON.parse errors when bookmarking #485

Open
opened 2026-02-25 23:34:19 +03:00 by kerem · 5 comments
Owner

Originally created by @edsu on GitHub (Jan 23, 2026).
Original GitHub issue: https://github.com/go-shiori/shiori/issues/1181

Data

  • Shiori version: 1.8.0
  • Database Engine: SQLite
  • Operating system: ubuntu
  • CLI/Web interface/Web Extension:

Describe the bug / actual behavior

When I bookmark https://pardalotus.tech/posts/2024-10-02-falsehoods-programmers-believe-about-dois/ I get an error:

JSON.parse: unexpected character at line 1 column 1 of the JSON data

Image

I noticed that the browser devtools that the POST that the Shiori interface is doing resulted in a 502 Error from the server?

Image

This has happened to me in the past with other URLs, but I haven't found a pattern in what the problem is. I think it may sometimes work, depending on whether I am archiving the URL or not?

Expected behavior

I expected the bookmark to be saved!

To Reproduce

Try to bookmark https://pardalotus.tech/posts/2024-10-02-falsehoods-programmers-believe-about-dois/

Screenshots

I included some above.

Notes

Add any other context about the problem here.

Originally created by @edsu on GitHub (Jan 23, 2026). Original GitHub issue: https://github.com/go-shiori/shiori/issues/1181 ## Data - **Shiori version**: 1.8.0 - **Database Engine**: SQLite - **Operating system**: ubuntu - **CLI/Web interface/Web Extension**: ## Describe the bug / actual behavior When I bookmark https://pardalotus.tech/posts/2024-10-02-falsehoods-programmers-believe-about-dois/ I get an error: > JSON.parse: unexpected character at line 1 column 1 of the JSON data <img width="1748" height="1144" alt="Image" src="https://github.com/user-attachments/assets/c41bc49f-c34e-4a2f-bf4a-2db316bdb49f" /> I noticed that the browser devtools that the POST that the Shiori interface is doing resulted in a 502 Error from the server? <img width="1712" height="971" alt="Image" src="https://github.com/user-attachments/assets/c9a5c57d-80e4-431c-9b14-b1f037e707c6" /> This has happened to me in the past with other URLs, but I haven't found a pattern in what the problem is. I think it may sometimes work, depending on whether I am archiving the URL or not? ## Expected behavior I expected the bookmark to be saved! ## To Reproduce Try to bookmark https://pardalotus.tech/posts/2024-10-02-falsehoods-programmers-believe-about-dois/ ## Screenshots I included some above. ## Notes Add any other context about the problem here.
Author
Owner

@edsu commented on GitHub (Jan 29, 2026):

This URL seems to trigger it too?

https://osf.io/preprints/socarxiv/6z5pa_v1

<!-- gh-comment-id:3820854858 --> @edsu commented on GitHub (Jan 29, 2026): This URL seems to trigger it too? https://osf.io/preprints/socarxiv/6z5pa_v1
Author
Owner

@edsu commented on GitHub (Feb 1, 2026):

And https://automerge.org/

<!-- gh-comment-id:3830870017 --> @edsu commented on GitHub (Feb 1, 2026): And https://automerge.org/
Author
Owner

@fmartingr commented on GitHub (Feb 1, 2026):

Do you have some server logs? I haven't tested all the links, but I just tried the last one, and it works just fine. Seems like a server/proxy error.

<!-- gh-comment-id:3830877163 --> @fmartingr commented on GitHub (Feb 1, 2026): Do you have some server logs? I haven't tested all the links, but I just tried the last one, and it works just fine. Seems like a server/proxy error.
Author
Owner

@edsu commented on GitHub (Feb 24, 2026):

I saw it again just now when bookmarking https://arstechnica.com/tech-policy/2026/02/wikipedia-bans-archive-today-after-site-executed-ddos-and-altered-web-captures/. This is what popped into my /var/log/syslog

2026-02-24T14:04:56.892924+00:00 home shiori[1201]: time="2026-02-24T14:04:56Z" level=info msg="allowing legacy api access using JWT token" method=POST path=/api/bookmarks username=ed
2026-02-24T14:04:56.901881+00:00 home shiori[1201]: 2026/02/24 14:04:56 http: panic serving 127.0.0.1:48862: failed to save bookmark: failed to execute select query for bookmark content: transaction failed after retry: transaction failed: failed to delete bookmark content: constraint failed: UNIQUE constraint failed: bookmark.url (2067)
2026-02-24T14:04:56.902187+00:00 home shiori[1201]: goroutine 79515 [running]:
2026-02-24T14:04:56.902397+00:00 home shiori[1201]: net/http.(*conn).serve.func1()
2026-02-24T14:04:56.902659+00:00 home shiori[1201]: #011/opt/hostedtoolcache/go/1.23.6/x64/src/net/http/server.go:1947 +0xb0
2026-02-24T14:04:56.902912+00:00 home shiori[1201]: panic({0x927e20?, 0x40003f8c30?})
2026-02-24T14:04:56.903141+00:00 home shiori[1201]: #011/opt/hostedtoolcache/go/1.23.6/x64/src/runtime/panic.go:785 +0x124
2026-02-24T14:04:56.903341+00:00 home shiori[1201]: github.com/go-shiori/shiori/internal/webserver.(*Handler).ApiInsertBookmark(0x40002a9ce0, {0x19e3150, 0x40000e8140}, 0x4000296500, {0x0?, 0x0?, 0xa223cf?})
2026-02-24T14:04:56.903513+00:00 home shiori[1201]: #011/home/runner/work/shiori/shiori/internal/webserver/handler-api.go:228 +0xbc0
2026-02-24T14:04:56.903694+00:00 home shiori[1201]: github.com/go-shiori/shiori/internal/http/handlers.(*LegacyHandler).HandleInsertBookmark(0x4000060618, {0x699db008?, 0x4000bd3a08?}, {0x19e8d18, 0x4000306420})
2026-02-24T14:04:56.903861+00:00 home shiori[1201]: #011/home/runner/work/shiori/shiori/internal/http/handlers/legacy.go:84 +0x90
2026-02-24T14:04:56.904157+00:00 home shiori[1201]: github.com/go-shiori/shiori/internal/http.(*HttpServer).Setup.ToHTTPHandler.func12({0x19e1f38, 0x40005401c0}, 0x40008b6b28?)
2026-02-24T14:04:56.904437+00:00 home shiori[1201]: #011/home/runner/work/shiori/shiori/internal/http/http.go:26 +0x14c
2026-02-24T14:04:56.904644+00:00 home shiori[1201]: net/http.HandlerFunc.ServeHTTP(0x40002600e0?, {0x19e1f38?, 0x40005401c0?}, 0x40008b6b10?)
2026-02-24T14:04:56.904839+00:00 home shiori[1201]: #011/opt/hostedtoolcache/go/1.23.6/x64/src/net/http/server.go:2220 +0x38
2026-02-24T14:04:56.904980+00:00 home shiori[1201]: net/http.(*ServeMux).ServeHTTP(0x10?, {0x19e1f38, 0x40005401c0}, 0x4000296280)
2026-02-24T14:04:56.905186+00:00 home shiori[1201]: #011/opt/hostedtoolcache/go/1.23.6/x64/src/net/http/server.go:2747 +0x1b4
2026-02-24T14:04:56.905350+00:00 home shiori[1201]: net/http.serverHandler.ServeHTTP({0x19dee40?}, {0x19e1f38?, 0x40005401c0?}, 0x6?)
2026-02-24T14:04:56.905530+00:00 home shiori[1201]: #011/opt/hostedtoolcache/go/1.23.6/x64/src/net/http/server.go:3210 +0xbc
2026-02-24T14:04:56.905672+00:00 home shiori[1201]: net/http.(*conn).serve(0x4000222120, {0x19e42a8, 0x40000b2cf0})
2026-02-24T14:04:56.905900+00:00 home shiori[1201]: #011/opt/hostedtoolcache/go/1.23.6/x64/src/net/http/server.go:2092 +0x4fc
2026-02-24T14:04:56.906097+00:00 home shiori[1201]: created by net/http.(*Server).Serve in goroutine 8
2026-02-24T14:04:56.906300+00:00 home shiori[1201]: #011/opt/hostedtoolcache/go/1.23.6/x64/src/net/http/server.go:3360 +0x3dc

I tried logging out of Shiori, and restarting Shiori, but the behavior stayed the same.

<!-- gh-comment-id:3952173050 --> @edsu commented on GitHub (Feb 24, 2026): I saw it again just now when bookmarking `https://arstechnica.com/tech-policy/2026/02/wikipedia-bans-archive-today-after-site-executed-ddos-and-altered-web-captures/`. This is what popped into my `/var/log/syslog` ``` 2026-02-24T14:04:56.892924+00:00 home shiori[1201]: time="2026-02-24T14:04:56Z" level=info msg="allowing legacy api access using JWT token" method=POST path=/api/bookmarks username=ed 2026-02-24T14:04:56.901881+00:00 home shiori[1201]: 2026/02/24 14:04:56 http: panic serving 127.0.0.1:48862: failed to save bookmark: failed to execute select query for bookmark content: transaction failed after retry: transaction failed: failed to delete bookmark content: constraint failed: UNIQUE constraint failed: bookmark.url (2067) 2026-02-24T14:04:56.902187+00:00 home shiori[1201]: goroutine 79515 [running]: 2026-02-24T14:04:56.902397+00:00 home shiori[1201]: net/http.(*conn).serve.func1() 2026-02-24T14:04:56.902659+00:00 home shiori[1201]: #011/opt/hostedtoolcache/go/1.23.6/x64/src/net/http/server.go:1947 +0xb0 2026-02-24T14:04:56.902912+00:00 home shiori[1201]: panic({0x927e20?, 0x40003f8c30?}) 2026-02-24T14:04:56.903141+00:00 home shiori[1201]: #011/opt/hostedtoolcache/go/1.23.6/x64/src/runtime/panic.go:785 +0x124 2026-02-24T14:04:56.903341+00:00 home shiori[1201]: github.com/go-shiori/shiori/internal/webserver.(*Handler).ApiInsertBookmark(0x40002a9ce0, {0x19e3150, 0x40000e8140}, 0x4000296500, {0x0?, 0x0?, 0xa223cf?}) 2026-02-24T14:04:56.903513+00:00 home shiori[1201]: #011/home/runner/work/shiori/shiori/internal/webserver/handler-api.go:228 +0xbc0 2026-02-24T14:04:56.903694+00:00 home shiori[1201]: github.com/go-shiori/shiori/internal/http/handlers.(*LegacyHandler).HandleInsertBookmark(0x4000060618, {0x699db008?, 0x4000bd3a08?}, {0x19e8d18, 0x4000306420}) 2026-02-24T14:04:56.903861+00:00 home shiori[1201]: #011/home/runner/work/shiori/shiori/internal/http/handlers/legacy.go:84 +0x90 2026-02-24T14:04:56.904157+00:00 home shiori[1201]: github.com/go-shiori/shiori/internal/http.(*HttpServer).Setup.ToHTTPHandler.func12({0x19e1f38, 0x40005401c0}, 0x40008b6b28?) 2026-02-24T14:04:56.904437+00:00 home shiori[1201]: #011/home/runner/work/shiori/shiori/internal/http/http.go:26 +0x14c 2026-02-24T14:04:56.904644+00:00 home shiori[1201]: net/http.HandlerFunc.ServeHTTP(0x40002600e0?, {0x19e1f38?, 0x40005401c0?}, 0x40008b6b10?) 2026-02-24T14:04:56.904839+00:00 home shiori[1201]: #011/opt/hostedtoolcache/go/1.23.6/x64/src/net/http/server.go:2220 +0x38 2026-02-24T14:04:56.904980+00:00 home shiori[1201]: net/http.(*ServeMux).ServeHTTP(0x10?, {0x19e1f38, 0x40005401c0}, 0x4000296280) 2026-02-24T14:04:56.905186+00:00 home shiori[1201]: #011/opt/hostedtoolcache/go/1.23.6/x64/src/net/http/server.go:2747 +0x1b4 2026-02-24T14:04:56.905350+00:00 home shiori[1201]: net/http.serverHandler.ServeHTTP({0x19dee40?}, {0x19e1f38?, 0x40005401c0?}, 0x6?) 2026-02-24T14:04:56.905530+00:00 home shiori[1201]: #011/opt/hostedtoolcache/go/1.23.6/x64/src/net/http/server.go:3210 +0xbc 2026-02-24T14:04:56.905672+00:00 home shiori[1201]: net/http.(*conn).serve(0x4000222120, {0x19e42a8, 0x40000b2cf0}) 2026-02-24T14:04:56.905900+00:00 home shiori[1201]: #011/opt/hostedtoolcache/go/1.23.6/x64/src/net/http/server.go:2092 +0x4fc 2026-02-24T14:04:56.906097+00:00 home shiori[1201]: created by net/http.(*Server).Serve in goroutine 8 2026-02-24T14:04:56.906300+00:00 home shiori[1201]: #011/opt/hostedtoolcache/go/1.23.6/x64/src/net/http/server.go:3360 +0x3dc ``` I tried logging out of Shiori, and restarting Shiori, but the behavior stayed the same.
Author
Owner

@edsu commented on GitHub (Feb 25, 2026):

I ran into it again with https://dangerzone.rocks/

I'm assuming you can bookmark this ok?

<!-- gh-comment-id:3959637067 --> @edsu commented on GitHub (Feb 25, 2026): I ran into it again with https://dangerzone.rocks/ I'm assuming you can bookmark this ok?
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/shiori#485
No description provided.