Django и ElasticBeanstalk: внутренняя ошибка сервера, протокол HTTP / 2 будет неактивным - PullRequest
0 голосов
/ 17 сентября 2018

Я пытаюсь развернуть мое приложение Django в eb.Я создал среду на eb, и, хотя все кажется хорошим, происходит внутренняя ошибка сервера.

Я просто следовал руководству на официальном сайте.Я уже передал свои requirements.txt и .ebextensions своему мерзавцу.Я устанавливаю переменные окружения в конфигурации eb.

Но есть внутренняя ошибка сервера.А также eb open не работает.

.ebextensions/django.config

option_settings:
  aws:elasticbeanstalk:container:python:
   WSGIPath: config/wsgi.py

settings.py

ALLOWED_HOSTS = ["*"]

Я все еще использую sqlite3 на локальном,

error.log похож на это

[Mon Sep 17 03:26:31.366607 2018] [mpm_prefork:notice] [pid 10621] AH00169: caught SIGTERM, shutting down
[Mon Sep 17 03:26:32.520377 2018] [suexec:notice] [pid 11711] AH01232: suEXEC mechanism enabled (wrapper: /usr/sbin/suexec)
[Mon Sep 17 03:26:32.536121 2018] [so:warn] [pid 11711] AH01574: module wsgi_module is already loaded, skipping
[Mon Sep 17 03:26:32.538258 2018] [http2:warn] [pid 11711] AH10034: The mpm module (prefork.c) is not supported by mod_http2. The mpm determines how things are processed in your server. HTTP/2 has more demands in this regard and the currently selected mpm will just not do. This is an advisory warning. Your server will continue to work, but the HTTP/2 protocol will be inactive.
[Mon Sep 17 03:26:32.538272 2018] [http2:warn] [pid 11711] AH02951: mod_ssl does not seem to be enabled
[Mon Sep 17 03:26:32.538809 2018] [lbmethod_heartbeat:notice] [pid 11711] AH02282: No slotmem from mod_heartmonitor
[Mon Sep 17 03:26:32.538869 2018] [:warn] [pid 11711] mod_wsgi: Compiled for Python/3.6.2.
[Mon Sep 17 03:26:32.538875 2018] [:warn] [pid 11711] mod_wsgi: Runtime using Python/3.6.5.
[Mon Sep 17 03:26:32.541103 2018] [mpm_prefork:notice] [pid 11711] AH00163: Apache/2.4.33 (Amazon) mod_wsgi/3.5 Python/3.6.5 configured -- resuming normal operations
[Mon Sep 17 03:26:32.541124 2018] [core:notice] [pid 11711] AH00094: Command line: '/usr/sbin/httpd -D FOREGROUND'
[Mon Sep 17 03:26:35.694597 2018] [:error] [pid 11716] /opt/python/run/venv/local/lib/python3.6/site-packages/storages/backends/s3boto3.py:282: UserWarning: The default behavior of S3Boto3Storage is insecure and will change in django-storages 2.0. By default files and new buckets are saved with an ACL of 'public-read' (globally publicly readable). Version 2.0 will default to using the bucket's ACL. To opt into the new behavior set AWS_DEFAULT_ACL = None, otherwise to silence this warning explicitly set AWS_DEFAULT_ACL.
[Mon Sep 17 03:26:35.694625 2018] [:error] [pid 11716]   "The default behavior of S3Boto3Storage is insecure and will change "
[Mon Sep 17 03:26:35.763182 2018] [:error] [pid 11716] /opt/python/run/venv/local/lib/python3.6/site-packages/storages/backends/s3boto3.py:282: UserWarning: The default behavior of S3Boto3Storage is insecure and will change in django-storages 2.0. By default files and new buckets are saved with an ACL of 'public-read' (globally publicly readable). Version 2.0 will default to using the bucket's ACL. To opt into the new behavior set AWS_DEFAULT_ACL = None, otherwise to silence this warning explicitly set AWS_DEFAULT_ACL.
[Mon Sep 17 03:26:35.763199 2018] [:error] [pid 11716]   "The default behavior of S3Boto3Storage is insecure and will change "

Как исправить эту ошибку?

Часть, вызванная django-storages, устранена.Но другая часть все та же.

[Mon Sep 17 06:44:13.104471 2018] [mpm_prefork:notice] [pid 18559] AH00169: caught SIGTERM, shutting down
[Mon Sep 17 06:44:14.259136 2018] [suexec:notice] [pid 19102] AH01232: suEXEC mechanism enabled (wrapper: /usr/sbin/suexec)
[Mon Sep 17 06:44:14.274950 2018] [so:warn] [pid 19102] AH01574: module wsgi_module is already loaded, skipping
[Mon Sep 17 06:44:14.277045 2018] [http2:warn] [pid 19102] AH10034: The mpm module (prefork.c) is not supported by mod_http2. The mpm determines how things are processed in your server. HTTP/2 has more demands in this regard and the currently selected mpm will just not do. This is an advisory warning. Your server will continue to work, but the HTTP/2 protocol will be inactive.
[Mon Sep 17 06:44:14.277059 2018] [http2:warn] [pid 19102] AH02951: mod_ssl does not seem to be enabled
[Mon Sep 17 06:44:14.277619 2018] [lbmethod_heartbeat:notice] [pid 19102] AH02282: No slotmem from mod_heartmonitor
[Mon Sep 17 06:44:14.277677 2018] [:warn] [pid 19102] mod_wsgi: Compiled for Python/3.6.2.
[Mon Sep 17 06:44:14.277681 2018] [:warn] [pid 19102] mod_wsgi: Runtime using Python/3.6.5.
[Mon Sep 17 06:44:14.279864 2018] [mpm_prefork:notice] [pid 19102] AH00163: Apache/2.4.33 (Amazon) mod_wsgi/3.5 Python/3.6.5 configured -- resuming normal operations
[Mon Sep 17 06:44:14.279883 2018] [core:notice] [pid 19102] AH00094: Command line: '/usr/sbin/httpd -D FOREGROUND'

1 Ответ

0 голосов
/ 17 сентября 2018

Если вы прочитали ошибку, проблема возникает в приложении django-storages. Добавьте этот параметр в файл settings.py, чтобы устранить проблему.

AWS_DEFAULT_ACL = None

Это изменение исправит ошибку, с которой вы столкнулись сейчас, но, возможно, есть и другие проблемы. Пожалуйста, поделитесь более подробной информацией о следующей ошибке.

...