Get hands-on experience with 20+ free Google Cloud products and $300 in free credit for new customers.

Error CloudSQL lock file "postmaster.pid" already exists

Hi,

I having this error, after do a uncesseful import:

lock file "postmaster.pid" already exists cloudsql

leonardorocha96_0-1698001339043.png

Then, i cannot more connect to the database, but the "state" of CloudSQL is running.

Can somebody can help? I saw some solutions, but they have to connect to the VM, but i don't have access in CloudSQL.

0 2 862
2 REPLIES 2

The error "lock file "postmaster.pid" already exists" indicates that a previous instance of the PostgreSQL server was not shut down cleanly. This can happen for various reasons, such as a power outage or a system crash.

In the case of Cloud SQL, the underlying VM is managed by Google. So yes, you won’t have direct access to the VM's filesystem. However, you can still attempt to resolve the issue:

  1. Go to the Cloud SQL Instances page in the Google Cloud console.
  2. Click on the name of the affected instance.
  3. Click on the "Operations" tab.
  4. Look for the most recent operation that failed.
  5. Click on the operation to view its details.
  6. If the operation failed due to the "postmaster.pid" error, consider restarting the instance. There should be a "Restart" option available.

If the restart doesn't resolve the issue, it's advisable to contact Google Cloud Support. They might provide guidance or take actions to help resolve the problem.

To prevent such issues in the future, ensure that the PostgreSQL server is shut down cleanly before performing any maintenance tasks. Additionally, regular backups and monitoring can help detect and mitigate potential problems.

Hi, thanks for the explanation.

I opened a ticket support to Google Cloud, because i did the restarted and didn't worked the instance yet.

I hope this ticket help me solve this problem, because i'm not getting to use this instance of CloudSQL from PostgreSQL.