localstack / localstack/serverless-localstack

Golang function triggers "no such file or directory" when mountCode -> True

Open
#129 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

configuration status: backlog
Dominant language
JavaScript
Stars
542
Forks
92
PR merge metrics
No merged PRs in 30d

Description

I'm trying to invoke a function locally using localstack and a Golang binary as a handler.

If I mount the directory (mountCode: True), I get the following message when doing the invoke:

# serverless invoke --function hello -p event.json
Serverless: Using serverless-localstack
{
    "errorMessage": "RequestId: b669e3f0-8ff3-1b84-748d-066ac5b8578e Error: fork/exec /var/task/bin/adaptor-k8s: no such file or directory",
    "errorType": "exitError"
}

If I set mountCode: False, the function works without issues.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the serverless invoke command with mountCode enabled, event.json, and the Go binary at /var/task/bin/adaptor-k8s; compare it with the working mountCode-disabled case. Trace the plugin's mountCode handling and verify that invoking the function no longer reports the fork/exec "no such file or directory" error.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
backend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.