jenkinsci / jenkinsci/gitlab-branch-source-plugin
[JENKINS-64814] GitLab Branch Source unable to download project avatar
- Dominant language
- Java
- Stars
- 134
- Forks
- 113
- PR merge metrics
- No merged PRs in 30d
Description
Preconditions
- Private GitLab project hosted @ https://gitlab.com
Steps
- Install Jenkins and Gitlab branch source plugin (versions mentioned in the environment field)
- Setup necessary credentials for GitLab integration (private token with API access && ssh creds.)
- Create a Multi branch pipeline
- Observe the logo/avatar displayed in the dashboard
Outcome
- The logo/avatar seem to be a randomly generated one
- The logs show that the attempt to fetch project's logo fails
Feb 07, 2021 10:16:48 PM INFO io.jenkins.plugins.gitlabbranchsource.helpers.GitLabAvatarCache$FetchImage call
Server returned HTTP response code: 401 for URL: https://gitlab.com/uploads/-/system/project/avatar/XXXXXXXX/IMG.png
java.io.IOException: Server returned HTTP response code: 401 for URL: https://gitlab.com/uploads/-/system/project/avatar/XXXXXXXX/IMG.png
at java.base/sun.net.www.protocol.http.HttpURLConnection.getInputStream0(HttpURLConnection.java:1924)
at java.base/sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1520)
at java.base/sun.net.www.protocol.http.HttpURLConnection.getHeaderField(HttpURLConnection.java:3099)
at java.base/java.net.URLConnection.getContentType(URLConnection.java:519)
at java.base/sun.net.www.protocol.https.HttpsURLConnectionImpl.getContentType(HttpsURLConnectionImpl.java:402)
at io.jenkins.plugins.gitlabbranchsource.helpers.GitLabAvatarCache$FetchImage.call(GitLabAvatarCache.java:506)
Caused: java.io.IOException: Server returned HTTP response code: 401 for URL: https://gitlab.com/uploads/-/system/project/avatar/XXXXXXXX/IMG.png
at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:490)
at java.base/sun.net.www.protocol.http.HttpURLConnection$10.run(HttpURLConnection.java:1974)
at java.base/sun.net.www.protocol.http.HttpURLConnection$10.run(HttpURLConnection.java:1969)
at java.base/java.security.AccessController.doPrivileged(Native Method)
at java.base/sun.net.www.protocol.http.HttpURLConnection.getChainedException(HttpURLConnection.java:1968)
at java.base/sun.net.www.protocol.http.HttpURLConnection.getInputStream0(HttpURLConnection.java:1536)
at java.base/sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1520)
at java.base/sun.net.www.protocol.https.HttpsURLConnectionImpl.getInputStream(HttpsURLConnectionImpl.java:250)
at io.jenkins.plugins.gitlabbranchsource.helpers.GitLabAvatarCache$FetchImage.call(GitLabAvatarCache.java:513)
at io.jenkins.plugins.gitlabbranchsource.helpers.GitLabAvatarCache$FetchImage.call(GitLabAvatarCache.java:490)
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
at java.base/java.lang.Thread.run(Thread.java:834)
Notes
- The project builds normally otherwise and build status is correctly pushed to GitLab
- Trying the failing URL (from logs) in the browser actually provides the project logo/avatar
---
Originally reported by
ytux, imported from: GitLab Branch Source unable to download project avatar
baymac
Raw content of original issue
Preconditions
- Private GitLab project hosted @ https://gitlab.com
Steps
- Install Jenkins and Gitlab branch source plugin (versions mentioned in the environment field)
- Setup necessary credentials for GitLab integration (private token with API access && ssh creds.)
- Create a Multi branch pipeline
- Observe the logo/avatar displayed in the dashboard
Outcome
- The logo/avatar seem to be a randomly generated one
- The logs show that the attempt to fetch project's logo fails
Feb 07, 2021 10:16:48 PM INFO io.jenkins.plugins.gitlabbranchsource.helpers.GitLabAvatarCache$FetchImage call
Server returned HTTP response code: 401 for URL: https://gitlab.com/uploads/-/system/project/avatar/XXXXXXXX/IMG.png
java.io.IOException: Server returned HTTP response code: 401 for URL: https://gitlab.com/uploads/-/system/project/avatar/XXXXXXXX/IMG.png
at java.base/sun.net.www.protocol.http.HttpURLConnection.getInputStream0(HttpURLConnection.java:1924)
at java.base/sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1520)
at java.base/sun.net.www.protocol.http.HttpURLConnection.getHeaderField(HttpURLConnection.java:3099)
at java.base/java.net.URLConnection.getContentType(URLConnection.java:519)
at java.base/sun.net.www.protocol.https.HttpsURLConnectionImpl.getContentType(HttpsURLConnectionImpl.java:402)
at io.jenkins.plugins.gitlabbranchsource.helpers.GitLabAvatarCache$FetchImage.call(GitLabAvatarCache.java:506)
Caused: java.io.IOException: Server returned HTTP response code: 401 for URL: https://gitlab.com/uploads/-/system/project/avatar/XXXXXXXX/IMG.png
at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:490)
at java.base/sun.net.www.protocol.http.HttpURLConnection$10.run(HttpURLConnection.java:1974)
at java.base/sun.net.www.protocol.http.HttpURLConnection$10.run(HttpURLConnection.java:1969)
at java.base/java.security.AccessController.doPrivileged(Native Method)
at java.base/sun.net.www.protocol.http.HttpURLConnection.getChainedException(HttpURLConnection.java:1968)
at java.base/sun.net.www.protocol.http.HttpURLConnection.getInputStream0(HttpURLConnection.java:1536)
at java.base/sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1520)
at java.base/sun.net.www.protocol.https.HttpsURLConnectionImpl.getInputStream(HttpsURLConnectionImpl.java:250)
at io.jenkins.plugins.gitlabbranchsource.helpers.GitLabAvatarCache$FetchImage.call(GitLabAvatarCache.java:513)
at io.jenkins.plugins.gitlabbranchsource.helpers.GitLabAvatarCache$FetchImage.call(GitLabAvatarCache.java:490)
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
at java.base/java.lang.Thread.run(Thread.java:834)
Notes
- The project builds normally otherwise and build status is correctly pushed to GitLab
- Trying the failing URL (from logs) in the browser actually provides the project logo/avatar
- environment:
Jenkins 2.263.3, GitLab Branch Source plugin 1.5.4 , GitLab 13.9.0-pre 80a6f1bf66f
1 attachment
- [image-2022-02-18-12-20-16-915.png](https://issues.jenkins.io/secure/attachment/57290/image-2022-02-18-12-20-16-915.png)
> 
Contributor guide
Assessment
This issue has not been assessed yet.