aws-lambda

gonewest818 2017-10-27T05:04:40.000040Z

@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...

šŸ‘ 1
valtteri 2017-10-27T05:07:24.000047Z

What is the error about?

valtteri 2017-10-27T05:08:12.000181Z

And via console do you mean the AWS browser web interface ā€˜consoleā€™ or command line?

gonewest818 2017-10-27T15:48:39.000150Z

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)

gonewest818 2017-10-27T17:08:09.000169Z

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?

gonewest818 2017-10-27T17:08:19.000456Z

sorry - the guide Iā€™m following is thi shttps://github.com/langford/clj-aws-lambda-example

gonewest818 2017-10-27T19:12:55.000073Z

@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]

gonewest818 2017-10-27T19:16:21.000238Z

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 <https://lambda.us-west-1.amazonaws.com/2015-03-31/functions/arn:aws:lambda:us-west-1:########:function:freshdeps-lookup-test/invocations>
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]