Tim-B/grunt-aws-lambda

Unable to deploy

Closed this issue · 8 comments

Unable to deploy to lambda when I run grunt deploy, getting following error:

Running "lambda_upload" task
Fatal error: Cannot read property 'Configuration' of null

My gruntfile is as follows:

var grunt = require('grunt');
grunt.loadNpmTasks('grunt-aws-lambda');

grunt.initConfig({
lambda_invoke: {
    default: {
      options: {
        file_name: 'index.js'
      }
    }
},
lambda_deploy: {
    default: {
        options: {
            timeout : 10,
            memory: 256            
        },
        arn: 'arn:aws:lambda:us-east-1:XXXXXXXX:function:XXXX'
    }
},
lambda_package: {
    default: {
    }
}
});

grunt.registerTask('deploy', ['lambda_package', 'lambda_deploy']);

I am able to run grunt lambda_package and get no issues. Tried running grunt lambda_deploy on its own, but to no avail.

Tim-B commented

Can you try running with the --stack grunt flag and see if it gives you any more information about the issue.

Running "lambda_upload" task
Fatal error: Cannot read property 'Configuration' of null
TypeError: Cannot read property 'Configuration' of null
at Response.<anonymous> (/Users/rethompsoniii/workspace/jarvis/vonBraun/node_modules/grunt-aws-lambda/tasks/lambda_upload.js:45:31)
at Request.<anonymous> (/Users/rethompsoniii/workspace/jarvis/vonBraun/node_modules/grunt-aws-lambda/node_modules/aws-sdk/lib/request.js:350:18)
at Request.callListeners (/Users/rethompsoniii/workspace/jarvis/vonBraun/node_modules/grunt-aws-lambda/node_modules/aws-sdk/lib/sequential_executor.js:100:18)
at Request.emit (/Users/rethompsoniii/workspace/jarvis/vonBraun/node_modules/grunt-aws-lambda/node_modules/aws-sdk/lib/sequential_executor.js:77:10)
at Request.emit (/Users/rethompsoniii/workspace/jarvis/vonBraun/node_modules/grunt-aws-lambda/node_modules/aws-sdk/lib/request.js:604:14)
at Request.transition (/Users/rethompsoniii/workspace/jarvis/vonBraun/node_modules/grunt-aws-lambda/node_modules/aws-sdk/lib/request.js:21:12)
at AcceptorStateMachine.runTo (/Users/rethompsoniii/workspace/jarvis/vonBraun/node_modules/grunt-aws-lambda/node_modules/aws-sdk/lib/state_machine.js:14:12)
at /Users/rethompsoniii/workspace/jarvis/vonBraun/node_modules/grunt-aws-lambda/node_modules/aws-sdk/lib/state_machine.js:26:10
at Request.<anonymous> (/Users/rethompsoniii/workspace/jarvis/vonBraun/node_modules/grunt-aws-lambda/node_modules/aws-sdk/lib/request.js:22:9)
at Request.<anonymous> (/Users/rethompsoniii/workspace/jarvis/vonBraun/node_modules/grunt-aws-lambda/node_modules/aws-sdk/lib/request.js:606:12)
Tim-B commented

I don't see a task called lambda_upload which might be causing the issue, perhaps you meant to run grunt deploy?

cipas commented

Have the same issue

Tim-B commented

Can you post your Gruntfile, the output of the grunt command with the --stack flag and check which version you're running.

rontho1992 were you able to fix this? I am having the same issue.

I have the same issue with 'grunt deploy'. Double checked function name, its correct.

grunt deploy --force --stack
Running "lambda_package:default" (lambda_package) task
aaaaaaa@1.0.0 ../../../../tmp/1513286865475.8289/node_modules/newsletter-registration
Created package at ./taaaaaaaaaaa_1-0-0_2017-11-14-21-27-45.zip

Running "lambda_deploy:default" (lambda_deploy) task
Warning: Unable to find lambda function arn:aws:lambda:ca-central-1:999999999999:function:zzzzzzz, verify the lambda function name and AWS region are correct. Used --force, continuing.
Fatal error: Cannot read property 'Configuration' of null
TypeError: Cannot read property 'Configuration' of null
at Response. (/home/ec2-user/slack-user-registration-notification/aws-files/node_modules/grunt-aws-lambda/utils/deploy_task.js:135:31)
at Request. (/home/ec2-user/slack-user-registration-notification/aws-files/node_modules/grunt-aws-lambda/node_modules/aws-sdk/lib/request.js:354:18)
at Request.callListeners (/home/ec2-user/slack-user-registration-notification/aws-files/node_modules/grunt-aws-lambda/node_modules/aws-sdk/lib/sequential_executor.js:105:20)
at Request.emit (/home/ec2-user/slack-user-registration-notification/aws-files/node_modules/grunt-aws-lambda/node_modules/aws-sdk/lib/sequential_executor.js:77:10)
at Request.emit (/home/ec2-user/slack-user-registration-notification/aws-files/node_modules/grunt-aws-lambda/node_modules/aws-sdk/lib/request.js:596:14)
at Request.transition (/home/ec2-user/slack-user-registration-notification/aws-files/node_modules/grunt-aws-lambda/node_modules/aws-sdk/lib/request.js:21:10)
at AcceptorStateMachine.runTo (/home/ec2-user/slack-user-registration-notification/aws-files/node_modules/grunt-aws-lambda/node_modules/aws-sdk/lib/state_machine.js:14:12)
at /home/ec2-user/slack-user-registration-notification/aws-files/node_modules/grunt-aws-lambda/node_modules/aws-sdk/lib/state_machine.js:26:10
at Request. (/home/ec2-user/slack-user-registration-notification/aws-files/node_modules/grunt-aws-lambda/node_modules/aws-sdk/lib/request.js:37:9)
at Request. (/home/ec2-user/slack-user-registration-notification/aws-files/node_modules/grunt-aws-lambda/node_modules/aws-sdk/lib/request.js:598:12)

Same issue