Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updating Lambda that was using 8.10 won't update anymore and How to end Travis with fail after unsuccessful deploy? #525

Open
teebu opened this issue May 3, 2020 · 11 comments

Comments

@teebu
Copy link

teebu commented May 3, 2020

Two issues.

  1. Updating a lambda with runtime of 8 to 12 now fails to deploy with a message:

My .env file has AWS_RUNTIME=nodejs12.x set when calling deploy. I can verify that it is using it, because the log has Runtime: 'nodejs12.x', string before it fails.

The runtime parameter of nodejs8.10 is no longer supported for creating or updating AWS Lambda functions. We recommend you use the new runtime (nodejs12.x) while creating or updating
 functions.

Any way to force update it? I had to manually log into AWS and change the version in the lambda.

  1. How can I end Travis with a fail instead of success on any type of fail to deploy thrown by node-lambda?
@teebu teebu changed the title How to end Travis with fail after unsuccessful deploy? Updating Lambda that was using 8.10 won't update anymore and How to end Travis with fail after unsuccessful deploy? May 3, 2020
@abetomo
Copy link
Contributor

abetomo commented May 4, 2020

  1. if possible, I would like to see the log of the node-lambda execution.
  2. I'd like to see the specifics of the travis configuration.

@teebu
Copy link
Author

teebu commented May 4, 2020

node-lambda deploy
=> Moving files to temporary directory
=> Running npm install --production
=> Zipping deployment package
=> Zipping repo. This might take up to 30 seconds
=> Reading zip file to memory
=> Reading event source file to memory
=> Uploading zip file to AWS Lambda us-east-1 with parameters:
{
  FunctionName: 'myfunc',
  Code: {
    ZipFile: <Buffer 50 4b 03 04 14 00 08 00 08 00 f3 10 a3 50 00 00 00 00 00 00 00 00 00 00 00 00 04 00 00 00 2e 65 6e 76 4d 8f 4b 6f 83 30 10 84 ef f9 15 56 ee 21 85 26 ... 2602897 more bytes>
  },
  Handler: 'myfunc.handler',
  Role: 'arn:aws:iam::12345:role/exec_role',
  Runtime: 'nodejs12.x',
  Description: 'generate and/or execute ES query based on parameters',
  MemorySize: '256',
  Timeout: '60',
  Publish: false,
  VpcConfig: { SubnetIds: [], SecurityGroupIds: [] },
  Environment: { Variables: null },
  KMSKeyArn: '',
  DeadLetterConfig: { TargetArn: null },
  TracingConfig: { Mode: null }
}
The runtime parameter of nodejs8.10 is no longer supported for creating or updating AWS Lambda functions. We recommend you use the new runtime (nodejs12.x) while creating or updating functions.
=> Retrying
InvalidParameterValueException: The runtime parameter of nodejs8.10 is no longer supported for creating or updating AWS Lambda functions. We recommend you use the new runtime (nodejs12.x) while creating or updating functions.
    at Object.extractError (/home/travis/.nvm/versions/node/v12.16.3/lib/node_modules/node-lambda/node_modules/aws-sdk/lib/protocol/json.js:51:27)
    at Request.extractError (/home/travis/.nvm/versions/node/v12.16.3/lib/node_modules/node-lambda/node_modules/aws-sdk/lib/protocol/rest_json.js:55:8)
    at Request.callListeners (/home/travis/.nvm/versions/node/v12.16.3/lib/node_modules/node-lambda/node_modules/aws-sdk/lib/sequential_executor.js:106:20)
    at Request.emit (/home/travis/.nvm/versions/node/v12.16.3/lib/node_modules/node-lambda/node_modules/aws-sdk/lib/sequential_executor.js:78:10)
    at Request.emit (/home/travis/.nvm/versions/node/v12.16.3/lib/node_modules/node-lambda/node_modules/aws-sdk/lib/request.js:683:14)
    at Request.transition (/home/travis/.nvm/versions/node/v12.16.3/lib/node_modules/node-lambda/node_modules/aws-sdk/lib/request.js:22:10)
    at AcceptorStateMachine.runTo (/home/travis/.nvm/versions/node/v12.16.3/lib/node_modules/node-lambda/node_modules/aws-sdk/lib/state_machine.js:14:12)
    at /home/travis/.nvm/versions/node/v12.16.3/lib/node_modules/node-lambda/node_modules/aws-sdk/lib/state_machine.js:26:10
    at Request.<anonymous> (/home/travis/.nvm/versions/node/v12.16.3/lib/node_modules/node-lambda/node_modules/aws-sdk/lib/request.js:38:9)
    at Request.<anonymous> (/home/travis/.nvm/versions/node/v12.16.3/lib/node_modules/node-lambda/node_modules/aws-sdk/lib/request.js:685:12) {
  code: 'InvalidParameterValueException',
  time: 2020-05-03T02:07:45.477Z,
  requestId: '9bc44ab5-a682-4f3e-94f9-a57b0c025005',
  statusCode: 400,
  retryable: false,
  retryDelay: 39.15361165564799
}
Done. Your build exited with 0.

