title: Cloud build error when deploying to cloud run
body: <p>I have been running a cloud build service which deploys a nextjs application to a cloud run container for a year now. This week, after making some commits, I was unable to successfully deploy the changes even though I have not changed anything on GCP. On cloud build, the error reads:</p>
  <pre><code>&quot;Deploy&quot;: ERROR: (gcloud.run.services.update) Cloud Run error: The user-provided container failed to start and listen on the port defined provided by the PORT=3000 environment variable. Logs for this revision might contain more information.
  </code></pre>
  <p>after it downloads this image</p>
  <pre><code>ERROR: build step 2 &quot;gcr.io/google.com/cloudsdktool/cloud-sdk:slim&quot; failed: step exited with non-zero status: 1
  </code></pre>
  <p>My steps on my cloudbuild.yaml file have been:</p>
  <ol>
  <li><p>download .env file</p>
  </li>
  <li><p>build the container image</p>
  </li>
  <li><p>push the container image to gcr</p>
  </li>
  <li><p>deploy container image to Cloud Run Anthos</p>
  </li>
  </ol>
  <p>I have even increased my timeout to 900s because that is the first error that I received.
  These steps have successfully deployed the application in the past and I have only changed the timeout time in cloudbuild.yaml</p>
  <p>My dockerfile only has the following:</p>
  <pre class="lang-sh prettyprint-override"><code>FROM node:14-alpine
  WORKDIR /app
  COPY . .
  RUN npm install
  RUN npm rebuild node-sass
  RUN npm run build
  EXPOSE 3000
  CMD [&quot;npm&quot;,&quot;start&quot;]
  </code></pre>