Skip to content

Can no longer compile two things at once with 2.1.1 from 1.9.3 #4876

Closed

Description

@dten

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.

Activity

  1. 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
  2. dten commented on Jun 17, 2019

    @dten
    ContributorAuthor

    Tried this on some colleagues' machines, seems like it's to do with WSL 😿 p.s. i'm on WSL Ubuntu 18.04

  3. dten commented on Jun 17, 2019

    @dten
    ContributorAuthor

    The internet says WAL is broken on WSL, is there a choice to not use WAL :)?

  4. borsboom commented on Jun 24, 2019

    @borsboom
    Contributor

    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.

  5. igraves commented on Jun 24, 2019

    @igraves

    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.

  6. jihygk commented on Jun 27, 2019

    @jihygk

    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.

  7. borsboom commented on Jun 27, 2019

    @borsboom
    Contributor

    Strange, I don't seem to be able to reproduce this on macOS (using the current stable version of Docker for Mac).

  8. added a commit that references this issue on Jun 27, 2019
    398f9fa
  9. borsboom commented on Jun 27, 2019

    @borsboom
    Contributor

    Pull request that disables WAL mode for new databases: #4915

  10. added a commit that references this issue on Jun 28, 2019
    93dfdf1
  11. ygale commented on Jul 24, 2019

    @ygale

    @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.

  12. borsboom commented on Jul 24, 2019

    @borsboom
    Contributor

    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).

  13. ygale commented on Aug 4, 2019

    @ygale

    @borsboom Agreed. And this is anyway fixed in WSL2. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions