web-dev-qa-db-fra.com

Elastic BeanStalk - La commande a échoué sur l'instance.Le erreur inattendue a eu lieu [ErrorCode: 0000000001]

Première fois que j'essaie de déployer un Django application à élastic beanstalk. L'application utilise Django canaux.

Ce sont mes fichiers de configuration:

option_settings:  
  aws:elasticbeanstalk:container:python:     
    WSGIPath: "dashboard/dashboard/wsgi.py"
  aws:elasticbeanstalk:application:environment:
    Django_SETTINGS_MODULE: "dashboard/dashboard/settings.py"
    PYTHONPATH: /opt/python/current/app/dashboard:$PYTHONPATH

  aws:elbv2:listener:80:
    DefaultProcess: http
    ListenerEnabled: 'true'
    Protocol: HTTP
    Rules: ws
  aws:elbv2:listenerrule:ws:
    PathPatterns: /websockets/*
    Process: websocket
    Priority: 1
  aws:elasticbeanstalk:environment:process:http:
    Port: '80'
    Protocol: HTTP
  aws:elasticbeanstalk:environment:process:websocket:
    Port: '5000'
    Protocol: HTTP

container_commands:
  00_pip_upgrade:
    command: "source /opt/python/run/venv/bin/activate && pip install --upgrade pip"
    ignoreErrors: false
  01_migrate:
    command: "Django-admin.py migrate"
    leader_only: true
  02_collectstatic:
    command: "Django-admin.py collectstatic --noinput"
  03_wsgipass:
    command: 'echo "WSGIPassAuthorization On" >> ../wsgi.conf'

Quand je cours eb create Django-env Je reçois les journaux suivants:

Creating application version archive "app-200617_112710".
Uploading: [##################################################] 100% Done...
Environment details for: Django-env
  Application name: dashboard
  Region: us-west-2
  Deployed Version: app-200617_112710
  Environment ID: e-rdgipdg4z3
  Platform: arn:aws:elasticbeanstalk:us-west-2::platform/Python 3.7 running on 64bit Amazon Linux 2/3.0.2
  Tier: WebServer-Standard-1.0
  CNAME: UNKNOWN
  Updated: 2020-06-17 10:27:48.898000+00:00
Printing Status:
2020-06-17 10:27:47    INFO    createEnvironment is starting.
2020-06-17 10:27:49    INFO    Using elasticbeanstalk-us-west-2-041741961231 as Amazon S3 storage bucket for environment data.
2020-06-17 10:28:10    INFO    Created security group named: sg-0942435ec637ad173
2020-06-17 10:28:25    INFO    Created load balancer named: awseb-e-r-AWSEBLoa-19UYXEUG5IA4F
2020-06-17 10:28:25    INFO    Created security group named: awseb-e-rdgipdg4z3-stack-AWSEBSecurityGroup-17RVV1ZT14855
2020-06-17 10:28:25    INFO    Created Auto Scaling launch configuration named: awseb-e-rdgipdg4z3-stack-AWSEBAutoScalingLaunchConfiguration-H5E4G2YJ3LEC
2020-06-17 10:29:30    INFO    Created Auto Scaling group named: awseb-e-rdgipdg4z3-stack-AWSEBAutoScalingGroup-1I2C273N6RN8S
2020-06-17 10:29:30    INFO    Waiting for EC2 instances to launch. This may take a few minutes.
2020-06-17 10:29:30    INFO    Created Auto Scaling group policy named: arn:aws:autoscaling:us-west-2:041741961231:scalingPolicy:8d4c8dcf-d77d-4d18-92d8-67f8a2c1cd9e:autoScalingGroupName/awseb-e-rdgipdg4z3-stack-AWSEBAutoScalingGroup-1I2C273N6RN8S:policyName/awseb-e-rdgipdg4z3-stack-AWSEBAutoScalingScaleDownPolicy-1JAUAII3SCELN
2020-06-17 10:29:30    INFO    Created Auto Scaling group policy named: arn:aws:autoscaling:us-west-2:041741961231:scalingPolicy:0c3d9c2c-bc65-44ed-8a22-2f9bef538ba7:autoScalingGroupName/awseb-e-rdgipdg4z3-stack-AWSEBAutoScalingGroup-1I2C273N6RN8S:policyName/awseb-e-rdgipdg4z3-stack-AWSEBAutoScalingScaleUpPolicy-XI8Z22SYWQKR
2020-06-17 10:29:30    INFO    Created CloudWatch alarm named: awseb-e-rdgipdg4z3-stack-AWSEBCloudwatchAlarmHigh-572C6W1QYGIC
2020-06-17 10:29:30    INFO    Created CloudWatch alarm named: awseb-e-rdgipdg4z3-stack-AWSEBCloudwatchAlarmLow-1RTNBIHPHISRO
2020-06-17 10:33:05    ERROR   [Instance: i-01576cfe5918af1c3] Command failed on instance. An unexpected error has occurred [ErrorCode: 0000000001].
2020-06-17 10:33:05    INFO    Command execution completed on all instances. Summary: [Successful: 0, Failed: 1].
2020-06-17 10:34:07    ERROR   Create environment operation is complete, but with errors. For more information, see troubleshooting documentation.

ERROR: ServiceError - Create environment operation is complete, but with errors. For more information, see troubleshooting documentation.

L'erreur est extrêmement vague et je n'ai aucune idée de ce que je fais mal.

8
Filipe Aleixo

Comme cela attire une certaine attention, je vous suggère de vérifier vos journaux élastiques beanstalk sur la console AWS, car l'erreur est complètement générique et peut être n'importe quoi. Je suggère de vérifier principalement les journaux d'exécution et d'activité CMD.

Dans mon cas, c'est parce que j'ai eu les suivants énumérés dans les exigences.txt, et ils n'ont pas réussi à s'installer sur EC2:

mkl-fft==1.1.0
mkl-random==1.1.0
mkl-service==2.3.0
pypiwin32==223
pywin32==228

Supprimer ceux des exigences.txt fixé le problème

0
Filipe Aleixo