Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • Aug 01 2019 16:35
    praveenvelampudi7 commented #49
  • May 29 2018 19:21
    contractorwolf commented #49
  • May 10 2018 02:55
    deoresheetal commented #49
  • Sep 27 2017 13:25
    contractorwolf unassigned #49
  • Sep 27 2017 13:25
    contractorwolf commented #49
  • May 12 2017 15:22

    EFF on master

    Update README.md (compare)

  • May 12 2017 15:21
    EFF closed #70
  • May 12 2017 15:21
    EFF commented #70
  • May 11 2017 00:04
    Echelonsecretintelligenceofficer commented #70
  • Feb 13 2016 03:45
    vboctor opened #70
  • Jan 13 2016 18:31

    EFF on master

    Update README.md (compare)

  • Dec 11 2015 22:00
    adelevie opened #69
  • Oct 23 2015 15:55
    EFF commented #68
  • Oct 16 2015 18:31
    jakelodwick opened #68
  • Oct 06 2015 15:52
    oortlieb commented #67
  • Oct 06 2015 15:47
    slvnperron commented #67
  • Oct 06 2015 15:34
    oortlieb opened #67
  • Oct 01 2015 04:45
    chrxn commented #66
  • Sep 29 2015 17:00

    slvnperron on master

    Added 'logs:*' as a required pe… Merge pull request #66 from chr… (compare)

  • Sep 29 2015 17:00
    slvnperron closed #66
Raphaël Antonmattei
@rantonmattei
I figured it out. It is in master but not available on npm yet.
Thanks
Sylvain Perron
@slvnperron
Oh, yes. Sorry about that
We’ll push to NPM this week along with other features
Raphaël Antonmattei
@rantonmattei
Just tried to install 1.0.12
got the following:
npm ERR! Darwin 14.1.0
npm ERR! argv "node" "/usr/local/bin/npm" "install"
npm ERR! node v0.10.28
npm ERR! npm  v2.7.1
npm ERR! path /Users/rantonmattei/work/dev/lambdas/node_modules/lambdaws/bin/lambdaws-cli
npm ERR! code ENOENT
npm ERR! errno 34

npm ERR! enoent ENOENT, chmod '/Users/rantonmattei/work/dev/lambdas/node_modules/lambdaws/bin/lambdaws-cli'
npm ERR! enoent This is most likely not a problem with npm itself
npm ERR! enoent and is related to npm not being able to find a file.
npm ERR! enoent
1.0.11 is going through just fine
Anyone experienced that?
Luciano Bertenasco
@lbertenasco
Hey guys, first of all great work! It runs great and its super easy to set up. Thank you for your hard work!
Secondly, I'm having an issue sometimes when i restart or re-upload the server in ebs & local. I have 3 lambda functions and on every restart i always get one of them stuck with this message:
{ [Error: Function upload to AWS Lambda timed out.] code: 'ETIMEDOUT' }
I need to manually delete the lambda function from the aws console, then restart the server in ebs and pray that it works. its kind of random and i couldn't figure out why it happens.
Can you give me a hand?
EFF
@EFF
Hey @rantonmattei, you’re right, looks like we’re experiencing some issues with our CLI. Thanks for your feedback, I’ll fix this issue tomorrow during the day. If you get time and figure out what’s going on, please send a PR !
@lbertenasco thanks for your support. Lambdaws will get most of my attention tomorrow during the day, I’ll try to figure out what’s happening in there.
EFF
@EFF
If you guys land up on anything more that I should take care of, please feel free to notify !
Luciano Bertenasco
@lbertenasco
Thanks @EFF, meanwhile i'll keep trying to solve this by myself. if i have news i'll let you know.
EFF
@EFF
great !!!
Raphaël Antonmattei
@rantonmattei
@EFF thx! I noticed the version is also off on master in the package.json it says "version": "1.0.10" whereas the latest is supposed to be 1.0.12 according to NPM. I'll look into that error.
Another thing that could help to debug this would be to publish the tags on github, cause it is really hard for me to know what I actually pull. (I mean npm vs. github)
Sylvain Perron
@slvnperron
Hey @lbertenasco ! Thank you for the feedback, it’s really appreciated. There’s other people that had the same issue, and it seems like it could be related to a slow upload. The default timeout is 5 seconds, can you try raising that timeout to 20s?
  credentials: {
    accessKey: 'MYACCESSKEY',  // string, AWS AccessKeyId.
    secretKey: 'MYSECRETKEY',  // string, AWS AccessKeySecret.
  },
  role: 'arn:aws:iam::999999999999999:role/lambda_exec_role',  // string, AWS ARN. Must have full access to SQS.
  region: 'us-east-1',
  uploadTimeout: 30000
});
@rantonmattei you’re right, we’ll do that. Feel free to make a PR if you happen to know how to do this quickly. The CLI isn’t working with npm for some reason, but if you pull master you can run the CLI with node bin/lambdaws-cli
Luciano Bertenasco
@lbertenasco
@slvnperron good info, i mistakenly thought the default was 20s. i've just changed my config adding "uploadTimeout: 120000" (just to be safe) and it seems it fixed the issue.
I re-uploaded it several times to give it a good try and it does not break, thank you very much!
EFF
@EFF
@lbertenasco good to hear !
Sylvain Perron
@slvnperron
@lbertenasco Glad it fixed your issue!
Sylvain Perron
@slvnperron
@lbertenasco The CLI’s fixed in 1.0.14
Raphaël Antonmattei
@rantonmattei
Thanks, that's great
Raphaël Antonmattei
@rantonmattei
Hi there
I am working with S3 events
and the way the user function is called does not allow that because you call :
func.apply(this, event.args);
If I change this to
func.apply(this, [event, context]);
this works fine
so, I was about to submit a PR for that
however I ran into another issue with this line
event.args.push(doneCallback);
https://github.com/mentum/lambdaws/blob/master/lib/LambdaHelper.js#L46
because in my case, the args property is not defined
Here is the event object I get back from the invocation
[ { 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] } ] }
So, that line triggers an error
Failure while running task: TypeError: Cannot call method 'push' of undefined at __lambda__ (/var/task/index.js:13:20)
Raphaël Antonmattei
@rantonmattei
So, it seems there are differences between your examples (calling lambda from a local process) and what I am doing (calling from an S3 events)
In your example, you do need args
var minus = function(a, b, callback) { /*...*/ };
With S3 events you need the entire event obj and the context
var myFunc = function(event, context) { /*...*/ };
So, if I add my change, it's going to break the scenario in your example
Raphaël Antonmattei
@rantonmattei
so, here is what I suggest:
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)) }
}
Raphaël Antonmattei
@rantonmattei
I've a PR out: mentum/lambdaws#63
Sylvain Perron
@slvnperron
@rantonmattei You are right about the events thing. Thanks a lot for the contribution. I’ll have a look later today!
Raphaël Antonmattei
@rantonmattei
@slvnperron I read your comments and made the requested changes.
Sylvain Perron
@slvnperron
@rantonmattei Awesome! PR merged
Gustav Svalander
@gurre
What AMI roles does lambdaws require more specifically? Needs to be added to the docs.
Sylvain Perron
@slvnperron
@gurre R/W SQS, Lambda full access
zulutune
@zulutune

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?

I'm using node just as an example here, and it also doesn't work with other binaries.
The file is an executable: "-rwxr-xr-x@ 1 zulutune staff 20231104 Mar 24 03:08 node"