embedded-postgres: Stopped working on IntelliJ 2019.2
Hey, just like for the original otj-pg-embedded project this fork stopped working on my system since upgrading to Mac OS 10.14.6 (latest version). The error I get is java.lang.IllegalStateException: Process [/var/folders/l_/c1b_7t2n39j48k7sbpp54zy00000gn/T/embedded-pg/PG-8eddc1e460ca1c5597350c162933683c/bin/initdb, -A, trust, -U, postgres, -D, /var/folders/l_/c1b_7t2n39j48k7sbpp54zy00000gn/T/epg3835758492450081687, -E, UTF-8] failed.
Deleting the temporary embedded-pg folder does not solve the problem. Do you have any ideas?
About this issue
- Original URL
- State: open
- Created 5 years ago
- Comments: 16
Commits related to this issue
- Re-enable tests that use embedded Postgres Since we originally implemented these and had problems running the tests on macOS, things seem to have gotten fixed. So this commit simply removes the Enabl... — committed to kiwiproject/kiwi-test by sleberknight 3 years ago
- Re-enable tests that use embedded Postgres (#197) Since we originally implemented these and had problems running the tests on macOS, things seem to have gotten fixed. So this commit simply removes ... — committed to kiwiproject/kiwi-test by sleberknight 3 years ago
I had exact problem with otj-pg-embedded and spent too many hours on the issue (downgrading IntelliJ didn’t help).
./gradlew buildfrommac terminalworked fine but same operation fromintellij terminalfailed with exactly same message as in the 1st post. Problem was with locales (don’t ask why). Setting these properties in ~/.bash_profile helped: export LC_CTYPE=“en_US.UTF-8” export LC_ALL=“en_US.UTF-8” Hope this saves someone from struggles.and if you using zsh, put these 2 exports into .zshrc file and restart Intellij
it works, thanks bro, you saved my day.
Just my 2 cents: you can also put the locale environment variables in your gradle build file like this:
Full answer here: https://github.com/opentable/otj-pg-embedded/issues/65#issuecomment-567860383
For those running into this on MacOS and using Maven Surefire, you can set the LC_* environment variables like so:
I am having this problem too, on all of
with versions
Exporting the environment variables provided by @wiktord did not fix it for IntelliJ (2020.3), or on the MacOS terminals.
Caused by: java.lang.IllegalStateException: Process [/var/folders/pv/c91ppn_s3n36kff_5jqqkh580000gn/T/embedded-pg/PG-abc4d7798f0045b30e0a18facc5799d0/bin/initdb, -A, trust, -U, postgres, -D, /var/folders/pv/c91ppn_s3n36kff_5jqqkh580000gn/T/epg5612952893588405656, -E, UTF-8] failedTurns out in the end that it was the missing
libpq.5.dylibthat was the problem for me. I have Postgres.app installed on my machine, so I just symlinked that based on this issue in the postgresql-libpq project https://github.com/lpsmith/postgresql-libpq/issues/9 and it now works. For 12.1. 12.5 still doesn’t work because ofdyld: Library not loaded: @loader_path/../lib/libz.1.dylib Referenced from: /private/var/folders/pv/c91ppn_s3n36kff_5jqqkh580000gn/T/embedded-pg/PG-21706f841db941a04058ca5131a27776/lib/libxml2.2.dylib Reason: no suitable image found. Did find: file system relative paths not allowed in hardened programs no data was returned by command ""/private/var/folders/pv/c91ppn_s3n36kff_5jqqkh580000gn/T/embedded-pg/PG-21706f841db941a04058ca5131a27776/bin/postgres" -V" initdb: error: The program "postgres" is needed by initdb but was not found in the same directory as "/private/var/folders/pv/c91ppn_s3n36kff_5jqqkh580000gn/T/embedded-pg/PG-21706f841db941a04058ca5131a27776/bin/initdb". Check your installation.