Failed: c56eb8db-29fb-46fb-93e6-6a27212f0f82

i am getting the following error:
rajeshdevops_0-1701774509213.png

 

 
 
 
 
#cloudbuild yaml file for sales-dashboard
steps:
# Build the container image
- name: 'gcr.io/cloud-builders/docker'
  args: ['build', '-t', 'gcr.io/  invoice-362011/sales-dashboard-image', '.']
# Push the container image to the Container Registry
- name: 'gcr.io/cloud-builders/docker'
  args: ['push', 'gcr.io/invoice-362011/sales-dashboard-image']
# Deploy container image to Cloud Run
- name: 'gcr.io/google.com/cloudsdktool/cloud-sdk'
  entrypoint: gcloud
  args: ['run', 'deploy', 'dashboard', '--image', 'gcr.io/  invoice-362011/sales-dashboard-image', '--region', 'asia-south1']

images:
- gcr.io/ invoice-362011/sales-dashboard-image
options:
  logging: CLOUD_LOGGING_ONLY
0 3 211
3 REPLIES 3

Hi @rajeshdevops,

Welcome to Google Cloud Community!

Please provide additional information such as:

  • The snippet provided only shows a partial message. Please provide the entire error message, including any additional information or stack traces.
  • Sharing the build logs will offer valuable insights into the build process and pinpoint the specific step where the error occurred.
  • Sharing the Dockerfile content will allow me to analyze the build process and identify potential issues or missing configurations.
  • If possible, share the full Cloud Build configuration file (cloudbuild.yaml) for better understanding of the build steps and environment.

With this additional information, I can analyze the error message and provide a more accurate diagnosis and potential solutions.

Hi Christian Paula,
Thanks for the reply. Please check the following details.
when I deploy the app manually to the cloud run service,  it can create the revision and route the traffic(not getting any port issues).
But when I use a cloud build for deploying, I get the port issue. please docker file, cloud build file, and error message also.
Docker File:

FROM node:18-slim

WORKDIR /app

COPY package*.json ./

RUN npm install --global --unsafe-perm sequelize-cli

RUN npm install --production

COPY . ./

EXPOSE 8000

CMD [ "npm","start" ]

Cloud Build.yaml:

#cloudbuild yaml file for saudi-evhc-dev-cloud-run-service

steps:

  - name: 'gcr.io/cloud-builders/docker'

    args: ['build', '-t', 'gcr.io/invoice-362011/evhc-saudi-dev', '.']

 

  - name: 'gcr.io/cloud-builders/docker'

    args: ['push', 'gcr.io/invoice-362011/evhc-saudi-dev']

 

  - name: 'gcr.io/cloud-builders/gcloud'

    args:

      - 'run'

      - 'deploy'

      - 'saudi-evhc-dev' # cloud run service name

      - '--image=gcr.io/invoice-362011/evhc-saudi-dev'

      - '--platform=managed'

      - '--region=asia-south1'

      - '--port=8000'

options:

  logging: 'CLOUD_LOGGING_ONLY'

rajeshdevops_0-1701934419466.pngrajeshdevops_1-1701934444068.pngrajeshdevops_2-1701934465669.png

 

 

 
 
 
 

  1. Review build logs: Analyze the Cloud Build logs to identify any issues during image build or push. Look for errors related to missing files, failed commands, or application errors.
  2. Check application code: Ensure the code is properly compiled and packaged within the container image. Verify that the application is configured to listen on port 8000.
  3. Cloud Logging: Analyze the logs for revision "saudi-evhc-dev-00020-zf2" on Cloud Logging. These logs might contain specific details about the application startup failure and the port issue.

Additional steps:

  1. Retry deployment: After addressing the potential causes, try redeploying the service to Cloud Run.
  2. Increase logging: Consider enabling additional logging within the application to capture more information about the startup process and any errors encountered.
  3. Debug locally: Try running the application locally using the same Docker image to identify and resolve any issues before deploying to Cloud Run.

By following these steps and analyzing the logs, you should be able to identify the specific cause of the container failure and successfully deploy the service to Cloud Run.

Additional notes:

  • Ensure the Cloud Build service account has the appropriate permissions to access the Container Registry and Cloud Run service.
  • Verify that the Cloud Run service configuration is correct, including the port number and region settings.
  • Consider sharing the Cloud Build logs and Cloud Logging information for a more detailed analysis of the specific issues.