Build Artifact API returning 404 for commit hashes
Summary
Trying to download the artifact of a build for a specific commit hash (not branch name or tag) results in a 404.
Steps to reproduce
- Have a CI job produce an artifact
- Request the artifact download using the API:
/projects/:id/builds/artifacts/:ref_name/download?job=name
where:ref_name
is the commit hash
What is the current bug behavior?
The API returns 404.
What is the expected correct behavior?
The Artifact of the latest build for the given commit hash like it works for branch names and tags.
Output of checks
Results of GitLab environment info
System information
System: Debian 8.7
Current User: git
Using RVM: no
Ruby Version: 2.3.3p222
Gem Version: 2.6.6
Bundler Version:1.13.7
Rake Version: 10.5.0
Redis Version: 3.2.5
Sidekiq Version:4.2.7
GitLab information
Version: 8.17.0
Revision: 77254ab
Directory: /opt/gitlab/embedded/service/gitlab-rails
DB Adapter: postgresql
URL: https://*****
HTTP Clone URL: https://*****/some-group/some-project.git
SSH Clone URL: git@*****:some-group/some-project.git
Using LDAP: yes
Using Omniauth: no
GitLab Shell
Version: 4.1.1
Repository storage paths:
- default: /data/gitlab/gitlab-omnibus/git-data/repositories
Hooks: /opt/gitlab/embedded/service/gitlab-shell/hooks/
Git: /opt/gitlab/embedded/bin/git
Results of GitLab application Check
Checking GitLab Shell ...
GitLab Shell version >= 4.1.1 ? ... OK (4.1.1)
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/4 ... ok
5/7 ... ok
5/8 ... ok
5/9 ... ok
5/11 ... ok
5/12 ... ok
5/13 ... ok
5/15 ... ok
12/17 ... ok
5/20 ... ok
5/21 ... ok
5/22 ... ok
5/25 ... ok
5/29 ... ok
6/30 ... ok
5/31 ... ok
6/33 ... ok
18/34 ... ok
12/36 ... ok
9/37 ... ok
20/40 ... ok
13/42 ... ok
5/45 ... ok
4/46 ... ok
9/47 ... ok
20/49 ... repository is empty
5/51 ... ok
5/52 ... ok
20/54 ... ok
9/57 ... ok
5/59 ... ok
5/60 ... ok
5/61 ... ok
5/63 ... ok
12/64 ... ok
5/65 ... ok
5/66 ... ok
5/69 ... ok
3/70 ... ok
5/71 ... ok
5/73 ... ok
20/74 ... ok
5/78 ... ok
6/81 ... ok
13/82 ... ok
24/83 ... ok
24/84 ... ok
24/85 ... ok
5/86 ... ok
23/87 ... ok
23/88 ... ok
9/89 ... ok
23/91 ... ok
23/92 ... ok
23/96 ... ok
5/97 ... ok
6/98 ... ok
28/99 ... ok
28/100 ... ok
28/101 ... ok
28/102 ... ok
13/103 ... ok
28/105 ... ok
5/106 ... ok
5/107 ... ok
2/108 ... ok
4/109 ... ok
5/110 ... ok
5/111 ... ok
5/112 ... ok
5/113 ... ok
13/114 ... ok
5/115 ... ok
3/116 ... ok
4/118 ... ok
28/119 ... ok
4/120 ... ok
4/121 ... ok
4/122 ... ok
4/123 ... ok
5/124 ... ok
5/125 ... ok
28/126 ... ok
13/127 ... ok
5/128 ... ok
5/129 ... ok
5/131 ... ok
5/133 ... ok
4/134 ... repository is empty
5/135 ... ok
5/136 ... ok
20/137 ... ok
28/138 ... ok
5/139 ... ok
8/140 ... ok
4/141 ... ok
5/142 ... ok
5/143 ... ok
13/145 ... ok
5/146 ... ok
30/147 ... repository is empty
2/148 ... ok
2/149 ... ok
5/151 ... ok
5/152 ... ok
13/153 ... ok
5/154 ... ok
12/155 ... ok
5/156 ... ok
6/157 ... ok
5/158 ... ok
5/159 ... ok
5/160 ... ok
5/161 ... ok
5/162 ... ok
5/163 ... ok
5/164 ... ok
5/165 ... ok
13/166 ... ok
5/167 ... ok
5/168 ... ok
5/169 ... ok
5/170 ... ok
5/171 ... ok
13/173 ... ok
5/174 ... ok
5/175 ... ok
5/176 ... ok
13/177 ... ok
4/178 ... ok
5/179 ... ok
5/181 ... ok
5/182 ... ok
28/183 ... ok
28/184 ... ok
28/185 ... ok
12/186 ... ok
5/187 ... ok
13/188 ... ok
5/189 ... ok
2/190 ... ok
13/191 ... ok
5/192 ... ok
5/193 ... ok
5/194 ... 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 ...
Server: ldapmain
LDAP authentication... Success
LDAP users with access to your GitLab server (only showing the first 100 results)
***SNIP***
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? ... yes
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/4 ... yes
5/7 ... yes
5/8 ... yes
5/9 ... yes
5/11 ... yes
5/12 ... yes
5/13 ... yes
5/15 ... yes
12/17 ... yes
5/20 ... yes
5/21 ... yes
5/22 ... yes
5/25 ... yes
5/29 ... yes
6/30 ... yes
5/31 ... yes
6/33 ... yes
18/34 ... yes
12/36 ... yes
9/37 ... yes
20/40 ... yes
13/42 ... yes
5/45 ... yes
4/46 ... yes
9/47 ... yes
20/49 ... yes
5/51 ... yes
5/52 ... yes
20/54 ... yes
9/57 ... yes
5/59 ... yes
5/60 ... yes
5/61 ... yes
5/63 ... yes
12/64 ... yes
5/65 ... yes
5/66 ... yes
5/69 ... yes
3/70 ... yes
5/71 ... yes
5/73 ... yes
20/74 ... yes
5/78 ... yes
6/81 ... yes
13/82 ... yes
24/83 ... yes
24/84 ... yes
24/85 ... yes
5/86 ... yes
23/87 ... yes
23/88 ... yes
9/89 ... yes
23/91 ... yes
23/92 ... yes
23/96 ... yes
5/97 ... yes
6/98 ... yes
28/99 ... yes
28/100 ... yes
28/101 ... yes
28/102 ... yes
13/103 ... yes
28/105 ... yes
5/106 ... yes
5/107 ... yes
2/108 ... yes
4/109 ... yes
5/110 ... yes
5/111 ... yes
5/112 ... yes
5/113 ... yes
13/114 ... yes
5/115 ... yes
3/116 ... yes
4/118 ... yes
28/119 ... yes
4/120 ... yes
4/121 ... yes
4/122 ... yes
4/123 ... yes
5/124 ... yes
5/125 ... yes
28/126 ... yes
13/127 ... yes
5/128 ... yes
5/129 ... yes
5/131 ... yes
5/133 ... yes
4/134 ... yes
5/135 ... yes
5/136 ... yes
20/137 ... yes
28/138 ... yes
5/139 ... yes
8/140 ... yes
4/141 ... yes
5/142 ... yes
5/143 ... yes
13/145 ... yes
5/146 ... yes
30/147 ... yes
2/148 ... yes
2/149 ... yes
5/151 ... yes
5/152 ... yes
13/153 ... yes
5/154 ... yes
12/155 ... yes
5/156 ... yes
6/157 ... yes
5/158 ... yes
5/159 ... yes
5/160 ... yes
5/161 ... yes
5/162 ... yes
5/163 ... yes
5/164 ... yes
5/165 ... yes
13/166 ... yes
5/167 ... yes
5/168 ... yes
5/169 ... yes
5/170 ... yes
5/171 ... yes
13/173 ... yes
5/174 ... yes
5/175 ... yes
5/176 ... yes
13/177 ... yes
4/178 ... yes
5/179 ... yes
5/181 ... yes
5/182 ... yes
28/183 ... yes
28/184 ... yes
28/185 ... yes
12/186 ... yes
5/187 ... yes
13/188 ... yes
5/189 ... yes
2/190 ... yes
13/191 ... yes
5/192 ... yes
5/193 ... yes
5/194 ... yes
Redis version >= 2.8.0? ... yes
Ruby version >= 2.1.0 ? ... yes (2.3.3)
Your git bin path is "/opt/gitlab/embedded/bin/git"
Git version >= 2.7.3 ? ... yes (2.10.2)
Active users: 14
Checking GitLab ... Finished