You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
v0.14.0 added the ability to listen on a Unix socket, but it is not possible to reproducibly/cleanly use it (i.e. in a docker container) because --init-db and db migrate fail because they both call shutdown() which tries to remove the socket file that was never set up.
This causes upgrades (db migrations) to print an error and os.Exit(1) on installations that are using a socket, even if the migration is successful. Expected behavior is to not exit with a failure code on non-failures.
Should being unable to delete the socket file be a fatal error? Or can paths that don't set up the listener, and aren't supposed to set up the listener, be changed to not try to remove it?
root@f8dcc12ce2f8:/tmp/writefreely# ./writefreely db migrate
2024/02/04 14:59:49 Loading config.ini configuration...
2024/02/04 14:59:49 Connecting to sqlite3 database...
2024/02/04 14:59:49 Migrating to V13: support newsletters
2024/02/04 14:59:49 Migrating to V14: support password resetting
2024/02/04 14:59:49 Migrating to V15: speed up blog post retrieval
2024/02/04 14:59:49 Closing database connection...
2024/02/04 14:59:49 Removing socket file...
ERROR: 2024/02/04 14:59:49 app.go:876: Unable to remove socket: remove /tmp/writef.sock: no such file or directory
root@f8dcc12ce2f8:/tmp/writefreely# echo $?
1
Describe the bug
v0.14.0 added the ability to listen on a Unix socket, but it is not possible to reproducibly/cleanly use it (i.e. in a docker container) because
--init-db
anddb migrate
fail because they both callshutdown()
which tries to remove the socket file that was never set up.writefreely/app.go
Line 732 in 4aad033
writefreely/app.go
Line 744 in 4aad033
Other locations may also do this (ResetPassword?).
Steps to reproduce (if necessary)
Start from a clean directory/image - example:
docker run -it --rm ubuntu:22.04
Run the following to reliably reproduce:
The important part being: create a config that uses a socket file, then try to initialize the database.
Alternate repro: take an existing working setup that uses a socket, and try to run
writefreely db migrate
.The logs in the migrate case are shorter and look like this:
Expected behavior
writefreely starts up using a socket for HTTP connections. db migrations/inits don't fail on a missing HTTP socket file.
Application configuration
Version or last commit:
0.14.0
cc: @clarfonthey
The text was updated successfully, but these errors were encountered: