This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
Hi, i am trying to build Docker for my Clojure code and on "RUN lein deps" I get this error to all of my dependencies:
Could not transfer artifact org.clojure:clojure:jar:1.11.1 from/to central ( ): transfer failed for
I am not behind a proxy, tried different networks as well and running the code out of docker build do workthe .m2 directory is not created as the build fails. this is the full error:
RUN lein deps:
3.057 Could not transfer artifact com.layerware:hugsql:jar:0.5.1 from/to central ( ): transfer failed for
3.057 Could not transfer artifact com.layerware:hugsql:jar:0.5.1 from/to clojars ( ): transfer failed for
3.057 Could not transfer artifact compojure:compojure:jar:1.6.1 from/to central ( ): transfer failed for
3.057 Could not transfer artifact compojure:compojure:jar:1.6.1 from/to clojars ( ): transfer failed for
3.057 Could not transfer artifact http-kit:http-kit:jar:2.3.0 from/to central ( ): transfer failed for
3.057 Could not transfer artifact http-kit:http-kit:jar:2.3.0 from/to clojars ( ): transfer failed for
3.058 Could not transfer artifact ring:ring-defaults:jar:0.3.2 from/to central ( ): transfer failed for
3.058 Could not transfer artifact ring:ring-defaults:jar:0.3.2 from/to clojars ( ): transfer failed for
3.058 Could not transfer artifact ring:ring-core:jar:1.10.0 from/to central ( ): transfer failed for
3.058 Could not transfer artifact ring:ring-core:jar:1.10.0 from/to clojars ( ): transfer failed for
3.058 Could not transfer artifact ring:ring-jetty-adapter:jar:1.8.1 from/to central ( ): transfer failed for
3.058 Could not transfer artifact ring:ring-jetty-adapter:jar:1.8.1 from/to clojars ( ): transfer failed for
3.058 Could not transfer artifact ring:ring-codec:jar:1.2.0 from/to central ( ): transfer failed for
3.058 Could not transfer artifact ring:ring-codec:jar:1.2.0 from/to clojars ( ): transfer failed for
3.059 Could not transfer artifact org.clojure:data.json:jar:0.2.6 from/to central ( ): transfer failed for
3.059 Could not transfer artifact org.clojure:data.json:jar:0.2.6 from/to clojars ( ): transfer failed for
3.059 Could not transfer artifact com.microsoft.sqlserver:mssql-jdbc:jar:12.4.1.jre11 from/to central ( ): transfer failed for
3.059 Could not transfer artifact com.microsoft.sqlserver:mssql-jdbc:jar:12.4.1.jre11 from/to clojars ( ): transfer failed for
3.059 Could not transfer artifact clj-http:clj-http:jar:3.12.3 from/to central ( ): transfer failed for
3.059 Could not transfer artifact clj-http:clj-http:jar:3.12.3 from/to clojars ( ): transfer failed for
3.060 Could not transfer artifact hiccup:hiccup:jar:2.0.0-RC2 from/to central ( ): transfer failed for
3.060 Could not transfer artifact hiccup:hiccup:jar:2.0.0-RC2 from/to clojars ( ): transfer failed for
3.060 Failed to read artifact descriptor for com.layerware:hugsql:jar:0.5.1
3.060 Failed to read artifact descriptor for compojure:compojure:jar:1.6.1
3.060 Failed to read artifact descriptor for http-kit:http-kit:jar:2.3.0
3.060 Failed to read artifact descriptor for ring:ring-defaults:jar:0.3.2
3.060 Failed to read artifact descriptor for ring:ring-core:jar:1.10.0
3.060 Failed to read artifact descriptor for ring:ring-jetty-adapter:jar:1.8.1
3.060 Failed to read artifact descriptor for ring:ring-codec:jar:1.2.0
3.061 Failed to read artifact descriptor for org.clojure:data.json:jar:0.2.6
3.061 Failed to read artifact descriptor for com.microsoft.sqlserver:mssql-jdbc:jar:12.4.1.jre11
3.061 Failed to read artifact descriptor for clj-http:clj-http:jar:3.12.3
3.061 Failed to read artifact descriptor for hiccup:hiccup:jar:2.0.0-RC2
3.061 This could be due to a typo in :dependencies, file system permissions, or network issues.
3.061 If you are behind a proxy, try setting the 'http_proxy' environment variable.
------
Dockerfile:16
--------------------
14 | WORKDIR /usr/src/app
15 | COPY project.clj /usr/src/app/
16 | >>> RUN lein deps
17 | COPY . /usr/src/app
18 | RUN mv "$(lein uberjar | sed -n 's/^Created \(.*standalone\.jar\)/\1/p')" app-standalone.jar
--------------------
ERROR: failed to solve: process "/bin/sh -c lein deps" did not complete successfully: exit code: 1
I don't know Lein but lein deps
seems to be trimming the errors, not letting you see the full context.
Perhaps there's some flag that prints out more verbose error messages.
thats pretty irrelevant. other tasks just also run it and would fail in the same way.
I'm guessing something with the docker network setup prevents proper https transfers in some way
You get the same exact "Could not transfer artifact" error if .m2
is not writable, which is trivial to achieve with some bad volume configuration or running something as root that creates .m2
.
i am using the lein deps
to preload all dependencies so i will get better run time for the docker but when i build the docker without preloading dependencies the docker is created and i get the same errors when running it
lein deps
running outside the container doesn't help anything inside the container. they won't see each other
this one works on build but fails on run:
FROM clojure:lein-2.10.0
COPY . /usr/src/app
WORKDIR /usr/src/app
CMD ["lein", "run"]
this one fails on build:
FROM clojure:lein-2.10.0
RUN mkdir -p /usr/src/app
WORKDIR /usr/src/app
COPY project.clj /usr/src/app/
RUN lein deps
COPY . /usr/src/app
RUN mv "$(lein uberjar | sed -n 's/^Created \(.*standalone\.jar\)/\1/p')" app-standalone.jar
CMD ["java", "-jar", "app-standalone.jar"]
Try running run -it --rm clojure:lein-2.10.0 bash
.
When you get to the prompt, first run
cat <<EOF > project.clj
(defproject my-stuff "0.1.0-SNAPSHOT"
:description "FIXME: write description"
:url ""
:license {:name "Eclipse Public License"
:url ""}
:dependencies [[org.clojure/clojure "1.8.0"]]
:main ^:skip-aot my-stuff.core
:target-path "target/%s"
:profiles {:uberjar {:aot :all}})
EOF
Then run lein deps
. Does that work?tried it, i get the same error:
Could not transfer artifact org.clojure:clojure:jar:1.8.0 from/to central ( ): transfer failed for
Could not transfer artifact org.clojure:clojure:jar:1.8.0 from/to clojars ( ): transfer failed for
Failed to read artifact descriptor for org.clojure:clojure:jar:1.8.0
This could be due to a typo in :dependencies, file system permissions, or network issues.
If you are behind a proxy, try setting the 'http_proxy' environment variable
when running the above it gives me 404 not found
but when drooping the --output /dev/null
it works
sorry I was running it in postman and i got 200 on running the http, when running it in Git Bash I get this:
$ curl --output /dev/null
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0
curl: (35) schannel: next InitializeSecurityContext failed: CRYPT_E_NO_REVOCATION_CHECK (0x80092012) - The revocation function was unable to check revocation for the certificate.
Something wrong with your setup. I don't know what. Have you ever fiddled with root HTTPS certificates?
no i haven't on which setup you are referring? Docker?
i was able to run it with --ssl-no-revoke
$ curl --ssl-no-revoke --output /dev/null
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 3537k 100 3537k 0 0 510k 0 0:00:06 0:00:06 --:--:-- 777k
That's a band-aid, not a solution. You should figure out why it happens in the first place. Maybe you have some weird antivirus that does that. Maybe something or someone has replaced your root certificates (which would be a terrible thing). SSL errors are not a thing you should just ignore.
Many organizations use firewall systems with SSL Inspection, introducing additional certificates. VMs and Containers usually come with their own certificate trust store and rightfully complain. Whenever I have to locally test a container I have to install the corporate certificates e.g. with java keystore or debian ca-certificates during container build to get it working and not see similar issues.