testcontainers-java icon indicating copy to clipboard operation
testcontainers-java copied to clipboard

[Bug]:

Open stbischof opened this issue 1 year ago • 1 comments

Module

Core

Testcontainers version

1.20.2

Using the latest Testcontainers version?

Yes

Host OS

linux fedora silverblue

Host Arch

x64

Docker version

podman

What happened?

Exception while calc getMemTotel with null

Relevant log output

<<< ERROR: Cannot invoke "java.lang.Long.longValue()" because the return value of "com.github.dockerjava.api.model.Info.getMemTotal()" is null java.lang.NullPointerException: Cannot invoke "java.lang.Long.longValue()" because the return value of "com.github.dockerjava.api.model.Info.getMemTotal()" is null at org.testcontainers.DockerClientFactory.client(DockerClientFactory.java:228) at org.testcontainers.DockerClientFactory$1.getDockerClient(DockerClientFactory.java:108) at com.github.dockerjava.api.DockerClientDelegate.pingCmd(DockerClientDelegate.java:124)

Additional Information

    private static boolean tryOutStrategy(List<String> configurationFailures, DockerClientProviderStrategy strategy) {
        try {
            log.debug("Trying out strategy: {}", strategy.getClass().getSimpleName());

            if (!strategy.test()) {
                log.debug("strategy {} did not pass the test", strategy.getClass().getSimpleName());
                return false;
            }

            strategy.info = strategy.getDockerClient().infoCmd().exec();
            log.info("Found Docker environment with {}", strategy.getDescription());
            log.debug(

the strategy.info

is

Info(architecture=null, containers=null, containersStopped=null, containersPaused=null, containersRunning=null, cpuCfsPeriod=null, cpuCfsQuota=null, cpuShares=null, cpuSet=null, debug=null, discoveryBackend=null, dockerRootDir=null, driver=null, driverStatuses=null, systemStatus=null, plugins=null, executionDriver=null, loggingDriver=null, experimentalBuild=null, httpProxy=null, httpsProxy=null, id=null, ipv4Forwarding=null, bridgeNfIptables=null, bridgeNfIp6tables=null, images=null, indexServerAddress=null, initPath=null, initSha1=null, kernelVersion=null, labels=null, memoryLimit=null, memTotal=null, name=null, ncpu=null, nEventsListener=null, nfd=null, nGoroutines=null, noProxy=null, oomKillDisable=null, osType=null, oomScoreAdj=null, operatingSystem=null, registryConfig=null, sockets=null, swapLimit=null, systemTime=null, serverVersion=null, clusterStore=null, clusterAdvertise=null, swarm=null, isolation=null, securityOptions=null, runtimes=null)

stbischof avatar Oct 18 '24 09:10 stbischof

Hi, have you followed the docs?

eddumelendez avatar Oct 18 '24 10:10 eddumelendez

This issue is missing a title

Two4 avatar Oct 30 '24 08:10 Two4

Hi @stbischof, you can edit the title. There was no need to close and open a new one.

eddumelendez avatar Oct 30 '24 13:10 eddumelendez

@eddumelendez I didn't close this issue, nor did I open a new one.

Two4 avatar Oct 30 '24 13:10 Two4

Sorry @Two4, I edited the previous message

eddumelendez avatar Oct 30 '24 14:10 eddumelendez

Not reproduceable. Works after reboot and wait

stbischof avatar Oct 30 '24 15:10 stbischof