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

crowd2 Jenkins plugin crashes if user not found

    XMLWordPrintable

Details

    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

          gmshake Zhenlei Huang added a comment -

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

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

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

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

          I just ran into the same problem.

           

          gmshake: 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

           

          pascalhofmann Pascal Hofmann added a comment - I just ran into the same problem.   gmshake : 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  
          gmshake Zhenlei Huang added a comment -

          pascalhofmann 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[…]"

          gmshake Zhenlei Huang added a comment - pascalhofmann 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

          People

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

            Dates

              Created:
              Updated:
              Resolved: