UWSGI died, killed by signal 9 #8059
Unanswered
gatiszeiris
asked this question in
Q&A
Replies: 1 comment
-
Hi, Did you find a an solution for this error. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
CKAN version
2.10.1
Describe the bug
When I upload new resource (more than 1MB) in dataset using UI or API I get 502 Bad Gateway error.
In uwsgi.ERR log get the following error:
HTTP/1.0 200) 4 headers in 289 bytes (1 switches on core 0)
Tue Feb 6 08:11:52 2024 - *** HARAKIRI ON WORKER 1 (pid: 78643, try: 1, graceful: yes) ***
HARAKIRI: -- wchan> 0
Tue Feb 6 08:11:52 2024 - HARAKIRI !!! worker 1 status !!!
Tue Feb 6 08:11:52 2024 - HARAKIRI [core 0] 127.0.0.1 - POST /dati/dataset/gatisz/resource/new since 1707199911
Tue Feb 6 08:11:52 2024 - HARAKIRI !!! end of worker 1 status !!!
Tue Feb 6 08:11:52 2024 - HARAKIRI triggered by worker 1 core 0 !!!
DAMN ! worker 1 (pid: 78643) died, killed by signal 9 :( trying respawn ...
Respawned uWSGI worker 1 (new pid: 78852)
In nginx log get the following error:
2024/02/06 08:11:52 [error] 23117#0: *3244 recv() failed (104: Connection reset by peer) while reading response header from upstream, client: 192.168.47.250, server: ckan210.dsistemas.lv, request: "POST /dati/dataset/gatisz/resource/new HTTP/1.1", upstream: "http://127.0.0.1:8080/dati/dataset/gatisz/resource/new", host: "ckan210.dsistemas.lv", referrer: "https://ckan210.dsistemas.lv/dati/dataset/gatisz/resource/new"
Very strange thing that when I upload very small CSV file some KB all works fine without this error. Also when I start CKAN and use directly without uwsgi I can upload large files
Steps to reproduce
CKAN version 2.10.1
ckan.ini conf
debug = false
[app:main]
General settings
use = egg:ckan
ckan.legacy_route_mappings = {}
config.mode = default
Development settings
ckan.devserver.host = 192.168.47.34
ckan.devserver.port = 5001
ckan.devserver.threaded = true
ckan.devserver.multiprocess = 1
ckan.devserver.watch_patterns =
ckan.devserver.ssl_cert =
ckan.devserver.ssl_key =
Session settings
ckan.user.last_active_interval = 600
cache_dir = /tmp/%(ckan.site_id)s
beaker.session.key = ckan
beaker.session.secret = 10slbG7Wg1x7yNCXqVk9-ujGujE
beaker.session.auto = false
beaker.session.cookie_expires = false
beaker.session.cookie_domain = .example.com
beaker.session.save_accessed_time = true
beaker.session.secure = false
beaker.session.timeout =3600
Database settings
sqlalchemy.url = postgresql://ckan_default:pass@localhost/ckan_default
ckan.datastore.write_url = postgresql://ckan_default:pass@localhost/datastore_default
ckan.datastore.read_url = postgresql://datastore_default:pass@localhost/datastore_default
#ckan.datastore.default_fts_lang = lv
sqlalchemy.pool_pre_ping = true
sqlalchemy. =
Site Settings
ckan.site_url = https://ckan210.dsistemas.lv
ckan.root_path = /dati/{{LANG}}
apikey_header_name = X-CKAN-API-Key
ckan.cache_expires = 0
ckan.cache_enabled = false
ckan.mimetype_guess = file_ext
ckan.static_max_age = 3600
ckan.tracking_enabled = false
ckan.valid_url_schemes = http https ftp
ckan.requests.timeout = 5
ckan.hide_version = false
ckan.redirect_to_login_if_not_authorized = true
Authorization Settings
ckan.auth.anon_create_dataset = false
ckan.auth.create_unowned_dataset = false
ckan.auth.create_dataset_if_not_in_organization = true
ckan.auth.user_create_groups = true
ckan.auth.user_create_organizations = true
ckan.auth.user_delete_groups = true
ckan.auth.user_delete_organizations = true
ckan.auth.create_user_via_api = false
ckan.auth.create_user_via_web = true
ckan.auth.roles_that_cascade_to_sub_groups = admin
ckan.auth.public_user_details = true
ckan.auth.public_activity_stream_detail = false
ckan.auth.allow_dataset_collaborators = false
ckan.auth.allow_admin_collaborators = false
ckan.auth.allow_collaborators_to_change_owner_org = false
ckan.auth.create_default_api_keys = false
ckan.auth.login_view = user.login
ckan.auth.reveal_private_datasets = false
ckan.auth.enable_cookie_auth_in_api = true
ckan.auth.route_after_login = dashboard.datasets
CSRF Protection
WTF_CSRF_ENABLED = false
WTF_CSRF_CHECK_DEFAULT = true
WTF_CSRF_SECRET_KEY = -qL6CKXlyo_jGIV3VpmR8BXuWIrp_ldlf9yiHRzeSqI
WTF_CSRF_METHODS = POST PUT PATCH DELETE
WTF_CSRF_FIELD_NAME = _csrf_token
WTF_CSRF_HEADERS = X-CSRFToken X-CSRF-Token
WTF_CSRF_TIME_LIMIT = 3600
WTF_CSRF_SSL_STRICT = true
WTF_I18N_ENABLED = true
ckan.csrf_protection.ignore_extensions = true
Flask-Login Remember me cookie settings
REMEMBER_COOKIE_NAME = remember_token
REMEMBER_COOKIE_DURATION = 31536000
REMEMBER_COOKIE_DOMAIN = .example.com
REMEMBER_COOKIE_PATH = /
REMEMBER_COOKIE_SECURE = false
REMEMBER_COOKIE_HTTPONLY = true
REMEMBER_COOKIE_REFRESH_EACH_REQUEST = false
REMEMBER_COOKIE_SAMESITE = None
API Token Settings
api_token.nbytes = 32
api_token.jwt.encode.secret = string:%(beaker.session.secret)s
api_token.jwt.decode.secret = string:%(beaker.session.secret)s
api_token.jwt.algorithm = HS256
Search Settings
ckan.site_id = default
solr_url = http://127.0.0.1:8983/solr/ckan
solr_user =
solr_password =
ckan.search.remove_deleted_packages = true
ckan.search.solr_commit = true
ckan.search.show_all_types = dataset
ckan.search.default_include_private = true
ckan.search.default_package_sort = score desc, metadata_modified desc
search.facets = organization groups tags res_format license_id
search.facets.limit = 50
search.facets.default = 10
ckan.extra_resource_fields =
ckan.search.rows_max = 1000
ckan.group_and_organization_list_max = 1000
ckan.group_and_organization_list_all_fields_max = 25
solr_timeout = 60
Redis Settings
ckan.redis.url = redis://localhost:6379/0
Harvest Settings
ckan.harvest.mq.type = redis
ckan.harvest.mq.hostname = localhost
ckan.harvest.mq.port = 6379
ckan.harvest.mq.redis_db = 0
ckan.harvest.log_scope = 0
ckan.harvest.log_timeframe = 10
ckanext.spatial.harvest.continue_on_validation_errors = true
CORS Settings
ckan.cors.origin_allow_all = false
ckan.cors.origin_whitelist =
Plugins Settings
ckan.plugins = activity scheming_datasets csvmetadata datapusher datastore dcat harvest ckan_harvester dcat_rdf_harvester csw_harvester datatables_view recline_view image_view text_view barchart piechart customstats latvian_theme_v2
#ckan.plugins = harvest csw_harvester ckan_harvester dcat_rdf_harvester csvuploadvalid
ckan.resource_proxy.timeout = 5
CSV metadata Settings############################################################
csvmetadata.ckan_api_key=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJqdGkiOiIzYXg2dWtXNTlSaTBZaTJNY3hHT1lEdVNkSnFSSVJmMWRuRTZMU1pIdzhrIiwiaWF0IjoxNjk1NzMyMDk0fQ.o_uFZTe3V1rmNlULNC6yntvHUwY1UH2x9KDtmlDDqx4
CSV file validation Settings############################################################
csvuploadvalid.resource_upload_delimiter =;
csvuploadvalid.resource_upload_regex = ^[A-Za-z0-9_]*$
csvuploadvalid.resource_column_name_length=63
Scheming Settings############################################################
scheming.dataset_schemas = ckanext.scheming:dcat_ap_lv_schema.json
Datapusher Settings############################################################
ckan.datapusher.url = http://127.0.0.1:8800/
ckan.datapusher.api_token=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJqdGkiOiJaQ2tNcVBXb19qVGJ6VlJvU05wRXdFM0ZsR0paNFhXaWF1Y2JZSXpGdkRjIiwiaWF0IjoxNjk1ODAwNzczfQ.cNBMUT43jr6eqIHobbc2K-HPCc-Tdwn0ck2jzJEIofw
ckan.datapusher.formats = csv xls xlsx tsv application/csv application/vnd.ms-excel application/vnd.openxmlformats-officedocument.spreadsheetml.sheet
DCAT Setting#################################################################
ckanext.dcat.base_uri = https://ckan210.dsistemas.lv/dati
Front-End Settings
ckan.site_title = CKAN
ckan.site_description =
ckan.site_intro_text =
ckan.site_logo = /base/images/ckan-logo.png
ckan.site_about =
ckan.theme = css/main
ckan.favicon = /dati/images/theme2/ckan.ico
ckan.datasets_per_page = 20
package_hide_extras =
ckan.dumps_url =
ckan.dumps_format =
ckan.recaptcha.publickey =
ckan.recaptcha.privatekey =
ckan.featured_groups =
ckan.featured_orgs =
ckan.default_group_sort = title
ckan.gravatar_default = identicon
ckan.debug_supress_header = false
ckan.homepage_style = 1
ckan.site_custom_css =
Resource Views Settings
ckan.views.default_views = datatables_view text_view image_view recline_view
Theming Settings
ckan.template_head_end =
ckan.template_footer_end =
ckan.template_title_delimiter = -
extra_template_paths =
extra_public_paths =
ckan.base_public_folder = public
ckan.base_templates_folder = templates
ckan.default.package_type = dataset
ckan.default.group_type = group
ckan.default.organization_type = organization
ckan.admin_tabs = {}
Storage Settings
ckan.storage_path = /var/lib/ckan/default
ckan.max_resource_size = 100000
ckan.max_image_size = 1
Uploader Settings
ckan.upload.user.types =
ckan.upload.user.mimetypes =
ckan.upload.group.types =
ckan.upload.group.mimetypes =
Webassets Settings
ckan.webassets.path =
ckan.webassets.use_x_sendfile = false
User Settings
ckan.user_list_limit = 20
ckan.user_reset_landing_page = home.index
Activity Streams Settings
ckan.activity_streams_enabled = true
ckan.activity_streams_email_notifications = false
ckan.activity_list_limit = 31
ckan.activity_list_limit_max = 100
ckan.email_notifications_since = 2 days
ckan.hide_activity_from_users = %(ckan.site_id)s
Feeds Settings
ckan.feeds.author_name =
ckan.feeds.author_link =
ckan.feeds.authority_name =
ckan.feeds.date =
ckan.feeds.limit = 20
Internationalisation Settings
ckan.locale_default = lv
ckan.locales_offered = lv eng
ckan.locales_filtered_out =
ckan.locale_order = lv eng
ckan.i18n_directory =
ckan.i18n.extra_directory =
ckan.i18n.extra_gettext_domain =
ckan.i18n.extra_locales =
ckan.i18n.rtl_languages = he ar fa_IR
ckan.i18n.rtl_theme = css/main-rtl
ckan.display_timezone = UTC
ckan.resource_formats = /usr/lib/ckan/default/src/ckan/ckan/config/resource_formats.json
Form Settings
ckan.dataset.create_on_ui_requires_resources = true
package_new_return_url =
package_edit_return_url =
licenses_group_url = file:////etc/ckan/default/ckan-licences.json
Email settings
smtp.server = localhost
smtp.starttls = false
smtp.user =
smtp.password =
smtp.mail_from =
smtp.reply_to =
email_to =
error_email_from =
Background Job Settings
ckan.jobs.timeout = 180
Logging configuration
[loggers]
keys = root, ckan, ckanext, werkzeug
[handlers]
keys = console
[formatters]
keys = generic
[logger_root]
level = DEBUG
handlers = console
[logger_werkzeug]
level = DEBUG
handlers = console
qualname = werkzeug
propagate = 0
[logger_ckan]
level = DEBUG
handlers = console
qualname = ckan
propagate = 0
[logger_ckanext]
level = DEBUG
handlers = console
qualname = ckanext
propagate = 0
[handler_console]
class = StreamHandler
args = (sys.stderr,)
level = NOTSET
formatter = generic
[formatter_generic]
format = %(asctime)s %(levelname)-5.5s [%(name)s] %(message)s
Python version 3.8.16
Uwsgi version 2.0.22
ckan uwsgi conf
[uwsgi]
http11-socket = 127.0.0.1:8080
uid = ckan-user
gid = ckan-user
wsgi-file = /etc/ckan/default/wsgi.py
virtualenv = /usr/lib/ckan/default
module = wsgi:application
mount = /dati=/etc/ckan/default/wsgi.py
manage-script-name = true
master = true
pidfile = /tmp/%n.pid
harakiri = 14400
harakiri-verbose = true
max-requests = 5000
vacuum = true
callable = application
buffer-size = 32768
strict = true
enable-threads = true
workers = 4
lazy-apps = true
post-buffering = 1
buffer-size = 731072
Nginx conf
include fastcgi_params; upstream php { server 127.0.0.1:9000;$test "$ {test}C";$param "$ {param}C";
}
proxy_cache_path /tmp/nginx_cache levels=1:2 keys_zone=cache:30m max_size=250m; proxy_temp_path /tmp/nginx_proxy 1 2; server { listen 80; server_name ckan210.dsistemas.lv; return 301 https://$server_name$request_uri;
}
server { listen 443 ssl; server_name ckan210.dsistemas.lv; add_header Strict-Transport-Security "max-age=31536000; includeSubDomains" always; client_max_body_size 500M; sendfile on; client_body_timeout 300; client_header_timeout 300; keepalive_timeout 900s; proxy_cookie_path / "/; secure"; server_tokens off;
add_header X-Xss-Protection "1; mode=block" always; fastcgi_hide_header X-Powered-By; fastcgi_hide_header X-Generator; fastcgi_hide_header X-Drupal-Dynamic-Cache; fastcgi_hide_header X-Drupal-Cache;
uwsgi_read_timeout 360s;
uwsgi_send_timeout 360s;
proxy_read_timeout 360s;
proxy_send_timeout 360s;
location /dati {
#proxy_pass http://127.0.0.1:5000/dati;
#proxy_set_header X-Forwarded-For $remote_addr;
#proxy_set_header Host $host;
proxy_pass http://127.0.0.1:8080/dati;
proxy_set_header X-Forwarded-For $remote_addr;
proxy_set_header Host $host;
proxy_cache cache;
proxy_cache_bypass $cookie_auth_tkt;
proxy_no_cache $cookie_auth_tkt;
proxy_cache_valid 30m;
proxy_cache_key $host$scheme$proxy_host$request_uri;
proxy_connect_timeout 300;
proxy_read_timeout 300;
if ($request_method = POST) { set $test P;
}
if ($http_referer !~ "https://ckan210\.dsistemas\.lv*") { set
}
if ($args ~* "^.sql=."){ set $param P;
}
if ($args ~*
"^.(version(.)|user$|current_user$|session_.(.)|inet_.(.)|current_.(.)|pg_.(.)|create(%20)|update(%20)|delete(%20)|drop(%20)|if(%20)|return(%20)|for(%20)|while(%20)|execute(%20)|raise(%20))."){
set $param "${param}C";
}
if ($param = PC){ return 403;
}
}
location /fanstatic { proxy_pass http://127.0.0.1:8080/dati/fanstatic; proxy_set_header X-Forwarded-For $remote_addr; proxy_set_header Host $host;
}
location /user { proxy_pass http://127.0.0.1:8080/dati/user; proxy_set_header X-Forwarded-For $remote_addr; proxy_set_header Host $host;
}
location /base { proxy_pass http://127.0.0.1:8080/dati/base; proxy_set_header X-Forwarded-For $remote_addr; proxy_set_header Host $host;
}
location /api { if ($args ~* "^.sql=."){ set $param P;
}
if ($args ~*
"^.(version(.)|user$|current_user$|session_.(.)|inet_.(.)|current_.(.)|pg_.(.)|create(%20)|update(%20)|delete(%20)|drop(%20)|if(%20)|return(%20)|for(%20)|while(%20)|execute(%20)|raise(%20))."){
set
}
if ($param = PC){ return 403;
}
proxy_pass http://127.0.0.1:8080/dati/api; proxy_set_header X-Forwarded-For $remote_addr; proxy_set_header Host $host;
}
}
Expected behavior
Using CKAN 2.10 with uwsgi can upoad large files in CKAN repo
Beta Was this translation helpful? Give feedback.
All reactions