Skip to content

Instantly share code, notes, and snippets.

@juanibiapina
Created February 6, 2020 16:23
Show Gist options
  • Save juanibiapina/8b4342e0d83f0d8322667922ad40d805 to your computer and use it in GitHub Desktop.
Save juanibiapina/8b4342e0d83f0d8322667922ad40d805 to your computer and use it in GitHub Desktop.
LambCI Image bug
def func(event:, context:)
nil[]
end
docker run --rm -v "$PWD":/var/task:ro,delegated lambci/lambda:ruby2.5 file.func
#START RequestId: 0f54aca5-6eaf-15d0-6ea0-107e6034b792 Version: $LATEST
#Critical exception from handler
#{
# "errorMessage": "undefined method `[]' for nil:NilClass",
# "errorType": "Function<NoMethodError>",
# "stackTrace": [
# "/var/task/file.rb:2:in `func'"
# ]
#}
# This container is now stuck. It only gets stuck for some types of errors.
# this is what localstack does then: (cocky_montalcini is the name of the running container)
docker exec -e AWS_LAMBDA_EVENT_BODY="$AWS_LAMBDA_EVENT_BODY" -e HOSTNAME="$HOSTNAME" -e LOCALSTACK_HOSTNAME="$LOCALSTACK_HOSTNAME" -e AWS_LAMBDA_FUNCTION_TIMEOUT="$AWS_LAMBDA_FUNCTION_TIMEOUT" -e AWS_LAMBDA_FUNCTION_NAME="$AWS_LAMBDA_FUNCTION_NAME" -e AWS_LAMBDA_FUNCTION_VERSION="$AWS_LAMBDA_FUNCTION_VERSION" -e AWS_LAMBDA_FUNCTION_INVOKED_ARN="$AWS_LAMBDA_FUNCTION_INVOKED_ARN" -e _LAMBDA_SERVER_PORT="$_LAMBDA_SERVER_PORT" cocky_montalcini /var/rapid/init --bootstrap /var/runtime/bootstrap file.func
# now we get
# 2020/02/06 16:21:10 listen tcp :9001: bind: address already in use
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment