Upload/Download cache from Minio through cmd shell encounter 400 Bad Request
Summary
When I tried to upload/download cache through cmd shell and destination is hosted by Minio, console output showed the error message FATAL: Received: 400 Bad Request.
Steps to reproduce
Assume we have one GitLab Runner called runner01
- Configure
shell
as executor andcmd
as shell for runner01 - Use Minio to host cache provider
- Configure [runners-cache] with Minio related info for runner01
- Run any pipeline which is run by runner01
Actual behavior
Console output show the error message FATAL: Received: 400 Bad Request
Expected behavior
Console output should show success message
Relevant logs and/or screenshots
"D:\GitLab-Runner\gitlab-runner.exe" "cache-archiver" "--file" "..\..\..\..\..\..\cache\xxx\xxx\xxx\default\cache.zip" "--timeout" "10" "--path" "artifacts" "--url" "http://minio.xxx.xxx:9000/gitlab-runners/project/xxx/default?X-Amz-Algorithm=AWS4-HMAC-SHA256^&X-Amz-Credential=xxxF20170824Fus-east-1Fs3Faws4_request^&X-Amz-Date=20170824T082300Z^&X-Amz-Expires=3600^&X-Amz-SignedHeaders=host^&X-Amz-Signature=xxx"
Sorry for hide some senstive info with xxx.
Environment description
- Build Server OS: MS Windows Server 2012 R2
- GitLab Version: GitLab Enterprise Edition 9.5.0-ee
- Minio Version: 2017-08-05T00:00:53Z
Used GitLab Runner version
Version: 9.5.0
Git revision: 413da38
Git branch: 9-5-stable
GO version: go1.8.3
Built: Tue, 22 Aug 2017 13:40:42 +0000
OS/Arch: windows/amd64
Investigation
There are two weird point:
- I saw the symbol caret(^) in cache access command no matter uploading or downloading, but the command is single line, not multiple line.
- X-Amz-Credential should use symbol slash(/) as separator, but I saw the command used F as separator.
After I removed caret(^) from command and changed F with slash(/) in X-Amx-Credential, the command was able to execute successfully.