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

crowd2 Jenkins plugin crashes if user not found

    XMLWordPrintable

    Details

    • Similar Issues:

      Description

      I am trying to configure groups support in Crowd2 plugin for Jenkins.

      Let's say we have two groups in our JIRA: systems and developers. As stated in documentation, I put both in 'Restrict Groups' section, separated by commas: systems,developers . It works if user sys (a member of systems group) is trying to login and does not work if user dev (a member of developers group). If I change the order and put developers,systems, then dev can login and sys cannot_._ The problem is that JIRA Crowd2 API returns 404 when the plugin asks if user dev is a member of systems (and he is not):

      and the exceptions is thrown:

      Checking group membership for user 'dev' and group 'systems'...
      Nov 06, 2017 11:15:58 AM SEVERE de.theit.jenkins.crowd.CrowdConfigurationService isGroupMember
      The connection check failed.
      com.atlassian.crowd.exception.InvalidCrowdServiceException: The following URL does not specify a valid Crowd User Management REST service: https://myjira.net/rest/usermanagement/1/group/user/direct?groupname=systems&username=dev    at com.atlassian.crowd.integration.rest.service.RestExecutor$MethodExecutor.executeCrowdServiceMethod(RestExecutor.java:455)
          at com.atlassian.crowd.integration.rest.service.RestExecutor$MethodExecutor.doesExist(RestExecutor.java:374)
          at com.atlassian.crowd.integration.rest.service.RestCrowdClient.isUserDirectGroupMember(RestCrowdClient.java:384)
          at de.theit.jenkins.crowd.CrowdConfigurationService.isGroupMember(CrowdConfigurationService.java:187)
          at de.theit.jenkins.crowd.CrowdConfigurationService.isGroupMember(CrowdConfigurationService.java:138)
          at de.theit.jenkins.crowd.CrowdAuthenticationManager.authenticate(CrowdAuthenticationManager.java:116)
      

      The exception is not handled correctly, so the plugin even does not try to check if dev is a member of developers group after.

      Since, the exception is thrown by Client Integration Client of v2.7.1 I tried to rebuild the plugin against v2.8.3, however it did not help.

      Posted in StackOverflow as well: https://stackoverflow.com/questions/47136248/crowd2-jenkins-plugin-crashes-if-user-not-found

        Attachments

          Activity

          Hide
          gmshake Zhenlei Huang added a comment -

          Pascal Hofmann There's no more detailed info that can help me figure out the the problem you encounter. But I guess probably there're bad proxies between your Jenkins instance and JIRA/Crowd.

          I'd suggest your debugging the REST API response using curl / postman before further investigation.

          For the RFC, yes, exactly.
          "A proxy MUST forward unrecognized header fields[…]"

          Show
          gmshake Zhenlei Huang added a comment - Pascal Hofmann There's no more detailed info that can help me figure out the the problem you encounter. But I guess probably there're bad proxies between your Jenkins instance and JIRA/Crowd. I'd suggest your debugging the REST API response using curl / postman before further investigation. For the RFC, yes, exactly. "A proxy MUST forward unrecognized header fields […] " https://tools.ietf.org/html/rfc7230#section-3.2.1
          Hide
          pascalhofmann Pascal Hofmann added a comment -

          I just ran into the same problem.

           

          Zhenlei Huang: I guess this is the RFC that you are referring to?

          "A proxy MUST forward unrecognized header fields[…]"
          https://tools.ietf.org/html/rfc7230#section-3.2.1

           

          Show
          pascalhofmann Pascal Hofmann added a comment - I just ran into the same problem.   Zhenlei Huang : I guess this is the RFC that you are referring to? "A proxy MUST forward unrecognized header fields […] " -  https://tools.ietf.org/html/rfc7230#section-3.2.1  
          Hide
          gmshake Zhenlei Huang added a comment -
          Show
          gmshake Zhenlei Huang added a comment - Cyril Burd
          Hide
          cyril Cyril Burd added a comment -

          I have not tested it yet, but I guess you can close the ticket. Thanks again.

          Show
          cyril Cyril Burd added a comment - I have not tested it yet, but I guess you can close the ticket. Thanks again.
          Hide
          gmshake Zhenlei Huang added a comment -

          Cyril Burd You’re welcome 
          Have you solved the problem? I'd close this issue since Crowd2 plugin works as expected.

          Show
          gmshake Zhenlei Huang added a comment - Cyril Burd You’re welcome  Have you solved the problem? I'd close this issue since Crowd2 plugin works as expected.

            People

            Assignee:
            pingunaut Martin Spielmann
            Reporter:
            cyril Cyril Burd
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: