500 Internal Server Error when docker login
I ran nexus in docker.The image is sonatype/nexus3:3.81.1-alpine.
When I use command: docker login, the log showed:
2025-06-15 23:39:49,401+0000 WARN [qtp683327178-239] *SYSTEM org.eclipse.jetty.server.Response - writeError: status=500, message=java.lang.NullPointerException: Cannot invoke "org.eclipse.jetty.server.Request.getHeadersNanoTime()" because "request" is null, response=ErrorResponse@757ac2bc{500,GET@d79d22b http://docker.mookai.cn:9640/v2/ HTTP/1.1} java.lang.NullPointerException: Cannot invoke "org.eclipse.jetty.server.Request.getHeadersNanoTime()" because "request" is null at org.eclipse.jetty.server.Request.getTimeStamp(Request.java:241) at io.dropwizard.metrics.jetty12.AbstractInstrumentedHandler.handle(AbstractInstrumentedHandler.java:282) at org.sonatype.nexus.repository.docker.internal.DockerRequestHandler.handle(DockerRequestHandler.java:83) at org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:151) at org.eclipse.jetty.server.Server.handle(Server.java:182) at org.eclipse.jetty.server.internal.HttpChannelState$HandlerInvoker.run(HttpChannelState.java:662) at org.eclipse.jetty.server.internal.HttpConnection.onFillable(HttpConnection.java:416) at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:322) at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:99) at org.eclipse.jetty.io.SelectableChannelEndPoint$1.run(SelectableChannelEndPoint.java:53) at org.eclipse.jetty.util.thread.strategy.AdaptiveExecutionStrategy.runTask(AdaptiveExecutionStrategy.java:480) at org.eclipse.jetty.util.thread.strategy.AdaptiveExecutionStrategy.consumeTask(AdaptiveExecutionStrategy.java:443) at org.eclipse.jetty.util.thread.strategy.AdaptiveExecutionStrategy.tryProduce(AdaptiveExecutionStrategy.java:293) at org.eclipse.jetty.util.thread.strategy.AdaptiveExecutionStrategy.run(AdaptiveExecutionStrategy.java:201) at org.eclipse.jetty.util.thread.ReservedThreadExecutor$ReservedThread.run(ReservedThreadExecutor.java:311) at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:979) at org.eclipse.jetty.util.thread.QueuedThreadPool$Runner.doRunJob(QueuedThreadPool.java:1209) at org.eclipse.jetty.util.thread.QueuedThreadPool$Runner.run(QueuedThreadPool.java:1164) at java.base/java.lang.Thread.run(Thread.java:840)
For me there is the same problem
same problem!
same problem!
same problem!
same problem!
Tried with docker engine 27.5 and 28, broken for both.
Likely related to the Jetty 12 upgrade.
same problem
+1
Same issue
any update?
+1
Joining club
Still broken on 3.82.0-08 alpine.
It is also affecting /v1 REST endpoints, not only "docker login" command.
any workarounds for this?
yeah, I also have the same problem
My work around with nginx proxy is something like this, and this worked.
location /v2/ {
# Docker registry API workaround - rewrite /v2/ to /repository/docker/v2/
rewrite ^/v2/(.*)$ /repository/docker/v2/$1 break;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-Scheme $scheme;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Forwarded-For $remote_addr;
proxy_set_header X-Real-IP $remote_addr;
proxy_pass http://<IP>:8081;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $http_connection;
proxy_http_version 1.1;
}
Asked about this issue on the community forum: https://community.sonatype.com/t/3-81-3-82-ce-running-in-alpine-docker-has-major-jetty-12-problem/15289
yeah, I also have the same problem
My work around with nginx proxy is something like this, and this worked.
location /v2/ { # Docker registry API workaround - rewrite /v2/ to /repository/docker/v2/ rewrite ^/v2/(.*)$ /repository/docker/v2/$1 break; proxy_set_header Host $host; proxy_set_header X-Forwarded-Scheme $scheme; proxy_set_header X-Forwarded-Proto $scheme; proxy_set_header X-Forwarded-For $remote_addr; proxy_set_header X-Real-IP $remote_addr; proxy_pass http://<IP>:8081; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection $http_connection; proxy_http_version 1.1; }
In version 3.82.0-08, only v1 APIs appear in Settings→System→API, not v2. After slight modifications to your rewrite, it worked.
rewrite ^/v2/(.*)$ /repository/{your_repository_name}/v1/$1 break;
However, compatibility risks may exist since the docker client requests v2. This should hint at what's truly occurring; proceed with caution in your environment.
I struggled also with this issue and found the following post: https://stackoverflow.com/questions/49127414/docker-login-on-private-nexus-error-response-from-daemon-login-attempt-to-ht/49173667
Just enabled a separate HTTP connector on a different port and activated the docker bearer token realm - as described in the post. Now it works as expected.