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

Plugin gets stuck or fails when applied in same project with Spring Boot plugin 2.3.0 #8

Closed
agpopikov opened this issue May 21, 2020 · 3 comments
Labels
bug Something isn't working

Comments

@agpopikov
Copy link

Hi, after updating Spring Boot to version 2.3.0 in one of my existing project with this plugin i received interesting behaviour that depends on OS (in Linux it's fails generateJooqClasses task, but in MacOS X it gets stuck indefinitely).

To demonstrate this issue i created repository - https://github.com/agpopikov/jooq-plugin-bug-example. This repo contains example that fails when run ./gradlew clean generateJooqClasses build command.

After some investigation i found that after update of Spring Boot plugin (or docker-java as part of plugin) sends different (and obviously incorrect) payload to docker daemon when tries to create container, below example of request with payload:

5 > POST unix://localhost:80/containers/create?name=jooq-docker-container-jooq-plugin-bug-example
5 > Accept: application/json
5 > Content-Type: application/json
{"name":"jooq-docker-container-jooq-plugin-bug-example","authConfig":null,"links":[],"binds":[],"memory":null,"memorySwap":null,"networkMode":null,"portBindings":{"bindings":{"5432/tcp":[{"hostIp":null,"hostPortSpec":"43756"}]}},"privileged":null,"volumesFrom":null,"publishAllPorts":null,"extraHosts":null,"capAdd":null,"capDrop":null,"blkioWeight":null,"cgroupParent":null,"cpuPeriod":null,"cpuShares":null,"cpusetCpus":null,"cpusetMems":null,"devices":null,"dns":null,"dnsSearch":null,"logConfig":{"type":null,"config":null},"lxcConf":null,"oomKillDisable":null,"pidMode":null,"readonlyRootfs":null,"restartPolicy":null,"ulimits":null,"Hostname":null,"Domainname":null,"User":null,"AttachStdin":null,"AttachStdout":null,"AttachStderr":null,"PortSpecs":null,"Tty":null,"OpenStdin":null,"StdinOnce":null,"Env":["POSTGRES_USER=postgres","POSTGRES_PASSWORD=postgres","POSTGRES_DB=postgres"],"Cmd":null,"Healthcheck":null,"ArgsEscaped":null,"Entrypoint":null,"Image":"postgres:11.2-alpine","Volumes":{"volumes":[]},"WorkingDir":null,"MacAddress":null,"OnBuild":null,"NetworkDisabled":null,"ExposedPorts":{"exposedPorts":[{"protocol":"TCP","port":5432,"scheme":"tcp"}]},"StopSignal":null,"StopTimeout":null,"HostConfig":{"binds":[],"blkioWeight":null,"blkioWeightDevice":null,"blkioDeviceReadBps":null,"blkioDeviceWriteBps":null,"blkioDeviceReadIOps":null,"blkioDeviceWriteIOps":null,"memorySwappiness":null,"nanoCPUs":null,"capAdd":null,"capDrop":null,"containerIDFile":null,"cpuPeriod":null,"cpuRealtimePeriod":null,"cpuRealtimeRuntime":null,"cpuShares":null,"cpuQuota":null,"cpusetCpus":null,"cpusetMems":null,"devices":null,"deviceCgroupRules":null,"deviceRequests":null,"diskQuota":null,"dns":null,"dnsOptions":null,"dnsSearch":null,"extraHosts":null,"groupAdd":null,"ipcMode":null,"cgroup":null,"links":[],"logConfig":{"type":null,"config":null},"lxcConf":null,"memory":null,"memorySwap":null,"memoryReservation":null,"kernelMemory":null,"networkMode":null,"oomKillDisable":null,"init":null,"autoRemove":null,"oomScoreAdj":null,"portBindings":{"bindings":{"5432/tcp":[{"hostIp":null,"hostPortSpec":"43756"}]}},"privileged":null,"publishAllPorts":null,"readonlyRootfs":null,"restartPolicy":null,"ulimits":null,"cpuCount":null,"cpuPercent":null,"ioMaximumIOps":null,"ioMaximumBandwidth":null,"volumesFrom":null,"mounts":null,"pidMode":null,"isolation":null,"securityOpts":null,"storageOpt":null,"cgroupParent":null,"volumeDriver":null,"shmSize":null,"pidsLimit":null,"runtime":null,"tmpFs":null,"utSMode":null,"usernsMode":null,"sysctls":null,"consoleSize":null,"userDefinedNetwork":false},"Labels":null,"Shell":null,"NetworkingConfig":null}

And here for example of request and payload from working version of setup:

4 > POST unix://localhost:80/containers/create?name=jooq-docker-container-jooq-plugin-bug-example
4 > Accept: application/json
4 > Content-Type: application/json
{"name":"jooq-docker-container-jooq-plugin-bug-example","Env":["POSTGRES_USER=postgres","POSTGRES_PASSWORD=postgres","POSTGRES_DB=postgres"],"Image":"postgres:11.2-alpine","Volumes":{},"ExposedPorts":{"5432/tcp":{}},"HostConfig":{"PortBindings":{"5432/tcp":[{"HostIp":"","HostPort":"35032"}]}}}

After analysing build environment dependency tree i found that new version of Spring Boot override some dependencies versions (jackson related packages was updated to 2.11.x version instead of 2.10.x).

I think that problem doesn't have elegant solution here at this time (initial problem may contains in docker-java and can't be fixed here without shadowing of broken dependency), but this issue should be actual when docker-java release fix and here it should be updated.

@adrianskrobaczrevolut
Copy link
Contributor

Hello @agpopikov 🙂
Thank's for the investigation 👍 I did a little more digging into it seems like it's due to update of the testcontainers form org.testcontainers:testcontainers:1.13.0 to org.testcontainers:testcontainers:1.14.1. When I forced previous version for the build script it works just fine. Looks like test containers maintain theirs own version of docker-java within theirs codebase and most probably it won in the classpath war for some classes that are not compatible with external docker-java. Actually we use only one class from the test containers AuthDelegatingDockerClientConfig, I'll have to do more digging to see maybe we can get rid of the test containers dependency at all. I'll let you know once I'll sort this out 🙂 For now as a workaround you can try forcing old version of test containers

@adrianskrobaczrevolut adrianskrobaczrevolut added the bug Something isn't working label May 31, 2020
@adrianskrobaczrevolut
Copy link
Contributor

@agpopikov should be now fixed in latest 0.3.4 version. Let me know if it works for you 🙂

@agpopikov
Copy link
Author

@adrianskrobaczrevolut yes, now all works fine (tested on example project that i pointed in first comment), thank you 😊

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants