Fixing /opt/wrapper: does not exist error in Vercel PHP functions

,

Running Vercel community PHP on a side proejct and this bug has started appearing out of nowhere. suggesting Vercel changed something as of last night:

The same code that ran and deployed yesterday is failing today due to the /opt/wrapper issue

1 Like

Hi @absalomedia, welcome to the Vercel Community!

Sorry that you are facing this issue.

Could you share your public repo or a minimal reproducible example. That will let us all work together from the same code to figure out what’s going wrong.

Here you can see and test the minimal example:

The strange thing is, it works on certain accounts (as you can see from the github issue).

I’m having the same issue for a Go project deployed to Vercel.

The same deployment that worked a few days ago can no longer be redeployed successfully.

After redeploying, I get the following panic:

panic: no such file or directory
goroutine 1 [running]:
main.checkForLambdaWrapper()
./main__vc__go__.go:24 +0x14a
main.main()
./main__vc__go__.go:29 +0x13

So I checked the vercel code, and it looks like Vercel is injecting the AWS_LAMBDA_EXEC_WRAPPER environment variable into the Lambda runtime. My app tries to execute whatever path is provided by this variable, but it points to a file that does not exist in the execution environment, which causes the panic. :thinking:

Code: vercel/packages/go/main.go at 74edeef49a3b51441fe61fcc2323260af6902a16 · vercel/vercel · GitHub

func checkForLambdaWrapper() {
	wrapper := os.Getenv("AWS_LAMBDA_EXEC_WRAPPER")
	if wrapper == "" {
		return
	}

	// Removing the env var doesn't work
	// Set it to empty string to override the previous value
	os.Setenv("AWS_LAMBDA_EXEC_WRAPPER", "")
	argv := append([]string{wrapper}, os.Args...)
	err := syscall.Exec(wrapper, argv, os.Environ())
	if err != nil {
		panic(err)
	}
}

For a minimal reproducible example, see GitHub - xjasonlyu/vercel-faas: Vercel serverless functions in Go

looks like this is the same - newly built go functions suddenly panic'ing - here’s an even smaller repro for go, just run vercel deploy: GitHub - zhammer/vercel-go-test

would very much appreciate if this were fixed before the weekend.

fyi if this broke functionality on one of your projects, instead of redeploying an old stable version (which will introduce the bug), just promote that old version to your environment, which fixed for me. (but of course now can’t release anything new.)

1 Like

Hi everyone, thanks for providing the inputs. Let me escalate this internally to get more information for you.

@zhammer, the Go issue was resolved yesterday. Can you confirm if you are still facing that issue?

From the GitHub issue thread this issue seems to be resolved now: /opt/wrapper: does not exist · Issue #603 · vercel-community/php · GitHub.