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

Thread will wait for "mysqld: ready for connections." to appear in Console output of process Program #901

Open
linksgo2011 opened this issue Mar 13, 2024 · 5 comments

Comments

@linksgo2011
Copy link

Hi, I encountered a problem on Mac. It seems that mysqld can't bind port.

--socket=/private/var/folders/0q/q67ljypj5vz8n3n6ytfcrdj80000gy/T/MariaDB4j.3389.sock, --user=root, --character-set-server=utf8] (in working directory /var/folders/0q/q67ljypj5vz8n3n6ytfcrdj80000gy/T/MariaDB4j/base)
2024-03-13 16:09:05.512 INFO 3997 --- [ main] ch.vorburger.exec.ManagedProcess : Thread will wait for "mysqld: ready for connections." to appear in Console output of process Program

@legnesi
Copy link

legnesi commented Mar 21, 2024

I encounter the same issue on ubuntu with mariadb-linux-x86_64-10.5.1 or higher. All the previous mariadb version works. I'm using mariadb4j-core version 2.6.0

@vorburger
Copy link
Collaborator

I'm using mariadb4j-core version 2.6.0

@legnesi would you be able to upgrade to the latest version, currently 3.0.2?

@Eyzic
Copy link

Eyzic commented Mar 26, 2024

I'm having the same issue in 3.0.1. Would be willing to try 3.0.2 if it were available on maven repository: https://mvnrepository.com/artifact/ch.vorburger.mariaDB4j/mariaDB4j

@legnesi
Copy link

legnesi commented Mar 27, 2024

I can confirm that version 3.0.1 does not solve the problem. The problem is that the lib is unable to start the mysqld process because the lib does not properly install mariadb via the mysql_install_d process. I don't think that 3.0.2 will solve the problem (speaking of maria4j-core) because when I compare the sources I don't see any evolution on this subject.

