Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't lunch with gunicorn the website #23

Open
gwajnberg opened this issue Jul 6, 2023 · 2 comments
Open

Can't lunch with gunicorn the website #23

gwajnberg opened this issue Jul 6, 2023 · 2 comments

Comments

@gwajnberg
Copy link

gwajnberg commented Jul 6, 2023

I followed all the steps and it fails when I lunch the prod. Here is my prod log:

config: /home/gabriel/card-live-dashboard-home/config/gunicorn.conf.py
wsgi_app: None
bind: ['127.0.0.1:8050']
backlog: 2048
workers: 2
worker_class: sync
threads: 1
worker_connections: 1000
max_requests: 0
max_requests_jitter: 0
timeout: 600
graceful_timeout: 30
keepalive: 2
limit_request_line: 4094
limit_request_fields: 100
limit_request_field_size: 8190
reload: False
reload_engine: auto
reload_extra_files: []
spew: False
check_config: False
print_config: False
preload_app: False
sendfile: None
reuse_port: False
chdir: /home/gabriel/card-live-dashboard
daemon: True
raw_env: []
pidfile: /home/gabriel/card-live-dashboard-home/config/../cardlive.pid
worker_tmp_dir: None
user: 1009
group: 1009
umask: 0
initgroups: False
tmp_upload_dir: None
secure_scheme_headers: {'X-FORWARDED-PROTOCOL': 'ssl', 'X-FORWARDED-PROTO': 'https', 'X-FORWARDED-SSL': 'on'}
forwarded_allow_ips: ['127.0.0.1']
accesslog: /home/gabriel/card-live-dashboard-home/config/../access.log
disable_redirect_access_to_syslog: False
access_log_format: %(h)s %(l)s %(u)s %(t)s "%(r)s" %(s)s %(b)s "%(f)s" "%(a)s"
errorlog: /home/gabriel/card-live-dashboard-home/config/../prod.log
loglevel: debug
capture_output: False
logger_class: gunicorn.glogging.Logger
logconfig: None
logconfig_dict: {}
syslog_addr: udp://localhost:514
syslog: False
syslog_prefix: None
syslog_facility: user
enable_stdio_inheritance: False
statsd_host: None
dogstatsd_tags:
statsd_prefix:
proc_name: cardlive
default_proc_name: card_live_dashboard.app:flask_app(card_live_home='/home/gabriel/card-live-dashboard-home')
pythonpath: None
paste: None
on_starting: <function OnStarting.on_starting at 0x7fa11f557d00>
on_reload: <function OnReload.on_reload at 0x7fa11f557e20>
when_ready: <function WhenReady.when_ready at 0x7fa11f557f40>
pre_fork: <function Prefork.pre_fork at 0x7fa11f5700d0>
post_fork: <function Postfork.post_fork at 0x7fa11f5701f0>
post_worker_init: <function PostWorkerInit.post_worker_init at 0x7fa11f570310>
worker_int: <function WorkerInt.worker_int at 0x7fa11f570430>
worker_abort: <function WorkerAbort.worker_abort at 0x7fa11f570550>
pre_exec: <function PreExec.pre_exec at 0x7fa11f570670>
pre_request: <function PreRequest.pre_request at 0x7fa11f570790>
post_request: <function PostRequest.post_request at 0x7fa11f570820>
child_exit: <function ChildExit.child_exit at 0x7fa11f570940>
worker_exit: <function WorkerExit.worker_exit at 0x7fa11f570a60>
nworkers_changed: <function NumWorkersChanged.nworkers_changed at 0x7fa11f570b80>
on_exit: <function OnExit.on_exit at 0x7fa11f570ca0>
proxy_protocol: False
proxy_allow_ips: ['127.0.0.1']
keyfile: None
certfile: None
ssl_version: 2
cert_reqs: 0
ca_certs: None
suppress_ragged_eofs: True
do_handshake_on_connect: False
ciphers: None
raw_paste_global_conf: []
strip_header_spaces: False
[2023-07-04 18:29:23 +0000] [2477914] [INFO] Starting gunicorn 20.1.0
[2023-07-04 18:29:23 +0000] [2477914] [DEBUG] Arbiter booted
[2023-07-04 18:29:23 +0000] [2477914] [INFO] Listening at: http://127.0.0.1:8050 (2477914)
[2023-07-04 18:29:23 +0000] [2477914] [INFO] Using worker: sync
[2023-07-04 18:29:23 +0000] [2477915] [INFO] Booting worker with pid: 2477915
[2023-07-04 18:29:23 +0000] [2477916] [INFO] Booting worker with pid: 2477916
[2023-07-04 18:29:23 +0000] [2477914] [DEBUG] 2 workers
[2023-07-04 18:29:23 +0000] [2477915] [ERROR] Exception in worker process
Traceback (most recent call last):
File "/home/gabriel/card-live-venv/lib/python3.10/site-packages/gunicorn/arbiter.py", line 589, in spawn_worker
worker.init_process()
File "/home/gabriel/card-live-venv/lib/python3.10/site-packages/gunicorn/workers/base.py", line 134, in init_process
self.load_wsgi()
File "/home/gabriel/card-live-venv/lib/python3.10/site-packages/gunicorn/workers/base.py", line 146, in load_wsgi
self.wsgi = self.app.wsgi()
File "/home/gabriel/card-live-venv/lib/python3.10/site-packages/gunicorn/app/base.py", line 67, in wsgi
self.callable = self.load()
File "/home/gabriel/card-live-venv/lib/python3.10/site-packages/gunicorn/app/wsgiapp.py", line 58, in load
return self.load_wsgiapp()
File "/home/gabriel/card-live-venv/lib/python3.10/site-packages/gunicorn/app/wsgiapp.py", line 48, in load_wsgiapp
return util.import_app(self.app_uri)
File "/home/gabriel/card-live-venv/lib/python3.10/site-packages/gunicorn/util.py", line 359, in import_app
mod = importlib.import_module(module)
File "/usr/lib/python3.10/importlib/init.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "", line 1050, in _gcd_import
File "", line 1027, in _find_and_load
File "", line 1006, in _find_and_load_unlocked
File "", line 688, in _load_unlocked
File "", line 883, in exec_module
File "", line 241, in _call_with_frames_removed
File "/home/gabriel/card-live-dashboard/card_live_dashboard/app.py", line 8, in
import card_live_dashboard.callbacks as callbacks
File "/home/gabriel/card-live-dashboard/card_live_dashboard/callbacks/init.py", line 8, in
import card_live_dashboard.layouts.figures as figures
File "/home/gabriel/card-live-dashboard/card_live_dashboard/layouts/init.py", line 10, in
import card_live_dashboard.layouts.figures as figures
File "/home/gabriel/card-live-dashboard/card_live_dashboard/layouts/figures.py", line 13, in
from card_live_dashboard.model.CardLiveData import CardLiveData
File "/home/gabriel/card-live-dashboard/card_live_dashboard/model/init.py", line 4, in
world = region_codes.get_un_m49_regions_naturalearth()
File "/home/gabriel/card-live-dashboard/card_live_dashboard/service/GeographicRegionCodesService.py", line 146, in get_un_m49_regions_naturalearth
world = self.split_france_french_guiana(world)
File "/home/gabriel/card-live-dashboard/card_live_dashboard/service/GeographicRegionCodesService.py", line 180, in split_france_french_guiana
world_new = world_new.append(french_guiana_row)
File "/home/gabriel/card-live-venv/lib/python3.10/site-packages/pandas/core/generic.py", line 5989, in getattr
return object.getattribute(self, name)
AttributeError: 'GeoDataFrame' object has no attribute 'append'
[2023-07-04 18:29:23 +0000] [2477915] [INFO] Worker exiting (pid: 2477915)
[2023-07-04 18:29:23 +0000] [2477916] [ERROR] Exception in worker process
Traceback (most recent call last):
File "/home/gabriel/card-live-venv/lib/python3.10/site-packages/gunicorn/arbiter.py", line 589, in spawn_worker
worker.init_process()
File "/home/gabriel/card-live-venv/lib/python3.10/site-packages/gunicorn/workers/base.py", line 134, in init_process
self.load_wsgi()
File "/home/gabriel/card-live-venv/lib/python3.10/site-packages/gunicorn/workers/base.py", line 146, in load_wsgi
self.wsgi = self.app.wsgi()
File "/home/gabriel/card-live-venv/lib/python3.10/site-packages/gunicorn/app/base.py", line 67, in wsgi
self.callable = self.load()
File "/home/gabriel/card-live-venv/lib/python3.10/site-packages/gunicorn/app/wsgiapp.py", line 58, in load
return self.load_wsgiapp()
File "/home/gabriel/card-live-venv/lib/python3.10/site-packages/gunicorn/app/wsgiapp.py", line 48, in load_wsgiapp
return util.import_app(self.app_uri)
File "/home/gabriel/card-live-venv/lib/python3.10/site-packages/gunicorn/util.py", line 359, in import_app
mod = importlib.import_module(module)
File "/usr/lib/python3.10/importlib/init.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "", line 1050, in _gcd_import
File "", line 1027, in _find_and_load
File "", line 1006, in _find_and_load_unlocked
File "", line 688, in _load_unlocked
File "", line 883, in exec_module
File "", line 241, in _call_with_frames_removed
File "/home/gabriel/card-live-dashboard/card_live_dashboard/app.py", line 8, in
import card_live_dashboard.callbacks as callbacks
File "/home/gabriel/card-live-dashboard/card_live_dashboard/callbacks/init.py", line 8, in
import card_live_dashboard.layouts.figures as figures
File "/home/gabriel/card-live-dashboard/card_live_dashboard/layouts/init.py", line 10, in
import card_live_dashboard.layouts.figures as figures
File "/home/gabriel/card-live-dashboard/card_live_dashboard/layouts/figures.py", line 13, in
from card_live_dashboard.model.CardLiveData import CardLiveData
File "/home/gabriel/card-live-dashboard/card_live_dashboard/model/init.py", line 4, in
world = region_codes.get_un_m49_regions_naturalearth()
File "/home/gabriel/card-live-dashboard/card_live_dashboard/service/GeographicRegionCodesService.py", line 146, in get_un_m49_regions_naturalearth
world = self.split_france_french_guiana(world)
File "/home/gabriel/card-live-dashboard/card_live_dashboard/service/GeographicRegionCodesService.py", line 180, in split_france_french_guiana
world_new = world_new.append(french_guiana_row)
File "/home/gabriel/card-live-venv/lib/python3.10/site-packages/pandas/core/generic.py", line 5989, in getattr
return object.getattribute(self, name)
AttributeError: 'GeoDataFrame' object has no attribute 'append'
[2023-07-04 18:29:23 +0000] [2477916] [INFO] Worker exiting (pid: 2477916)
[2023-07-04 18:29:23 +0000] [2477914] [WARNING] Worker with pid 2477916 was terminated due to signal 15
[2023-07-04 18:29:24 +0000] [2477914] [INFO] Shutting down: Master
[2023-07-04 18:29:24 +0000] [2477914] [INFO] Reason: Worker failed to boot.

@apetkau
Copy link
Collaborator

apetkau commented Jul 7, 2023

Thanks for reporting @gwajnberg

This appears to be due to changes in the API for pandas>=1.4.0. Mainly, DataFrame.append() was deprecated in 1.4.0 (and removed in version 2.0.0). This is mentioned in this issue geopandas/geopandas#2606

Until we release a new version, the way to get CARD:Live Dashboard working is to downgrade pandas. That is:

python -m pip install 'pandas<2.0.0'

@gwajnberg
Copy link
Author

That works! It is on now! thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants