0

I am deploying my Django project on google cloud I have installed gdal=3.0.4 but when try to deploy I get error

ERROR: (gcloud.app.deploy) Error Response: [9]
Application startup error! Code: APP_CONTAINER_CRASHED
[2020-07-20 10:49:53 +0000] [6] [INFO] Starting gunicorn 20.0.4
[2020-07-20 10:49:53 +0000] [6] [INFO] Listening at: http://0.0.0.0:8080 (6)
[2020-07-20 10:49:53 +0000] [6] [INFO] Using worker: sync
[2020-07-20 10:49:53 +0000] [9] [INFO] Booting worker with pid: 9
[2020-07-20 10:49:56 +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/tiwari/tiwari/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 91, in populate
  app_config = AppConfig.create(entry)
  File "/env/lib/python3.7/site-packages/django/apps/config.py", line 90, in create
  module = import_module(entry)
  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/Lib/site-packages/mapwidgets/__init__.py", line 4, in <module>
from .widgets import GooglePointFieldWidget, GooglePointFieldInlineWidget, \
  File "/home/vmagent/app/Lib/site-packages/mapwidgets/widgets.py", line 5, in <module>
from django.contrib.gis.forms import BaseGeometryWidget
  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-07-20 10:49:56 +0000] [9] [INFO] Worker exiting (pid: 9)
  [2020-07-20 10:49:56 +0000] [6] [INFO] Shutting down: Master
  [2020-07-20 10:49:56 +0000] [6] [INFO] Reason: Worker failed to boot.

i am working on windows my dockerfile

FROM gcr.io/google-appengine/python

RUN apt-get update && apt-get install -y \
binutils \
gdal-bin \
python-gdal

# 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.
entrypoint gunicorn -b :$PORT tiwari.tiwari.wsgi

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.