@teebu
Copy link
Author

teebu commented May 4, 2020

Travis Config

language: node_js
env:
  global:
    #need AWS user to update/create lambdas
    secure: wHf6Mhmj36Xsy
node_js:
- '12'
before_install:
  #set github api key (set in travis env var CI_USER_TOKEN) to .netrc to be able to install private repo modules
  - echo -e "machine github.com\n  login $CI_USER_TOKEN" >> ~/.netrc
after_success:
- npm install -g node-lambda
- node-lambda deploy

abetomo added a commit to abetomo/node-lambda that referenced this issue May 4, 2020
motdotla#525

```
The runtime parameter of nodejs8.10 is no longer supported for creating or updating AWS Lambda functions. We recommend you use the new runtime (nodejs12.x) while creating or updating functions.
```

Current Code:
First, update the function code.
At this time, the configuration is still outdated, so the runtime updates it with nodejs.8.10, which results in an error.

Modifications:
Update your settings at the beginning.
This will update the runtime, so the update is expected to succeed.

Since I can't create any nodejs8.10 functions already, I can't confirm their operation at hand.
@abetomo
Copy link
Contributor

abetomo commented May 4, 2020

Thank you.
As for the nodejs8.10 error, I've opened a PR.

@teebu
Copy link
Author

teebu commented May 4, 2020

OK let me know, I still have a few older lambdas that I can test this on. I know there is no going back after updating the lambda, but there are plenty of us with older lambdas that could use this fix.

DeviaVir pushed a commit that referenced this issue May 4, 2020
#525

```
The runtime parameter of nodejs8.10 is no longer supported for creating or updating AWS Lambda functions. We recommend you use the new runtime (nodejs12.x) while creating or updating functions.
```

Current Code:
First, update the function code.
At this time, the configuration is still outdated, so the runtime updates it with nodejs.8.10, which results in an error.

Modifications:
Update your settings at the beginning.
This will update the runtime, so the update is expected to succeed.

Since I can't create any nodejs8.10 functions already, I can't confirm their operation at hand.
@teebu
Copy link
Author

teebu commented May 4, 2020

updateCodeReuest 😂

@DeviaVir
Copy link
Collaborator

DeviaVir commented May 4, 2020

Long as it's consistent.. heh

@teebu
Copy link
Author

teebu commented May 4, 2020

I can confirm it's working. Just pushed an older 6 lambda to 12 that was throwing errors previously.

Can you push it to npm? I think your pusher is broken. Thanks.

@DeviaVir
Copy link
Collaborator

DeviaVir commented May 4, 2020

Jenkins has been set up to push on tags, once we have a 0.17.0 PR like this we can go ahead and get a tag up that will be automatically pushed.

@teebu
Copy link
Author

teebu commented May 4, 2020

As for my second issue. Do you think node-lambda exists with a 0 on fail deploys? Is that the case with Travis thinking it was successful? Any advice how to properly setup the travis?

@teebu
Copy link
Author

teebu commented Jun 13, 2020

@DeviaVir I see the 17 release, but https://www.npmjs.com/package/node-lambda still showing 16, some test fail?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants