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

HandlerNotFound Error After Moving Lambda Function to Module in Chalice #2114

Open
ArKhachatryan opened this issue Jul 29, 2024 · 0 comments

Comments

@ArKhachatryan
Copy link

ArKhachatryan commented Jul 29, 2024

I have a Lambda function deployed with Chalice that is triggered by an SQS queue event. After refactoring my code to move the function from the main app.py file to a module and registering the module via a blueprint, I started receiving the following error:

[ERROR] Runtime.HandlerNotFound: Handler 'any_handler' missing on module 'app'
Traceback (most recent call last):

api.py

from chalice import Blueprint

api = Blueprint(__name__)

@api.on_sqs_message(
    queue='queue_name',
    batch_size=1
)
def any_handler(event):
    # Function logic here

app.py:


from chalice import Chalice
from chalicelib.api import api, handle_http_errors

app = Chalice(app_name='app_name')

app.api.binary_types = ['application/x-protobuf']
app.register_blueprint(api)

app.register_middleware(handle_http_errors, 'http')

Chalice version: 1.31.0

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

No branches or pull requests

1 participant