I am facing an issue in pipeline deployment with Zappa - unable to update lambda configuration. It shows below error
Traceback (most recent call last):
File "/var/lang/lib/python3.7/site-packages/zappa/cli.py", line 3415, in handle
sys.exit(cli.handle())
File "/var/lang/lib/python3.7/site-packages/zappa/cli.py", line 588, in handle
self.dispatch_command(self.command, stage)
File "/var/lang/lib/python3.7/site-packages/zappa/cli.py", line 644, in dispatch_command
self.vargs["docker_image_uri"],
File "/var/lang/lib/python3.7/site-packages/zappa/cli.py", line 1174, in update
wait=False,
File "/var/lang/lib/python3.7/site-packages/zappa/core.py", line 1408, in update_lambda_configuration
if lambda_aws_config["PackageType"] != "Image":
KeyError: 'PackageType'
It was working previously file but now when I run the pipeline its starts failing. I have not done any changes to requirements.txt it is the same as the previous successful pass.
The version of Python is 3.7 and
AWS is running in us-east-1 region.
Upgrade to Zappa 0.54.1 fixes this issue as a wait function has been included to collect the correct key params from AWS.
Related
Trying to deploy a Flask app on Heroku, used to work perfectly with other apps, but now when I try to upgrade the db with:
>:heroku run python manage.py db upgrade
I get the following error:
Traceback (most recent call last):
File "manage.py", line 121, in <module>
manager.run()
File "/app/.heroku/python/lib/python3.6/site-packages/flask_script/__init__.py", line 417, in run
result = self.handle(argv[0], argv[1:])
File "/app/.heroku/python/lib/python3.6/site-packages/flask_script/__init__.py", line 386, in handle
res = handle(*args, **config)
File "/app/.heroku/python/lib/python3.6/site-packages/flask_script/commands.py", line 216, in __call__
return self.run(*args, **kwargs)
File "/app/.heroku/python/lib/python3.6/site-packages/flask_migrate/__init__.py", line 259, in upgrade
command.upgrade(config, revision, sql=sql, tag=tag)
File "/app/.heroku/python/lib/python3.6/site-packages/alembic/command.py", line 254, in upgrade
script.run_env()
File "/app/.heroku/python/lib/python3.6/site-packages/alembic/script/base.py", line 425, in run_env
util.load_python_file(self.dir, 'env.py')
File "/app/.heroku/python/lib/python3.6/site-packages/alembic/util/pyfiles.py", line 85, in load_python_file
raise ImportError("Can't find Python file %s" % path)
ImportError: Can't find Python file migrations/env.py
The file migrations/env.py is there on my local machine, and in the git repository:
>: git status migrations\env.py
On branch master
nothing to commit, working tree clean
Locally I work on python 3.6.3, tried also to move to python 3.6.4 on Heroku because it says 3.6.3 is not supported, but with no luck.
Locally, it works without problem, I can migrate and upgrade the DB (postgres both locally and on heroku).
Thanks
This happened to me !
Here is how I solved the problem:
I logged into my dyno using
heroku ps:exec
Then I went to my migrations folder, and the env.py was not there.
So I checked my .gitignore, and there was obviously a env* line in it.
So just delete this line, and commit your migrations/env.py on Heroku.
Try to init it first.I also encountered this problem when I implemented the examples in the book.Then I noticed that I had missed initalization.
I'm trying to use duplicity to backup files to a Swift Object Storage service offered by RunAbove. The name of the container is "backup" and it has a pseudo folder named "web" inside which I want to place backups.
Duplicity version: 0.6.24
Python version: 2.7.3
python-keystoneclient 1.0.0
python-swiftclient 2.3.1
After setting the necessary environment variables I have tried the following commands:
duplicity --no-encryption /var/www swift://backup/web/
Returns the following error:
Listing of 'backup/web/' failed (attempt 1): JSONDecodeError: Expecting value: line 1 column 1 (char 0)
Then I tried:
duplicity --no-encryption --file-prefix web/ /var/www swift://backup
Which returns python errors:
Local and Remote metadata are synchronized, no sync needed.
Last full backup date: none
No signatures found, switching to full backup.
Traceback (most recent call last):
File "/usr/bin/duplicity", line 1509, in <module>
with_tempdir(main)
File "/usr/bin/duplicity", line 1503, in with_tempdir
fn()
File "/usr/bin/duplicity", line 1352, in main
do_backup(action)
File "/usr/bin/duplicity", line 1478, in do_backup
full_backup(col_stats)
File "/usr/bin/duplicity", line 545, in full_backup
globals.backend)
File "/usr/bin/duplicity", line 420, in write_multivol
sig_outfp.to_partial()
File "/usr/lib/python2.7/dist-packages/duplicity/dup_temp.py", line 168, in to_partial
self.tdp.rename(self.dirpath.append(self.partname))
File "/usr/lib/python2.7/dist-packages/duplicity/path.py", line 612, in rename
os.rename(self.name, new_path.name)
OSError: [Errno 2] No such file or directory
How do I backup files to a pseudo folder in OpenStack Swift using duplicity?
This issue is fixed in duplicity v0.7.08 (see http://duplicity.nongnu.org/CHANGELOG)
Merged in lp:~ghoz/duplicity/swift-prefix
adds the abiliy to use path in the swift backend, in order to have multiple
backups to the same container neatly organized.
I'm developing a web-browser extension, and have found a tool which will allow me to publish the extension for all browsers from a single code-base. The tool is called Open Forge and is developed by Trigger.io.
The setup instructions listed in the Open Forge ReadMe (included in the link above) involve creating and configuring a new python environment. I've been able to create and activate a new python environment in my project directory, however the command to configure the environment (pip install -r requirements.txt) generates the following exception:
Exception:
Traceback (most recent call last):
File "C:\Users\ian\Documents\Kitchology\browser-extensions\python-env\lib\site
-packages\pip\basecommand.py", line 215, in main
status = self.run(options, args)
File "C:\Users\ian\Documents\Kitchology\browser-extensions\python-env\lib\site
-packages\pip\commands\install.py", line 347, in run
root=options.root_path,
File "C:\Users\ian\Documents\Kitchology\browser-extensions\python-env\lib\site
-packages\pip\req\req_set.py", line 497, in install
and req.installed_version in distribute_req):
File "C:\Users\ian\Documents\Kitchology\browser-extensions\python-env\lib\site
-packages\pip\_vendor\pkg_resources.py", line 2851, in __contains__
return self.specifier.contains(item, prereleases=True)
File "C:\Users\ian\Documents\Kitchology\browser-extensions\python-env\lib\site
-packages\pip\_vendor\packaging\specifiers.py", line 651, in contains
item = parse(item)
File "C:\Users\ian\Documents\Kitchology\browser-extensions\python-env\lib\site
-packages\pip\_vendor\packaging\version.py", line 41, in parse
return Version(version)
File "C:\Users\ian\Documents\Kitchology\browser-extensions\python-env\lib\site
-packages\pip\_vendor\packaging\version.py", line 202, in __init__
match = self._regex.search(version)
TypeError: expected string or buffer
The process hangs on line 17 of the requirements.txt document. The line in question is:
PyHamcrest==1.6
I have also attempted this process on Unix (OS X) and encountered the same error.
I'm able to complete the process successfully by specifying the latest version of PyHamcrest (1.8) in requirements.txt. I've never used PyHamcrest before, and don't feel comfortable speculating as to why 1.8 works while 1.6 does not.
We are trying to deploy a Python flask application on Azure but keep on reciving 500 error with following trace .
StdErr:
2014-09-22 19:24:07.347000: Unhandled exception in wfastcgi.py: Traceback (most recent call last):
File "D:\Python27\Scripts\wfastcgi.py", line 710, in main
env, handler = read_wsgi_handler(response.physical_path)
File "D:\Python27\Scripts\wfastcgi.py", line 567, in read_wsgi_handler
return env, get_wsgi_handler(handler_name)
File "D:\Python27\Scripts\wfastcgi.py", line 550, in get_wsgi_handler
raise ValueError('"%s" could not be imported' % handler_name)
ValueError: "cpmapp.app" could not be imported
2014-09-22 19:24:07.370000: wfastcgi.py 2.1.0 closed
Can anyone help ?
I've had similar issues understanding why my apps were failing on Azure.
I'm assuming you're using Azure Web Apps?
You must configure your deployment using 2 important files (web.config & deploy.cmd) and adding a requirements.txt file with the list of dependencies.
I have a blog post breaking it down
This post helped me understand what Azure is doing.
This issue occurs when deploying either by the Google App Engine Launcher and via the command-line using appcfg.py
I have tried:
- Changing version - (doesn't work)
- Deleting version from when the issue stated (24 hours ago- around the time there was some Python issues on Google) - Doesn't work
- Install one of my other applications (works)
I have been banging my head against the wall on this for 24 hours and can't get any updates onto production
-------- Output -------------------------
Scanning files on local disk.
Cloning 10 static files.
Cloning 98 application files.
Compilation starting.
Compilation completed.
Starting deployment.
Checking if deployment succeeded.
Will check again in 1 seconds.
............
Will check again in 60 seconds.
Checking if deployment succeeded.
Will check again in 60 seconds.
Checking if deployment succeeded.
Will check again in 60 seconds.
Checking if deployment succeeded.
2012-02-24 07:38:36,362 WARNING appcfg.py:1948 Version still not ready to serve, aborting.
2012-02-24 07:38:36,363 ERROR appcfg.py:2178 An unexpected error occurred. Aborting.
Traceback (most recent call last):
File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/tools/appcfg.py", line 2164, in DoUpload
app_summary = self.Commit()
File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/tools/appcfg.py", line 1949, in Commit
raise Exception('Version not ready.')
Exception: Version not ready.
Rolling back the update.
Password for XXXXX#XXXXXX: Traceback (most recent call last):
File "google_appengine/appcfg.py", line 101, in <module>
run_file(__file__, globals())
File "google_appengine/appcfg.py", line 97, in run_file
execfile(script_path, globals_)
File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/tools/appcfg.py", line 3935, in <module>
main(sys.argv)
File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/tools/appcfg.py", line 3926, in main
result = AppCfgApp(argv).Run()
File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/tools/appcfg.py", line 2497, in Run
self.action(self)
File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/tools/appcfg.py", line 3692, in __call__
return method()
File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/tools/appcfg.py", line 2915, in Update
self.UpdateVersion(rpcserver, self.basepath, appyaml)
File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/tools/appcfg.py", line 2904, in UpdateVersion
self.options.max_size)
File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/tools/appcfg.py", line 2164, in DoUpload
app_summary = self.Commit()
File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/tools/appcfg.py", line 1949, in Commit
raise Exception('Version not ready.')
Exception: Version not ready.
If deploy fails you might need to 'rollback' manually.
The "Make Symlinks..." menu option can help with command-line work.
*** appcfg.py has finished with exit code 1 ***