Giter Site home page Giter Site logo

Comments (5)

andresmgot avatar andresmgot commented on September 7, 2024

There are several problems with that:

  • Depending on the RBAC rules of the cluster the user may not be able to retrieve the logs from the controller.
  • If the controller is processing a different request at the same time the logs entries may be intertwined.
  • There are other possible error causes like a syntax error that won't appear in the controller logs.

What we could do is to print some tips (like the command you mention) for people to find the problem without the need to google the issue.

from serverless-kubeless.

alexander-alvarez avatar alexander-alvarez commented on September 7, 2024

Alright, that makes sense.

Not sure if related, but I'm getting deceptive messages when the handler is defined incorrectly.

What the user sees:

~/dev/serverless$ serverless deploy
Serverless: Packaging service...
Serverless: Excluding development dependencies...
Serverless: Deploying Kafka trigger: echo-hellotopic
Serverless: Updating existing Kafka trigger
$

(you would think it was successful)
What is actually happening

time="2018-06-06T20:27:10Z" level=error msg="Function can not be created/updated: failed: incorrect handler format. It should be module_name.handler_name" pkg=function-controller
time="2018-06-06T20:27:10Z" level=error msg="Error processing default/echo (will retry): failed: incorrect handler format. It should be module_name.handler_name" pkg=function-controller

To that effect I'm struggling to define a handler within a folder e.g the main in dist/index.js
I was trying hander: dist.index.main which doesn't seem to work

I just came across https://github.com/open-bot/open-bot/blob/master/handlers.js#L7..L12 but it seems super hacky, but maybe what I'm trying to do isn't supported

from serverless-kubeless.

andresmgot avatar andresmgot commented on September 7, 2024

mm, I see, I assume that's the output of an upgrade and I also assume that the first deployment was successfully performed. The problem with that is that the client submits the changes and see that there is a working deployment so it assumes that is has been successfully updated. We should fix that.

Regarding your problem with the handler, it is not possible to use folders, the serverless.yaml file should be in the same directory than the function code. See #121. Note that you can still use an index.js file in the root folder (something like the link you posted but more simple):

index.js

module.exports = {
  main: require('./lib/index').main,
}

And define the handler as index.main.

from serverless-kubeless.

alexander-alvarez avatar alexander-alvarez commented on September 7, 2024

mm, I see, I assume that's the output of an upgrade and I also assume that the first deployment was successfully performed

Those assumptions are correct.

Thanks for the snippet -- In the above example are all files in lib automatically packaged or do we have to supply package: include: - lib/ also? Happy to improve documentation on this front if I'm told where would be best appropriate

from serverless-kubeless.

andresmgot avatar andresmgot commented on September 7, 2024

yes, all the files in the directory of the serverless.yaml are packaged except node_modules by default.

We have documentation in both the serverless repo (more related to the serverless plugin) and in the kubeless one. Happy to have contributions in any of those sites if you want to clarify something.

from serverless-kubeless.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.