@Eyzic The 3.0.2 is not in maven central. I should normaly be in the JitPack repo (https://jitpack.io/#vorburger/MariaDB4j). But it look like it is not available

If it can help to insetigate below the output console for mariadb 10.5.23 binary:

[INFO] DOCKER> DB starting on 3367
[INFO] DOCKER> DB DATA_DIR /opt/lyra/app-root/src/mariadb/datas/
DB BASE_DIR /opt/lyra/app-root/src/mariadb/base
[INFO] DOCKER> [91m[main] INFO ch.vorburger.mariadb4j.DB - Not unpacking any embedded database (as BinariesClassPathLocation configuration is null)
[main] INFO ch.vorburger.mariadb4j.DB - Installing a new embedded database to: /opt/lyra/app-root/src/mariadb/base

[INFO] DOCKER> [91m[main] INFO ch.vorburger.exec.ManagedProcess - Starting Program [/opt/lyra/app-root/src/mariadb/base/bin/mysql_install_db, --datadir=/opt/lyra/app-root/src/mariadb/datas, --basedir=/opt/lyra/app-root/src/mariadb/base, --no-defaults, --force, --skip-name-resolve] (in working directory /opt/lyra/app-root/src/mariadb/base)

[INFO] DOCKER> [91m[Exec Default Executor] INFO ch.vorburger.exec.LoggingExecuteResultHandler - Program [/opt/lyra/app-root/src/mariadb/base/bin/mysql_install_db, --datadir=/opt/lyra/app-root/src/mariadb/datas, --basedir=/opt/lyra/app-root/src/mariadb/base, --no-defaults, --force, --skip-name-resolve] (in working directory /opt/lyra/app-root/src/mariadb/base) just exited, with value 0

[INFO] DOCKER> [91m[main] INFO ch.vorburger.exec.ManagedProcess - Thread is now going to wait for this process to terminate itself: Program [/opt/lyra/app-root/src/mariadb/base/bin/mysql_install_db, --datadir=/opt/lyra/app-root/src/mariadb/datas, --basedir=/opt/lyra/app-root/src/mariadb/base, --no-defaults, --force, --skip-name-resolve] (in working directory /opt/lyra/app-root/src/mariadb/base)
[main] INFO ch.vorburger.mariadb4j.DB - Installation complete.
[main] INFO ch.vorburger.mariadb4j.DB - Starting up the database...

[INFO] DOCKER> [91m[main] INFO ch.vorburger.mariadb4j.DB - mysqld executable: /opt/lyra/app-root/src/mariadb/base/bin/mysqld
[main] INFO ch.vorburger.exec.ManagedProcess - Starting Program [/opt/lyra/app-root/src/mariadb/base/bin/mysqld, --no-defaults, --console, --skip-grant-tables, --max_allowed_packet=64M, --basedir=/opt/lyra/app-root/src/mariadb/base, --datadir=/opt/lyra/app-root/src/mariadb/datas, --port=3367, --socket=/tmp/MariaDB4j.3367.sock, --lower-case-table-names=1, --skip-name-resolve, --innodb_lock_wait_timeout=100] (in working directory /opt/lyra/app-root/src/mariadb/base)

[INFO] DOCKER> [91m[main] INFO ch.vorburger.exec.ManagedProcess - Thread will wait for "mysqld: ready for connections." to appear in Console output of process Program [/opt/lyra/app-root/src/mariadb/base/bin/mysqld, --no-defaults, --console, --skip-grant-tables, --max_allowed_packet=64M, --basedir=/opt/lyra/app-root/src/mariadb/base, --datadir=/opt/lyra/app-root/src/mariadb/datas, --port=3367, --socket=/tmp/MariaDB4j.3367.sock, --lower-case-table-names=1, --skip-name-resolve, --innodb_lock_wait_timeout=100] (in working directory /opt/lyra/app-root/src/mariadb/base) for max. 30000ms

[INFO] DOCKER> [91m[Exec Default Executor] INFO ch.vorburger.exec.LoggingExecuteResultHandler - Program [/opt/lyra/app-root/src/mariadb/base/bin/mysqld, --no-defaults, --console, --skip-grant-tables, --max_allowed_packet=64M, --basedir=/opt/lyra/app-root/src/mariadb/base, --datadir=/opt/lyra/app-root/src/mariadb/datas, --port=3367, --socket=/tmp/MariaDB4j.3367.sock, --lower-case-table-names=1, --skip-name-resolve, --innodb_lock_wait_timeout=100] (in working directory /opt/lyra/app-root/src/mariadb/base) just exited, with value 0

[INFO] DOCKER> [91m[main] ERROR ch.vorburger.mariadb4j.DB - failed to start mysqld

[INFO] DOCKER> [91mch.vorburger.exec.ManagedProcessException: Asked to wait for "mysqld: ready for connections." from Program [/opt/lyra/app-root/src/mariadb/base/bin/mysqld, --no-defaults, --console, --skip-grant-tables, --max_allowed_packet=64M, --basedir=/opt/lyra/app-root/src/mariadb/base, --datadir=/opt/lyra/app-root/src/mariadb/datas, --port=3367, --socket=/tmp/MariaDB4j.3367.sock, --lower-case-table-names=1, --skip-name-resolve, --innodb_lock_wait_timeout=100] (in working directory /opt/lyra/app-root/src/mariadb/base), but it already exited! (without that message in console), last 100 lines of console:

        at ch.vorburger.exec.ManagedProcess.startAndWaitForConsoleMessageMaxMs(ManagedProcess.java:278)
        at ch.vorburger.mariadb4j.DB.start(DB.java:153)
        at com.lyra.monetique.mariadb.MariaDBLauncher.launchMariaDB(MariaDBLauncher.java:34)
        at com.lyra.monetique.mariadb.MariaDBLauncher.main(MariaDBLauncher.java:69)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:498)
        at org.springframework.boot.loader.MainMethodRunner.run(MainMethodRunner.java:48)
        at org.springframework.boot.loader.Launcher.launch(Launcher.java:87)
        at org.springframework.boot.loader.Launcher.launch(Launcher.java:50)
        at org.springframework.boot.loader.JarLauncher.main(JarLauncher.java:51)

[INFO] DOCKER> [91mException in thread "main" java.lang.reflect.InvocationTargetException
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:498)
        at org.springframework.boot.loader.MainMethodRunner.run(MainMethodRunner.java:48)
        at org.springframework.boot.loader.Launcher.launch(Launcher.java:87)
        at org.springframework.boot.loader.Launcher.launch(Launcher.java:50)
        at org.springframework.boot.loader.JarLauncher.main(JarLauncher.java:51)

Thanks

@vorburger
Copy link
Collaborator

@Eyzic The 3.0.2 is not in maven central.

==> #902

I should normaly be in the JitPack repo (https://jitpack.io/#vorburger/MariaDB4j). But it look like it is not available

==> #915

As for ch.vorburger.exec.ManagedProcess : Thread will wait for "mysqld: ready for connections." to appear in Console output of process Program there can be many reasons for that - it just means that it couldn't start. The root cause for @linksgo2011 and for @legnesi and for @Eyzic could all be completely different.

You need to look at (or post here) the full log, and see if there is any indication earlier than the failure that tells you why.

If you use MariaDB4j professionally, please consider to, either:

to support future maintenance!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants