injected db credentials change when I deploy new app version to cloud

I deploy a web app to a local cloudfoundry environment. As a database service for my DEV environment I have chosen a Marketplace service google-cloudsql-postgres with the plan postgres-db-f1-micro. Using the Web UI I created an instance with the name myapp-test-database and mentioned it in the CF Manifest:

applications:
- name: myapp-test
  services:
   - myapp-test-database

At first, all is fine. I can even redeploy the existing artifact. However, when I build a new version of my app and push it to CF, the injected credentials are updated and the app can no longer access the tables:

PSQLException: ERROR: permission denied for table 

The tables are still there, but they're owned by the previous user. They were automatically created by the ORM in the public schema.

While the -OLD application still exists I can retrieve the old username/password from the CF Web UI or $VCAP_SERVICES and drop the tables.

Is this all because of Rolling App Deployments? But then there should be a lot of complaints.



Read more here: https://stackoverflow.com/questions/68400771/injected-db-credentials-change-when-i-deploy-new-app-version-to-cloud

Content Attribution

This content was originally published by Basin at Recent Questions - Stack Overflow, and is syndicated here via their RSS feed. You can read the original post over there.

%d bloggers like this: