[GH-ISSUE #1053] Failed to check token error #450

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

Originally created by @rmayergfx on GitHub (Jan 9, 2025).
Original GitHub issue: https://github.com/go-shiori/shiori/issues/1053

ERRO[2025-01-09T14:34:06Z] Failed to check token error="error parsing token: error parsing token: token is malformed: token contains an invalid number of segments"

v1.7.4 installed in docker.

Error is seen when i try to access via web-extension or after reboot.

how to fix this?

Originally created by @rmayergfx on GitHub (Jan 9, 2025). Original GitHub issue: https://github.com/go-shiori/shiori/issues/1053 ERRO[2025-01-09T14:34:06Z] Failed to check token error="error parsing token: error parsing token: token is malformed: token contains an invalid number of segments" v1.7.4 installed in docker. Error is seen when i try to access via web-extension or after reboot. how to fix this?
Author
Owner

@Oxyaxion commented on GitHub (Jan 10, 2025):

Hello same for me on freebsd just after an upgrade from the git repo from the latest v1.7.4

time="2025-01-10T20:30:49+01:00" level=warning msg="x.x.x.x- shiori [10/Jan/2025:20:30:49 +0100] \"GET /api/v1/auth/me\" 403 27 \"https://domain.fr/\" \"Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36\" (1ms)" clientIP=x.x.x.x dataLength=27 hostname=shiori latency=1 method=GET path=/api/v1/auth/me referer0

Authentication never finish ... When I press CTRL + F5 I can login in kind of "read only mode", I can read my url but can't add it anymore.

<!-- gh-comment-id:2583774436 --> @Oxyaxion commented on GitHub (Jan 10, 2025): Hello same for me on freebsd just after an upgrade from the git repo from the latest v1.7.4 `time="2025-01-10T20:30:49+01:00" level=warning msg="x.x.x.x- shiori [10/Jan/2025:20:30:49 +0100] \"GET /api/v1/auth/me\" 403 27 \"https://domain.fr/\" \"Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36\" (1ms)" clientIP=x.x.x.x dataLength=27 hostname=shiori latency=1 method=GET path=/api/v1/auth/me referer0` Authentication never finish ... When I press CTRL + F5 I can login in kind of "read only mode", I can read my url but can't add it anymore.
Author
Owner

@fmartingr commented on GitHub (Jan 10, 2025):

Can you provide more details about your setup, as the issue template suggests? I have been running 1.7.4 before release (I test releases manually) and I haven't experienced any of this. What browser are you using? What do you see in the browsers console?

<!-- gh-comment-id:2583858224 --> @fmartingr commented on GitHub (Jan 10, 2025): Can you provide more details about your setup, as the issue template suggests? I have been running 1.7.4 before release (I test releases manually) and I haven't experienced any of this. What browser are you using? What do you see in the browsers console?
Author
Owner

@Oxyaxion commented on GitHub (Jan 13, 2025):

Everything works fine after a whole reboot of the plateform ... probably yet another nginx/reverse-proxy/ browser cache issue ... Sorry for the noise.

<!-- gh-comment-id:2586506043 --> @Oxyaxion commented on GitHub (Jan 13, 2025): Everything works fine after a whole reboot of the plateform ... probably yet another nginx/reverse-proxy/ browser cache issue ... Sorry for the noise.
Author
Owner

@tarbib commented on GitHub (Feb 11, 2025):

I actually have the same error even after full restart:
I simply did:
docker pull ghcr.io/go-shiori/shiori
Then mounted:
./data:/shiori
Thanks

<!-- gh-comment-id:2650728889 --> @tarbib commented on GitHub (Feb 11, 2025): I actually have the same error even after full restart: I simply did: docker pull ghcr.io/go-shiori/shiori Then mounted: ./data:/shiori Thanks
Author
Owner

@rmayergfx commented on GitHub (Feb 12, 2025):

Why is this closed? Still having this issue on Docker on Synology NAS, nothing changed.
Also the webextension is still not working with the latest version...

<!-- gh-comment-id:2653364963 --> @rmayergfx commented on GitHub (Feb 12, 2025): Why is this closed? Still having this issue on Docker on Synology NAS, nothing changed. Also the webextension is still not working with the latest version...
Author
Owner

@fmartingr commented on GitHub (Feb 12, 2025):

Why is this closed? Still having this issue on Docker on Synology NAS, nothing changed. Also the webextension is still not working with the latest version...

Ups sorry I thought one of the answers that said it was working ok was yours 😅

<!-- gh-comment-id:2653373099 --> @fmartingr commented on GitHub (Feb 12, 2025): > Why is this closed? Still having this issue on Docker on Synology NAS, nothing changed. Also the webextension is still not working with the latest version... Ups sorry I thought one of the answers that said it was working ok was yours 😅
Author
Owner

@pudymody commented on GitHub (Feb 22, 2025):

I think the problem happens before you login, when you neither have an Authorization header nor a token cookie.

A quickfix could be to add a check against empty values in the auth middleware before checking it.

if token == "" {
return
}
<!-- gh-comment-id:2676360523 --> @pudymody commented on GitHub (Feb 22, 2025): I think the problem happens before you login, when you neither have an `Authorization` header nor a `token` cookie. A quickfix could be to add a check against empty values in the [auth middleware](https://github.com/go-shiori/shiori/blob/master/internal/http/middleware/auth.go#L24) before checking it. ```go if token == "" { return } ```
Author
Owner

@fmartingr commented on GitHub (Mar 1, 2025):

I think the problem happens before you login, when you neither have an Authorization header nor a token cookie.

A quickfix could be to add a check against empty values in the auth middleware before checking it.

if token == "" {
return
}

Thanks for the hint, fixed in #1064, available in the next release.

<!-- gh-comment-id:2692088836 --> @fmartingr commented on GitHub (Mar 1, 2025): > I think the problem happens before you login, when you neither have an `Authorization` header nor a `token` cookie. > > A quickfix could be to add a check against empty values in the [auth middleware](https://github.com/go-shiori/shiori/blob/master/internal/http/middleware/auth.go#L24) before checking it. > > if token == "" { > return > } Thanks for the hint, fixed in #1064, available in the next release.
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#450
No description provided.