0

I've been hosting my static site via an google app engine standard python setup for years without a problem. Today I started seeing the error below. Note: there used to be a page on GCP explaining how to host a static page using python GAE standard, but I can't find it now. Is it maybe the case where now it's recommended to use a bucket instead?

gunicorn.errors.HaltServer
Traceback (most recent call last): File "/layers/google.python.pip/pip/bin/gunicorn", line 8, in sys.exit(run()) File "/layers/google.python.pip/pip/lib/python3.8/site-packages/gunicorn/app/wsgiapp.py", line 58, in run WSGIApplication("%(prog)s [OPTIONS] [APP_MODULE]").run() File "/layers/google.python.pip/pip/lib/python3.8/site-packages/gunicorn/app/base.py", line 228, in run super().run() File "/layers/google.python.pip/pip/lib/python3.8/site-packages/gunicorn/app/base.py", line 72, in run Arbiter(self).run() File "/layers/google.python.pip/pip/lib/python3.8/site-packages/gunicorn/arbiter.py", line 229, in run self.halt(reason=inst.reason, exit_status=inst.exit_status) File "/layers/google.python.pip/pip/lib/python3.8/site-packages/gunicorn/arbiter.py", line 342, in halt self.stop() File "/layers/google.python.pip/pip/lib/python3.8/site-packages/gunicorn/arbiter.py", line 393, in stop time.sleep(0.1) File "/layers/google.python.pip/pip/lib/python3.8/site-packages/gunicorn/arbiter.py", line 242, in handle_chld self.reap_workers() File "/layers/google.python.pip/pip/lib/python3.8/site-packages/gunicorn/arbiter.py", line 525, in reap_workers raise HaltServer(reason, self.WORKER_BOOT_ERROR) gunicorn.errors.HaltServer:

Here's my app.yaml file:

runtime: python38
service: webapp

handlers:

# site root -> app
- url: /
  static_files: dist/index.html
  upload: dist/index.html
  expiration: "0m"
  secure: always

# urls with no dot in them -> app
- url: /([^.]+?)\/?$  # urls
  static_files: dist/index.html
  upload: dist/index.html
  expiration: "0m"
  secure: always

# everything else
- url: /(.*)
  static_files: dist/\1
  upload: dist/(.*)
  expiration: "0m"
  secure: always
Steve
  • 883
  • 7
  • 23
  • Which gunicorn version are you using? – Akshansha Singhal Nov 18 '21 at 10:58
  • I'm not using gunicorn at all :-) Literally I'm just hosting static files above. I assume what's happening is app engine standard is using gunicorn under the hood to be the webserver. @AkshanshaSinghal – Steve Nov 18 '21 at 16:29
  • Could you checkout these threads once: [Thread1](https://stackoverflow.com/questions/55214396/gcloud-app-deploy-fails-using-pythondjangogunicorn-worker-failed-to-boot), [Thread2](https://stackoverflow.com/questions/24488891/gunicorn-errors-haltserver-haltserver-worker-failed-to-boot-3-django) ? – Akshansha Singhal Nov 18 '21 at 17:17
  • @AkshanshaSinghal Thanks. I had a look at those two threads. They seem different in that one has to do with setting up a local python web server and the other seems to relate to app engine flex. My setup is so ultra simple in that I'm not even running a single python file. Just using app engine to host a fully static site which used to be what they recommended. It's handy because you can use all the app engine versioning, a/b testing, as well as domain rules etc. – Steve Nov 19 '21 at 04:00
  • Can you show your requirements.txt file? – Akshansha Singhal Nov 19 '21 at 11:45
  • @AkshanshaSinghal This is going to sound crazy, but this project doesn't have a single python file, and so no requirements.txt. This is the setup as recommended by google for hosting static web sites on google app engine standard: https://cloud.google.com/appengine/docs/standard/python/getting-started/hosting-a-static-website – Steve Nov 19 '21 at 16:56

2 Answers2

1

This error only happened on Nov 17th and has since not happened again, without any changes by me. Perhaps it was related to something under-the-hood on google app engine servers.

Steve
  • 883
  • 7
  • 23
0

Note that you are using Python 3.8 as per your app.yaml file, and the document you have shared is for Python 2.7. As Python 2 is no longer supported, migrating from Python 2 to Python 3 runtime will help you remove the error.

The documentation here will help you to migrate to Python 3 standard runtime.

  • Hmm, this doesn't make sense. As I've said, I'm not using any python whatsoever. There's nothing to migrate. – Steve Nov 19 '21 at 20:29
  • If you look closely, you'll see the documentation is not specifically about 2.7, it's about how to launch a "static website" on google app engine. You can actually do this specifying any run time, since they can all host static files. The reason I posted the 2.7 doc is that page doesn't exist for 3.x. I wonder if Google is pushing towards using cloud storage for this purpose. But it's much less convenient. – Steve Nov 19 '21 at 20:35