Cloud Run fails with Deploy New Revision. Trying to call Cloud SQL from Cloud Functions v2.

I’m using Firebase to deploy hosting and functions. The functions are using Node/Express. One of the functions must read/write from a MySql 8 database in Cloud SQL. I’ve done this with other apps using Functions v1 with no problem, but I cannot get it to work with this new app and with Functions v2 (Cloud Run).

I followed all the instructions. The Default Compute Service Account is configured with Cloud Sql Client (I’ve also tried changing to Cloud SQL Admin).

I then went to Cloud Run to deploy a new revision with the SQL connection added. However, the revision always fails. I actually don’t think this has anything to do with Cloud SQL, though. I tried completely deleting the function, resploying to create from scratch, and deploying a revision with no changes and I get the same error.

There is a “creating revision” error that states “Revision ‘action-00002-s5d’ is not ready and cannot serve traffic. Image ‘us-central1-docker.pkg.dev/eforall-admin-dev/gcf-artifacts/action:version_1’ not found.

The Image URL is set to “(missing)” The only error I see in the logs is this cryptic message.

I don’t know if this is needed, but while trying to debug, I added Cloud Run Admin role to the Default Compute Servie Account, too. …but it didn’t help. I have the Owner role.

Any ideas?

What’s the output of the build process for building this function? When you deploy a cloud function, it takes your code. And uploads it to a storage bucket and then runs it through a managed build process. You can see the output of this process in the cloud build logs.

That might lead you to some further clues.

Thanks for the response. I believe I figured it out. Manually adding a new revision seems to leave it in an error state, but the changes stay around to be used with the next deployment. When I trigger a new deploy with Firebase, another revision is added that has no errors but does include the changes from the prior manual revision (the sql connection)