keep_warm_callback not working, No module named 'handler'
See original GitHub issueContext
I get this error message for the keep_warm_callback that gets scheduled, and it has been going on since I used venv3.8 before the repo migration, and still going on to this day
[ERROR] ModuleNotFoundError: No module named 'handler'
Traceback (most recent call last):
File "/code/zappa/handler.py", line 657, in lambda_handler
return LambdaHandler.lambda_handler(event, context)
File "/code/zappa/handler.py", line 254, in lambda_handler
return handler.handler(event, context)
File "/code/zappa/handler.py", line 389, in handler
app_function = self.import_module_and_get_function(whole_function)
File "/code/zappa/handler.py", line 245, in import_module_and_get_function
app_module = importlib.import_module(module)
File "/usr/local/lib/python3.8/importlib/__init__.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 1014, in _gcd_import
File "<frozen importlib._bootstrap>", line 991, in _find_and_load
File "<frozen importlib._bootstrap>", line 973, in _find_and_load_unlocked
-- | --
My zappa_settings.json
"aws_region": "us-east-1",
"profile_name": "default",
"project_name": "flueth",
"s3_bucket": "zappa-lambda-docker-django",
"django_settings": "flueth.settings",
"environment_variables": {
"INSTANTIATE_LAMBDA_HANDLER_ON_IMPORT": "true"
},
"lambda_description": "Zappa + Docker + Django",
"memory_size": 10240,
"keep_warm": true,
Anyone know the issue? Are we supposed to use “zappa.handler.keep_warm_callback” here? Or do I need to set something else up with env paths or something?
https://github.com/zappa/Zappa/blob/master/zappa/cli.py#L1405
Issue Analytics
- State:
- Created 2 years ago
- Comments:5
Top Results From Across the Web
ModuleNotFoundError: No module named 'handler'
I have the following declaration on my main.py import model import handler import ...
Read more >ModuleNotFoundError: no module named Python Error [Fixed]
When you try to import a module in a Python file, Python tries to resolve this module in several ways. Sometimes, Python throws...
Read more >How to Fix ModuleNotFoundError and ImportError
How does module import work behind the scenes? · Locate, load and initialise (if required) the requested module · Define necessary names in...
Read more >Unable to import module lambda function No ... - Edureka
AWS Lambda with Zappa fails on “Unable to import module 'handler': No module named builtins”. I solved the problem. I'm using pipenv ....
Read more >logging.handlers — Logging handlers — Python 3.11.1 ...
The WatchedFileHandler class, located in the logging.handlers module, is a FileHandler ... The namer function is called quite a few times during rollover, ......
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Hi @opqpop Can you please remove
INSTANTIATE_LAMBDA_HANDLER_ON_IMPORT
from your code and try again. Let me know if it works.INSTANTIATE_LAMBDA_HANDLER_ON_IMPORT
is an experimental feature see here@opqpop has the above fixed your issue?