Open marktani opened 6 years ago
Comment by marktani Wednesday Jan 10, 2018 at 10:22 GMT
Can you try replacing
const er = (err) => {
console.log(err.message)
return { error: err.message }
}
with
const er = (err) => {
return { error: "error" }
}
and see if that helps? 🙂
Comment by thauvette Saturday Jan 13, 2018 at 13:42 GMT
I was getting the same error. I made the changes suggested by @marktani but now the function doesn't run at all.
Comment by Boid-John Saturday Jan 13, 2018 at 16:05 GMT
Same. I moved to a different platform.
On Sat, Jan 13, 2018 at 7:42 AM, Matt Thauvette notifications@github.com wrote:
I was getting the same error. I made the suggested changes but now the function doesn't run at all.
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/graphcool/graphcool/issues/1550#issuecomment-357436291, or mute the thread https://github.com/notifications/unsubscribe-auth/Ac0uR1nisUnOodsvLh7MxDPGPJmuLlWvks5tKLLdgaJpZM4RXb9Q .
-- John Heeter Founder & CTO @ Boid.com
Comment by omatrot Monday Jan 15, 2018 at 16:17 GMT
I have the exact same problem with a typescript function of my own. I started from a mutation template. In its simple form it just awaited a timeout and returned some data. I added code that is working in a test program outside graphcool framework. I know that is is partially working because I send emails and I receive them. This is not tied to the console calls because I have none. What can I do to help pinpoint the issue ?
Comment by Boid-John Monday Jan 15, 2018 at 16:25 GMT
Graphcool is abandoning managed functions in their latest version, disappointing, as managed functions are part of the "Graphcool Framework" announced in October. I ran into many issue with their implementation so I moved to using the cli at serverless.com.
On Mon, Jan 15, 2018 at 10:17 AM, Olivier MATROT notifications@github.com wrote:
I have the exact same problem with a typescript function of my own. I started from a mutation template. In its simple form it just awaited a timeout and returned some data. I added code that is working in a test program outside graphcool framework. I know that is is partially working because I send emails and I receive them. This is not tied to the console calls because I have none. What can I do to help pinpoint the issue ?
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/graphcool/graphcool/issues/1550#issuecomment-357727791, or mute the thread https://github.com/notifications/unsubscribe-auth/Ac0uRwRNV1zAwuKXN9qwctgvaXNtnKH3ks5tK3oFgaJpZM4RXb9Q .
-- John Heeter Founder & CTO @ Boid.com
Comment by marktani Monday Jan 15, 2018 at 16:33 GMT
Hey, thanks a lot for your feedback @Boid-John, @thauvette and @omatrot 🙂 I am still looking into reproducing this and finding a workaround so we can work on a fix.
@omatrot you could try to do a "binary search" on your function, to find out which specific change introduces the error message. That would be super helpful 👍
Comment by omatrot Tuesday Jan 16, 2018 at 15:16 GMT
I'll do that because Graphcool is awesome. Stay tuned.
Comment by omatrot Tuesday Jan 16, 2018 at 17:44 GMT
I think I've found it.
I'm using Es6 Promise
Comment by omatrot Wednesday Jan 17, 2018 at 10:55 GMT
Well I'm probably wrong about my first analysis. The function is running fine up to the point of returning data. I'm using loggly to replace console.log and it shows me that everything is fine, no exception is thrown in my code...
Comment by omatrot Wednesday Jan 17, 2018 at 13:25 GMT
In a local cluster deployment it works perfectly fine. Could you tell me how get access to the shared cluster logs ? May be this could help.
Comment by marktani Thursday Jan 18, 2018 at 13:56 GMT
Hey @omatrot thanks for digging into this!
Given that it works locally but not remotely makes me believe that it might be an issue in the way graphcool deploy
bundles the local functions together before deploying it to AWS Lambda. My current assumption is that something causes an error when then executing the function in AWS Lambda, and that error is not correctly caught by the functions engine.
Do you see anything suspicious about the produced bundle, in the case of this error occuring?
You can enabled debug output by setting the env variable DEBUG
to "*"
. In fish
:
set -xg DEBUG "*"
Comment by omatrot Thursday Jan 18, 2018 at 14:11 GMT
@marktani I do not see something suspicious per se, but I notice that you're using ts-builder to transpile the typescript code. Does it take into account the tsconfig.json file ? Another question : Do you use the same node.js version on the local docker engine versus the lambda engine on AWS ? I have some experience with AWS typescript lambda and node.js is version 6.10.
Comment by omatrot Thursday Jan 18, 2018 at 16:14 GMT
My playground output is the following:
{
"data": {
"addMeeting": null
},
"errors": [
{
"locations": [
{
"line": 2,
"column": 3
}
],
"path": [
"addMeeting"
],
"code": 5000,
"message": "A function returned an unhandled error. Please check the logs for executionId 'us-west-2:simple:cjckp2902lyfb01804649umew'",
"requestId": "us-west-2:simple:cjckp2902lyfb01804649umew"
}
]
}
@marktani Have you the ability to check those logs ?
Comment by omatrot Saturday Jan 20, 2018 at 07:12 GMT
@marktani can you ping me on Slack ? I have material to reproduce the issue. I'd like to send you the code by email for privacy. Thanks in advance.
I'm also getting this error
Also getting this error
I'm also getting this error for multiple functions after an (theoretically) unrelated deploy. Also sometimes it works.
Sadly, I've also ran into this issue. Seems sporadic too.
Not sure it's related, but is there a default Timeout in CLI functions?
I have the same problem with the template googleAuthentication if I add a log for the variable "googleToken" for exemple
async function getGoogleUser(googleToken: string): Promise<GoogleUser> {
console.log("getGoogle")
// console.log("googleToken", googleToken) // log googleToken make it crashes wherever I try to log it
const endpoint = "https://www.googleapis.com/oauth2/v3/tokeninfo?id_token=" + googleToken;
const data = await fetch(endpoint)
.then(response => response.json())
I'm seeing this error as well on signup user function. Any idea what could cause this?
No news ?
Having also this issue with aws-sdk s3 upload.
Was getting this when I used requires instead of imports
Issue by Boid-John Tuesday Jan 09, 2018 at 07:52 GMT Originally opened as https://github.com/graphcool/prisma/issues/1550
Current behavior 2018-01-09T07:42:50.148Z 46ms FAILURE { "error": "Function returned invalid status code: 0. Raw body: empty.last" } Reproduction
Expected behavior? Function should work the same remote vs deployed and return useful errors
When function is run with invoke-local: