commercialhaskell / commercialhaskell/stack
Stack crashes with "SQLite3 returned ErrorReadOnly ..." on every build
- Dominant language
- Haskell
- Stars
- 4.1k
- Forks
- 850
- Avg merge
- 10h 37m
- Merged PRs (30d)
- 4
Description
### General summary/comments
Whenever I try to build any stack project on one of my Windows machines, I get the following error (usually 7 copies of it):
```
SQLite3 returned ErrorReadOnly while attempting to perform step: attempt to write a readonly database
```
I've tried nuking the stack root directory, uninstalling and reinstalling stack, and deleting the .stack-work/ directories. I've also tried making sure any possibly relevant file in local .stack-work/ and in stack root are not read-only, which had no effect. After deleting .stack-work/ directories, I start getting this error:
```
Encountered error while migrating Stack database:
SQLite3 returned ErrorReadOnly while attempting to perform step: attempt to write a readonly database
Please report this on https://github.com/commercialhaskell/stack/issues
As a workaround you may delete Stack database in C:\\.stack-work\stack.sqlite3 triggering its recreation.
```
The file `.stack-work\stack.sqlite3` didn't exist before executing `stack build` and still does not exist after.
I'm not sure exactly how to reproduce this. On one of my windows machines, it happens consistently and persistently no matter what I do. On the other one, I've never had a problem.
I have the official 2.5.1 binary which was initially installed via `stack upgrade` but was reinstalled today from the installer in the user guide.
Contributor guide
Assessment
This issue has not been assessed yet.