You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
2023-10-17 19:35:20 DB2 has not been started
2023-10-17 19:35:20 Starting DB2...
2023-10-17 19:35:20
2023-10-17 19:36:20 10/17/2023 22:36:20 0 0 SQL1042C An unexpected system error occurred.
2023-10-17 19:36:20 SQL1032N No start database manager command was issued. SQLSTATE=57019
2023-10-17 19:36:20 (*) User chose to create lbcat database
In the docker logs, the "No start database manager command was issued" is not expected. But startup process continues and eventually it finishes successfully - besides tcpip listener is not started. You can connect to the container and confirm that with "netstat -na" (port 50000 won't show, only 22)
Additional Information
Adding port mappings to the container using container.withCreateContainerCmdModifier() triggers the issue.
Below there is a sample code that produces the error:
If I exclude the container.withCreateContainerCmdModifier db2 starts just fine. In Liquibase test suite we do this as part of our startup method for all of our integration test databases (postgresql, mysql, mssql, etc) but just db2 has startup problems.
The text was updated successfully, but these errors were encountered:
Can you share what are you trying to achieve? Currently, Db2Container already expose port 50000 but through a random port when calling getJdbcUrl(). Fixed port is a bad practice not recommended by Testcontainers. If fixed port is required for debugging purposes, I would recommend to use Testcontainers Desktop
Hello @eddumelendez - we have this generic code around here that maps all exposed ports to local ones. It's been used with other docker containers, but it only cause issues to db2 one.
In fact we already have a workaround for that but we just wanted to report this odd behavior as we saw that more people faced similar issues.
If doing so, you should know what are you doing. Check the second example using cmd.getHostConfig() in https://java.testcontainers.org/features/advanced_options/. I think it should be related to the remapping port but IMHO that's not the use for Testcontainers modules.
Also, it is highly recommended to declare the image in the constructor
Module
DB2
Testcontainers version
1.19.1
Using the latest Testcontainers version?
Yes
Host OS
Windows, Linux, MacOsX
Host Arch
Docker version
What happened?
DB2 fails to start tcpip listener on port 50000 .
Relevant log output
Additional Information
Adding port mappings to the container using
container.withCreateContainerCmdModifier()
triggers the issue.Below there is a sample code that produces the error:
If I exclude the
container.withCreateContainerCmdModifier
db2 starts just fine. In Liquibase test suite we do this as part of our startup method for all of our integration test databases (postgresql, mysql, mssql, etc) but just db2 has startup problems.The text was updated successfully, but these errors were encountered: