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

Stopped working on IntelliJ 2019.2 #11

Open
renedewaele opened this issue Jul 29, 2019 · 16 comments
Open

Stopped working on IntelliJ 2019.2 #11

renedewaele opened this issue Jul 29, 2019 · 16 comments

Comments

@renedewaele
Copy link

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?

@tomix26
Copy link
Collaborator

tomix26 commented Jul 29, 2019

Hi, thanks for the report. I will try to upgrade my system and let you know.

@aposchmann
Copy link

I am still using macOS 10.14.5, but experience the same issue. I did update IntelliJ to 2019.2 though. Everything else is still the same setup compared to the last successful run.

I tried embedded-database-spring-test version 1.4.1 and 1.5.0 ... without success so far.

@renedewaele
Copy link
Author

renedewaele commented Jul 29, 2019

I also updated to IntelliJ 2019.2 so that may be related to this as well. However, my tests fail with the same error during maven install.

@aposchmann
Copy link

I ran ./gradlew clean test from IntelliJ's integrated Terminal command line view -> fail. Afterwards I ran the same command from the Apple Terminal -> scuccess.

@renedewaele Can you confirm the behaviour with maven install?

@renedewaele
Copy link
Author

Hi, I saw the same: maven install works from the terminal but not within IntelliJ 2019.2. Really weird, but I'm glad that settles it.

@tomix26
Copy link
Collaborator

tomix26 commented Aug 9, 2019

Hey guys, thanks for the investigation. I did upgrade to IntelliJ 2019.2 (build IU-192.5728.98) and I'm trying to simulate the problem, but everything works fine. So, are you still experiencing the problem? Maybe some update fixed it?

@tomix26 tomix26 changed the title Stopped working on Mac OS 10.14.6 Stopped working on IntelliJ 2019.2 Aug 9, 2019
@aposchmann
Copy link

aposchmann commented Aug 14, 2019

@tomix26 In my case the problem is still exists. But I have two colleagues with almost the same setup (macOS 10.14.x and IntelliJ 2019.2) who don't experience the described behaviour. So it's very likely that it is some rare combination of installed programs and IntelliJ 2019.2

Edit

I just downgraded to IntelliJ 2019.1.4 and it works like a charm. So i guess it's more an IntelliJ 2019.2 issue and less an embedded-postgres issue.

@wiktord
Copy link

wiktord commented Sep 20, 2019

I had exact problem with otj-pg-embedded and spent too many hours on the issue (downgrading IntelliJ didn't help). ./gradlew build from mac terminal worked fine but same operation from intellij terminal failed 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.

@mahmoudnsr
Copy link

and if you using zsh, put these 2 exports into .zshrc file and restart Intellij

@sobvan
Copy link

sobvan commented Dec 20, 2019

Just my 2 cents: you can also put the locale environment variables in your gradle build file like this:

test {
    useJUnitPlatform()
    environment "LC_CTYPE", "en_US.UTF-8"
    environment "LC_ALL", "en_US.UTF-8"
}

Full answer here: opentable#65 (comment)

@mark-anzcro
Copy link

I am having this problem too, on all of

  • MacOS terminal
  • iTerm
  • IntelliJ Terminal
  • IntelliJ runner

with versions

  • 12.0
  • 12.1
  • 12.5

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] failed

Turns out in the end that it was the missing libpq.5.dylib that 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 lpsmith/postgresql-libpq#9 and it now works. For 12.1. 12.5 still doesn't work because of

dyld: 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.

@tomix26
Copy link
Collaborator

tomix26 commented Jan 5, 2021

@mark-anzcro This is another problem that was reported here: zonkyio/embedded-postgres-binaries#21

@barbarosalp
Copy link

barbarosalp commented Feb 18, 2021

This used to work for me but it has stopped working after the BigSur upgrade.

I had exact problem with otj-pg-embedded and spent too many hours on the issue (downgrading IntelliJ didn't help). ./gradlew build from mac terminal worked fine but same operation from intellij terminal failed 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.

@kenshinji
Copy link

and if you using zsh, put these 2 exports into .zshrc file and restart Intellij

it works, thanks bro, you saved my day.

sleberknight added a commit to kiwiproject/kiwi-test that referenced this issue Feb 28, 2021
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 EnabledOnOs annotation that restricted to Linux. I don't
really care about Windows, and doubt anyone is using this there anyway.

See:

zonkyio/embedded-postgres#32
zonkyio/embedded-postgres#40

Also see:

zonkyio/embedded-postgres#11
zonkyio/embedded-postgres#11 (comment)

for the original solution regarding the LC_CTYPE and LC_ALL environment
variables.

Closes #80
Closes #152
sleberknight added a commit to kiwiproject/kiwi-test that referenced this issue Feb 28, 2021
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 EnabledOnOs annotation that restricted to Linux. I don't
really care about Windows, and doubt anyone is using this there anyway.

See:

zonkyio/embedded-postgres#32
zonkyio/embedded-postgres#40

Also see:

zonkyio/embedded-postgres#11
zonkyio/embedded-postgres#11 (comment)

for the original solution regarding the LC_CTYPE and LC_ALL environment
variables.

Closes #80
Closes #152
@b-nijhuis-doop
Copy link

b-nijhuis-doop commented May 12, 2021

For those running into this on MacOS and using Maven Surefire, you can set the LC_* environment variables like so:

<plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-surefire-plugin</artifactId>
    <version>3.0.0-M5</version>
    <configuration>
        <reuseForks>true</reuseForks>
        <environmentVariables>
            <!-- required for running embedded PostgreSQL on MacOS -->
            <!-- see: https://github.com/zonkyio/embedded-postgres/issues/11#issuecomment-533468269 -->
            <LC_CTYPE>en_US.UTF-8</LC_CTYPE>
            <LC_ALL>en_US.UTF-8</LC_ALL>
        </environmentVariables>
    </configuration>
</plugin>

@mengjiann
Copy link

Using the builder with the localconfig works too if you want the programmatic way.

EmbeddedPostgres pg = EmbeddedPostgres.builder()
                .setLocaleConfig("locale","en_US.UTF-8")
                .start()

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests