yandex-qatools / postgresql-embedded

Embedded PostgreSQL Server
Other
493 stars 90 forks source link

Failed to read PID file #135

Open normenmueller opened 6 years ago

normenmueller commented 6 years ago

Running on macOS with the Postgres App, I always get the following error:

[error] r.y.q.e.p.PostgresProcess - Failed to read PID file (File '/var/folders/lh/rdl1gz9n1w3c60p9wqy1_4j40000gn/T/postgresql-embed-8b80eefd-4d77-4930-a2b4-02c05b20a921/db-content-c13d1e62-18d6-4151-a4c7-bc8523561fca/postmaster.pid' does not exist)
java.io.FileNotFoundException: File '/var/folders/lh/rdl1gz9n1w3c60p9wqy1_4j40000gn/T/postgresql-embed-8b80eefd-4d77-4930-a2b4-02c05b20a921/db-content-c13d1e62-18d6-4151-a4c7-bc8523561fca/postmaster.pid' does not exist
    at org.apache.commons.io.FileUtils.openInputStream(FileUtils.java:299)
    at org.apache.commons.io.FileUtils.readLines(FileUtils.java:1783)
    at org.apache.commons.io.FileUtils.readLines(FileUtils.java:1819)
    at ru.yandex.qatools.embed.postgresql.PostgresProcess.onAfterProcessStart(PostgresProcess.java:255)
    at de.flapdoodle.embed.process.runtime.AbstractProcess.<init>(AbstractProcess.java:116)
    at ru.yandex.qatools.embed.postgresql.AbstractPGProcess.<init>(AbstractPGProcess.java:19)
    at ru.yandex.qatools.embed.postgresql.PostgresProcess.<init>(PostgresProcess.java:68)
    at ru.yandex.qatools.embed.postgresql.PostgresExecutable.start(PostgresExecutable.java:25)
    at ru.yandex.qatools.embed.postgresql.PostgresExecutable.start(PostgresExecutable.java:13)
    at de.flapdoodle.embed.process.runtime.Executable.start(Executable.java:108)

Any ideas how to fix this one?

Reeebuuk commented 6 years ago

I'm having the same error. Using OSX 10.13.4.

tocology commented 6 years ago

Actually, I don't know the exact way to fix this issue, but I had the same error. I'm using this 'postgresql-embedded' to test my codes and the codes are working good even though the issue is occurring.

I tested more times to figure out the reason, and I found that it is related to the process which works by that embedded postgresql. More detail, the embedded postgresql is executed by the source code, however, it would not be terminated automatically. We should terminate by our terminal orprocess.stop() in our source code.

I think a more exact way to fix that issue is needed.

brainoutsource commented 6 years ago

Same here, OS X 10.13.6

alinbrici commented 5 years ago

I've seen this issue when I had an external postgres running and the port was already taken.

hannahsquier commented 5 years ago

I am getting the same issue without external postgres running. The issue started when my computer restarted unexpectedly in the middle of running a test. I assume that the process was not shut down correctly, but I have not been able to fix it even after clearing caches.

ThomasStubbe commented 5 years ago

I'm having the same issue on windows 10

tomgross commented 5 years ago

There might be a leftover from another test. Try sudo lsof -PiTCP -sTCP:LISTEN | grep "postgres" on Mac to see if this is the case and kill the process. This worked for me at least.