我看了这个问题,答案没有帮助Target WSGI script not found or unable to stat
所以我有一个错误Target WSGI script not found or unable to stat: /opt/python/current/app/application.py
,其日志如下所示:
-------------------------------------
[Mon Feb 27 06:30:18.662493 2017] [suexec:notice] [pid 2814] AH01232: suEXEC mechanism enabled (wrapper: /usr/sbin/suexec)
[Mon Feb 27 06:30:18.683705 2017] [auth_digest:notice] [pid 2814] AH01757: generating secret for digest authentication ...
[Mon Feb 27 06:30:18.684297 2017] [lbmethod_heartbeat:notice] [pid 2814] AH02282: No slotmem from mod_heartmonitor
[Mon Feb 27 06:30:18.685851 2017] [mpm_prefork:notice] [pid 2814] AH00163: Apache/2.4.25 (Amazon) mod_wsgi/3.5 Python/3.4.3 configured -- resuming normal operations
[Mon Feb 27 06:30:18.685868 2017] [core:notice] [pid 2814] AH00094: Command line: '/usr/sbin/httpd -D FOREGROUND'
[Mon Feb 27 06:31:13.692724 2017] [mpm_prefork:notice] [pid 2814] AH00169: caught SIGTERM, shutting down
[Mon Feb 27 06:31:14.807849 2017] [suexec:notice] [pid 3107] AH01232: suEXEC mechanism enabled (wrapper: /usr/sbin/suexec)
[Mon Feb 27 06:31:14.818836 2017] [so:warn] [pid 3107] AH01574: module wsgi_module is already loaded, skipping
[Mon Feb 27 06:31:14.823227 2017] [auth_digest:notice] [pid 3107] AH01757: generating secret for digest authentication ...
[Mon Feb 27 06:31:14.823836 2017] [lbmethod_heartbeat:notice] [pid 3107] AH02282: No slotmem from mod_heartmonitor
[Mon Feb 27 06:31:14.825753 2017] [mpm_prefork:notice] [pid 3107] AH00163: Apache/2.4.25 (Amazon) mod_wsgi/3.5 Python/3.4.3 configured -- resuming normal operations
[Mon Feb 27 06:31:14.825767 2017] [core:notice] [pid 3107] AH00094: Command line: '/usr/sbin/httpd -D FOREGROUND'
[Mon Feb 27 06:31:17.412531 2017] [:error] [pid 3114] [client 127.0.0.1:49512] Target WSGI script not found or unable to stat: /opt/python/current/app/application.py
[Mon Feb 27 06:31:18.414605 2017] [:error] [pid 3113] [client 127.0.0.1:49514] Target WSGI script not found or unable to stat: /opt/python/current/app/application.py
[Mon Feb 27 06:31:19.416729 2017] [:error] [pid 3115] [client 127.0.0.1:49516] Target WSGI script not found or unable to stat: /opt/python/current/app/application.py
[Mon Feb 27 06:31:20.418697 2017] [:error] [pid 3116] [client 127.0.0.1:49518] Target WSGI script not found or unable to stat: /opt/python/current/app/application.py
[Mon Feb 27 06:32:37.369544 2017] [:error] [pid 3116] [client 172.31.25.204:44521] Target WSGI script not found or unable to stat: /opt/python/current/app/application.py
[Mon Feb 27 06:32:38.135561 2017] [:error] [pid 3116] [client 172.31.25.204:44521] Target WSGI script not found or unable to stat: /opt/python/current/app/application.py
[Mon Feb 27 06:32:38.229702 2017] [:error] [pid 3116] [client 172.31.25.204:44521] Target WSGI script not found or unable to stat: /opt/python/current/app/application.py
[Mon Feb 27 06:33:31.412746 2017] [:error] [pid 3260] [client 172.31.25.204:44613] Target WSGI script not found or unable to stat: /opt/python/current/app/application.py
[Mon Feb 27 06:35:09.997950 2017] [:error] [pid 3116] [client 172.31.25.204:44703] Target WSGI script not found or unable to stat: /opt/python/current/app/application.py
[Mon Feb 27 06:35:10.172663 2017] [:error] [pid 3116] [client 172.31.25.204:44703] Target WSGI script not found or unable to stat: /opt/python/current/app/application.py, referer: http://my.url/
我的应用程序配置了eb init -p python3.4 myApp
然后eb create myEnv
然后eb deploy
。
.elasticbeanstalk / config.yml有
branch-defaults:
master:
environment: myEnv
group_suffix: null
global:
application_name: myApp
branch: null
default_ec2_keyname: null
default_platform: python3.4
default_region: us-west-2
profile: eb-cli
repository: null
sc: git
application.py文件与.elasticbeanstalk文件夹处于同一级别。
我也尝试过:
branch-defaults:
master:
environment: myEnv
group_suffix: null
environment-defaults:
myEnv:
branch: null
repository: null
global:
application_name: myApp
branch: null
default_ec2_keyname: null
default_platform: python3.4
default_region: us-west-2
profile: eb-cli
repository: null
sc: git
option_settings:
aws:elasticbeanstalk:container:python:
WSGIPath: application.py