game-ci / unity-builder

Build Unity projects for different platforms
https://github.com/marketplace/actions/unity-builder
MIT License
857 stars 253 forks source link

Permission error GitHub self hosted #598

Closed antoinerrr closed 1 year ago

antoinerrr commented 1 year ago

Bug description Hey, not sure this is for you of for GitHub, but since I upgraded from V2 to V4 I got this error and my GitHub worker won't even start:

Error: One or more errors occurred. (Access to the path '/home/ubuntu/actions-runner/_work/_actions/game-ci/unity-builder/v4/dist/BlankProject/Logs/Packages-Update.log' is denied.) (Access to the path '/home/ubuntu/actions-runner/_work/_actions/game-ci/unity-builder/v4/dist/BlankProject/Library/AnnotationManager' is denied.)

the file are created as root, and so after one run everything is stuck as the worker can't access root owned files

-

Additional details

On self-hosted GitHub worker, ubuntu

AndrewKahr commented 1 year ago

Whoops, didn't check on self hosted. Can you test to see if game-ci/unity-builder@perm-fix fixes the issue? If it does we can get that merged to main and release a hot fix for v4.

antoinerrr commented 1 year ago

Starting a build :)

antoinerrr commented 1 year ago

@AndrewKahr I can confirm that the fix is working on self-hosted worker

AndrewKahr commented 1 year ago

Should be merged and released on v4. Thanks for reporting and testing the fix!

antoinerrr commented 1 year ago

Thanks for the quick fix !

DenverGylee commented 11 months ago

I came across this issue as I was recently dealing with it using ubuntu-2022.3.16f1-windows-mono-3. I am manually running sudo chmod -R 777 BlankProject when this image is used for the first time. Is there a way I can check that https://github.com/game-ci/unity-builder/pull/599 is indeed included in the image?

Here are more details on the image I am using

REPOSITORY       TAG                                 IMAGE ID       CREATED        SIZE
unityci/editor   ubuntu-2022.3.16f1-windows-mono-3   e4524a860edd   4 days ago     7.72GB
webbertakken commented 11 months ago

The change isn't in the image, it's in builder. It has since been released albeit not mentioned with the issue number in the release notes.

Epicguru commented 7 months ago

This issue seems to still be happening even though it is marked as fixed. I am using the latest version of the builder and tester, unity-test-runner version v4.1.1 and unity-builder v4.2.3, on a self-hosted Ubuntu runner.

The issue is exactly the same as described here, works fine the first time, subsequent runs fail to start due not being able to access the path. Using checkout@v4.1.1 in case that matters.

I've seen issues suggesting that this is actually a Github actions-related issue, if that is the case is there any known workaround? I do not want to run my build pipeline as root for fairly obvious security reasons.

Thanks.

Epicguru commented 7 months ago

Ignore my comment: I found the documentation for the runAsHostUser option, which does exactly what I want and solves this issue. I'll leave my comment for other people who find this issue through Google.

https://game.ci/docs/github/test-runner#runashostuser