EFF on master
Update README.md (compare)
EFF on master
Update README.md (compare)
slvnperron on master
Added 'logs:*' as a required pe… Merge pull request #66 from chr… (compare)
event.args.push(doneCallback);
[ { eventVersion: '2.0', eventSource: 'aws:s3', awsRegion: 'us-east-1', eventTime: '2015-03-18T15:40:07.417Z', eventName: 'ObjectCreated:Put', userIdentity: [Object], requestParameters: [Object], responseElements: [Object], s3: [Object] } ] }
Failure while running task: TypeError: Cannot call method 'push' of undefined at __lambda__ (/var/task/index.js:13:20)
var minus = function(a, b, callback) { /*...*/ };
var myFunc = function(event, context) { /*...*/ };
function __lambda__ (event, context) {
var utils = require('./_utils'),
callbackHandler = require('./_callbackHandler'),
externalsHandler = require('./_externalsHandler');
var doneCallback = callbackHandler.getCallback(event, context);
if (event.args) {
event.args.push(doneCallback);
}
var externals = /*externals*/null; // The external libraries to install, injected below
var func = /*user function*/null; // The user function or module to run, injected below
var runUserFunction = function() {
try {
if (event.args) {
func.apply(this, event.args);
} else {
func.apply(this, [event, context]);
}
} catch(error) {
doneCallback(utils.objectifyError(error));
}
};
try { externalsHandler.installExternals(externals, runUserFunction) }
catch(error) { doneCallback(utils.objectifyError(error)) }
}
Hey guys,
When I start a new process with require('child_process').spawn I always get "Spawn EACCES".
And when I use require('child_process').execFile, I get "Process exited before completing request".
According to the lambda docs, lambda supports creating processes, and have seen lots of examples doing that. I can't figure out what I am doing wrong. Have a stripped down, simple version which doesn't work either:
var path = require('path'),
childProcess = require('child_process')
, fs = require('fs');
exports.handler = function(event, context) {
console.log('starting handler', event);
var nodePath = path.join(__dirname, 'node');
var nodeArgs = [path.join(__dirname, 'hello.js')];
console.log('calling node: ', nodePath, nodeArgs);
try {
var proc = childProcess.spawn(nodePath, nodeArgs);
proc.stdout.on('data', function (data) {
console.log(data.toString('utf8'));
});
proc.stderr.on('data', function (data) {
console.log('error ---:> ' + data);
});
proc.on('exit', function (code) {
console.log('child process exited with code ' + code);
context.done();
});
} catch (e) {
console.log(e);
context.done(e, null);
}
};
Anyone ideas?
/**
* Lambda Set-Up
* - Upload all Lambda functions on server start so they are ready to be called
*/
var λ = require('lambdaws').create;
fs.readdirSync(path).forEach(function(file) {
var lambda_function_path = __dirname + '/app/lambda/' + file;
λ(require(lambda_function_path));
});
node_modules/lambdaws/lib/zipper.js:66
var callbackHandler = !!configs.ignoreResponse ? '_emptyCallbackHandle
TypeError: Cannot read property 'ignoreResponse' of undefined
[]
λ(require(lambda_function_path), [], {});
is should work.