mirror of
https://github.com/go-shiori/shiori.git
synced 2026-04-25 14:35:52 +03:00
[GH-ISSUE #459] Crash when bookmark URL is not accessible #285
Labels
No labels
component:backend
component:builds
component:builds
component:extension
component:frontend
component:readability
database
database:mysql
database:postgres
database:sqlite
feature:ebooks
github_actions
good first issue
hacktoberfest
note:duplicate?
note:fixed?
note:out-of-scope?
os:windows
priority:high
priority:low
pull-request
resolution:as-intended
resolution:cant-reproduce
resolution:duplicate
resolution:fixed
resolution:wontfix
tag:TBD
tag:big-task
tag:help-wanted
tag:huge-data
tag:meta
tag:more-info
tag:next
tag:no-stale
tag:requires-migrations
tag:research
tag:security 🛡️
tag:stale
tag:waiting-for-assignee
type:bug
type:documentation
type:enhancement
type:meta
type:ux
user:cli
user:web
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/shiori#285
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @leafee98 on GitHub (Aug 4, 2022).
Original GitHub issue: https://github.com/go-shiori/shiori/issues/459
Step to reproduce:
shiori serveand loginUpdate archiveon the saved bookmark, the optionsKeep the old title and excerptandUpdate archive as wellis not necessary to check or uncheck.connection refused, the shiori will crash immediately.Log is following:
The results is same when the error message is
i/o timeout,read: connection reset by peerorconnection refusedlike above.Version
shiori_1.5.3_Linux_x86_64.tar.gzfrom GitHub release page.@leafee98 commented on GitHub (Aug 4, 2022):
After crash and restart shiori, there is no offline save or archive for the crashed bookmark. And click
Update archivewill do nothing, no offline save or archive will be created, and shiori will not crash again for this one bookmark.@hulb commented on GitHub (Oct 9, 2022):
@leafee98 Does this issue still exist in the latest release? I try to reproduce it but it seems the issue is gone.
@leafee98 commented on GitHub (Oct 9, 2022):
I think it still exist, I'm on commit
d15dc186741c8b8c37949e8b0ef6e7e6273714e8.I build the shiori by run
go get -u -v github.com/go-shiori/shioriand thengo build, and get binaryshiori.After configuring database with MariaDB by environment variables like follows.
Run
./shiori --portable migrateand./shiori --portable serve.Then login the web UI and type an inaccessible URL like
http://localhost:2323, and I got the final crash log.If there are any wrong in my building steps or configuration or usage, let me know.
@hulb commented on GitHub (Oct 9, 2022):
@leafee98 thx, I see. There is an issue there. But it may not causes the main process crash and exit, it should only crash the goroutine.It's nothing to do with your configuration. You could simply add a
returnafterinternal/webserver/handler-api.go:340to fix it. But yes, somewhere nearby the same issue will cause the main process crash.@fmartingr commented on GitHub (Oct 9, 2022):
There's an insane abuse of
panicthrough all the code, so most of things that can fail just panics. For CLI users it may be ok depending on what it is, but for server users mean a restart of the service, losing the session, etc etc. Error handling and logging requires huge improvements.@hulb commented on GitHub (Oct 9, 2022):
agree. Panic should be more careful. At present, the web controller layer uses panic to throw out an err and handles it in a recover middlerware. I think it's quite normal, since the err handling in go is annoying.
@hulb commented on GitHub (Oct 9, 2022):
Maybe a more elegant way is to implement a
fail(w *http.Response, err error)function to handle all expected server err and return a more friendly response.