Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

hTryLock: lock already exists: /home/simon/.cabal/packages/hackage.haskell.org/hackage-security-lock #6222

Closed
sjakobi opened this issue Sep 2, 2019 · 15 comments

Comments

@sjakobi
Copy link
Member

sjakobi commented Sep 2, 2019

$ cabal install cabal2nix -w ghc-8.6.5
Resolving dependencies...
Build profile: -w ghc-8.6.5 -O1
In order, the following will be built (use -v for more details):
 - Glob-0.10.0 (lib) (requires build)
 - attoparsec-0.13.2.3 (lib) (requires build)
 - connection-0.3.1 (lib:connection) (requires download & build)
 - hopenssl-2.2.4 (lib) (requires download & build)
 - language-nix-2.1.0.1 (lib) (requires download & build)
 - tar-0.5.1.1 (lib) (requires download & build)
 - aeson-1.4.4.0 (lib) (requires build)
 - http-client-tls-0.3.5.3 (lib) (requires build)
 - yaml-0.11.1.2 (lib) (requires build)
 - hackage-db-2.0.1 (lib) (requires download & build)
 - distribution-nixpkgs-1.2 (lib) (requires download & build)
 - hpack-0.32.0 (lib) (requires download & build)
 - cabal2nix-2.14.4 (lib) (requires download & build)
 - cabal2nix-2.14.4 (exe:hackage2nix) (requires download & build)
 - cabal2nix-2.14.4 (exe:cabal2nix) (requires download & build)
Downloading  hopenssl-2.2.4
Starting     Glob-0.10.0 (lib)
Starting     attoparsec-0.13.2.3 (lib)
Downloaded   hopenssl-2.2.4
Downloading  tar-0.5.1.1
Starting     hopenssl-2.2.4 (lib)
Building     Glob-0.10.0 (lib)
Building     attoparsec-0.13.2.3 (lib)
Downloaded   tar-0.5.1.1
Downloading  connection-0.3.1
Starting     tar-0.5.1.1 (lib)
Downloading  hackage-db-2.0.1
Building     hopenssl-2.2.4 (lib)
Building     tar-0.5.1.1 (lib)
Downloading  hpack-0.32.0
Installing   hopenssl-2.2.4 (lib)
Installing   Glob-0.10.0 (lib)
Completed    hopenssl-2.2.4 (lib)
Downloading  language-nix-2.1.0.1
Completed    Glob-0.10.0 (lib)
Downloading  distribution-nixpkgs-1.2
Downloading  cabal2nix-2.14.4
Installing   tar-0.5.1.1 (lib)
Completed    tar-0.5.1.1 (lib)
Installing   attoparsec-0.13.2.3 (lib)
Completed    attoparsec-0.13.2.3 (lib)
cabal: Failed to download connection-0.3.1 (which is required by
exe:hackage2nix from cabal2nix-2.14.4 and exe:cabal2nix from
cabal2nix-2.14.4). The exception was:
user error (hTryLock: lock already exists:
/home/simon/.cabal/packages/hackage.haskell.org/hackage-security-lock)
Failed to download language-nix-2.1.0.1 (which is required by exe:hackage2nix
from cabal2nix-2.14.4 and exe:cabal2nix from cabal2nix-2.14.4). The exception
was:
user error (hTryLock: lock already exists:
/home/simon/.cabal/packages/hackage.haskell.org/hackage-security-lock)

Re-running the same command then succeeded.

This seems related to #4960, but in my case there was no second cabal process downloading packages, only a long-running cabal repl.

$ cabal --version
cabal-install version 3.1.0.0
compiled using version 3.1.0.0 of the Cabal library

(This is the current cabal-install-head from hvr's repo.)

@23Skidoo
Copy link
Member

23Skidoo commented Sep 2, 2019

How often does this happen?

@sjakobi
Copy link
Member Author

sjakobi commented Sep 2, 2019

How often does this happen?

This was the first time for me.

@23Skidoo
Copy link
Member

23Skidoo commented Sep 2, 2019

I think that the package downloading code has some parallelism in it, maybe there's a deadlock in it somewhere.

@bgamari
Copy link
Contributor

bgamari commented Oct 12, 2019

Indeed I am also seeing this in the new head.hackage CI infrastructure. It happens most builds (perhaps exacerbated by the fact that we build multiple projects concurrently).

@mpickering
Copy link
Collaborator

I've also seen this happen on GHC CI.

@phadej
Copy link
Collaborator

phadej commented Oct 16, 2019

May or may not be fixed when haskell/hackage-security#228 is resolved.

@bgamari
Copy link
Contributor

bgamari commented Oct 18, 2019

@phadej I doubt haskell/hackage-security#228 will affect this. Afterall, the locking implementation from base is already used when it's available. That issue will only affect the fallback path.

@bgamari
Copy link
Contributor

bgamari commented Oct 18, 2019

Alright, with the help of @gbaz and @dcoutts I've fixed the likely cause of this in haskell/hackage-security#230.

@bgamari
Copy link
Contributor

bgamari commented Oct 21, 2019

I believe this should be fixed with the next hackage-security release.

@hvr
Copy link
Member

hvr commented Oct 24, 2019

I believe this should be fixed with the next hackage-security release.

Which will also require a new cabal release... ;-)

@hanshoglund
Copy link
Contributor

hanshoglund commented Jan 6, 2020

Also seing this intermittently when running cabal build in a fresh environment, for example https://app.circleci.com/jobs/github/hanshoglund/music-suite/94

@phadej
Copy link
Collaborator

phadej commented Jan 6, 2020 via email

@hanshoglund
Copy link
Contributor

That page is unviewable

Thanks, seems I have a CircleCI issue. Anyway error message is the same as above.

@phadej
Copy link
Collaborator

phadej commented Feb 21, 2020

should be fixed in 3.0.1.0 / 3.2.0.0 (see -rc tags).

@phadej phadej closed this as completed Feb 21, 2020
@symbiont-sam-halliday
Copy link

Great work finding the cause! 👏 Is there an ETA for a 3.0.1.0 release?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants