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
{{ message }}
Repository navigation
Can no longer compile two things at once with 2.1.1 from 1.9.3 #4876
It used to be fine compiling a project in different .stack-work directories or different projects at the same time.
After upgrading to stack 2.1.1 I can't even build different projets at the same time let a long the same project.
Just get this error until the first build has finished. After that I can try build the second project.
This makes stack unusable on CI, and pretty awful to use locally with multiple projects.
Encountered error while migrating Pantry database:
SQLite3 returned ErrorProtocol while attempting to perform prepare "PRAGMA journal_mode=WAL;": locking protocol
Please report this on https://github.com/commercialhaskell/stack/issues
As a workaround you may delete Pantry database in /home/david/.stack/pantry/pantry.sqlite3 triggering its recreation.
changed the title [-]Can no longer compile two thing at once with 2.1.1 from 1.9.3[/-][+]Can no longer compile two things at once with 2.1.1 from 1.9.3[/+]on Jun 17, 2019
Oh, that's annoying, it certainly would be nice for Stack to work out of the box on WSL. Looks like WAL is enabled by default in persistent-sqlite, but does provide an option to disable it. @snoyberg Can you think of any downside for Stack/Pantry to disable WAL by default? Alternatively, we could provide a configuration option to disable it.
I'm seeing this same issue running on MacOS with docker. 2.1.1 works locally on MacOS, but in the docker image (latest fpco/stack-build) stack build fails with this message.
@borsboom@snoyberg A comment in microsoft/WSL#2395 says that disabling WAL will not fix the issue, just make it happen less often. Someone else reports working around it by introducing a delay to avoid the race condition. The core issue is microsoft/WSL#1927. This was reported more than two years ago, but so far still no response from Microsoft.
EDIT: Looks like the MS WSL team is focusing on WSL2 now.
I think disabling WAL by default is the right choice anyway (since it also can cause problems on network filesystems and with Docker for Mac).
I think it's out of scope for Stack to do anything more to work around this issue. SQLite is hardly an esoteric choice for local data storage, and if Microsoft purports Linux compatibility it really should work out of the box. Adding 0.1 second delays before writing to the DB, as suggested in one comment, would be terrible for performance (and I suspect just makes the problem less likely).
Activity
[-]Can no longer compile two thing at once with 2.1.1 from 1.9.3[/-][+]Can no longer compile two things at once with 2.1.1 from 1.9.3[/+]dten commentedon Jun 17, 2019
Tried this on some colleagues' machines, seems like it's to do with WSL 😿 p.s. i'm on WSL Ubuntu 18.04
dten commentedon Jun 17, 2019
The internet says WAL is broken on WSL, is there a choice to not use WAL :)?
borsboom commentedon Jun 24, 2019
Oh, that's annoying, it certainly would be nice for Stack to work out of the box on WSL. Looks like WAL is enabled by default in
persistent-sqlite, but does provide an option to disable it. @snoyberg Can you think of any downside for Stack/Pantry to disable WAL by default? Alternatively, we could provide a configuration option to disable it.igraves commentedon Jun 24, 2019
I'm seeing this same issue running on MacOS with docker.
2.1.1works locally on MacOS, but in the docker image (latest fpco/stack-build)stack buildfails with this message.jihygk commentedon Jun 27, 2019
Also encountering this on OS X with the docker build on 2.1.1. Went back to 1.9.3 and it was working again.
borsboom commentedon Jun 27, 2019
Strange, I don't seem to be able to reproduce this on macOS (using the current stable version of Docker for Mac).
Disable WAL mode for SQLite databases (fixes #4876)
borsboom commentedon Jun 27, 2019
Pull request that disables WAL mode for new databases: #4915
Merge pull request #4915 from commercialhaskell/disable-sqlite-wal
ygale commentedon Jul 24, 2019
@borsboom @snoyberg A comment in microsoft/WSL#2395 says that disabling WAL will not fix the issue, just make it happen less often. Someone else reports working around it by introducing a delay to avoid the race condition. The core issue is microsoft/WSL#1927. This was reported more than two years ago, but so far still no response from Microsoft.
EDIT: Looks like the MS WSL team is focusing on WSL2 now.
borsboom commentedon Jul 24, 2019
I think disabling WAL by default is the right choice anyway (since it also can cause problems on network filesystems and with Docker for Mac).
I think it's out of scope for Stack to do anything more to work around this issue. SQLite is hardly an esoteric choice for local data storage, and if Microsoft purports Linux compatibility it really should work out of the box. Adding 0.1 second delays before writing to the DB, as suggested in one comment, would be terrible for performance (and I suspect just makes the problem less likely).
ygale commentedon Aug 4, 2019
@borsboom Agreed. And this is anyway fixed in WSL2. Thanks!