Nicholas Tang
07/09/2025, 9:47 PMMarvin
07/09/2025, 9:47 PMMarvin
07/09/2025, 9:48 PMCloud Run Developer
role
- Service Account User
role
- Proper IAM permissions to create and manage Cloud Run Jobs
2. Environment Configuration
Verify these critical environment variables are properly set:
- PREFECT_API_KEY
- PREFECT_API_URL
- The correct GCP project and region settings
3. Work Pool Configuration
Check your work pool settings:
- Ensure the work pool's region matches your GCP Cloud Run region
- Verify the work pool's service account configuration
- Check that the work pool is properly configured for Cloud Run v2
4. Troubleshooting Steps
To resolve this:
bash
# 1. Verify your service account has the correct roles
gcloud projects get-iam-policy YOUR_PROJECT_ID \
--flatten="bindings[].members" \
--format='table(bindings.role)' \
--filter="bindings.members:YOUR_SERVICE_ACCOUNT"
# 2. Check if Cloud Run Jobs API is enabled
gcloud services list --enabled | grep <http://run.googleapis.com|run.googleapis.com>
# 3. Verify the work pool configuration
prefect work-pool inspect "your-work-pool-name"
5. Common Fixes
- Recreate the work pool with correct configurations
- Update the service account permissions
- Ensure your deployment's infrastructure configurations match the work pool settings
6. Best Practices
- Use infrastructure blocks to manage Cloud Run configurations
- Keep your Prefect worker version in sync with your server version
- Monitor Cloud Run quotas and limits
If these steps don't resolve the issue, you may want to check the Cloud Run Jobs console directly to see if there are any error messages or quota issues that could be preventing job creation.
Links for further reference:
- Prefect GCP Worker Guide
- Prefect Serverless Deployment Guide
Would you like me to help you troubleshoot any specific part of this configuration?