-
Notifications
You must be signed in to change notification settings - Fork 113
Local Server Immediate Exit code: 0 (Xcode 12 b3) #148
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
Comments
I've managed to step through the LocalServer code and found that the error is occurring in EvenLoopFuture in the wait() function (Line 928). The error is:
|
Hi. @fabianfett Thanks but the problem happens when I add that flag. I managed to trace it to an error occurring inside the code that sets up the local server (see above) but I'm a little stuck beyond that. |
@IrvTheSwirv Interesting... IMHO the most interesting part so far is that you get an The error you're getting is originating here: case (.GET, let url) where url.hasSuffix(Consts.getNextInvocationURLSuffix):
// check if our server is in the correct state
guard case .waitingForLambdaRequest = Self.invocationState else {
self.logger.error("invalid invocation state \(Self.invocationState)")
self.writeResponse(context: context, response: .init(status: .unprocessableEntity))
return
} Do you have by accident two Lambda running in parallel? |
or maybe the default port (7000) is already taken by another program? |
@tomerd @fabianfett fresh eyes looking at it again this morning and you are correct Tomer, it was a process on another project I'm working on periodically listening on ports in a range around 7000 and happened to be on those ports (even after reboots) which now explains the
I was seeing when stepping through the code. Would it be fair to say the fact that the library terminates with no message and exit code 0 if it can't bind to port 7000 should be considered a bug? That cost me a day and a half of time when a message would have helped me resolve the issue immediately. |
thanks @IrvTheSwirv yes lets track this is a bug to handle this kind of error better |
Wondering if this is an Xcode 12 beta 3 issue:
Having had this issue with my own first attempt at a simple swift lambda I tried building and running the MyLambda example project here and had the same result. If I run the project without the LOCAL_LAMBDA_SERVER_ENABLED flag I get the expected:
2020-07-29T12:22:40+0100 info Lambda : lambda lifecycle starting with Configuration General(logLevel: info)) Lifecycle(id: 148308112161193, maxTimes: 0, stopSignal: TERM) RuntimeEngine(ip: 127.0.0.1, port: 7000, keepAlive: true, requestTimeout: nil 2020-07-29T12:22:40+0100 error Lambda : lifecycleIteration=0 could not fetch work from lambda runtime engine: badStatusCode(NIOHTTP1.HTTPResponseStatus.unprocessableEntity) 2020-07-29T12:22:40+0100 error Lambda : lifecycleIteration=0 lambda invocation sequence completed with error: badStatusCode(NIOHTTP1.HTTPResponseStatus.unprocessableEntity) 2020-07-29T12:22:40+0100 info Lambda : shutdown completed Program ended with exit code: 0
However, if I add the LOCAL_LAMBDA_SERVER_ENABLED flag and run, the process starts and finishes immediately and the only output is the following:
Program ended with exit code: 0
Some pointers on where to look to resolve this would be great.
The text was updated successfully, but these errors were encountered: