superseriousbusiness / gotosocial

Fast, fun, small ActivityPub server.
https://docs.gotosocial.org
GNU Affero General Public License v3.0
3.61k stars 304 forks source link

[bug] Using NFS mounts for storage doesn't work #1011

Closed hnrd closed 1 year ago

hnrd commented 1 year ago

Describe the bug with a clear and concise description of what the bug is.

Placing the storage directory on a NFS mount results in error creating storage backend: bad file descriptor

What's your GoToSocial Version?

0.5.2, 0.5.1-SNAPSHOT@ad08c6c22987d31d9ead0429aae5fb84555b3cc2

GoToSocial Arch

amd64 docker

Browser version

No response

What happened?

To research #950 I built a test setup without k8s, just starting GoToSocial locally and using a NFS share for it's storage. This results in the same error, the storage backend errors out:

$ docker run --rm -v /mnt/nfs/gotosoc-data:/gotosocial/storage -e GTS_HOST="gts.local" -e GTS_ACCOUNT_DOMAIN="gts.local" -e GTS_DB_TYPE="sqlite" -e GTS_DB_ADDRESS=":memory:" -e GTS_LOG_LEVEL="debug" superseriousbusiness/gotosocial:0.5.2
timestamp="09/11/2022 17:00:04.441" func=bundb.sqliteConn level=INFO msg="using in-memory database address file:0d0720fc-121f-4a0a-ad59-29fb092b1a44?mode=memory&cache=shared"
timestamp="09/11/2022 17:00:04.441" func=bundb.sqliteConn level=WARN msg="sqlite in-memory database should only be used for debugging"
timestamp="09/11/2022 17:00:04.442" func=bundb.sqliteConn level=INFO msg="connected to SQLITE database"
2022/11/09 17:00:04 error executing command: error creating dbservice: db migration error: error creating storage backend: bad file descriptor

What you expected to happen?

The service to initialize the storage system.

How to reproduce it?

see docker command above. I also ran the gotosocial binary without docker to the same (erroneous) result.

Anything else we need to know?

These are the NFS mount options:

server.local:/export/nfs on /mnt/nfs type nfs4 (rw,relatime,vers=4.2,rsize=1048576,wsize=1048576,namlen=255,hard,proto=tcp,timeo=600,retrans=2,sec=sys,clientaddr=172.27.32.70,fsc,local_lock=none,addr=172.27.32.80)

This is how the storage directory looks after the crash:

$ ls -al gotosoc-data/
total 1548
drwxrwxrwx   2 user  user     3 Nov 10 10:25 .
drwxr-xr-x 101 user  user   185 Nov 10 10:25 ..
-rw-r--r--   1 nobody nogroup   0 Nov 10 10:25 store.lock
tsmethurst commented 1 year ago

Duplicate of https://github.com/superseriousbusiness/gotosocial/issues/950

tsmethurst commented 1 year ago

Oh i'm sorry. I closed it as a duplicate but it's not exactly, just caused by the same underlying issue. Feel free to reopen if you like :)

hnrd commented 1 year ago

It's fine to close. I just wanted to document findings a bit more, as it's not really related to k8s :)