Open dk27 opened 6 years ago
That's a weird one. Try just clearing your /tmp dir and trying again.
I removed all the directories that start with 15093 as they are the ones created today and I suspect created by zappa. When I submitted zappa deploy dev, I got the same error and 2 new directories that start with 15093 appeared.
I was able to resolve this issue. When I tried to do zappa deploy in bin directory within my virtual environment where all my python packages and flask app were, it gave me error above. What I did is I created a sub directory in bin, copied my flask app, did zappa init and zappa deploy (or zappa update at that point), and that worked perfectly. Oh, I also deleted zappa_settings.json file in bin folder -- not sure if it would have worked with the file there. I don't know if creating a sub directory in bin is common practice. Tutorials that I followed seemed to skip this step. So this turned out to be a silly issue after all.
I've seen this a few times before where people are working inside their virtual environment. We might want to watch for that and fail early.
I got the same error and I found that it was because I had a text file in the bin folder that happened to have the same name as one of the python dependencies (future in my case).
Steps to reproduce (I have pandas in requirements.txt):
touch pandas
zappa deploy dev
Calling deploy for stage dev..
Oh no! An error occurred! :(
==============
Traceback (most recent call last):
File "/usr/local/lib/python3.6/distutils/dir_util.py", line 70, in mkpath
os.mkdir(head, mode)
FileExistsError: [Errno 17] File exists: '/tmp/zappa-projecttby8jj11/pandas'
Context
I am very new to Zappa and AWS. I successfully installed zappa and managed to go through zappa init. However, when I try to deploy it with zappa deploy, I keep getting this error below. I originally got an iam:role error, but I now have administrator access and the new error message is below.
Possible Fix
I am not sure if this is a permissions issue or something else. I tried removing unicode file in the tmp directory, but zappa deploy seems to just create another directory, and I get the same error.
Steps to Reproduce
I created a virtual environment with python 3.6. Below is the error that I get. Calling deploy for stage dev.. Oh no! An error occurred! :(
==============
Traceback (most recent call last): File "/usr/local/lib/python3.6/distutils/dir_util.py", line 70, in mkpath os.mkdir(head, mode) FileExistsError: [Errno 17] File exists: '/tmp/1509375791/unidecode'
During handling of the above exception, another exception occurred:
Traceback (most recent call last): File "/home/daria/Tst/lib/python3.6/site-packages/zappa/cli.py", line 2525, in handle sys.exit(cli.handle()) File "/home/daria/Tst/lib/python3.6/site-packages/zappa/cli.py", line 484, in handle self.dispatch_command(self.command, stage) File "/home/daria/Tst/lib/python3.6/site-packages/zappa/cli.py", line 518, in dispatch_command self.deploy() File "/home/daria/Tst/lib/python3.6/site-packages/zappa/cli.py", line 687, in deploy self.create_package() File "/home/daria/Tst/lib/python3.6/site-packages/zappa/cli.py", line 2099, in create_package disable_progress=self.disable_progress File "/home/daria/Tst/lib/python3.6/site-packages/zappa/core.py", line 531, in create_lambda_zip copy_tree(temp_package_path, temp_project_path, update=True) File "/usr/local/lib/python3.6/distutils/dir_util.py", line 159, in copy_tree verbose=verbose, dry_run=dry_run)) File "/usr/local/lib/python3.6/distutils/dir_util.py", line 135, in copy_tree mkpath(dst, verbose=verbose) File "/usr/local/lib/python3.6/distutils/dir_util.py", line 74, in mkpath "could not create '%s': %s" % (head, exc.args[-1])) distutils.errors.DistutilsFileError: could not create '/tmp/1509375791/unidecode': File exists
==============
Your Environment
pip freeze
: argcomplete==1.9.2 base58==0.2.4 boto==2.48.0 boto3==1.4.7 botocore==1.7.14 certifi==2017.7.27.1 chardet==3.0.4 click==6.7 docutils==0.14 durationpy==0.5 Flask==0.12.2 future==0.16.0 futures==3.1.1 hjson==3.0.0 idna==2.6 itsdangerous==0.24 Jinja2==2.9.6 jmespath==0.9.3 kappa==0.6.0 lambda-packages==0.16.1 MarkupSafe==1.0 numpy==1.13.3 pandas==0.20.3 placebo==0.8.1 python-dateutil==2.6.1 python-slugify==1.2.4 pytz==2017.2 PyYAML==3.12 requests==2.18.4 rpy2==2.9.0 s3transfer==0.1.11 scikit-learn==0.19.1 scipy==1.0.0 six==1.11.0 sklearn==0.0 toml==0.9.2 tqdm==4.15.0 troposphere==2.0.2 Unidecode==0.4.21 urllib3==1.22 Werkzeug==0.12 wsgi-request-logger==0.4.6 zappa==0.44.3