otj-pg-embedded: Fail on OSX suddenly.

I believe some change to OSX or my JVM has introduced an error we do not see on our build machines. I’ve included the dependency via maven as:

        <dependency>
            <groupId>com.opentable.components</groupId>
            <artifactId>otj-pg-embedded</artifactId>
            <version>0.13.3</version>
            <scope>test</scope>
        </dependency>

The build runs fine in our Jenkins build container which is running JDK 8 on a deb variant.

Locally, on OSX 10.13.6, with multiple JVMs, I get the following error:

java.lang.ExceptionInInitializerError
Caused by: java.lang.IllegalStateException: 
Process [/var/folders/2n/f5gm14qj1nx8hmjss0ppggph0000gp/T/embedded-pg/PG-73dc0043fe7bdb624d5e8726bc457b7e/bin/initdb, -A, trust, -U, postgres, -D, /var/folders/2n/f5gm14qj1nx8hmjss0ppggph0000gp/T/epg9228892128578519833, -E, UTF-8] failed

Which causes all unit tests to fail and breaks the build. I’ve seen similar issues in the past that were resolved by deleting the directory in the error. However, that is no longer helping.

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Reactions: 2
  • Comments: 24 (5 by maintainers)

Most upvoted comments

Installing postgresql on my OS-X machine using brew install postgresql resolved the problem for now.

Not a definitive fix, but at least a way to continue without digging deeper into it now 😃

Just stumbled into the same problem after installing Big Sur. And likewise, brew install postgresql helped

Installing postgresql on my OS-X machine using brew install postgresql resolved the problem for now.

Not a definitive fix, but at least a way to continue without digging deeper into it now 😃

Phew, that saved me a lot of time digging. Thanks!

I am getting an issue in macos monterey, from the unit tests it fails with the following message:

java.lang.IllegalStateException: Process [/var/folders/_t/z620yvkx3_1bxrljqg8k7zpr0000gn/T/embedded-pg/PG-a2a9bc65661eac6f108fc920268a87b3/bin/initdb, -A, trust, -U, postgres, -D, /var/folders/_t/z620yvkx3_1bxrljqg8k7zpr0000gn/T/epg18324743191160135529, -E, UTF-8] failed

When running the same command directly in the command line I am getting:

➜  bin /var/folders/_t/z620yvkx3_1bxrljqg8k7zpr0000gn/T/embedded-pg/PG-a2a9bc65661eac6f108fc920268a87b3/bin/initdb -A trust -U postgres -D /var/folders/_t/z620yvkx3_1bxrljqg8k7zpr0000gn/T/epg18324743191160135529 -E UTF-8
no data was returned by command ""/private/var/folders/_t/z620yvkx3_1bxrljqg8k7zpr0000gn/T/embedded-pg/PG-a2a9bc65661eac6f108fc920268a87b3/bin/postgres" -V"
The program "postgres" is needed by initdb but was not found in the
same directory as "/private/var/folders/_t/z620yvkx3_1bxrljqg8k7zpr0000gn/T/embedded-pg/PG-a2a9bc65661eac6f108fc920268a87b3/bin/initdb".
Check your installation.

I downgraded my postgres to:

➜  bin which postgres
/opt/homebrew/bin/postgres
➜  bin postgres --version
postgres (PostgreSQL) 12.11

Not sure what else to try or do, I am running zonky embedded postgres 1.3.1

Never had any problem, until now. Upgraded to Big Sur, also facing this since then.

Great info! Using this I’ve found a workaround until the issue is ultimately resolved:

Running brew against the specific commit for openssl 1.0.2 via brew install https://raw.githubusercontent.com/Homebrew/homebrew-core/8b9d6d688f483a0f33fcfc93d433de501b9c3513/Formula/openssl.rb

Reference: https://stackoverflow.com/questions/59337838/openssl-1-0-2m-on-macos