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

No such file or directory (socket: /run/docker.sock) : exception while using the library #9

Open
nikita-bedmutha opened this issue Oct 9, 2020 · 1 comment
Assignees
Labels
question Further information is requested

Comments

@nikita-bedmutha
Copy link

Your Environment

The environment is the Kubernetes environment where we have jenkins slave pod which is spun up at runtime when a build job runs, this slave has a plugin which used docker-java-shaded library to tag the docker image. The docker socket /var/run/docker.sock is mounted to the pod from host machine. When the jenkins plugin running the docker-java lib is used and when it tries to tag the image, it fails with following error:

org.newsclub.net.unix.AFUNIXSocketException: No such file or directory (socket: /run/docker.sock)
at org.glassfish.jersey.apache.connector.ApacheConnector.apply(ApacheConnector.java:481)
at org.glassfish.jersey.client.ClientRuntime.invoke(ClientRuntime.java:252)
at org.glassfish.jersey.client.JerseyInvocation$1.call(JerseyInvocation.java:684)
at org.glassfish.jersey.client.JerseyInvocation$1.call(JerseyInvocation.java:681)
at org.glassfish.jersey.internal.Errors.process(Errors.java:315)
at org.glassfish.jersey.internal.Errors.process(Errors.java:297)
at org.glassfish.jersey.internal.Errors.process(Errors.java:228)
at org.glassfish.jersey.process.internal.RequestScope.runInScope(RequestScope.java:444)
at org.glassfish.jersey.client.JerseyInvocation.invoke(JerseyInvocation.java:681)
at org.glassfish.jersey.client.JerseyInvocation$Builder.method(JerseyInvocation.java:437)
at org.glassfish.jersey.client.JerseyInvocation$Builder.post(JerseyInvocation.java:343)
at com.github.dockerjava.jaxrs.AuthCmdExec.execute(AuthCmdExec.java:30)
at com.github.dockerjava.jaxrs.AuthCmdExec.execute(AuthCmdExec.java:17)
at com.github.dockerjava.jaxrs.AbstrSyncDockerCmdExec.exec(AbstrSyncDockerCmdExec.java:23)
at com.github.dockerjava.core.command.AbstrDockerCmd.exec(AbstrDockerCmd.java:35)
at com.github.dockerjava.core.command.AuthCmdImpl.exec(AuthCmdImpl.java:22)
at com.cj.adsystems.deployment.fargate.Deployer.setupDocker(Deployer.java:272)
at com.cj.adsystems.deployment.fargate.Deployer.deploy(Deployer.java:81)
at com.davidron.fargatedemo.Deploy.main(Deploy.java:16)
Caused by: org.newsclub.net.unix.AFUNIXSocketException: No such file or directory (socket: /run/docker.sock)

Can you please state any possible reasons for this error?

@cdancy cdancy added the question Further information is requested label Oct 9, 2020
@cdancy cdancy self-assigned this Oct 9, 2020
@cdancy
Copy link
Contributor

cdancy commented Oct 9, 2020

@nikita-bedmutha this project hasn't done a release in quite a while and so is many versions behind the upstream docker-java project.

With that said ... I'm not sure how you have configured the client. Did you define it to look for the docker socket at that location? If not can you try doing so and see what happens?

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

No branches or pull requests

2 participants