Welcome! Please see the About page for a little more info on how this works.

+5 votes
in tools.deps by
retagged by

depes.edn:

{:deps {org.deeplearning4j/deeplearning4j-nlp {:mvn/version "1.0.0-M2.1"}}}

It happened before in an older Clojure version, but disappeared, see here:

https://clojurians-log.clojureverse.org/tools-deps/2021-09-16

Now I have it back with a recent clojure CLI:
1.11.1.1200

The workarround is still to limit the number of download threads;

clj -Sthreads 1

So it only happens to me using (the default) multi-threaded downloading.

2 Answers

+2 votes
by

I haven't been able to reproduce this and haven't had any other reports from anyone on this for a while, so not going to create a ticket for now.

by
I cannot reproduce neither from work, on a fast network.
I will try again from home later, on a slow line.
by
I can reproduce it  by limiting the bandwidth of my work machine.

So first running:

sudo wondershaper -a eth0 -d 1024 -u 1024

to limit download bandwith to 1MBit/s

and then starting the clj from latest Clojure Docker image

docker run -ti clojure clj -Sdeps '{:deps {org.deeplearning4j/deeplearning4j-nlp {:mvn/version "1.0.0-M2.1"}}}'


fails with:


Downloading: com/twelvemonkeys/imageio/imageio-bmp/3.1.1/imageio-bmp-3.1.1.jar from central
Downloading: org/bytedeco/javacpp/1.5.7/javacpp-1.5.7-linux-arm64.jar from central
Error building classpath. Could not acquire write lock for 'artifact:org.bytedeco:leptonica:1.82.0-1.5.7'
java.lang.IllegalStateException: Could not acquire write lock for 'artifact:org.bytedeco:leptonica:1.82.0-1.5.7'
        at org.eclipse.aether.internal.impl.synccontext.named.NamedLockFactoryAdapter$AdaptedLockSyncContext.acquire(N
by
Thanks, I think I understand why we're seeing this again and have some things to look at
0 votes
by
by
The problem is still present on Clojure 1.12:
Only sometimes, as before.

[2024-09-09T21:19:21.048Z] Downloading: org/bytedeco/mkl/2020.3-1.5.4/mkl-2020.3-1.5.4-linux-x86-redist.jar from central
[2024-09-09T21:19:22.032Z] Error building classpath. Could not acquire write lock for 'artifact:org.bytedeco:mkl:2020.3-1.5.4'
[2024-09-09T21:19:22.032Z] java.lang.IllegalStateException: Could not acquire write lock for 'artifact:org.bytedeco:mkl:2020.3-1.5.4'
    at org.eclipse.aether.internal.impl.synccontext.named.NamedLockFactoryAdapter$AdaptedLockSyncContext.acquire(NamedLockFactoryAdapter.java:165)
[2024-09-09T21:19:22.032Z]
    at org.eclipse.aether.internal.impl.DefaultArtifactResolver.resolveArtifacts(DefaultArtifactResolver.java:233)
    at org.eclipse.aether.internal.impl.DefaultArtifactResolver.resolveArtifact(DefaultArtifactResolver.java:212)
    at o
by
Yeah, I have a partially done upgrade to a new set of Maven libs that I think will help but it’s a big change.
by
In the context of Clojure in Docker, libraries get download  repeatedly.
So I see this "often", and using "-Sthreads 1" in Dockerfiles as default is for me know habit.
It happens far more often then any other random Docker build issue due to "bad network or similar".
So it is in my experience the number 1 reason of failing Docker builds.
I suppose "network issues" get retried in some from, this not.
by
hey, I was working on a different problem, may actually have fixed (or improved) this one as a side effect. There is a dev version of the CLI available, 1.12.0.1517, with the change. I plan to release it as stable on Monday but if you wanted to try it both with and without -Sthreads 1, that would be interesting feedback.
ago by
i've done some digging and left a comment on a maven related thread here:
https://github.com/apache/maven-mvnd/issues/836#issuecomment-3468472309

surprisingly, this problem seems to go away, if i remove the
`:mvn/repos {"datomic-cloud" {:url "s3://datomic-releases-1fc2183a/maven/releases"}}`
entry from our `deps.edn`.

what gave me this idea was noticing that the problematic lib (junit in our case)
was being pulled from both maven central and datomic-cloud:

```
Downloading: org/junit/junit-bom/5.10.0/junit-bom-5.10.0.pom from datomic-cloud
Downloading: org/junit/junit-bom/5.10.0/junit-bom-5.10.0.pom from central
Execution error (IllegalStateException) at org.eclipse.aether.internal.impl.synccontext.named.NamedLockFactoryAdapter$AdaptedLockSyncContext/acquire (NamedLockFactoryAdapter.java:165).
Could not acquire write lock for 'artifact:org.junit:junit-bom:5.10.0'
```

simply upgrading to the latest Clojure CLI version 1.12.3.1577 hasn't made any difference;
it failed the same way, as with version 1.12.0.1530, which is the version bundled with
the `cimg/clojure:1.12.0-openjdk-17.0-node` CircleCI Clojure convenience image
https://github.com/CircleCI-Public/cimg-clojure/blob/main/1.12/17.0/Dockerfile#L13
...