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

update docs: Function logs accepts unique name not path #1057

Closed
simonexmachina opened this issue Apr 29, 2016 · 3 comments
Closed

update docs: Function logs accepts unique name not path #1057

simonexmachina opened this issue Apr 29, 2016 · 3 comments
Milestone

Comments

@simonexmachina
Copy link

When I run sls function logs functions/donationCreate I get Cannot read property 'getDeployedName' of undefined.

I'm using serverless v0.5.5 with serverless-runtime-babel plugin, although the problem persists if I remove this plugin. I've tried using the master branch and it doesn't help.

Here's the stack trace:

/Users/simonwade/.nvm/versions/node/v6.0.0/lib/node_modules/serverless/node_modules/bluebird/js/release/async.js:61
        fn = function () { throw arg; };
                           ^

TypeError: Cannot read property 'getDeployedName' of undefined
    at FunctionLogs._validateAndPrepare (/Users/simonwade/.nvm/versions/node/v6.0.0/lib/node_modules/serverless/lib/actions/FunctionLogs.js:126:39)
From previous event:
    at FunctionLogs.functionLogs (/Users/simonwade/.nvm/versions/node/v6.0.0/lib/node_modules/serverless/lib/actions/FunctionLogs.js:95:10)
From previous event:
    at /Users/simonwade/.nvm/versions/node/v6.0.0/lib/node_modules/serverless/lib/Serverless.js:186:31
    at Array.reduce (native)
    at /Users/simonwade/.nvm/versions/node/v6.0.0/lib/node_modules/serverless/lib/Serverless.js:185:32
From previous event:
    at Serverless._execute (/Users/simonwade/.nvm/versions/node/v6.0.0/lib/node_modules/serverless/lib/Serverless.js:183:12)
    at Serverless.actions.(anonymous function) (/Users/simonwade/.nvm/versions/node/v6.0.0/lib/node_modules/serverless/lib/Serverless.js:429:20)
    at Serverless.command (/Users/simonwade/.nvm/versions/node/v6.0.0/lib/node_modules/serverless/lib/Serverless.js:398:38)
    at /Users/simonwade/.nvm/versions/node/v6.0.0/lib/node_modules/serverless/bin/serverless:19:16
    at tryOnImmediate (timers.js:534:15)
    at processImmediate [as _immediateCallback] (timers.js:514:5)
From previous event:
    at Object.<anonymous> (/Users/simonwade/.nvm/versions/node/v6.0.0/lib/node_modules/serverless/bin/serverless:18:4)
    at Module._compile (module.js:413:34)
    at Object.Module._extensions..js (module.js:422:10)
    at Module.load (module.js:357:32)
    at Function.Module._load (module.js:314:12)
    at Function.Module.runMain (module.js:447:10)
    at startup (node.js:142:18)
    at node.js:939:3
@simonexmachina
Copy link
Author

The solution to this issue is simple: function logs only accepts the last part of the function, so if I change this to sls function logs donationCreate then it works :)

This is pretty confusing for newcomers, particularly when function create does require the relative path to the function. I suggest that the various function actions should accept the function name either with or without the relative path.

@eahefnawy
Copy link
Member

hmmm @aexmachina yeah we're now enforcing unique function names across your project to make it easy to reference your functions without having to specify the path. So it's intended to work this way. Maybe the docs doesn't cover that change yet. Really sorry about that :/

Will update the docs today. Thanks for reporting 😊

@eahefnawy eahefnawy added the docs label May 2, 2016
@eahefnawy eahefnawy changed the title Can't view function logs: Cannot read property 'getDeployedName' of undefined update docs: Function logs accepts unique name not path May 2, 2016
@flomotlik flomotlik added area/docs and removed docs labels May 12, 2016
@flomotlik flomotlik added this to the 1.0 milestone May 14, 2016
@flomotlik
Copy link
Contributor

Our new logs plugin for V1 doesn't have this issue any more. Closing therefore

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