我正在尝试在 render.com 上部署 Django 项目,但在使用 Gunicorn 时遇到了一些麻烦

问题描述 投票:0回答:0

我有一个在开发环境中工作的项目。我正在尝试在 render.com 上部署它。 根据日志构建成功。但随后 Gunicorn 启动并启动了很长一段时间的工人。部署失败,没有任何错误消息。

Apr 19 10:56:52 PM  125 static files copied to '/opt/render/project/src/myproject/staticfiles', 349 post-processed.
Apr 19 10:56:53 PM  Operations to perform:
Apr 19 10:56:53 PM    Apply all migrations: admin, auth, avito, contenttypes, sessions
Apr 19 10:56:53 PM  Running migrations:
Apr 19 10:56:53 PM    No migrations to apply.
Apr 19 10:56:54 PM  ==> Uploading build...
Apr 19 10:57:04 PM  ==> Build uploaded in 8s
Apr 19 10:57:05 PM  ==> Build successful 🎉
Apr 19 10:57:05 PM  ==> Deploying...
Apr 19 10:57:53 PM  ==> Starting service with 'cd ./myproject && gunicorn -b :8000 --preload --log-level debug myproject.wsgi'
Apr 19 10:58:00 PM  [2023-04-19 22:58:00 +0300] [51] [INFO] Starting gunicorn 20.1.0
Apr 19 10:58:00 PM  [2023-04-19 22:58:00 +0300] [51] [DEBUG] Arbiter booted
Apr 19 10:58:00 PM  [2023-04-19 22:58:00 +0300] [51] [INFO] Listening at: http://0.0.0.0:8000 (51)
Apr 19 10:58:00 PM  [2023-04-19 22:58:00 +0300] [51] [INFO] Using worker: sync
Apr 19 10:58:01 PM  [2023-04-19 22:58:01 +0300] [52] [INFO] Booting worker with pid: 52
Apr 19 10:58:01 PM  [2023-04-19 22:58:01 +0300] [51] [DEBUG] 1 workers
Apr 19 11:11:24 PM  [2023-04-19 23:11:24 +0300] [51] [INFO] Handling signal: term
Apr 19 11:11:24 PM  [2023-04-19 23:11:24 +0300] [52] [INFO] Worker exiting (pid: 52)
Apr 19 11:11:26 PM  [2023-04-19 23:11:26 +0300] [51] [INFO] Shutting down: Master

Gunicorn配置如下:

Apr 19 10:57:55 PM  [2023-04-19 19:57:55 +0000] [51] [DEBUG] Current configuration:
Apr 19 10:57:55 PM    config: ./gunicorn.conf.py
Apr 19 10:57:55 PM    wsgi_app: None
Apr 19 10:57:55 PM    bind: [':8000']
Apr 19 10:57:55 PM    backlog: 2048
Apr 19 10:57:55 PM    workers: 1
Apr 19 10:57:55 PM    worker_class: sync
Apr 19 10:57:55 PM    threads: 1
Apr 19 10:57:55 PM    worker_connections: 1000
Apr 19 10:57:55 PM    max_requests: 0
Apr 19 10:57:55 PM    max_requests_jitter: 0
Apr 19 10:57:55 PM    timeout: 30
Apr 19 10:57:55 PM    graceful_timeout: 30
Apr 19 10:57:55 PM    keepalive: 2
Apr 19 10:57:55 PM    limit_request_line: 4094
Apr 19 10:57:55 PM    limit_request_fields: 100
Apr 19 10:57:55 PM    limit_request_field_size: 8190
Apr 19 10:57:55 PM    reload: False
Apr 19 10:57:55 PM    reload_engine: auto
Apr 19 10:57:55 PM    reload_extra_files: []
Apr 19 10:57:55 PM    spew: False
Apr 19 10:57:55 PM    check_config: False
Apr 19 10:57:55 PM    print_config: False
Apr 19 10:57:55 PM    preload_app: True
Apr 19 10:57:55 PM    sendfile: None
Apr 19 10:57:55 PM    reuse_port: False
Apr 19 10:57:55 PM    chdir: /opt/render/project/src/myproject
Apr 19 10:57:55 PM    daemon: False
Apr 19 10:57:55 PM    raw_env: []
Apr 19 10:57:55 PM    pidfile: None
Apr 19 10:57:55 PM    worker_tmp_dir: None
Apr 19 10:57:55 PM    user: 1000
Apr 19 10:57:55 PM    group: 1000
Apr 19 10:57:55 PM    umask: 0
Apr 19 10:57:55 PM    initgroups: False
Apr 19 10:57:55 PM    tmp_upload_dir: None
Apr 19 10:57:55 PM    secure_scheme_headers: {'X-FORWARDED-PROTOCOL': 'ssl', 'X-FORWARDED-PROTO': 'https', 'X-FORWARDED-SSL': 'on'}
Apr 19 10:57:55 PM    forwarded_allow_ips: ['*']
Apr 19 10:57:55 PM    accesslog: -
Apr 19 10:57:55 PM    disable_redirect_access_to_syslog: False
Apr 19 10:57:55 PM    access_log_format: %(h)s %(l)s %(u)s %(t)s "%(r)s" %(s)s %(b)s "%(f)s" "%(a)s"
Apr 19 10:57:55 PM    errorlog: -
Apr 19 10:57:55 PM    loglevel: debug
Apr 19 10:57:55 PM    capture_output: False
Apr 19 10:57:55 PM    logger_class: gunicorn.glogging.Logger
Apr 19 10:57:55 PM    logconfig: None
Apr 19 10:57:55 PM    logconfig_dict: {}
Apr 19 10:57:55 PM    syslog_addr: udp://localhost:514
Apr 19 10:57:55 PM    syslog: False
Apr 19 10:57:55 PM    syslog_prefix: None
Apr 19 10:57:55 PM    syslog_facility: user
Apr 19 10:57:55 PM    enable_stdio_inheritance: False
Apr 19 10:57:55 PM    statsd_host: None
Apr 19 10:57:55 PM    dogstatsd_tags:
Apr 19 10:57:55 PM    statsd_prefix:
Apr 19 10:57:55 PM    proc_name: None
Apr 19 10:57:55 PM    default_proc_name: myproject.wsgi
Apr 19 10:57:55 PM    pythonpath: None
Apr 19 10:57:55 PM    paste: None
Apr 19 10:57:55 PM    on_starting: <function OnStarting.on_starting at 0x7fc443fe1a80>
Apr 19 10:57:55 PM    on_reload: <function OnReload.on_reload at 0x7fc443fe1bc0>
Apr 19 10:57:55 PM    when_ready: <function WhenReady.when_ready at 0x7fc443fe1d00>
Apr 19 10:57:55 PM    pre_fork: <function Prefork.pre_fork at 0x7fc443fe1e40>
Apr 19 10:57:55 PM    post_fork: <function Postfork.post_fork at 0x7fc443fe1f80>
Apr 19 10:57:55 PM    post_worker_init: <function PostWorkerInit.post_worker_init at 0x7fc443fe20c0>
Apr 19 10:57:55 PM    worker_int: <function WorkerInt.worker_int at 0x7fc443fe2200>
Apr 19 10:57:55 PM    worker_abort: <function WorkerAbort.worker_abort at 0x7fc443fe2340>
Apr 19 10:57:55 PM    pre_exec: <function PreExec.pre_exec at 0x7fc443fe2480>
Apr 19 10:57:55 PM    pre_request: <function PreRequest.pre_request at 0x7fc443fe25c0>
Apr 19 10:57:55 PM    post_request: <function PostRequest.post_request at 0x7fc443fe2660>
Apr 19 10:57:55 PM    child_exit: <function ChildExit.child_exit at 0x7fc443fe27a0>
Apr 19 10:57:55 PM    worker_exit: <function WorkerExit.worker_exit at 0x7fc443fe28e0>
Apr 19 10:57:55 PM    nworkers_changed: <function NumWorkersChanged.nworkers_changed at 0x7fc443fe2a20>
Apr 19 10:57:55 PM    on_exit: <function OnExit.on_exit at 0x7fc443fe2b60>
Apr 19 10:57:55 PM    proxy_protocol: False
Apr 19 10:57:55 PM    proxy_allow_ips: ['127.0.0.1']
Apr 19 10:57:55 PM    keyfile: None
Apr 19 10:57:55 PM    certfile: None
Apr 19 10:57:55 PM    ssl_version: 2
Apr 19 10:57:55 PM    cert_reqs: 0
Apr 19 10:57:55 PM    ca_certs: None
Apr 19 10:57:55 PM    suppress_ragged_eofs: True
Apr 19 10:57:55 PM    do_handshake_on_connect: False
Apr 19 10:57:55 PM    ciphers: None
Apr 19 10:57:55 PM    raw_paste_global_conf: []
Apr 19 10:57:55 PM    strip_header_spaces: False

我不明白什么是问题。有人可以帮忙吗?

django gunicorn render.com
© www.soinside.com 2019 - 2024. All rights reserved.