postgresql-embedded icon indicating copy to clipboard operation
postgresql-embedded copied to clipboard

Failed to read PID file

Open normenmueller opened this issue 7 years ago • 7 comments

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?

normenmueller avatar Jun 07 '18 11:06 normenmueller

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

Reeebuuk avatar Jun 22 '18 13:06 Reeebuuk

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.

tocology avatar Jun 26 '18 09:06 tocology

Same here, OS X 10.13.6

brainoutsource avatar Jul 20 '18 07:07 brainoutsource

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

alinbrici avatar Oct 02 '18 23:10 alinbrici

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.

hannahsquier avatar Oct 12 '18 18:10 hannahsquier

I'm having the same issue on windows 10

ThomasStubbe avatar Dec 18 '18 17:12 ThomasStubbe

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.

tomgross avatar Feb 01 '19 08:02 tomgross