Direkt zum Inhalt

Go Lambda "fork/exec /var/task/main: no such file or directory"

0

I am building a Go application to run on lambda and we are getting the following error when calling the function URL.

{
  "errorMessage": "fork/exec /var/task/main: no such file or directory",
  "errorType": "PathError"
}

Our Zip file is called main.zip and the executable we are building is called main we then have a function in the executable called main that calls the main functionality of the lambda.

The build script is as follows.

go build -o main ./src/*.go
zip main.zip main
rm -f main

We also have the following build arguments set

GOOS=linux 
GOARCH=amd64

but we still see the error post build I can see the zip file with the executable in.

gefragt vor 4 Jahren4067 Aufrufe

1 Antwort
0

The issue was I was using a terraform module to create the deployment package and it was zipping the currently created package.

beantwortet vor 4 Jahren

Du bist nicht angemeldet. Anmelden um eine Antwort zu veröffentlichen.

Eine gute Antwort beantwortet die Frage klar, gibt konstruktives Feedback und fördert die berufliche Weiterentwicklung des Fragenstellers.