Active: failed (Result: exit-code) since Sun 2023-09-03 16:05:30 UTC; 19s ago #3062
Replies: 1 comment
-
Conseguiu resolver o problema? parece que o erro está relacionado à falta de especificação de uma região para o boto3, que é uma biblioteca usada para interagir com serviços da AWS. Aqui estão algumas sugestões para resolver o problema: Especificar a Região do AWS: Verifique se você especificou a região correta no seu código ou nas variáveis de ambiente. import boto3 Código gerado por IA. Examine e use com cuidado. Mais informações em perguntas frequentes. Ou defina a variável de ambiente: export AWS_DEFAULT_REGION=us-east-1 Outro detalhe é a criação do serviço para o Gunicorn sudo tee /etc/systemd/system/$project_name.service <<EOL [Service] [Install] |
Beta Was this translation helpful? Give feedback.
-
Greetings Everyone!
I need help regarding Gunicorn's "failed" service. I tried the following solutions to resolve the issue but I keep getting the same error message:
Your advice and suggestions will be greatly appreciated!
Below is the Gunicorn service configuration file and the "failed" error message I get every time I run commands 4, 5, and 6 above:
[Unit]
Description=Gunicorn instance to serve
After=network.target
[Service]
User=
Group=www-data
WorkingDirectory=
Environment="PATH=/humangovenv/bin"
Environment="AWS_REGION=us-east-1"
Environment="AWS_DYNAMODB_TABLE=humangov-new-york-dynamodb"
Environment="AWS_BUCKET=humangov-new-york-s3-pb7tt"
Environment="US_STATE=new-york"
ExecStart=$project_name/humangovenv/bin/gunicorn --workers 1 --bind unix:/.sock -m 007 :app
[Install]
WantedBy=multi-user.target
(humangovenv) ubuntu@ip-:/etc/systemd/system$ clear
(humangovenv) ubuntu@ip-:/etc/systemd/system$ sudo systemctl daemon-reload
(humangovenv) ubuntu@ip-:/etc/systemd/system$ sudo systemctl restart humangov
(humangovenv) ubuntu@ip-:/etc/systemd/system$ sudo systemctl status humangov
● humangov.service - Gunicorn instance to serve humangov
Loaded: loaded (/etc/systemd/system/humangov.service; enabled; vendor preset: enabled)
Active: failed (Result: exit-code) since Sun 2023-09-03 16:05:30 UTC; 19s ago
Process: 37017 ExecStart=/home/ubuntu/humangov/humangovenv/bin/gunicorn --workers 1 --bind unix:/home/ubuntu/h>
Main PID: 37017 (code=exited, status=3)
Sep 03 16:05:30 ip- gunicorn[37019]: File "/home/ubuntu/humangov/humangovenv/lib/python3.8/site-package>
Sep 03 16:05:30 ip- gunicorn[37019]: result = self._endpoint_for_partition(
Sep 03 16:05:30 ip- gunicorn[37019]: File "/home/ubuntu/humangov/humangovenv/lib/python3.8/site-package>
Sep 03 16:05:30 ip- gunicorn[37019]: raise NoRegionError()
Sep 03 16:05:30 ip- gunicorn[37019]: botocore.exceptions.NoRegionError: You must specify a region.
Sep 03 16:05:30 ip- gunicorn[37019]: [2023-09-03 16:05:30 +0000] [37019] [INFO] Worker exiting (pid: 3701>
Sep 03 16:05:30 ip- gunicorn[37017]: [2023-09-03 16:05:30 +0000] [37017] [INFO] Shutting down: Master
Sep 03 16:05:30 ip- gunicorn[37017]: [2023-09-03 16:05:30 +0000] [37017] [INFO] Reason: Worker failed to >
Sep 03 16:05:30 ip- systemd[1]: humangov.service: Main process exited, code=exited, status=3/NOTIMPLEMENT>
Sep 03 16:05:30 ip- systemd[1]: humangov.service: Failed with result 'exit-code'.
lines 1-16/16 (END)
Thank you for your suggestions!
Beta Was this translation helpful? Give feedback.
All reactions