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

serverstatus and serverstartstop API Gateway Lambda fails #32

Open
rjaduthie opened this issue Jan 18, 2023 · 4 comments
Open

serverstatus and serverstartstop API Gateway Lambda fails #32

rjaduthie opened this issue Jan 18, 2023 · 4 comments

Comments

@rjaduthie
Copy link
Contributor

There seems to be some slight misconfiguration for the updownstatus API. The API responds with 500 and the Lambda logs show that the handler is not found:

{
    "errorType": "Runtime.HandlerNotFound",
    "errorMessage": "index.handler is undefined or not exported",
    "stack": [
        "Runtime.HandlerNotFound: index.handler is undefined or not exported",
        "    at UserFunction.js.module.exports.load (file:///var/runtime/index.mjs:1038:15)",
        "    at async start (file:///var/runtime/index.mjs:1200:23)",
        "    at async file:///var/runtime/index.mjs:1206:1"
    ]
}

Both endpoints are affected.

I'll take a look at this, but it'll be the earliest tomorrow.

Screenshot 2023-01-18 at 22 36 33

@rileydakota
Copy link
Owner

rileydakota commented Jan 19, 2023

Wondering if it doesn't like this recent change for some reason:

const handler: APIGatewayProxyHandler = async (event: APIGatewayEvent, context: Context) => {

Although it appears to still be exported here:

export default handler;

The original:

exports.handler = async (event, context, callback) => {

I should have some time to take a look tonight as well

@rjaduthie
Copy link
Contributor Author

My initial tests, it looks like reverting this fixes the issue. I've still got some work to figure out how to use this API properly; it's late here, so maybe I can finish testing another day.

@rjaduthie
Copy link
Contributor Author

OK, didn't leave this. The fix is substitute the const handler [...] lines with:

exports.handler = async (event: APIGatewayEvent, context: Context) => { 

However, the startstop endpoint doesn't seem to actually change the desire count of the Fargate task. I should probably create a new issue for this though.

@rjaduthie
Copy link
Contributor Author

Minimal change fix in PR #33

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

2 participants