2

I have a perfectly fine express node.js app that serves http requests. I put it on Google Cloud App Engine.

It serves the pages fine, but occasionally when I visit the page I get a white page that says:

Cannot Get /

if I refresh the page is served as usual.

This happens very often for my initial requests for the website. I use a custom domain.

How can I track this error, it doesn't show up in the log viewer. What is the cause of this?

app.yaml

runtime: nodejs12

env_variables:
  BUCKET_NAME: "example-gcs-bucket"

handlers:
- url: /.*
  secure: always
  script: auto
eguneys
  • 6,028
  • 7
  • 31
  • 63
  • https://trackdailywork.com is my domain – eguneys Dec 31 '20 at 16:50
  • 1
    Use the Chrome or other debugger: `Content Security Policy of your site blocks some resources because their origin is not included in the content security policy header` – John Hanley Dec 31 '20 at 19:00
  • Found this similar [Dynamic HTML Page in App Engine. Returns Cannot Get /index](https://stackoverflow.com/questions/53854036/) which could tell us that there could be something interesting in your app.yaml file. Can you share it with us? Just make sure to remove any sensitive information. – Kevin Quinzel Dec 31 '20 at 23:52
  • Also, are you using App Engine Standard or Flex? – Kevin Quinzel Jan 01 '21 at 00:00
  • I think Standard, with free tier, but not sure where to find that information. – eguneys Jan 01 '21 at 00:19
  • No worries, if you were in Flex, the yaml file would have something like env: flex, this is Standard and we can discard issues with the yaml. – Kevin Quinzel Jan 01 '21 at 18:19
  • @eguneys Did you find the issue? –  Oct 24 '22 at 14:17
  • found a solution for my Nuxt app on appengine, happening on cold starts, it was because my server index.js was missing `await nuxt.ready()`. maybe helps someone –  Nov 14 '22 at 21:45

1 Answers1

0

Thanks for sharing additional information on the comments, we could discard any issues with your app.yaml file.

It seems that App Engine fails from time to time to add the CSP headers in their responses, making the message Content Security Policy of your site blocks some resources because their origin is not included in the content security policy header to be shown as found by John Hanley.

After some deep research it seems that this is a known issue and the GCP team is working to fix this. To mitigate this in the meantime you will need to set a policy as a HTTP header (recommended), or via an HTML <meta> tag following this Public blog.

I have created this Issue Tracker for you and the community to track the GCP team's progress. It includes the steps to diagnose the issue and the current workaround

Kevin Quinzel
  • 1,430
  • 1
  • 13
  • 23
  • I've set the meta csp headers, but I still have this issue, please check https://trackdailywork.com and https://chessishard.com – eguneys Jan 06 '21 at 01:03