Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-64814

GitLab Branch Source unable to download project avatar

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Major Major
    • None
    • Jenkins 2.263.3, GitLab Branch Source plugin 1.5.4 , GitLab 13.9.0-pre 80a6f1bf66f

      Preconditions

      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

            baymac Parichay Barpanda
            ytux Ytux
            Votes:
            4 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated: