Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a pre-deployment sanity check #78

Open
Miserlou opened this issue May 11, 2016 · 6 comments
Open

Add a pre-deployment sanity check #78

Miserlou opened this issue May 11, 2016 · 6 comments

Comments

@Miserlou
Copy link
Owner

Just display warnings if the app_module doesn't exist to avoid the

 UnboundLocalError: local variable 'app_module' referenced before assignment 

that happens from putting the wrong values in zappa_settings.

@Miserlou Miserlou assigned Miserlou and unassigned Miserlou May 11, 2016
@tipu
Copy link

tipu commented May 11, 2016

on it.

@tipu
Copy link

tipu commented May 12, 2016

I'm going to put the addition for this in zappa/cli.py:create_package(). Does this seem like a suitable place?

@Miserlou
Copy link
Owner Author

This would probably be better to but in zappa.py so that it could be used by other clients. We should expect that this function may grow over time.

@tipu
Copy link

tipu commented May 18, 2016

@Miserlou zappa/zappa.py appears to be unaware of the zappa_settings reference that zappa/cli holds onto. Should I inject the zappa_settings into zappa/zappa.py or should I implement it in the update method within ZappaCLI? The zappa_settings is necessary to access the app_function key of zappa_settings.json.

@collingreen
Copy link
Collaborator

It would be helpful to check types on config values -- for example, memory_size, parameter_depth, timout_seconds, etc all need to be numbers, not strings. If they are strings, zappa will zip your project, upload it, then fail with an error:

Parameter validation failed:
Invalid type for parameter MemorySize, value: 128, type: <type 'unicode'>, valid types: <type 'int'>, <type 'long'>

@Miserlou
Copy link
Owner Author

This recently happened to somebody in IRC:

[1471899440322] No module named your_module
[1471899440322] No module named your_module: ImportError
Traceback (most recent call last):
 File "/var/task/handler.py", line 345, in lambda_handler
   return LambdaHandler.lambda_handler(event, context)
 File "/var/task/handler.py", line 122, in lambda_handler
   return cls().handler(event, context)
 File "/var/task/handler.py", line 317, in handler
   raise e
ImportError: No module named your_module

Could we check if the specified module exists before uploading?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants