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

GitLab Branch Source unable to download project avatar

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Open (View Workflow)
    • Priority: Major
    • Resolution: Unresolved
    • Labels:
      None
    • Environment:
      Jenkins 2.263.3, GitLab Branch Source plugin 1.5.4 , GitLab 13.9.0-pre 80a6f1bf66f
    • Similar Issues:

      Description

      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

        Attachments

          Activity

          Hide
          iancotton Ian added a comment -

          I'm seeing exactly the same issue.

          Gitlab version 13.9

          Jenkins 2.277.4

          Gitlab branch source plugin 1.5.7

          2021-05-24 12:31:33.310+0000 [id=28171] INFO i.j.p.g.h.GitLabAvatarCache$FetchImage#call: Server returned HTTP response code: 401 for URL: https://thgitlab.helpsystems.com/uploads/-/system/group/avatar/21/gateway.jpg
          java.io.IOException: Server returned HTTP response code: 401 for URL: https://thgitlab.helpsystems.com/uploads/-/system/group/avatar/21/gateway.jpg
          at sun.net.www.protocol.http.HttpURLConnection.getInputStream0(HttpURLConnection.java:1900)
          at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1498)
          at sun.net.www.protocol.http.HttpURLConnection.getHeaderField(HttpURLConnection.java:3057)
          at java.net.URLConnection.getContentType(URLConnection.java:512)
          at sun.net.www.protocol.https.HttpsURLConnectionImpl.getContentType(HttpsURLConnectionImpl.java:420)
          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://thgitlab.helpsystems.com/uploads/-/system/group/avatar/21/gateway.jpg
          at sun.reflect.GeneratedConstructorAccessor493.newInstance(Unknown Source)
          at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
          at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
          at sun.net.www.protocol.http.HttpURLConnection$10.run(HttpURLConnection.java:1950)
          at sun.net.www.protocol.http.HttpURLConnection$10.run(HttpURLConnection.java:1945)
          at java.security.AccessController.doPrivileged(Native Method)
          at sun.net.www.protocol.http.HttpURLConnection.getChainedException(HttpURLConnection.java:1944)
          at sun.net.www.protocol.http.HttpURLConnection.getInputStream0(HttpURLConnection.java:1514)
          at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1498)
          at sun.net.www.protocol.https.HttpsURLConnectionImpl.getInputStream(HttpsURLConnectionImpl.java:268)
          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.util.concurrent.FutureTask.run(FutureTask.java:266)
          at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
          at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
          at java.lang.Thread.run(Thread.java:748)

           

          Show
          iancotton Ian added a comment - I'm seeing exactly the same issue. Gitlab version 13.9 Jenkins 2.277.4 Gitlab branch source plugin 1.5.7 2021-05-24 12:31:33.310+0000 [id=28171] INFO i.j.p.g.h.GitLabAvatarCache$FetchImage#call: Server returned HTTP response code: 401 for URL: https://thgitlab.helpsystems.com/uploads/-/system/group/avatar/21/gateway.jpg java.io.IOException: Server returned HTTP response code: 401 for URL: https://thgitlab.helpsystems.com/uploads/-/system/group/avatar/21/gateway.jpg at sun.net.www.protocol.http.HttpURLConnection.getInputStream0(HttpURLConnection.java:1900) at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1498) at sun.net.www.protocol.http.HttpURLConnection.getHeaderField(HttpURLConnection.java:3057) at java.net.URLConnection.getContentType(URLConnection.java:512) at sun.net.www.protocol.https.HttpsURLConnectionImpl.getContentType(HttpsURLConnectionImpl.java:420) 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://thgitlab.helpsystems.com/uploads/-/system/group/avatar/21/gateway.jpg at sun.reflect.GeneratedConstructorAccessor493.newInstance(Unknown Source) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) at java.lang.reflect.Constructor.newInstance(Constructor.java:423) at sun.net.www.protocol.http.HttpURLConnection$10.run(HttpURLConnection.java:1950) at sun.net.www.protocol.http.HttpURLConnection$10.run(HttpURLConnection.java:1945) at java.security.AccessController.doPrivileged(Native Method) at sun.net.www.protocol.http.HttpURLConnection.getChainedException(HttpURLConnection.java:1944) at sun.net.www.protocol.http.HttpURLConnection.getInputStream0(HttpURLConnection.java:1514) at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1498) at sun.net.www.protocol.https.HttpsURLConnectionImpl.getInputStream(HttpsURLConnectionImpl.java:268) 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.util.concurrent.FutureTask.run(FutureTask.java:266) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) at java.lang.Thread.run(Thread.java:748)  

            People

            Assignee:
            baymac Parichay Barpanda
            Reporter:
            ytux Ytux
            Votes:
            1 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated: