1
votes

I'm trying to create an environment in Amazon Elastic Beanstalk for deploying a Flask application. However, each time I run eb create I get the following error:

Your requirements.txt is invalid. Snapshot your logs for details.

I also get this error right about the previous one:

[Instance: i-05fe3499c279c3ca9] Command failed on instance. Return code: 1 Output: (TRUNCATED)...) 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. Hook /opt/elasticbeanstalk/hooks/appdeploy/pre/03deploy.py failed. For more detail, check /var/log/eb-activity.log using console or EB CLI.

My requirements.txt file:

click==6.7
Flask==0.12.2
itsdangerous==0.24
Jinja2==2.9.6
MarkupSafe==1.0
Werkzeug==0.12.2

I've tried rebuilding the environment via the AWS Console, but still persist these same errors. Anybody have any solutions? Thanks!

EDIT: Appended some of the erroneous output from activity.log:

UnicodeDecodeError: 'utf-8' codec can't decode byte 0xff in position 0: invalid start byte
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.
Error installing dependencies: Command '/opt/python/run/venv/bin/pip install -r /opt/python/ondeck/app/requirements.txt' returned non-zero exit status 2
1
"For more detail, check /var/log/eb-activity.log using console or EB CLI." Have you looked there? - mbrig
@mbrig See my edit. :-) Thanks - Mangohero1

1 Answers

2
votes

Your file seems to have a BOM. It's two bytes at the beginning of the file (usually 0xFEFF) that tell any text editor the file is UTF-8. You should remove those bytes manually, or just save your file as ANSI/ASCII (term might change depending on editor). With Windows Notepad, use Save As and pick ANSI/ASCII in the bottom drop box.