Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix starting container process caused: exec: "bin/phpunit": permission #625

Closed
wants to merge 1 commit into from

Conversation

EnterVPL
Copy link

Hi,
While checking the CI template, I encountered an error: OCI runtime exec failed: exec failed: container_linux.go:370: starting container process caused: exec: "bin/phpunit": permission. It surprised me a lot because everything was working fine locally. I managed to find a solution to the problem here: api-platform/api-platform#1819. I added a patch to the docker-entrypoint.sh file:

if [ "$APP_ENV" != 'prod' ]; then
   # https://github.com/api-platform/api-platform/issues/1819
   chmod +x bin/phpunit
fi

and everything started functioning correctly.

Hi,
While checking the CI template, I encountered an error:
`OCI runtime exec failed: exec failed: container_linux.go:370: starting container process caused: exec: "bin/phpunit": permission.` It surprised me a lot because everything was working fine locally.
I managed to find a solution to the problem here: api-platform/api-platform#1819.
I added a patch to the docker-entrypoint.sh file:

```shell
if [ "$APP_ENV" != 'prod' ]; then
   # api-platform/api-platform#1819
   chmod +x bin/phpunit
fi
```
and everything started functioning correctly.
@EnterVPL
Copy link
Author

Before fix:
image

After fix:
image

@7-zete-7
Copy link

7-zete-7 commented May 2, 2024

Hello @EnterVPL!

It will be enough to commit the bin/phpunit file with the rights 0775. In this case, this file will be executable in the repository and there will be no need to perform this fix.

@maxhelias
Copy link
Collaborator

Hello,

No need to include specific code for this, as the console file already comes with 755 rights. If those are lost, just re-apply them.

Thanks

@maxhelias maxhelias closed this May 2, 2024
@EnterVPL
Copy link
Author

EnterVPL commented May 2, 2024

Hello

@7-zete-7 and @maxhelias

I tried using the chmod +x bin/phpunit command via docker and git bash, but it didn't help.
The current file permissions are

$ ls -la | grep phpunit
-rwxr-xr-x 1 user 197121 776 May  1 17:43 phpunit*

I use Windows and I am one of many who need a universal solution to the problem of automatically running tests.
There are no errors in the local environment. They are only on github actions

@7-zete-7
Copy link

7-zete-7 commented May 2, 2024

@EnterVPL, when using Windows, I can recommend switching to store the project in WSL2 to solve a number of problems.

When working directly in Windows, you need to use a special git command and options (https://stackoverflow.com/a/40979016) to set the file's permissions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants