Recently our service in appengine was migrated from python2.7 to python3.11, with standard evironement. After migration, we keep seeing errors in threading and the message is not informative enough for debug.
The error seems not within Django framework we are using.
error message
Traceback (most recent call last):
File "/layers/google.python.runtime/python/lib/python3.11/threading.py", line 995, in _bootstrap
[2023-08-16 07:12:23 +0000] [18] [INFO] Worker exiting (pid: 18)
and
Traceback (most recent call last):
File "/layers/google.python.runtime/python/lib/python3.11/threading.py", line 995, in _bootstrap
Exception ignored in thread started byException ignored in thread started byException ignored in thread started by: : : Waiting up to 5 seconds.<bound method Thread._bootstrap of <Thread(google.cloud.logging.Worker, started daemon 68606081631808)>><bound method Thread._bootstrap of <Thread(google.cloud.logging.Worker, started daemon 68606081631808)>>
and
Traceback (most recent call last):
File "/layers/google.python.runtime/python/lib/python3.11/threading.py", line 995, in _bootstrap
self._bootstrap_inner()
File "/layers/google.python.runtime/python/lib/python3.11/threading.py", line 1042, in _bootstrap_inner
self._delete()
File "/layers/google.python.runtime/python/lib/python3.11/threading.py", line 1074, in _delete
del _active[get_ident()]
The app.yaml
runtime: python311
app_engine_apis: true
entrypoint: gunicorn dummy.wsgi:application -b :$PORT -w 8 -t 600
instance_class: F4
handlers:
- url: /internal/.*
script: auto
secure: always
login: optional
- url: /static
static_dir: static/
secure: always
- url: /.*
script: auto
secure: always
the wsgi.py
from dummy.boot import fix_path
fix_path()
import os
from django.core.wsgi import get_wsgi_application
from djangae.environment import is_production_environment
from google.appengine.api import wrap_wsgi_app
settings = "dummy.settings.live" if is_production_environment() else "dummy.settings.local"
os.environ.setdefault("DJANGO_SETTINGS_MODULE", settings)
application = get_wsgi_application()
application = wrap_wsgi_app(application)
Does anyone have an idea? Thanks in advance.