Unable to invoke a function that has hooked up to the --only-lambda-apis watcher · Issue #815 · cargo-lambda/cargo-lambda · GitHub
Skip to content

Unable to invoke a function that has hooked up to the --only-lambda-apis watcher #815

Closed

Description

@bassmanitram

Previously I could do this

  • cargo lambda watch --only-lambda-apis
  • export the env vars that that command says I should
  • run my lambda executable
  • cargo lambda invoke <payload details etc>

I would get the expected response

Now I have made is that the project is now a workspace with two binaries. I follow that sequence now and the cargo lambda invoke command returns immediately with the following error:

Error: Default function disabled

  × the default function route is disabled. To trigger a function call, add the name of a function as the invoke argument. Available functions: {"backend-url-plugin", "api-proxy-lambda"}

  Was this error unexpected?
  Open an issue in https://github.com/cargo-lambda/cargo-lambda/issues

When my lambda function hooks up to the watcher, the watcher displays the following:

Image

which appears to indicate that it has successfully hooked up as function "_". Setting AWS_LAMBDA_FUNCTION_NAME to any other value for the lambda function itself does not change the name with which it registers to the watcher.

As I said, this appears to be because I have a workspace with two binaries now - BUT since the watcher is only emulating the Lambda service and is not involved in the lifecycle of the lambda code itself then I'd still expect it to work as before.

Activity

  1. bassmanitram commented on Mar 11, 2025

    @bassmanitram
    ContributorAuthor

    I'm working on a fix - should be pretty straight forward - the determination of whether the default function is active should include an assessment of whether only-lambda-apis is true.

  2. added a commit that references this issue on Mar 12, 2025
  3. calavera commented on Mar 15, 2025

    @calavera
    Collaborator

    I just released version 1.8.0 with the fix for this issue. Thanks again for reporting it and fixing it!

  4. github-actions commented on Mar 15, 2025

    @github-actions
    Contributor

    This issue has been automatically locked. Create a new discussion if you'd like to continue the conversation. https://github.com/cargo-lambda/cargo-lambda/discussions/new?category=general

  5. locked as resolved and limited conversation to collaborators on Mar 15, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions