Problem with artifact permission on linux/macos machine
I had a little problem today related to artifact permission. I'm using artifact to pass files between jobs.
Today some of my prebuild environment did something strange things to directory permission and created them with dr-xrxwrxw in this way:
dr-xrwxr-x 6 gitlab-runner gitlab-runner 4096 Feb 23 17:42 CordovaLib
After the first run the job will fail because it cannot cleanup the directory because the permission will not let him delete the files inside the directory, a chmod is needed to delete them correctly.
Running with gitlab-ci-multi-runner 1.11.0 (33af656)
on itromdk19-script (18349e94)
Using Shell executor...
Running on itromdk19...
Fetching changes...
warning: failed to remove progetto/apps/Sfm/iphone/native/Frameworks/sqlcipher.framework/sqlcipher
warning: failed to remove progetto/apps/Sfm/iphone/native/Frameworks/sqlcipher.framework/include
warning: failed to remove progetto/apps/Sfm/iphone/native/Frameworks/IBMMobileFirstPlatformFoundationHybrid.framework/PrivateHeaders
warning: failed to remove progetto/apps/Sfm/iphone/native/Frameworks/IBMMobileFirstPlatformFoundationHybrid.framework/IBMMobileFirstPlatformFoundationHybrid
warning: failed to remove progetto/apps/Sfm/iphone/native/Frameworks/IBMMobileFirstPlatformFoundationHybrid.framework/Info.plist
warning: failed to remove progetto/apps/Sfm/iphone/native/Frameworks/IBMMobileFirstPlatformFoundationHybrid.framework/Modules
warning: failed to remove progetto/apps/Sfm/iphone/native/Frameworks/IBMMobileFirstPlatformFoundationHybrid.framework/Headers
warning: failed to remove progetto/apps/Sfm/iphone/native/Frameworks/IBMMobileFirstPlatformFoundationHybrid.framework/_CodeSignature
warning: failed to remove progetto/apps/Sfm/iphone/native/CordovaLib/CordovaLib.xcodeproj
warning: failed to remove progetto/apps/Sfm/iphone/native/CordovaLib/plugin
warning: failed to remove progetto/apps/Sfm/iphone/native/CordovaLib/build
warning: failed to remove progetto/apps/Sfm/iphone/native/CordovaLib/VERSION
warning: failed to remove progetto/apps/Sfm/iphone/native/CordovaLib/Classes
warning: failed to remove progetto/apps/Sfm/iphone/native/CordovaLib/CordovaLib_Prefix.pch
ERROR: Job failed: exit status 1
To simulate the problem this .gitlab-ci.yml will replicate it at the second run:
---
build:
stage: build
artifacts:
paths:
- testdir
script:
- mkdir -p testdir/subdir1/subdir1_1
- mkdir -p testdir/subdir1/subdir1_2
- echo "test" > testdir/subdir1/subdir1_1/testfile
- chmod -R 555 testdir
This is the result:
Running with gitlab-ci-multi-runner 1.10.6 (2dadd48)
Using Shell executor...
Running on itromdk19...
Fetching changes...
warning: failed to remove testdir/subdir1/subdir1_1/testfile
warning: failed to remove testdir/subdir1/subdir1_2
ERROR: Build failed: exit status 1
Tried with 1.10 and 1.11 same result. The server is a RHEL7 server with gitlab-runner starting at system startup. This is the runner configuration:
[[runners]]
name = "runner-script"
url = "https://gitlabserver.domain.name/ci"
token = "token"
executor = "shell"
[runners.cache]