-
Notifications
You must be signed in to change notification settings - Fork 181
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
Illegal State issue from initdb #65
Comments
Did postgres print anything to standard error before failing? |
Hi Steven, thanks for the reply. I've been unable to find any sign of logging other than the stack trace (I was running from an IntelliJ IDEA terminal) However, quite strangely the tests are now passing successfully. So something in my environment has changed to make it work. Previously I certainly had tried a number a times (including shutting down IDEA and rebuilding from scratch. Something I did do in the meantime, was that I did install Postgres (and drivers for it) on the windows box. Could that have made the difference? My understanding of otj-pg-embedded was that it comes complete with a bundled postgres. Was I wrong in my understanding? In any case, since things are now functioning (and I can no longer reproduce the problem) I guess we can close this ticket out. I would be interested in any comments you might have on what could have caused this, although there is very little to go on. Sorry for your time. |
I have the same issue locally. My environment:
Neither setting all logs to DEBUG/TRACE level or debugging helped me. Running everything as administrator does not change anything. Any idea? |
I have observed this issue while using otj-pg-embedded 0.11.0. Unfortunately, it still occurs while running 0.11.1 release. @stevenschlansker |
Since none of us at OT currently work with Windows, we are happy to entertain PR's, but can't really resolve it (assuming it's windows specific) What would be really great is if one of you would run initdb manually on a new postgres install |
I do not run PostgreSQL as a separate Windows process. In this scenario I used Embedded PostgreSQL: Embedded PostgreSQL 2.6 (latest release at the time of writing) runs PostgreSQL 9.6.7 in-memory. Running initdb.exe manually provides no output: ` Is there a way to enforce debug/trace messages on initdb.exe? |
Just as a quick update. I have not seen a recurrence of this issue, and cannot reproduce it. Also, a colleague here at work (who did not have PostgreSQL previously installed, and is running with a similar environment to mine) also does not hit this problem while running tests using embedded postgres. |
I have tried to more things:
None of them changed reported issue a bit. Any idea? |
I have also tried running all tests ('mvn test') on freshly cloned postgresql-embedded master branch. They failed:
|
I can replicate this one too:
|
@alexanderjamesking thanks for confirming that someone else observes the same issues as me To sum up, I have checked the following environments:
|
hi guys, i had the same issue, but when i run initdb.exe manually - widows alert me that some dll is not found, so just download it and it should help Cheers |
Thanks @Egoruch for your piece of advice. I have installed MS Visual C++ Redistributable Packages for Visual Studio 2013 x64 and it helped me. I had already installed MS Visual C++ Redistributable Packages for Visual Studio 2013 x86 but it turned out not to be sufficient. |
Makes sense! Thanks! We will add to readme then close this |
Closing, since the README is now updated. |
Had the same issue, even after I had installed Microsoft Visual C++ Redistributable for Visual Studio 2017 (64 bit). What helped was to install MS Visual C++ Redistributable Packages for Visual Studio 2013 x64 :-) Thanks! |
Right - these are static - and depend on what Postgres was compiled on at the time |
I had different error message. I had run time exception stating that This happened without any changes from except I added extra test, which threw the above exception. Then all other tests, which used to work just fine failed. Even another Application on the same machine threw the same exception. I downloaded |
I got the same error in a Mac machine, but seems that the problems was the user's permissions. I've tried execute the command manually and I got an error complaining about this. command executed: /var/folders/qc/q9c34bpj3k95fx2vfm6c7jx80000gp/T/embedded-pg/PG-d6f2320465793366f452337868c0d06f/bin/initdb -A trust -U postgres -D /var/folders/qc/q9c34bpj3k95fx2vfm6c7jx80000gp/T/epg8438268694472155640 -E UTF-8 |
After debugging, and running the initdb command directly on the docker agent:
This means that the locale wasn't set when embedded-postgres db was created. For me it worked by setting the locale:
|
I faced this issue on mac and seems like it was a permission issue on intellij not being able to run commands. I was successfully able to run test case from terminal using gradle. |
I've run into this issue on a Mac too. I tried removing various temp files, but I couldn't make it start correctly. Running the commands directly in my terminal was fine, but not from the JVM. After restarting the computer it ran fine. Not a satisfying result obviously, I'll do some more digging the next time this issue comes up. |
Running into this on Mac too. Similar to @danielcompton . Running my test with the IntelliJ runner I get one more clue:
|
I started receiving this exception after switching images on our CI to adopopenjdk 11. After running the initdb command from inside the container, I received this output:
Switching the container user from |
I had the same problem and solved it. The exception was the following:
From my spring test the following internally called command failed:
Doing this out of the windows console worked properly (after adding the Restarting the whole PC and cleaning the |
I had the same problem on a Mac, but I was able to solve quite simply.
The line You do have to set your localization environment variables to UTF8 like this:
(according to this stackoverflow answer.) Of course, you can set these environment variables in your intelliJ runtime config. Or even better, if you use gradle, you can add environment variables to the test task like this:
I cannot try this on windows, but it might help there, too. As far as I know, on windows you have to set the |
Here like to share my problem and solution. 5> The bottom line: some other programs may expect a newer/different version of openssl. May have to switch back and forth since i made the changes at system level. |
FYI for future people if you use mac and use brew they upgraded it automatically so force downgrading openssl worked in my case as well as @wtangv |
I'm having the same issue on Windows. I've verified that I have all of the mentioned MS VS C++ 2013 x64 and that running initdb manually works fine. Not sure what else to try. |
running manually on my mac i get the following error: |
Running |
Setting the locale environment variables worked for me. In macOS Catalina, set above variables in ~/etc/profile and restart your editor/open new shell. |
Hello, I'm having this issue (Process [/tmp/embedded-pg/PG-6e6cb600c5af6f0b241f84df1594a9c6/bin/initdb, -A, trust, -U, postgres, -D, /tmp/epg924981102176549599, -E, UTF-8] failed |
use a user that does not have root permission to execute embedded postgres. For some reason user with root access have problems during execution.
|
thanks @salluspeaks for your reply! I'll test and let you know |
Work for me thanks !! |
@dubreuil534 Thanks. MS Visual C++ Redistributable Packages for Visual Studio 2013 x64 worked for me too! |
Is there any specific version of redistributable c++ package..as for me nothing worked...changing encoding to utf8 of maven or cleaning temp or installing redistributable package |
I had a similar problem running tests with embedded postgres on MacOS M1:
I copy pasted the command and run it on shell:
and the output show me a hint:
Then I run on shell:
And it worked. |
Thanks
Thanks...but for me it's Windows. |
How do you fix it? I faced with the same propblem |
@istvanszoboszlai Any chance you remember how you got such a neat output ? We're having issues debugging a gitlab CI pipeline and getting the output of the initdb command seems key to understanding what is missing. |
Updating brew fixed the issue Thanks pekevski |
For people who are using |
Hi, I'm attempting to use otj-pg-embedded-0.11.0 (as downloaded from the maven repository) on a windows 10 system and I am getting the following when I attempt a simple junit test:
java.lang.IllegalStateException: Process [C:\Users\john\AppData\Local\Temp\embedded-pg\PG-20610842f7206a9abbecdcf12709c0f8\bin\initdb.exe, -A, trust, -U, postgres, -D, C:\Users\john\AppData\Local\Temp\epg3467157523703904606, -E, UTF-8] failed
The unit test is copied from from your test:
package com.billerica.manager.database;
import com.opentable.db.postgres.junit.EmbeddedPostgresRules;
import com.opentable.db.postgres.junit.SingleInstancePostgresRule;
import org.junit.Rule;
import org.junit.Test;
import java.sql.Connection;
import java.sql.ResultSet;
import java.sql.Statement;
import static org.junit.Assert.*;
public class testSingleInstanceEmbeddedPg {
}
I see that the temp folder epg3467157523703904606 is empty, if that says anything. I haven't found any log files in the temporary folders.
Other tests give similar results. Sorry if I have missed something obvious; I haven't done any other configuration or setup.
Thanks for any help you can provide.
The text was updated successfully, but these errors were encountered: