Graphcool / graphcool-framework

Apache License 2.0
1.77k stars 131 forks source link

Deploy functions needs update to aws lambda runtime nodejs 6.10 > nodejs8.10 #577

Closed b3nab closed 4 years ago

b3nab commented 5 years ago

For bug reports, please fill in the next sections:

Current behavior

Creating service service in cluster shared-eu-west-1... ✔
Bundling functions... ⣟
Bundling functions... 13.1s
Deploying... 776ms
There are issues with the new service definition:

  Global
    ✖ software.amazon.awssdk.services.lambda.model.InvalidParameterValueException: The runtime parameter of nodejs6.10 is no longer supported for creating or updating AWS Lambda functions. We recommend you use the new runtime (nodejs8.10) while creating or updating functions. (Service: null; Status Code: 400; Error Code: InvalidParameterValueException; Request ID: ee0cd923-76b8-11e9-a12b-2349b42e70b4)

Reproduction

I don't know how to reproduce or fix this bug, because in the graphcool.yml there isn't a runtime variable to just set to nodejs8.10.

Expected behavior?

It should just deploy as I do before in the pasts months without problems. What can I do to solve this bug during the deploy of a graphcool service?

pantharshit00 commented 5 years ago

It is fixed now

MingFaiYau commented 5 years ago

I also get this problem.. image How to solve it...

Ahrengot commented 5 years ago

Yep, same error here. Just appeared out of the blue today.

scgrossman commented 5 years ago

I'm also getting the same issue.

shokimble commented 4 years ago

So what is the fix?

froliveira94 commented 4 years ago

So what is the fix?

shokimble commented 4 years ago

I've found "the fix" unfortunately it only applies to new deployments not updating existing lambda functions. If you are trying to update production code like me I think you're out of luck.

It's from @dpetrick

https://github.com/prisma/graphcool-framework/commit/617ce95e2a4b68bc025e0d9206b5abdaf201df22#diff-0df7b5f86ea502ce516847555a3a9bed

Clearly I'm no expert on the internals but if you look at the rest of the code update seems to ignore the node runtime which would explain what's happening. Line 113 and beyond.

https://github.com/prisma/graphcool-framework/blob/master/server/backend-shared/src/main/scala/cool/graph/shared/functions/lambda/LambdaFunctionEnvironment.scala

It seems like the following one liner could be inserted between lines 128 and 129 to fix the issue

.runtime(runtime)

@dpetrick Are you able to help?

romanmandryk commented 4 years ago

This started to happen again today out of the blue. software.amazon.awssdk.services.lambda.model.InvalidParameterValueException: The runtime parameter of nodejs6.10 is no longer supported for creating or updating AWS Lambda functions.

romanmandryk commented 4 years ago

Received and advice from graphcool support and it solved the issue:

"You will need to redeploy the function in a new name so that it can reset the runtime."

shokimble commented 4 years ago

"You will need to redeploy the function in a new name so that it can reset the runtime."

Thanks for relaying that here @romanmandryk ... and it makes complete sense as the runtime is included in the create code but not the update code but that doesn't help when someone can't redeploy code as quickly that is calling the named functions such as in a mobile phone app.

Didn't get an ETA on it being resolved?

UPDATE: I tried renaming the functions and deploying with the hope that the old ones would be deleted and recreated but when naming them back and deploying again the same error occurred so please don't try do this as you'll end up completely breaking your setup.

josephmagara commented 4 years ago

@romanmandryk @shokimble

Received and advice from graphcool support and it solved the issue:

"You will need to redeploy the function in a new name so that it can reset the runtime."

Please could you give a bit more details on how to fix this? I'm stuck and cant figure out what needs to be done. I've renamed the function but the issue still occurs.

shokimble commented 4 years ago

You need to rename all your functions. Not just one. The deployment fails if even one fails.

Unfortunately for me and I'm sure many others I cant update the place the functions are called from all at once so it is not a good enough solution.

josephmagara commented 4 years ago

@shokimble Oh wow! That's hectic! At the very least is it a one time thing or would you need to rename your functions every time you need to deploy?

josephmagara commented 4 years ago

@shokimble Thank you for your help with this 😄

josephmagara commented 4 years ago

@shokimble @romanmandryk I've gone through and tried to rename all my functions but unfortunately, it's not worked. I'm guessing we're going to have to wait till this is rectified in a new graphcool-framework cli release

benseitz commented 4 years ago

Any news on this?

pantharshit00 commented 4 years ago

We have deployed a fix for this: https://github.com/prisma/graphcool-framework/commit/dc274418ba663caad8c157a8d8690127e64e6541

Please test this out now 🙏

shokimble commented 4 years ago

Phew! Finally, thanks.

I can confirm the deploy worked without errors. I haven't checked it actually updates your function but let's assume it does. If not I'll report back.

Nico-L commented 4 years ago

Hello,

I have the same issue from node6 to node 12 with a fresh install of graphcool. How do I install the fix?

Thanks

rCollet commented 4 years ago

Same issue here with v8.10 and renaming functions does not work for me.