Closed anacrolix closed 4 years ago
"Unable to open database file" looks like a file permission error or a corrupted DB to me.
There's more:
--- FAIL: TestAppdirs (0.00s)
main_test.go:15: UserDataDir returned an unexpected value! `/Users/anacrolix/Library/Application Support/magneticod`
main_test.go:21: UserCacheDir returned an unexpected value! `/Users/anacrolix/Library/Caches/magneticod`
FAIL
@anacrolix Thank you for reporting this!
You can ignore the failing tests as they test the paths generated by Appdir package, but assumes linux by default so it fails on other platforms, which are now fixed. 5a869e127b11582275fbdae2543715d65e83c8f0
Can you try again with the latest version? I don't expect it to be resolved, but updated the dependencies which now emit more details.
@boramalper the new error message:
2020-02-24T11:33:47.441+1100 FATAL Could not open the database {"url": "sqlite3:///Users/anacrolix/Library/Application Support/magneticod/database.sqlite3?_journal_mode=WAL&_busy_timeout=3000&_foreign_keys=true", "error": "sql.DB.Ping: unable to open database file: no such file or directory", "errorVerbose": "unable to open database file: no such file or directory\nsql.DB.Ping\ngithub.com/boramalper/magnetico/pkg/persistence.makeSqlite3Database\n\t/Users/anacrolix/src/magnetico/pkg/persistence/sqlite3.go:51\ngithub.com/boramalper/magnetico/pkg/persistence.MakeDatabase\n\t/Users/anacrolix/src/magnetico/pkg/persistence/interface.go:114\nmain.main\n\t/Users/anacrolix/src/magnetico/cmd/magneticod/main.go:95\nruntime.main\n\t/Users/anacrolix/src/go1.13/src/runtime/proc.go:203\nruntime.goexit\n\t/Users/anacrolix/src/go1.13/src/runtime/asm_amd64.s:1357"}
The issue appears to be with the space in the file path given to sqlite3. AFAICT, there's some bad unexpected URI handling, or not, on the sqlite3 side. I'll submit a PR.
Works fine on Linux, but on MacOS, running magneticod I get:
Same error on
master
andv0.9.0
.