Title: auth failure obscured by NullPointerException from checkForDockerSwarmResponse in PullImageResultCallback · Issue #2465 · docker-java/docker-java · GitHub
Open Graph Title: auth failure obscured by NullPointerException from checkForDockerSwarmResponse in PullImageResultCallback · Issue #2465 · docker-java/docker-java
X Title: auth failure obscured by NullPointerException from checkForDockerSwarmResponse in PullImageResultCallback · Issue #2465 · docker-java/docker-java
Description: With invalid auth, the PullImageResultCallback creates PullResponseItem with error e.g. initializing source xyz: unable to retrieve auth token: invalid username/password: unauthorized: incorrect username or password and corresponding err...
Open Graph Description: With invalid auth, the PullImageResultCallback creates PullResponseItem with error e.g. initializing source xyz: unable to retrieve auth token: invalid username/password: unauthorized: incorrect us...
X Description: With invalid auth, the PullImageResultCallback creates PullResponseItem with error e.g. initializing source xyz: unable to retrieve auth token: invalid username/password: unauthorized: incorrect us...
Opengraph URL: https://github.com/docker-java/docker-java/issues/2465
X: @github
Domain: patch-diff.githubusercontent.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"auth failure obscured by NullPointerException from checkForDockerSwarmResponse in PullImageResultCallback","articleBody":"With invalid auth, the `PullImageResultCallback` creates `PullResponseItem` with `error` e.g. `initializing source xyz: unable to retrieve auth token: invalid username/password: unauthorized: incorrect username or password` and corresponding `errorDetail`. However, when the `onNext` triggers, it has\n```\n if (this.results == null \u0026\u0026 this.latestItem == null) {\n this.checkForDockerSwarmResponse(item);\n }\n```\nwhich actually triggers always for failed auth - and that check has\n```\n if (item.getStatus().matches(\"Pulling\\\\s.+\\\\.{3}$\")) {\n```\ncheck, which, in case of failed auth, throws NPEx due to `item.getStatus()` returning null.\n\nCode reference: https://github.com/docker-java/docker-java/blob/main/docker-java-api/src/main/java/com/github/dockerjava/api/command/PullImageResultCallback.java#L48\n\nWhile the flow is failed anyway in the case of failed auth, figuring \"what happened\"/debugging it successfully gets extremely hard, and prevents any graceful recovery later on (TBH catching and providing logic for any NPEx in Gradle build flows is really problematic), especially since docker-java is often consumed by other libraries, which can't really handle this in any reasonable way.\n\nSince the current logic for detecting swarm is based on `status` field anyway, I'd just add a short-circuit null guard to the check, e.g.\n```\n if (item.getStatus() != null \u0026\u0026 item.getStatus().matches(\"Pulling\\\\s.+\\\\.{3}$\")) {\n```\n\nAn additional bonus for this fix would be that we'd have `LOGGER.debug(\"{}\", item);` from `onNext` to actually execute (now it doesn't due to the NPEx), so it would be even easier to figure what's going on here.\n","author":{"url":"https://github.com/FyiurAmron","@type":"Person","name":"FyiurAmron"},"datePublished":"2025-06-27T13:14:04.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":0},"url":"https://github.com/2465/docker-java/issues/2465"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:8afa7a65-2a9a-b083-a23c-acd3455c3430 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | C324:3A114F:A83C1E:E3DCC9:6971C8D4 |
| html-safe-nonce | 91c431fd0597e48a3e040ac35dc26e93f205b5d43ae9a6288d8e4a357069705e |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDMzI0OjNBMTE0RjpBODNDMUU6RTNEQ0M5OjY5NzFDOEQ0IiwidmlzaXRvcl9pZCI6IjQxNjMzMTI3ODkwNzE0NDgyNzYiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | c88b69c4b62c568d1f87e2e4f3b605a02b85b20eb1ac64325d45d1564023be01 |
| hovercard-subject-tag | issue:3182797782 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/docker-java/docker-java/2465/issue_layout |
| twitter:image | https://opengraph.githubassets.com/3992e3a2875f2af346f2e5324f290dd7f6532e5a2c9d402841095ef4b833cb96/docker-java/docker-java/issues/2465 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/3992e3a2875f2af346f2e5324f290dd7f6532e5a2c9d402841095ef4b833cb96/docker-java/docker-java/issues/2465 |
| og:image:alt | With invalid auth, the PullImageResultCallback creates PullResponseItem with error e.g. initializing source xyz: unable to retrieve auth token: invalid username/password: unauthorized: incorrect us... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | FyiurAmron |
| hostname | github.com |
| expected-hostname | github.com |
| None | ac615aa66802dad9a938c6abe95edf09ee43c0c7f508315b64b08612858ef32e |
| turbo-cache-control | no-preview |
| go-import | github.com/docker-java/docker-java git https://github.com/docker-java/docker-java.git |
| octolytics-dimension-user_id | 7772003 |
| octolytics-dimension-user_login | docker-java |
| octolytics-dimension-repository_id | 20415251 |
| octolytics-dimension-repository_nwo | docker-java/docker-java |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 20415251 |
| octolytics-dimension-repository_network_root_nwo | docker-java/docker-java |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 6b618569a5f93e0b31f97f620112341421ef5f69 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width