Skip to content

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

Open

Description

@teebu

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?

Activity

  1. 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?[/+] on May 3, 2020
  2. abetomo commented on May 4, 2020

    @abetomo
    Contributor
    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.
  3. teebu commented on May 4, 2020

    @teebu
    Author
    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.
    
  4. teebu commented on May 4, 2020

    @teebu
    Author

    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
    
  5. added a commit that references this issue on May 4, 2020
  6. abetomo commented on May 4, 2020

    @abetomo
    Contributor

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

  7. teebu commented on May 4, 2020

    @teebu
    Author

    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.

  8. added a commit that references this issue on May 4, 2020
  9. teebu commented on May 4, 2020

    @teebu
    Author

    updateCodeReuest 😂

  10. DeviaVir commented on May 4, 2020

    @DeviaVir
    Collaborator

    Long as it's consistent.. heh

  11. teebu commented on May 4, 2020

    @teebu
    Author

    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.

  12. DeviaVir commented on May 4, 2020

    @DeviaVir
    Collaborator

    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.

  13. teebu commented on May 4, 2020

    @teebu
    Author

    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?

  14. teebu commented on Jun 13, 2020

    @teebu
    Author

    @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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions