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

--tmpdir fails in windows #646

Closed
MazenAmria opened this issue Dec 5, 2022 · 3 comments
Closed

--tmpdir fails in windows #646

MazenAmria opened this issue Dec 5, 2022 · 3 comments
Assignees
Labels
helpwanted high Windows Anything specific to Microsoft Windows OS, not affecting Linux

Comments

@MazenAmria
Copy link
Contributor

Using Mariadb4j in Windows raised the following error:

[Exec Default Executor] ERROR ch.vorburger.exec.LoggingExecuteResultHandler - Program [C:\Users\User\AppData\Local\Temp\test\bin\mysql_install_db.exe, --datadir=C:\Users\User\AppData\Local\Temp\MariaDB4j\data\55358, --tmpdir=C:\Users\User\AppData\Local\Temp\MariaDB4j\tmp\55358] (in working directory C:\Users\User\AppData\Local\Temp\test) failed unexpectedly
org.apache.commons.exec.ExecuteException: Process exited with an error: 7 (Exit value: 7)
	at org.apache.commons.exec.DefaultExecutor.executeInternal(DefaultExecutor.java:404)
	at org.apache.commons.exec.DefaultExecutor.access$200(DefaultExecutor.java:48)
	at org.apache.commons.exec.DefaultExecutor$1.run(DefaultExecutor.java:200)
	at java.base/java.lang.Thread.run(Thread.java:833)
[main] ERROR ch.vorburger.exec.ManagedProcess - Program [C:\Users\User\AppData\Local\Temp\test\bin\mysql_install_db.exe, --datadir=C:\Users\User\AppData\Local\Temp\MariaDB4j\data\55358, --tmpdir=C:\Users\User\AppData\Local\Temp\MariaDB4j\tmp\55358] (in working directory C:\Users\User\AppData\Local\Temp\test) failed
Dec 05, 2022 11:31:36 AM net.equiptal.portal.test.PortalTest prepareEnvironment
SEVERE: null
ch.vorburger.exec.ManagedProcessException: An error occurred while installing the database
	at ch.vorburger.mariadb4j.DB.install(DB.java:141)
	at ch.vorburger.mariadb4j.DB.newEmbeddedDB(DB.java:89)
	at net.equiptal.portal.test.PortalTest.prepareEnvironment(PortalTest.java:39)
	at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:104)
	at java.base/java.lang.reflect.Method.invoke(Method.java:577)
	at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:59)
	at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
	at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:56)
	at org.junit.internal.runners.statements.RunBefores.invokeMethod(RunBefores.java:33)
	at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:24)
	at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:27)
	at org.junit.runners.ParentRunner$3.evaluate(ParentRunner.java:306)
	at org.junit.runners.ParentRunner.run(ParentRunner.java:413)
	at org.junit.runner.JUnitCore.run(JUnitCore.java:137)
	at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:69)
	at com.intellij.rt.junit.IdeaTestRunner$Repeater$1.execute(IdeaTestRunner.java:38)
	at com.intellij.rt.execution.junit.TestsRepeater.repeat(TestsRepeater.java:11)
	at com.intellij.rt.junit.IdeaTestRunner$Repeater.startRunnerWithArgs(IdeaTestRunner.java:35)
	at com.intellij.rt.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:235)
	at com.intellij.rt.junit.JUnitStarter.main(JUnitStarter.java:54)
Caused by: ch.vorburger.exec.ManagedProcessException: Program [C:\Users\User\AppData\Local\Temp\test\bin\mysql_install_db.exe, --datadir=C:\Users\User\AppData\Local\Temp\MariaDB4j\data\55358, --tmpdir=C:\Users\User\AppData\Local\Temp\MariaDB4j\tmp\55358] (in working directory C:\Users\User\AppData\Local\Temp\test) failed, exitValue=7, last 100 lines of console:
C:\Users\User\AppData\Local\Temp\test\bin\mysql_install_db.exe: unknown variable 'tmpdir=C:\Users\User\AppData\Local\Temp\MariaDB4j\tmp\55358'
	at ch.vorburger.exec.ManagedProcess.checkResult(ManagedProcess.java:310)
	at ch.vorburger.exec.ManagedProcess.startExecute(ManagedProcess.java:216)
	at ch.vorburger.exec.ManagedProcess.start(ManagedProcess.java:155)
	at ch.vorburger.mariadb4j.DB.install(DB.java:138)
	... 19 more
Caused by: org.apache.commons.exec.ExecuteException: Process exited with an error: 7 (Exit value: 7)
	at org.apache.commons.exec.DefaultExecutor.executeInternal(DefaultExecutor.java:404)
	at org.apache.commons.exec.DefaultExecutor.access$200(DefaultExecutor.java:48)
	at org.apache.commons.exec.DefaultExecutor$1.run(DefaultExecutor.java:200)
	at java.base/java.lang.Thread.run(Thread.java:833)

However, using it in linux worked correctly.

I'm not sure what the problem is, but investigated the problem and ended up with the following explanation, which I can't be sure if it's correct:

The problem is that mysql_install_db.exe cannot recognize the argument --tmpdir. After looking into Mariadb Knowledge Base, it doesn't mention any command line argument called --tmpdir for the mysql_install_db or mysql_install_db.exe.

The argument --tmpdir is used by mysqld and mysqld.exe according to Mariadb Knowledge Base.

After looking at mysql_install_db --help in linux, it doesn't mention that argument but it says:

All other options are passed to the mysqld program

While running mysql_install_db.exe --help on windows doesn't mention anything about the other options.
So maybe windows installer isn't passing those options to mysqld.exe and thus it fails on the --tmpdir option.

@vorburger
Copy link
Collaborator

Closing this issue (but not its PR!) as a duplicate of the (still open) #632; please shout if you disagree.

@vorburger vorburger reopened this Dec 10, 2022
@vorburger
Copy link
Collaborator

Duplicate of #632.

@vorburger
Copy link
Collaborator

PS: GitHub's Mark as Duplicate doesn't seem to work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
helpwanted high Windows Anything specific to Microsoft Windows OS, not affecting Linux
Projects
None yet
Development

No branches or pull requests

2 participants