Folders with certain characters ('[', ']') are not uploaded by multi-runner when marked as artifacts
Summary
Gitlab version: 8.13.6-ee Runner version: 1.7.1
When gitlab runner tries to upload a directory marked as "artifact" with certain characters, the runner throws an error and the file is not uploaded. The file name that causes the bug is "Performance-Validation-Tool [tests]".
Steps to reproduce
Install gitlab runner on a windows machine (in our case windows server 2008 x64) and configure as follows:
variables:
Solution: Performance-Validation-Tool.sln
stages:
- build
- test
# - deploy
build:
stage: build
script:
- echo "Restoring NuGet packages..."
- 'C:/nuget/NuGet.exe restore'
- echo building...
- 'msbuild.exe "%Solution%"'
- 'cd "Performance-Validation-Tool [tests]/bin/Debug"'
- dir
artifacts:
paths:
- "Performance-Validation-Tool [tests]/bin/Debug"
except:
- tags
test:
stage: test
script:
- echo "Testing..."
- 'C:/nunit/nunit3-console.exe "Performance-Validation-Tool [tests]\bin\Debug\Performance-Validation-Tool [tests].dll"'
dependencies:
- build
except:
- tags
Simply run a build and the result will display:
WARNING: Performance-Validation-Tool [tests]/bin/Debug: no matching files
Expected behavior
The file should appear in the artifacts archive when downloaded from gitlab.
Actual behavior
The artifacts archive file is empty.
Relevant logs and/or screenshots
This is the output of the runner, as viewed in gitlab
Build succeeded.
0 Warning(s)
0 Error(s)
Time Elapsed 00:00:01.77
$ cd "Performance-Validation-Tool [tests]/bin/Debug"
$ dir
Volume in drive C is System
Volume Serial Number is 1253-4304
Directory of C:\GitLabRunner\builds\0dd28ed8\0\TB4\performance-validation-tool\Performance-Validation-Tool [tests]\bin\Debug
11/17/2016 01:35 PM <DIR> .
11/17/2016 01:35 PM <DIR> ..
11/01/2014 08:30 AM 47,104 Jace.dll
10/03/2016 07:52 PM 302,592 nunit.framework.dll
10/03/2016 07:52 PM 921,823 nunit.framework.xml
11/17/2016 01:35 PM 190,976 Performance Validation Tool.exe
11/17/2016 01:35 PM 185,856 Performance Validation Tool.pdb
11/17/2016 01:35 PM 16,148 Performance Validation Tool.xml
11/17/2016 01:35 PM 21,504 Performance-Validation-Tool [tests].dll
11/17/2016 10:58 AM 184 Performance-Validation-Tool [tests].dll.config
11/17/2016 01:35 PM 34,304 Performance-Validation-Tool [tests].pdb
11/17/2016 01:35 PM 2,115 Performance-Validation-Tool [tests].xml
10 File(s) 1,722,606 bytes
2 Dir(s) 338,903,040 bytes free
Uploading artifacts...
WARNING: Performance-Validation-Tool [tests]/bin/Debug: no matching files
WARNING: TestResult.xml: no matching files
Uploading artifacts to coordinator... ok id=45 responseStatus=201 Created token=a76eb54f
Build succeeded
Outputs
Checking GitLab Shell ...
GitLab Shell version >= 3.6.6 ? ... OK (3.6.6)
Repo base directory exists?
default... yes
Repo storage directories are symlinks?
default... no
Repo paths owned by git:git?
default... yes
Repo paths access is drwxrws---?
default... yes
hooks directories in repos are links: ...
5/2 ... ok
5/7 ... ok
6/9 ... ok
3/12 ... ok
Running /opt/gitlab/embedded/service/gitlab-shell/bin/check
Check GitLab API access: OK
Access to /var/opt/gitlab/.ssh/authorized_keys: OK
Send ping to redis server: OK
gitlab-shell self-check successful
Checking GitLab Shell ... Finished
Checking Sidekiq ...
Running? ... yes
Number of Sidekiq processes ... 1
Checking Sidekiq ... Finished
Checking Reply by email ...
Reply by email is disabled in config/gitlab.yml
Checking Reply by email ... Finished
Checking LDAP ...
LDAP is disabled in config/gitlab.yml
Checking LDAP ... Finished
Checking GitLab ...
Git configured with autocrlf=input? ... yes
Database config exists? ... yes
All migrations up? ... yes
Database contains orphaned GroupMembers? ... no
GitLab config exists? ... yes
GitLab config outdated? ... no
Log directory writable? ... yes
Tmp directory writable? ... yes
Uploads directory setup correctly? ... no
Try fixing it:
sudo chown -R git /var/opt/gitlab/gitlab-rails/uploads
sudo find /var/opt/gitlab/gitlab-rails/uploads -type f -exec chmod 0644 {} \;
sudo find /var/opt/gitlab/gitlab-rails/uploads -type d -not -path /var/opt/git lab/gitlab-rails/uploads -exec chmod 0700 {} \;
For more information see:
doc/install/installation.md in section "GitLab"
Please fix the error above and rerun the checks.
Init script exists? ... skipped (omnibus-gitlab has no init script)
Init script up-to-date? ... skipped (omnibus-gitlab has no init script)
projects have namespace: ...
5/2 ... yes
5/7 ... yes
6/9 ... yes
3/12 ... yes
Redis version >= 2.8.0? ... yes
Ruby version >= 2.1.0 ? ... yes (2.3.1)
Your git bin path is "/opt/gitlab/embedded/bin/git"
Git version >= 2.7.3 ? ... yes (2.7.4)
Active users: 7
Checking GitLab ... Finished
I realize that the "uploads" folder comes up as not being setup correctly, but marking any other folder (without certain characters) as artifact
works just fine. This leads me to believe the "uploads" folder is not where artifacts are stored.
After a quick chat via e-mail support, it was suggested that gitlab is (or the runner?) is incorrectly escaping the '[' or ']' character.
P.S. I will provide more info (verions and sanity check) tomorrow when I get in to work.