-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
MSSQL Server throws Prelogin Warning but then works. #3079
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
Comments
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. If you believe this is a mistake, please reply to this comment to keep it open. If there isn't one already, a PR to fix or at least reproduce the problem in a test case will always help us get back on track to tackle this. |
Seeing this same issue as well, when using a r2dbc connection. |
This problem seems to come from the mssql-jdbc-driver directly: |
Hmm, I've not had a chance to dig into this, but it sounds like there's a log warning being emitted when Testcontainers is testing the JDBC connection while the container is starting. Is the problem just log spam, or is there some other problem? |
I think it's just log spam (however I'm not 100% sure) looks like the port is exposed but the SQL Server is not fully setup / starting. |
I have a similar issue here : |
Same here with version new MSSQLServerContainer<>("mcr.microsoft.com/mssql/server:2017-latest")
.withStartupCheckStrategy(new MinimumDurationRunningStartupCheckStrategy(Duration.ofSeconds(5))); |
Still getting this issue, the insert and select still successful but still get warning and throw SQLException in Spring RestController:
|
I am experiencing the same issue is there any resolution to it? |
Same here, annoying stderr messages logged while container is starting up. I believe this loop executing the test query is triggering it: Lines 142 to 182 in b50cfee
|
Any updates on how to fix this annoying log spam? |
The mssql jdbc driver is logging with java util logging to the logger named So the easiest way to disable it would be disable the warning level of this logger, how to do it depends on your logging setup. Another alternative would be to override waitUntilContainerStarted, the question is what to replace it with, is there an alternative way to check if mssql has started? This code is common for all jdbc containers so I'm guessing only the mssql driver logs this as warning or this would have been fixed by now. Another alternative is to wait for a while so that when this method is called the database should already be up, as suggested above. |
I am also facing similar issue . Anyone find the solution ? Jul 28, 2024 1:45:20 PM com.microsoft.sqlserver.jdbc.SQLServerConnection prelogin |
Same issue, but it does not start ever EDIT: in case someone else also cannot start, I have found a working combination for java 21. Still have the logged errors, but now at least it connects after a few attempts:
|
As mentioned above, the MS SQL JDBC driver uses the To get rid of the noise, you can override the log level: val logger = Logger.getLogger("com.microsoft.sqlserver.jdbc.internals.SQLServerConnection")
logger.level = Level.SEVERE Java: Logger logger = Logger.getLogger("com.microsoft.sqlserver.jdbc.internals.SQLServerConnection");
logger.setLevel(Level.SEVERE); |
for me this is not working. I'm still getting tons of """ |
i get prelogin warning messages after container boot, but it eventually stops and my sql import script runs just fine.
Afterwards the rest of my test runs perfectly, i'd just like to know how i could wait for something or improve this behaviour in anyway.
This is my extended MssqlContainer, i've tried adding a line to wait for a specific log line but it doesn't seem to make any difference.
This is my base test class where i init the container and run the schema and data init script..
The text was updated successfully, but these errors were encountered: