Fork me on GitHub
#aws-lambda
<
2017-10-27
>
gonewest81805:10:40

@valtteri you were right about the environment variables. By setting them all as you did, I can now revert to the current versions of those dependencies. So thanks for that. Next problem is some exception is thrown by my lambda any time I try to invoke it via the console...

valtteri05:10:24

What is the error about?

valtteri05:10:12

And via console do you mean the AWS browser web interface ‘console’ or command line?

gonewest81815:10:39

In the AWS lambda web console the log output is

nth not supported on this type: Character: java.lang.UnsupportedOperationException
java.lang.UnsupportedOperationException: nth not supported on this type: Character
at clojure.lang.RT.nthFrom(RT.java:947)
at clojure.lang.RT.nth(RT.java:897)
at ring_aws_lambda_adapter.core$interpolate_path$_interpolate_path__4227.invoke(core.clj:12)

gonewest81817:10:09

Where locally the same app runs in jetty. I’m following this (sort of) as my guide. What’s frustrating is none of my logging is invoked so I can’t even see what the request was. So e.g. “interpolate-path” is interpolating what?

gonewest81819:10:55

@valtteri I’m pretty fed up with this. Things I’ve done: (1) raise the memory allocation for the lambda to 1536MB, (2) make sure I have AOT enabled in the uberjar profile, (3) build and test the uberjar locally using curl [WORKS], (4) deploy the lambda and test it via the AWS Lambda web console [FAILS], (5) test via the AWS API gateway web interface “/{proxy+}” [FAILS]

gonewest81819:10:21

via the API gateway the failure is the same unsupported operation exception, here’s the log for that (with account ids and keys elided):

Fri Oct 27 18:54:54 UTC 2017 : Endpoint request body after transformations: {"resource":"/{proxy+}","path":"/","httpMethod":"POST","headers":null,"queryStringParameters":{"f":"g"},"pathParameters":null,"stageVariables":null,"requestContext":{"path":"/{proxy+}","accountId":"########","resourceId":"########","stage":"test-invoke-stage","requestId":"test-invoke-request","identity":{"cognitoIdentityPoolId":null,"accountId":"########","cognitoIdentityId":null,"caller":"########","apiKey":"test-invoke-api-key","sourceIp":"test-invoke-source-ip","accessKey":"########","cognitoAuthenticationType":null,"cognitoAuthenticationProvider":null,"userArn":"arn:aws:iam::########:user/adminuser","userAgent":"Apache-HttpClient/4.5.x (Java/1.8.0_144)","user":"########"},"resourcePath":"/{proxy+}","httpMethod":"POST","apiId":"########"},"body":"h=i","isBase64Encoded":false}
Fri Oct 27 18:54:54 UTC 2017 : Sending request to 
Fri Oct 27 18:54:54 UTC 2017 : Received response. Integration latency: 75 ms
Fri Oct 27 18:54:54 UTC 2017 : Endpoint response body before transformations: {"errorMessage":"nth not supported on this type: Character","errorType":"java.lang.UnsupportedOperationException","stackTrace":["clojure.lang.RT.nthFrom(RT.java:947)","clojure.lang.RT.nth(RT.java:897)","ring_aws_lambda_adapter.core$interpolate_path$_interpolate_path__4227.invoke(core.clj:12)","clojure.core.protocols$fn__6753.invokeStatic(protocols.clj:152)","clojure.core.protocols$fn__6753.invoke(protocols.clj:124)","clojure.core.protocols$fn__6710$G__6705__6719.invoke(protocols.clj:19)","clojure.core.protocols$seq_reduce.invokeStatic(protocols.clj:31)","clojure.core.protocols$fn__6732.invokeStatic(protocols.clj:75)","clojure.core.protocols$fn__6732.invoke(protocols.clj:75)","clojure.core.protocols$fn__6684$G__6679__6697.invoke(protocols.clj:13)","clojure.core$reduce.invokeStatic(core.clj:6545)","clojure.core$reduce.invoke(core.clj:6527)","ring_aws_lambda_adapter.core$interpolate_path.invokeStatic(core.clj:12)","ring_aws_lambda_adapter.core$interpolate_path.invok [TRUNCATED]