1

您的 requirements.txt 无效。快照您的日志以获取详细信息。

将 Django 项目部署到 aws 服务器时出错。我已经尝试升级 pip 但它不起作用。同样在 aws 文档中,在 ssh 终端中所做的任何更改如果不是文件格式,都将恢复。我尝试过查看 StackOverflow 和博客上给出的一系列解决方案。但解决方案有点旧,AWS 控制台会在短时间内不断更新。这个错误没有得到解决。在 ec2-ssh 中手动更新 pip。更新 .config 文件

这是我的要求.txt

dj-database-url==0.4.2
Django==1.10.5
django-allauth==0.31.0
django-simple-history==1.8.2
freeze==1.0.10
gunicorn==19.7.1
oauthlib==2.0.1
olefile==0.44
Pillow==4.0.0
Pinax==0.9a2
psycopg2==2.7.1
Pygments==2.2.0
python-openid==2.2.5
requery==0.3.5.1
requests==2.13.0
requests-oauthlib==0.8.0
six==1.10.0
virtualenv==15.1.0
whitenoise==3.3.0

添加activity.log文件

 Retrieving logs...
 ============= i-021263909933668a2 ==============

 -------------------------------------
 /opt/python/log/supervisord.log
-------------------------------------
2017-08-24 13:15:24,774 CRIT Supervisor running as root (no user in config file)
2017-08-24 13:15:24,784 INFO RPC interface 'supervisor' initialized
2017-08-24 13:15:24,784 CRIT Server 'unix_http_server' running without any HTTP authentication checking
2017-08-24 13:15:24,784 INFO supervisord started with pid 2943
2017-08-24 13:15:25,786 INFO spawned: 'httpd' with pid 3034
2017-08-24 13:15:26,873 INFO success: httpd entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
2017-08-24 14:08:40,855 INFO stopped: httpd (exit status 0)
2017-08-24 14:08:41,860 INFO spawned: 'httpd' with pid 5088
2017-08-24 14:08:42,888 INFO success: httpd entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)



-------------------------------------
/var/log/httpd/error_log
-------------------------------------
[Thu Aug 24 14:01:01.892540 2017] [lbmethod_heartbeat:notice] [pid 3034] AH02282: No slotmem from mod_heartmonitor
[Thu Aug 24 14:01:01.892596 2017] [:warn] [pid 3034] mod_wsgi: Compiled for Python/2.7.10.
[Thu Aug 24 14:01:01.892602 2017] [:warn] [pid 3034] mod_wsgi: Runtime using Python/2.7.12.
[Thu Aug 24 14:01:01.894216 2017] [mpm_prefork:notice] [pid 3034] AH00163: Apache/2.4.27 (Amazon) mod_wsgi/3.5 Python/2.7.12 configured -- resuming normal operations
[Thu Aug 24 14:01:01.894232 2017] [core:notice] [pid 3034] AH00094: Command line: '/usr/sbin/httpd -D FOREGROUND'
[Thu Aug 24 14:08:40.843745 2017] [mpm_prefork:notice] [pid 3034] AH00169: caught SIGTERM, shutting down
[Thu Aug 24 14:08:41.889533 2017] [suexec:notice] [pid 5088] AH01232: suEXEC mechanism enabled (wrapper: /usr/sbin/suexec)
[Thu Aug 24 14:08:41.900256 2017] [so:warn] [pid 5088] AH01574: module wsgi_module is already loaded, skipping
[Thu Aug 24 14:08:41.902693 2017] [lbmethod_heartbeat:notice] [pid 5088] AH02282: No slotmem from mod_heartmonitor
[Thu Aug 24 14:08:41.902737 2017] [:warn] [pid 5088] mod_wsgi: Compiled for Python/2.7.10.
[Thu Aug 24 14:08:41.902741 2017] [:warn] [pid 5088] mod_wsgi: Runtime using Python/2.7.12.
[Thu Aug 24 14:08:41.904563 2017] [mpm_prefork:notice] [pid 5088] AH00163: Apache/2.4.27 (Amazon) mod_wsgi/3.5 Python/2.7.12 configured -- resuming normal operations
[Thu Aug 24 14:08:41.904575 2017] [core:notice] [pid 5088] AH00094: Command line: '/usr/sbin/httpd -D FOREGROUND'
[Thu Aug 24 14:08:44.491871 2017] [:error] [pid 5095] [client 127.0.0.1:45672] Target WSGI script not found or unable to stat: /opt/python/current/app/printachu
[Thu Aug 24 14:08:45.494047 2017] [:error] [pid 5094] [client 127.0.0.1:45674] Target WSGI script not found or unable to stat: /opt/python/current/app/printachu
[Thu Aug 24 14:08:46.496148 2017] [:error] [pid 5096] [client 127.0.0.1:45676] Target WSGI script not found or unable to stat: /opt/python/current/app/printachu
[Thu Aug 24 14:08:47.498353 2017] [:error] [pid 5097] [client 127.0.0.1:45678] Target WSGI script not found or unable to stat: /opt/python/current/app/printachu



