title: Google Cloud Run: Error: Stream error in the HTTP/2 framing layer
body: <p>I created an API with <a href="https://www.starlette.io/" rel="nofollow noreferrer">https://www.starlette.io/</a>, docker image <code>python:3.7-slim-stretch</code> and everything is running fine locally as well as when deployed on AWS ECS.</p>
  
  <p>But when I try to deploy the same application on Google Cloud Run I can't get any request back.
  I can reach the server with the browser on the root domain <code>/</code> but when I try to get access to <code>/prediction-url</code> I get response errors like <code>Error: Stream error in the HTTP/2 framing layer</code> or <code>Service unavailable</code>. Tried to access the API with Insomnia, javascript request as well as curl requests.
  Strange is, that everything works 100% on AWS ECS but I couldn't get it working on Googl Cloud Run.
  Is there anything specific to take into consideration when deploying to Google Cloud Run?</p>
  
  <p>The request route definition:</p>
  
  <pre><code>@app.route("/classify-url", methods=["GET"])
  @requires("authenticated")
  async def classify_url(request):
      img_bytes = await get_bytes(request.query_params["url"])
      return await predict_image_from_bytes(img_bytes)
  </code></pre>
  
  <p>The server start command:</p>
  
  <pre><code>if __name__ == "__main__":
      if "serve" in sys.argv:
          # int(os.environ.get('PORT', 8080))
          uvicorn.run(app, host="0.0.0.0", port=8080, log_level="info")
  </code></pre>
  
  <p>The dockerfile:</p>
  
  <pre><code>FROM python:3.7-slim-stretch
  
  RUN apt-get update &amp;&amp; apt-get install -y git python3-dev gcc \
      &amp;&amp; rm -rf /var/lib/apt/lists/*
  
  COPY requirements.txt .
  
  RUN pip install --upgrade -r requirements.txt
  
  COPY . .
  
  EXPOSE 8080
  EXPOSE 8000
  EXPOSE 80
  ENV LISTEN_PORT=8080
  
  # Start the server
  CMD ["gunicorn", "-w 1", "-k uvicorn.workers.UvicornWorker", "-b 0.0.0.0:8080", "-t 8", "main:app"]
  </code></pre>