Issue
It happens in post_build phase.
- Tried to install first, but was already installed.
- Tried to export PATH to include /usr/bin (where curl is installed)
[Container] 2023/11/28 16:44:10.462047 Running command ls -la $(which curl)
-rwxr-xr-x 1 root root 260328 Oct 3 17:15 /usr/bin/curl
[Container] 2023/11/28 16:44:10.517469 Running command echo $PATH
/usr/local/bin/sbt/bin:/root/.goenv/shims:/root/.goenv/bin:/go/bin:/root/.phpenv/shims:/root/.phpenv/bin:/root/.pyenv/shims:/root/.pyenv/bin:/root/.rbenv/shims:/usr/local/rbenv/bin:/usr/local/rbenv/shims:/root/.dotnet/:/root/.dotnet/tools/:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/opt/tools:/codebuild/user/bin
Phase context status code: COMMAND_EXECUTION_ERROR Message: Error while executing command:(...) Reason: exit status 127
Solution
The problem was the way I was executing the command:
echo "$DATA" | gzip -c | curl -X POST -H "$AK" -H "$CT" "$URL" --data-binary @-
(works in shell - bash)
the fix was:
- temp=$(mktemp)
- $(echo "$DATA" | gzip -c > "$temp")
- 'curl -X POST -H "Api-Key: $LK" -H "Content-Encoding: gzip" "$URL" --data-binary "@$temp"'
- rm -rf "$temp"
Answered By - kingOfClubs686 Answer Checked By - Robin (WPSolving Admin)