-------------------------------------
/var/log/httpd/access_log
-------------------------------------
127.0.0.1 (-) - - [24/Aug/2017:14:08:44 +0000] "GET / HTTP/1.1" 404 198 "-" "Python-urllib/2.7"
127.0.0.1 (-) - - [24/Aug/2017:14:08:45 +0000] "GET / HTTP/1.1" 404 198 "-" "Python-urllib/2.7"
127.0.0.1 (-) - - [24/Aug/2017:14:08:46 +0000] "GET / HTTP/1.1" 404 198 "-" "Python-urllib/2.7"
127.0.0.1 (-) - - [24/Aug/2017:14:08:47 +0000] "GET / HTTP/1.1" 404 198 "-" "Python-urllib/2.7"



-------------------------------------
/var/log/eb-activity.log
-------------------------------------
    inflating: /opt/python/ondeck/app/poster/templates/poster/sucess.html  
    inflating: /opt/python/ondeck/app/poster/templates/poster/temppro.html  
    inflating: /opt/python/ondeck/app/poster/templates/poster/test.html  
    inflating: /opt/python/ondeck/app/poster/templates/poster/upload.html  
    inflating: /opt/python/ondeck/app/poster/tests.py  
    inflating: /opt/python/ondeck/app/poster/urls.py  
    inflating: /opt/python/ondeck/app/poster/urls.pyc  
    inflating: /opt/python/ondeck/app/poster/views.py  
    inflating: /opt/python/ondeck/app/poster/views.pyc  
     creating: /opt/python/ondeck/app/printachu/
   extracting: /opt/python/ondeck/app/printachu/__init__.py  
    inflating: /opt/python/ondeck/app/printachu/__init__.pyc  
    inflating: /opt/python/ondeck/app/printachu/settings.py  
    inflating: /opt/python/ondeck/app/printachu/settings.pyc  
    inflating: /opt/python/ondeck/app/printachu/urls.py  
    inflating: /opt/python/ondeck/app/printachu/urls.pyc  
    inflating: /opt/python/ondeck/app/printachu/wsgi.py  
    inflating: /opt/python/ondeck/app/printachu/wsgi.pyc  
    inflating: /opt/python/ondeck/app/requirements.txt  
