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

Unable to run on Windows #12

Closed
justinjohn83 opened this issue Apr 18, 2016 · 8 comments
Closed

Unable to run on Windows #12

justinjohn83 opened this issue Apr 18, 2016 · 8 comments

Comments

@justinjohn83
Copy link

When starting up the server receive

java.lang.RuntimeException: java.io.IOException: Cannot run program "uname": CreateProcess error=2, The system cannot find the file specified at com.google.common.base.Throwables.propagate(Throwables.java:160) at com.opentable.db.postgres.embedded.EmbeddedPostgreSQL.system(EmbeddedPostgreSQL.java:433) at com.opentable.db.postgres.embedded.EmbeddedPostgreSQL.prepareBinaries(EmbeddedPostgreSQL.java:453) at com.opentable.db.postgres.embedded.EmbeddedPostgreSQL.<init>(EmbeddedPostgreSQL.java:97) at com.opentable.db.postgres.embedded.EmbeddedPostgreSQL$Builder.start(EmbeddedPostgreSQL.java:418) at com.opentable.db.postgres.embedded.EmbeddedPostgreSQL$Builder$start$2.call(Unknown Source)

This is because "uname" does not exist on Windows. When I run it under MinGW it is unable to delete the temp files:

Caused by: java.lang.IllegalStateException: could not delete C:\Users\<user>\AppData\Local\Temp\pgpg5803195040675452262pgpg at com.google.common.base.Preconditions.checkState(Preconditions.java:197) at com.opentable.db.postgres.embedded.EmbeddedPostgreSQL.prepareBinaries(EmbeddedPostgreSQL.java:510) at com.opentable.db.postgres.embedded.EmbeddedPostgreSQL.<init>(EmbeddedPostgreSQL.java:97) at com.opentable.db.postgres.embedded.EmbeddedPostgreSQL$Builder.start(EmbeddedPostgreSQL.java:418)

@stevenschlansker
Copy link
Contributor

I'd happily accept a PR to fix these issues, but unfortunately I don't use Windows at all so I'm not likely to personally fix it.

@justinjohn83
Copy link
Author

I don't use Windows regularly either, but a few of our developers do so I was testing it out on a Windows VM. Aside from the Postgres process occasionally not shutting down in between test runs I've had no issues on Mac.

@MarekMalevic
Copy link
Contributor

I would like to fix the issue, however, I don't see an option to create branch for it (and I am not used to work with github). Do I need some permissions to be able to do that?

@stevenschlansker
Copy link
Contributor

If you fork the repository (top right button) and create the branch there, you can then create a pull request back to this repository.

@MarekMalevic
Copy link
Contributor

I have modified the code to support windows along with 64bit windows binary. Please see #13

@soenkenils
Copy link

soenkenils commented May 13, 2016

Our developers are forced to work on Windows 7 (company policy). For their daily work they also need admin-rights. Nonetheless, they would like to be able to execute tests with Embedded Postgres.

In the current version, they get the following error message:

The server must be started under an unprivileged user ID to prevent
possible system security compromises. See the documentation for
more information on how to properly start the server.

A possible workaround which we have been successfully for the last 14 days uses pg_ctl instead of postgres to start the postgres service. Please see #15

@stevenschlansker
Copy link
Contributor

Will be part of 0.7.0 release

@luqmanahmadbbmtek
Copy link

I ran into issues while on mac with
java.lang.IllegalStateException: No Postgres binary found for Darwin / x86_64

cverges-medallia pushed a commit to cverges-medallia/otj-pg-embedded that referenced this issue Dec 22, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants