Я пытаюсь развернуть свое приложение django в gcloud, однако оно не запускается из-за версии (версии 1.11.3) GDAL, которая устанавливается при запуске файла docker, потому что мне нужен GDAL версия превосходит 2 (согласно тому, что я читал об ошибке в других сообщениях). У меня похожие проблемы с разными предложениями, но я не смог решить свою проблему. Любые идеи, что я мог бы сделать?
Ошибка, возникающая при работе с приложенными app.yaml и Dockerfile , заключается в следующем:
Updating service [default] (this may take several minutes)...failed.
ERROR: (gcloud.app.deploy) Error Response: [9]
Application startup error! Code: APP_CONTAINER_CRASHED
[2020-04-19 17:56:40 +0000] [6] [INFO] Starting gunicorn 20.0.4
[2020-04-19 17:56:40 +0000] [6] [INFO] Listening at: http://0.0.0.0:8080 (6)
[2020-04-19 17:56:40 +0000] [6] [INFO] Using worker: sync
[2020-04-19 17:56:40 +0000] [9] [INFO] Booting worker with pid: 9
[2020-04-19 17:56:44 +0000] [9] [ERROR] Exception in worker process
Traceback (most recent call last):
File "/env/lib/python3.7/site-packages/gunicorn/arbiter.py", line 583, in spawn_worker
worker.init_process()
File "/env/lib/python3.7/site-packages/gunicorn/workers/base.py", line 119, in init_process
self.load_wsgi()
File "/env/lib/python3.7/site-packages/gunicorn/workers/base.py", line 144, in load_wsgi
self.wsgi = self.app.wsgi()
File "/env/lib/python3.7/site-packages/gunicorn/app/base.py", line 67, in wsgi
self.callable = self.load()
File "/env/lib/python3.7/site-packages/gunicorn/app/wsgiapp.py", line 49, in load
return self.load_wsgiapp()
File "/env/lib/python3.7/site-packages/gunicorn/app/wsgiapp.py", line 39, in load_wsgiapp
return util.import_app(self.app_uri)
File "/env/lib/python3.7/site-packages/gunicorn/util.py", line 358, in import_app
mod = importlib.import_module(module)
File "/env/lib/python3.7/importlib/__init__.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 1006, in _gcd_import
File "<frozen importlib._bootstrap>", line 983, in _find_and_load
File "<frozen importlib._bootstrap>", line 967, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 677, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 728, in exec_module
File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
File "/home/vmagent/app/mysite/wsgi.py", line 16, in <module>
application = get_wsgi_application()
File "/env/lib/python3.7/site-packages/django/core/wsgi.py", line 12, in get_wsgi_application
django.setup(set_prefix=False)
File "/env/lib/python3.7/site-packages/django/__init__.py", line 24, in setup
apps.populate(settings.INSTALLED_APPS)
File "/env/lib/python3.7/site-packages/django/apps/registry.py", line 114, in populate
app_config.import_models()
File "/env/lib/python3.7/site-packages/django/apps/config.py", line 211, in import_models
self.models_module = import_module(models_module_name)
File "/env/lib/python3.7/importlib/__init__.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 1006, in _gcd_import
File "<frozen importlib._bootstrap>", line 983, in _find_and_load
File "<frozen importlib._bootstrap>", line 967, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 677, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 728, in exec_module
File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
File "/env/lib/python3.7/site-packages/django/contrib/auth/models.py", line 2, in <module>
from django.contrib.auth.base_user import AbstractBaseUser, BaseUserManager
File "/env/lib/python3.7/site-packages/django/contrib/auth/base_user.py", line 47, in <module>
class AbstractBaseUser(models.Model):
File "/env/lib/python3.7/site-packages/django/db/models/base.py", line 121, in __new__
new_class.add_to_class('_meta', Options(meta, app_label))
File "/env/lib/python3.7/site-packages/django/db/models/base.py", line 325, in add_to_class
value.contribute_to_class(cls, name)
File "/env/lib/python3.7/site-packages/django/db/models/options.py", line 208, in contribute_to_class
self.db_table = truncate_name(self.db_table, connection.ops.max_name_length())
File "/env/lib/python3.7/site-packages/django/db/__init__.py", line 28, in __getattr__
return getattr(connections[DEFAULT_DB_ALIAS], item)
File "/env/lib/python3.7/site-packages/django/db/utils.py", line 207, in __getitem__
backend = load_backend(db['ENGINE'])
File "/env/lib/python3.7/site-packages/django/db/utils.py", line 111, in load_backend
return import_module('%s.base' % backend_name)
File "/env/lib/python3.7/importlib/__init__.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "/env/lib/python3.7/site-packages/django/contrib/gis/db/backends/postgis/base.py", line 6, in <module>
from .features import DatabaseFeatures
File "/env/lib/python3.7/site-packages/django/contrib/gis/db/backends/postgis/features.py", line 1, in <module>
from django.contrib.gis.db.backends.base.features import BaseSpatialFeatures
File "/env/lib/python3.7/site-packages/django/contrib/gis/db/backends/base/features.py", line 3, in <module>
from django.contrib.gis.db.models import aggregates
File "/env/lib/python3.7/site-packages/django/contrib/gis/db/models/__init__.py", line 3, in <module>
import django.contrib.gis.db.models.functions # NOQA
File "/env/lib/python3.7/site-packages/django/contrib/gis/db/models/functions.py", line 3, in <module>
from django.contrib.gis.db.models.fields import BaseSpatialField, GeometryField
File "/env/lib/python3.7/site-packages/django/contrib/gis/db/models/fields.py", line 3, in <module>
from django.contrib.gis import forms, gdal
File "/env/lib/python3.7/site-packages/django/contrib/gis/forms/__init__.py", line 3, in <module>
from .fields import ( # NOQA
File "/env/lib/python3.7/site-packages/django/contrib/gis/forms/fields.py", line 2, in <module>
from django.contrib.gis.gdal import GDALException
File "/env/lib/python3.7/site-packages/django/contrib/gis/gdal/__init__.py", line 28, in <module>
from django.contrib.gis.gdal.datasource import DataSource
File "/env/lib/python3.7/site-packages/django/contrib/gis/gdal/datasource.py", line 39, in <module>
from django.contrib.gis.gdal.driver import Driver
File "/env/lib/python3.7/site-packages/django/contrib/gis/gdal/driver.py", line 5, in <module>
from django.contrib.gis.gdal.prototypes import ds as vcapi, raster as rcapi
File "/env/lib/python3.7/site-packages/django/contrib/gis/gdal/prototypes/ds.py", line 71, in <module>
get_field_as_integer64 = int64_output(lgdal.OGR_F_GetFieldAsInteger64, [c_void_p, c_int])
File "/opt/python3.7/lib/python3.7/ctypes/__init__.py", line 377, in __getattr__
func = self.__getitem__(name)
File "/opt/python3.7/lib/python3.7/ctypes/__init__.py", line 382, in __getitem__
func = self._FuncPtr((name_or_ordinal, self))
AttributeError: /usr/lib/libgdal.so.1: undefined symbol: OGR_F_GetFieldAsInteger64
[2020-04-19 17:56:44 +0000] [9] [INFO] Worker exiting (pid: 9)
[2020-04-19 17:56:45 +0000] [6] [INFO] Shutting down: Master
[2020-04-19 17:56:45 +0000] [6] [INFO] Reason: Worker failed to boot.
файл app.yaml
# [START runtime]
runtime: custom
env: flex
entrypoint: gunicorn -b :$PORT mysite.wsgi
beta_settings:
cloud_sql_instances: <My instance connection name>
runtime_config:
python_version: 3
# [END runtime]
DOCKERFILE (Я пытался установить определенные c версии gdal-bin и libgdal-dev безуспешно )
FROM gcr.io/google-appengine/python
RUN apt-get update && apt-get install -y \
binutils \
# gdal-bin=3.0.4+dfsg-1build3 \
gdal-bin \
# libgdal-dev=2.4.2+dfsg-1build2 \
libgdal-dev \
python3-gdal \
binutils \
libproj-dev
# Create a virtualenv for dependencies. This isolates these packages from
# system-level packages.
RUN virtualenv /env -p python3.7
# Setting these environment variables are the same as running
# source /env/bin/activate.
ENV VIRTUAL_ENV /env
ENV PATH /env/bin:$PATH
# Copy the application's requirements.txt and run pip to install all
# dependencies into the virtualenv.
ADD requirements.txt /app/requirements.txt
RUN pip install -r /app/requirements.txt
# Add the application source code.
ADD . /app
# Run a WSGI server to serve the application. gunicorn must be declared as
# a dependency in requirements.txt.
CMD gunicorn -b :$PORT mysite.wsgi