[GH-ISSUE #465] java.lang.NoClassDefFoundError: Could not initialize class com.github.dockerjava.transport.DomainSocket #163

Closed
opened 2026-02-26 04:34:15 +03:00 by kerem · 0 comments
Owner

Originally created by @mageddo on GitHub (Jun 10, 2024).
Original GitHub issue: https://github.com/mageddo/dns-proxy-server/issues/465

What is Happening / What is expected

Docker socket is not volumed, then DPS container can't connect to docker and check it is running inside a container, the error Could not initialize class com.github.dockerjava.transport.DomainSocket is not suggestive for the root cause.

dps-1  | 11:29:55.831 [Thread-2       ] WAR c.m.d.dnsconfigurator.DnsConfigurators            l=59   m=lambda$configurationHook$0      status=failedToConfigureAsDefaultDns, path=/host/etc/systemd/resolved.conf,/host/etc/resolv.conf,/etc/systemd/resolved.conf,/etc/resolv.conf, msg=Could not initialize class com.github.dockerjava.transport.DomainSocket
dps-1  | java.lang.NoClassDefFoundError: Could not initialize class com.github.dockerjava.transport.DomainSocket

Logs attached
logs.txt

Specs

services:
  dps:
    image: defreitas/dns-proxy-server:3.19.1-snapshot
    command: --web-server-port 80
    volumes:
      - dps_vol:/app/conf

volumes: 
  dps_vol:

Changes

  • DnsConfigurators can't fail just because DPS can't connect to docker API
  • When failing to connect to docker API, thrown a more suggestive error, create a interceptor which always check docker connection before request docker via API
Originally created by @mageddo on GitHub (Jun 10, 2024). Original GitHub issue: https://github.com/mageddo/dns-proxy-server/issues/465 ### What is Happening / What is expected Docker socket is not volumed, then DPS container can't connect to docker and check it is running inside a container, the error `Could not initialize class com.github.dockerjava.transport.DomainSocket` is not suggestive for the root cause. ``` dps-1 | 11:29:55.831 [Thread-2 ] WAR c.m.d.dnsconfigurator.DnsConfigurators l=59 m=lambda$configurationHook$0 status=failedToConfigureAsDefaultDns, path=/host/etc/systemd/resolved.conf,/host/etc/resolv.conf,/etc/systemd/resolved.conf,/etc/resolv.conf, msg=Could not initialize class com.github.dockerjava.transport.DomainSocket dps-1 | java.lang.NoClassDefFoundError: Could not initialize class com.github.dockerjava.transport.DomainSocket ``` Logs attached [logs.txt](https://github.com/user-attachments/files/15764938/logs.txt) ### Specs ```yaml services: dps: image: defreitas/dns-proxy-server:3.19.1-snapshot command: --web-server-port 80 volumes: - dps_vol:/app/conf volumes: dps_vol: ``` ### Changes * DnsConfigurators can't fail just because DPS can't connect to docker API * When failing to connect to docker API, thrown a more suggestive error, create a interceptor which always check docker connection before request docker via API
kerem 2026-02-26 04:34:15 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/dns-proxy-server-mageddo#163
No description provided.