[2017-08-24T14:11:11.603Z] INFO  [5253]  - [Application update app-3ba1-170824_194019@4/AppDeployStage0/AppDeployPreHook/03deploy.py] : Starting activity...
[2017-08-24T14:11:12.033Z] INFO  [5253]  - [Application update app-3ba1-170824_194019@4/AppDeployStage0/AppDeployPreHook/03deploy.py] : Activity execution failed, because: Exception:
  Traceback (most recent call last):
    File "/opt/python/run/venv/local/lib/python2.7/site-packages/pip/basecommand.py", line 211, in main
      status = self.run(options, args)
    File "/opt/python/run/venv/local/lib/python2.7/site-packages/pip/commands/install.py", line 282, in run
      wheel_cache
    File "/opt/python/run/venv/local/lib/python2.7/site-packages/pip/basecommand.py", line 291, in populate_requirement_set
      wheel_cache=wheel_cache):
    File "/opt/python/run/venv/local/lib/python2.7/site-packages/pip/req/req_file.py", line 89, in parse_requirements
      for req in req_iter:
    File "/opt/python/run/venv/local/lib/python2.7/site-packages/pip/req/req_file.py", line 137, in process_line
      isolated=isolated, options=req_options, wheel_cache=wheel_cache
    File "/opt/python/run/venv/local/lib/python2.7/site-packages/pip/req/req_install.py", line 168, in from_line
      if (os.path.isdir(p) and
    File "/opt/python/run/venv/lib64/python2.7/genericpath.py", line 49, in isdir
      st = os.stat(s)
  TypeError: stat() argument 1 must be encoded string without null bytes, not str
  You are using pip version 7.1.2, however version 9.0.1 is available.
  You should consider upgrading via the 'pip install --upgrade pip' command.
  2017-08-24 14:11:12,027 ERROR    Error installing dependencies: Command '/opt/python/run/venv/bin/pip install -r /opt/python/ondeck/app/requirements.txt' returned non-zero exit status 2
  Traceback (most recent call last):
    File "/opt/elasticbeanstalk/hooks/appdeploy/pre/03deploy.py", line 22, in main
      install_dependencies()
    File "/opt/elasticbeanstalk/hooks/appdeploy/pre/03deploy.py", line 18, in install_dependencies
      check_call('%s install -r %s' % (os.path.join(APP_VIRTUAL_ENV, 'bin', 'pip'), requirements_file), shell=True)
    File "/usr/lib64/python2.7/subprocess.py", line 541, in check_call
      raise CalledProcessError(retcode, cmd)
  CalledProcessError: Command '/opt/python/run/venv/bin/pip install -r /opt/python/ondeck/app/requirements.txt' returned non-zero exit status 2 (ElasticBeanstalk::ExternalInvocationError)
caused by: Exception:
  Traceback (most recent call last):
    File "/opt/python/run/venv/local/lib/python2.7/site-packages/pip/basecommand.py", line 211, in main
      status = self.run(options, args)
    File "/opt/python/run/venv/local/lib/python2.7/site-packages/pip/commands/install.py", line 282, in run
      wheel_cache
    File "/opt/python/run/venv/local/lib/python2.7/site-packages/pip/basecommand.py", line 291, in populate_requirement_set
      wheel_cache=wheel_cache):
    File "/opt/python/run/venv/local/lib/python2.7/site-packages/pip/req/req_file.py", line 89, in parse_requirements
      for req in req_iter:
    File "/opt/python/run/venv/local/lib/python2.7/site-packages/pip/req/req_file.py", line 137, in process_line
      isolated=isolated, options=req_options, wheel_cache=wheel_cache
    File "/opt/python/run/venv/local/lib/python2.7/site-packages/pip/req/req_install.py", line 168, in from_line
      if (os.path.isdir(p) and
    File "/opt/python/run/venv/lib64/python2.7/genericpath.py", line 49, in isdir
      st = os.stat(s)
  TypeError: stat() argument 1 must be encoded string without null bytes, not str
  You are using pip version 7.1.2, however version 9.0.1 is available.
  You should consider upgrading via the 'pip install --upgrade pip' command.
  2017-08-24 14:11:12,027 ERROR    Error installing dependencies: Command '/opt/python/run/venv/bin/pip install -r /opt/python/ondeck/app/requirements.txt' returned non-zero exit status 2
  Traceback (most recent call last):
    File "/opt/elasticbeanstalk/hooks/appdeploy/pre/03deploy.py", line 22, in main
      install_dependencies()
    File "/opt/elasticbeanstalk/hooks/appdeploy/pre/03deploy.py", line 18, in install_dependencies
      check_call('%s install -r %s' % (os.path.join(APP_VIRTUAL_ENV, 'bin', 'pip'), requirements_file), shell=True)
    File "/usr/lib64/python2.7/subprocess.py", line 541, in check_call
      raise CalledProcessError(retcode, cmd)
  CalledProcessError: Command '/opt/python/run/venv/bin/pip install -r /opt/python/ondeck/app/requirements.txt' returned non-zero exit status 2 (Executor::NonZeroExitStatus)


[2017-08-24T14:11:12.033Z] INFO  [5253]  - [Application update app-3ba1-170824_194019@4/AppDeployStage0/AppDeployPreHook/03deploy.py] : Activity failed.
[2017-08-24T14:11:12.033Z] INFO  [5253]  - [Application update app-3ba1-170824_194019@4/AppDeployStage0/AppDeployPreHook] : Activity failed.
[2017-08-24T14:11:12.034Z] INFO  [5253]  - [Application update app-3ba1-170824_194019@4/AppDeployStage0] : Activity failed.
[2017-08-24T14:11:12.034Z] INFO  [5253]  - [Application update app-3ba1-170824_194019@4] : Completed activity. Result:
  Application update - Command CMD-AppDeploy failed
[2017-08-24T14:12:01.803Z] INFO  [5384]  - [CMD-TailLogs] : Starting activity...
[2017-08-24T14:12:01.803Z] INFO  [5384]  - [CMD-TailLogs/AddonsBefore] : Starting activity...
[2017-08-24T14:12:01.803Z] INFO  [5384]  - [CMD-TailLogs/AddonsBefore] : Completed activity.
[2017-08-24T14:12:01.803Z] INFO  [5384]  - [CMD-TailLogs/TailLogs] : Starting activity...
[2017-08-24T14:12:01.803Z] INFO  [5384]  - [CMD-TailLogs/TailLogs/TailLogs] : Starting activity...
[2017-08-24T14:12:02.003Z] INFO  [5384]  - [CMD-TailLogs/TailLogs/TailLogs] : Completed activity.
[2017-08-24T14:12:02.003Z] INFO  [5384]  - [CMD-TailLogs/TailLogs] : Completed activity. Result:
  CMD-TailLogs - stage 0 - Command CMD-TailLogs stage 0 completed
[2017-08-24T14:12:02.003Z] INFO  [5384]  - [CMD-TailLogs/AddonsAfter] : Starting activity...
[2017-08-24T14:12:02.003Z] INFO  [5384]  - [CMD-TailLogs/AddonsAfter] : Completed activity.
[2017-08-24T14:12:02.003Z] INFO  [5384]  - [CMD-TailLogs] : Completed activity. Result:
  CMD-TailLogs - Command CMD-TailLogs succeeded
[2017-08-24T14:14:08.346Z] INFO  [5459]  - [CMD-TailLogs] : Starting activity...
[2017-08-24T14:14:08.346Z] INFO  [5459]  - [CMD-TailLogs/AddonsBefore] : Starting activity...
[2017-08-24T14:14:08.346Z] INFO  [5459]  - [CMD-TailLogs/AddonsBefore] : Completed activity.
[2017-08-24T14:14:08.346Z] INFO  [5459]  - [CMD-TailLogs/TailLogs] : Starting activity...
[2017-08-24T14:14:08.346Z] INFO  [5459]  - [CMD-TailLogs/TailLogs/TailLogs] : Starting activity...



-------------------------------------
/var/log/eb-commandprocessor.log
-------------------------------------
  You are using pip version 7.1.2, however version 9.0.1 is available.
  You should consider upgrading via the 'pip install --upgrade pip' command.
  2017-08-24 14:11:12,027 ERROR    Error installing dependencies: Command '/opt/python/run/venv/bin/pip install -r /opt/python/ondeck/app/requirements.txt' returned non-zero exit status 2
  Traceback (most recent call last):
    File "/opt/elasticbeanstalk/hooks/appdeploy/pre/03deploy.py", line 22, in main
      install_dependencies()
    File "/opt/elasticbeanstalk/hooks/appdeploy/pre/03deploy.py", line 18, in install_dependencies
      check_call('%s install -r %s' % (os.path.join(APP_VIRTUAL_ENV, 'bin', 'pip'), requirements_file), shell=True)
    File "/usr/lib64/python2.7/subprocess.py", line 541, in check_call
      raise CalledProcessError(retcode, cmd)
  CalledProcessError: Command '/opt/python/run/venv/bin/pip install -r /opt/python/ondeck/app/requirements.txt' returned non-zero exit status 2 (ElasticBeanstalk::ExternalInvocationError)
caused by: Exception:
  Traceback (most recent call last):
    File "/opt/python/run/venv/local/lib/python2.7/site-packages/pip/basecommand.py", line 211, in main
      status = self.run(options, args)
    File "/opt/python/run/venv/local/lib/python2.7/site-packages/pip/commands/install.py", line 282, in run
      wheel_cache
    File "/opt/python/run/venv/local/lib/python2.7/site-packages/pip/basecommand.py", line 291, in populate_requirement_set
      wheel_cache=wheel_cache):
    File "/opt/python/run/venv/local/lib/python2.7/site-packages/pip/req/req_file.py", line 89, in parse_requirements
      for req in req_iter:
    File "/opt/python/run/venv/local/lib/python2.7/site-packages/pip/req/req_file.py", line 137, in process_line
      isolated=isolated, options=req_options, wheel_cache=wheel_cache
    File "/opt/python/run/venv/local/lib/python2.7/site-packages/pip/req/req_install.py", line 168, in from_line
      if (os.path.isdir(p) and
    File "/opt/python/run/venv/lib64/python2.7/genericpath.py", line 49, in isdir
      st = os.stat(s)
  TypeError: stat() argument 1 must be encoded string without null bytes, not str
  You are using pip version 7.1.2, however version 9.0.1 is available.
  You should consider upgrading via the 'pip install --upgrade pip' command.
  2017-08-24 14:11:12,027 ERROR    Error installing dependencies: Command '/opt/python/run/venv/bin/pip install -r /opt/python/ondeck/app/requirements.txt' returned non-zero exit status 2
  Traceback (most recent call last):
    File "/opt/elasticbeanstalk/hooks/appdeploy/pre/03deploy.py", line 22, in main
      install_dependencies()
    File "/opt/elasticbeanstalk/hooks/appdeploy/pre/03deploy.py", line 18, in install_dependencies
      check_call('%s install -r %s' % (os.path.join(APP_VIRTUAL_ENV, 'bin', 'pip'), requirements_file), shell=True)
    File "/usr/lib64/python2.7/subprocess.py", line 541, in check_call
      raise CalledProcessError(retcode, cmd)
  CalledProcessError: Command '/opt/python/run/venv/bin/pip install -r /opt/python/ondeck/app/requirements.txt' returned non-zero exit status 2 (Executor::NonZeroExitStatus)


[2017-08-24T14:11:12.034Z] ERROR [5253]  : Command CMD-AppDeploy failed!
[2017-08-24T14:11:12.034Z] INFO  [5253]  : Command processor returning results: 
{"status":"FAILURE","api_version":"1.0","results":[{"status":"FAILURE","msg":"(TRUNCATED)...)\n  File \"/usr/lib64/python2.7/subprocess.py\", line 541, in check_call\n    raise CalledProcessError(retcode, cmd)\nCalledProcessError: Command '/opt/python/run/venv/bin/pip install -r /opt/python/ondeck/app/requirements.txt' returned non-zero exit status 2. \nHook /opt/elasticbeanstalk/hooks/appdeploy/pre/03deploy.py failed. For more detail, check /var/log/eb-activity.log using console or EB CLI","returncode":1,"events":[{"msg":"Your requirements.txt is invalid. Snapshot your logs for details.","severity":"ERROR","timestamp":1503583871},{"msg":"Error installing dependencies: Command '/opt/python/run/venv/bin/pip install -r /opt/python/ondeck/app/requirements.txt' returned non-zero exit status 2","severity":"SYSTEM","timestamp":1503583872}]}],"truncated":"true"}
[2017-08-24T14:12:01.798Z] DEBUG [5384]  : Reading config file: /etc/elasticbeanstalk/.aws-eb-stack.properties
[2017-08-24T14:12:01.799Z] DEBUG [5384]  : Checking if the command processor should execute...
[2017-08-24T14:12:01.800Z] DEBUG [5384]  : Checking whether the command is applicable to instance (i-021263909933668a2)..
[2017-08-24T14:12:01.800Z] INFO  [5384]  : Command is applicable to this instance (i-021263909933668a2)..
[2017-08-24T14:12:01.800Z] DEBUG [5384]  : Checking if the received command stage is valid..
[2017-08-24T14:12:01.800Z] INFO  [5384]  : No stage_num in command. Valid stage..
[2017-08-24T14:12:01.800Z] INFO  [5384]  : Received command CMD-TailLogs: {"execution_data":"{\"aws_access_key_id\":\"ASIAJKMUWT6TXOJVDPFQ\",\"signature\":\"IsOWz1TlA24RiahLe+uTqjSQQF4=\",\"security_token\":\"FQoDYXdzEBcaDDWMcCnA+jnR6VBdRSKqA3Dn3wF5BQYqp3RZlWl12J31MWRD1QZBYzryO4K1j\\\/k9ao5ePl9x9ZPJZNpOhPHnFK3GD7\\\/wrbsjmA2oOk9X7GPiWQX1ZhywY0550+Gl03x2Rp3oYe31xBUi2dArvzkYuAnO8dGSoFGBfDfiWxkGEv8B6tA6ZvneV2\\\/aZ9OIALWAIzZ3qcnREO35pXegRVNKgkJmbRVbIictrG8qfXlqShfwCoMJ8cU1\\\/MP8L4TSqezAneXN1AJmweZJ8shaVuItIVrNK31YCjNCsm0QQBdECJitCA5\\\/rfYqDtX7aDBxS1VilHAdWQZnVCJ2LD7qKrYAGFnxnJS18\\\/ZxfNKvyetB3GPRZtYKZNVTIIn99TXd\\\/0PPsaJKO+Dpw3Qw2yI9HOGmG1n3gE17hiBbfjCXGCboq6p17OlSV4TuUgaiURmRPYpze+yOga1hSXyRXu6UX211\\\/Xd6\\\/\\\/k9sd+Rm6kSdSeavcTH5SlkM6+QSu+8M4kEQmFRL2m8nXOLWY7HR53v\\\/nKLEyDKVntaxlf2KODtGX0p5kGhlJGmOFyLLnncJHwBlIUBRmQSsGJqxFGaYCjqu\\\/vMBQ==\",\"policy\":\"eyJleHBpcmF0aW9uIjoiMjAxNy0wOC0yNFQxNDo0MjowMC44NFoiLCJjb25kaXRpb25zIjpbWyJzdGFydHMtd2l0aCIsIiR4LWFtei1tZXRhLXRpbWVfc3RhbXAiLCIiXSxbInN0YXJ0cy13aXRoIiwiJHgtYW16LW1ldGEtcHVibGlzaF9tZWNoYW5pc20iLCIiXSxbInN0YXJ0cy13aXRoIiwiJGtleSIsInJlc291cmNlc1wvZW52aXJvbm1lbnRzXC9sb2dzXC8iXSxbInN0YXJ0cy13aXRoIiwiJHgtYW16LW1ldGEtYmF0Y2hfaWQiLCIiXSxbInN0YXJ0cy13aXRoIiwiJHgtYW16LW1ldGEtZmlsZV9uYW1lIiwiIl0sWyJzdGFydHMtd2l0aCIsIiR4LWFtei1zZWN1cml0eS10b2tlbiIsIiJdLFsic3RhcnRzLXdpdGgiLCIkQ29udGVudC1UeXBlIiwiIl0sWyJlcSIsIiRidWNrZXQiLCJlbGFzdGljYmVhbnN0YWxrLWFwLXNvdXRoLTEtNjM5Njg2MzIyMTg1Il0sWyJlcSIsIiRhY2wiLCJwcml2YXRlIl1dfQ==\"}","instance_ids":["i-021263909933668a2"],"data":"31ef143f-88d6-11e7-86e1-e70304c7ff2d","command_name":"CMD-TailLogs","api_version":"1.0","resource_name":"AWSEBAutoScalingGroup","request_id":"31ef143f-88d6-11e7-86e1-e70304c7ff2d"}
[2017-08-24T14:12:01.800Z] INFO  [5384]  : Command processor should execute command.
[2017-08-24T14:12:01.800Z] DEBUG [5384]  : Storing current stage..
[2017-08-24T14:12:01.800Z] DEBUG [5384]  : Stage_num does not exist. Not saving null stage. Returning..
[2017-08-24T14:12:01.800Z] DEBUG [5384]  : Reading config file: /etc/elasticbeanstalk/.aws-eb-stack.properties
[2017-08-24T14:12:01.800Z] DEBUG [5384]  : Retrieving metadata for key: AWS::ElasticBeanstalk::Ext||_ContainerConfigFileContent||commands..
[2017-08-24T14:12:01.801Z] DEBUG [5384]  : Retrieving metadata for key: AWS::ElasticBeanstalk::Ext||_API||_Commands..
[2017-08-24T14:12:01.801Z] INFO  [5384]  : Found enabled addons: ["logstreaming", "logpublish"].
[2017-08-24T14:12:01.802Z] INFO  [5384]  : Updating Command definition of addon logstreaming.
[2017-08-24T14:12:01.803Z] INFO  [5384]  : Updating Command definition of addon logpublish.
    [2017-08-24T14:12:01.803Z] DEBUG [5384]  : Loaded definition of Command CMD-TailLogs.
    [2017-08-24T14:12:01.803Z] INFO  [5384]  : Executing CMD-TailLogs
    [2017-08-24T14:12:01.803Z] INFO  [5384]  : Executing command: CMD-TailLogs...
    [2017-08-24T14:12:01.803Z] INFO  [5384]  : Executing command CMD-TailLogs activities...
    [2017-08-24T14:12:01.803Z] DEBUG [5384]  : Setting environment variables..
    [2017-08-24T14:12:01.803Z] INFO  [5384]  : Running AddonsBefore for command CMD-TailLogs...
    [2017-08-24T14:12:01.803Z] DEBUG [5384]  : Running stages of Command CMD-TailLogs from stage 0 to stage 0...
    [2017-08-24T14:12:01.803Z] INFO  [5384]  : Running stage 0 of command CMD-TailLogs...
    [2017-08-24T14:12:01.803Z] DEBUG [5384]  : Loaded 1 actions for stage 0.
    [2017-08-24T14:12:01.803Z] INFO  [5384]  : Running 1 of 1 actions: TailLogs...
    [2017-08-24T14:12:02.003Z] INFO  [5384]  : Running AddonsAfter for command CMD-TailLogs...
    [2017-08-24T14:12:02.003Z] INFO  [5384]  : Command CMD-TailLogs succeeded!
    [2017-08-24T14:12:02.004Z] INFO  [5384]  : Command processor returning results: 
    {"status":"SUCCESS","api_version":"1.0","results":[{"status":"SUCCESS","msg":"","returncode":0,"events":[{"msg":"[Instance: i-021263909933668a2] Successfully finished tailing 5 log(s)","severity":"INFO","timestamp":1503583922003}]}]}
    [2017-08-24T14:14:08.342Z] DEBUG [5459]  : Reading config file: /etc/elasticbeanstalk/.aws-eb-stack.properties
    [2017-08-24T14:14:08.342Z] DEBUG [5459]  : Checking if the command processor should execute...
    [2017-08-24T14:14:08.343Z] DEBUG [5459]  : Checking whether the command is applicable to instance (i-021263909933668a2)..
    [2017-08-24T14:14:08.343Z] INFO  [5459]  : Command is applicable to this instance (i-021263909933668a2)..
    [2017-08-24T14:14:08.343Z] DEBUG [5459]  : Checking if the received command stage is valid..
    [2017-08-24T14:14:08.343Z] INFO  [5459]  : No stage_num in command. Valid stage..
    [2017-08-24T14:14:08.343Z] INFO  [5459]  : Received command CMD-TailLogs: {"execution_data":"{\"aws_access_key_id\":\"ASIAJ53OULF4R7RGWEEA\",\"signature\":\"TSczPtVwetjmhz8LHkQFvnnz\\\/j8=\",\"security_token\":\"FQoDYXdzEBcaDKcUWq5TjBH8MiM26iKqAzZ8TH4KIl2RegOGnHxItFJOIl\\\/RkrvC1qjEVWKm+t7ZnihSBzGjWs1U6o68vfn4qivd57oDYl9AXvJNNOia3hK7H6Umw9z5zUlCWxLQKYWkZdMz7k10sW+b90hKKI5aHUs2xIYvO2i6M7yR9t+mpRFMeIpJhQizwwrWBJYWHI4DQ8msPurTJfrBCg3AkcOxfpZTiiAyZ+NcljyJYEkjEQA2\\\/C01pA1pIU1vkfz4v4D9weB0iwxe80Y5ro5CL2o01xZKvwkTSY1dM18U2hyhp3gBl0XQHVzMac0Ijh9RL9Tx9wiAVYJS4MmXhVXjR8+f\\\/9umKm+i0MAW0yFYvnWErfqHyYXKwTvsygbdLBeqy9LTuvglUStzEfRdFMgcI2atsSZYqs1FLpsE0Hb\\\/S+gS5p\\\/jXna1d0Bxhe+\\\/ftE3hQkeoUeA4N3QaEzK1TFcJ4PWcs3qxYY6FMwPxE+0bXKqOHE74DVWERqmjhSuafnS6zgRXU01fW3P9tC2dO\\\/GTHgAGWB\\\/om8TF7RSwIkcTKF\\\/pQEahuQJHyxVrbMjtt+n6Iq97kU8Mz2vj2eJPCiuvvvMBQ==\",\"policy\":\"eyJleHBpcmF0aW9uIjoiMjAxNy0wOC0yNFQxNDo0NDowNi44NDRaIiwiY29uZGl0aW9ucyI6W1sic3RhcnRzLXdpdGgiLCIkeC1hbXotbWV0YS10aW1lX3N0YW1wIiwiIl0sWyJzdGFydHMtd2l0aCIsIiR4LWFtei1tZXRhLXB1Ymxpc2hfbWVjaGFuaXNtIiwiIl0sWyJzdGFydHMtd2l0aCIsIiRrZXkiLCJyZXNvdXJjZXNcL2Vudmlyb25tZW50c1wvbG9nc1wvIl0sWyJzdGFydHMtd2l0aCIsIiR4LWFtei1tZXRhLWJhdGNoX2lkIiwiIl0sWyJzdGFydHMtd2l0aCIsIiR4LWFtei1tZXRhLWZpbGVfbmFtZSIsIiJdLFsic3RhcnRzLXdpdGgiLCIkeC1hbXotc2VjdXJpdHktdG9rZW4iLCIiXSxbInN0YXJ0cy13aXRoIiwiJENvbnRlbnQtVHlwZSIsIiJdLFsiZXEiLCIkYnVja2V0IiwiZWxhc3RpY2JlYW5zdGFsay1hcC1zb3V0aC0xLTYzOTY4NjMyMjE4NSJdLFsiZXEiLCIkYWNsIiwicHJpdmF0ZSJdXX0=\"}","instance_ids":["i-021263909933668a2"],"data":"7d79c31b-88d6-11e7-b857-955a8deeb6c6","command_name":"CMD-TailLogs","api_version":"1.0","resource_name":"AWSEBAutoScalingGroup","request_id":"7d79c31b-88d6-11e7-b857-955a8deeb6c6"}
    [2017-08-24T14:14:08.343Z] INFO  [5459]  : Command processor should execute command.
    [2017-08-24T14:14:08.343Z] DEBUG [5459]  : Storing current stage..
    [2017-08-24T14:14:08.343Z] DEBUG [5459]  : Stage_num does not exist. Not saving null stage. Returning..
    [2017-08-24T14:14:08.343Z] DEBUG [5459]  : Reading config file: /etc/elasticbeanstalk/.aws-eb-stack.properties
    [2017-08-24T14:14:08.343Z] DEBUG [5459]  : Retrieving metadata for key: AWS::ElasticBeanstalk::Ext||_ContainerConfigFileContent||commands..
    [2017-08-24T14:14:08.344Z] DEBUG [5459]  : Retrieving metadata for key: AWS::ElasticBeanstalk::Ext||_API||_Commands..
    [2017-08-24T14:14:08.344Z] INFO  [5459]  : Found enabled addons: ["logstreaming", "logpublish"].
    [2017-08-24T14:14:08.345Z] INFO  [5459]  : Updating Command definition of addon logstreaming.
    [2017-08-24T14:14:08.345Z] INFO  [5459]  : Updating Command definition of addon logpublish.
    [2017-08-24T14:14:08.346Z] DEBUG [5459]  : Loaded definition of Command CMD-TailLogs.
    [2017-08-24T14:14:08.346Z] INFO  [5459]  : Executing CMD-TailLogs
    [2017-08-24T14:14:08.346Z] INFO  [5459]  : Executing command: CMD-TailLogs...
    [2017-08-24T14:14:08.346Z] INFO  [5459]  : Executing command CMD-TailLogs activities...
    [2017-08-24T14:14:08.346Z] DEBUG [5459]  : Setting environment variables..
    [2017-08-24T14:14:08.346Z] INFO  [5459]  : Running AddonsBefore for command CMD-TailLogs...
    [2017-08-24T14:14:08.346Z] DEBUG [5459]  : Running stages of Command CMD-TailLogs from stage 0 to stage 0...
    [2017-08-24T14:14:08.346Z] INFO  [5459]  : Running stage 0 of command CMD-TailLogs...
    [2017-08-24T14:14:08.346Z] DEBUG [5459]  : Loaded 1 actions for stage 0.
    [2017-08-24T14:14:08.346Z] INFO  [5459]  : Running 1 of 1 actions: TailLogs...

还附加 01package.config 文件

  packages:
  yum:
    git: []
    postgresql93-devel: []
    libjpeg-turbo-devel: []
    zlib-devel: []
    freetype-devel: []

03package.config

container_commands:
  01_addPostgreSQLPacket:
    command: 'yum install postgresql95-devel'
    leader_only: true
  02_setup_apache:
    command: "cp .ebextensions/enable_mod_deflate.conf /etc/httpd/conf.d/enable_mod_deflate.conf"
4

0 回答 0