Uploaded image for project: 'Jira Software Data Center'
  1. Jira Software Data Center
  2. JSWSERVER-14229

Exception when linking GitHub repository without admistration permission

      GitHub repository cannot be linked without administration permission. Instead of message about missing administration permission, the following exception is thrown and repository is not linked.

      @400000005342e925252481bc 2014-04-07 20:06:19,620 TP-Processor6 ERROR sysadmin 1206x3321x1 1s9jvge 46.243.25.78,59.167.29.201 /rest/bitbucket/1.0/repo/424/autolink [common.error.jersey.ThrowableExceptionMapper] Uncaught exception thrown by REST service: org.codehaus.jackson.map.JsonMappingException: Can not deserialize instance of com.atlassian.jira.plugins.dvcs.github.api.model.GitHubRepositoryHook[] out of START_OBJECT token
      @400000005342e9252524915c  at [Source: sun.net.www.protocol.http.HttpURLConnection$HttpInputStream@1fe94ba; line: 1, column: 1]
      @400000005342e92525276404 com.sun.jersey.api.client.ClientHandlerException: org.codehaus.jackson.map.JsonMappingException: Can not deserialize instance of com.atlassian.jira.plugins.dvcs.github.api.model.GitHubRepositoryHook[] out of START_OBJECT token
      @400000005342e92525276bd4  at [Source: sun.net.www.protocol.http.HttpURLConnection$HttpInputStream@1fe94ba; line: 1, column: 1]
      @400000005342e92525276bd4 	at com.sun.jersey.api.client.ClientResponse.getEntity(ClientResponse.java:563)
      @400000005342e925252773a4 	at com.sun.jersey.api.client.ClientResponse.getEntity(ClientResponse.java:506)
      @400000005342e9252527778c 	at com.atlassian.jira.plugins.dvcs.github.impl.AbstractGitHubRESTClientImpl.getAll(AbstractGitHubRESTClientImpl.java:143)
      @400000005342e92525278344 	at com.atlassian.jira.plugins.dvcs.github.impl.GitHubRESTClientImpl.getHooks(GitHubRESTClientImpl.java:74)
      @400000005342e9252527872c 	at com.atlassian.jira.plugins.dvcs.spi.github.GithubCommunicator.ensureHookPresent(GithubCommunicator.java:345)
      @400000005342e92525278b14 	at com.atlassian.jira.plugins.dvcs.service.remote.CachingCommunicator.ensureHookPresent(CachingCommunicator.java:226)
      @400000005342e92525278efc 	at com.atlassian.jira.plugins.dvcs.service.RepositoryServiceImpl.addOrRemovePostcommitHook(RepositoryServiceImpl.java:530)
      @400000005342e925252792e4 	at com.atlassian.jira.plugins.dvcs.service.RepositoryServiceImpl.enableRepository(RepositoryServiceImpl.java:480)
      @400000005342e925252796cc 	at com.atlassian.jira.plugins.dvcs.rest.RootResource.enableRepositoryAutolink(RootResource.java:393)
      

            [JSWSERVER-14229] Exception when linking GitHub repository without admistration permission

            ZehuaA added a comment -

            jjohnson5 As Miroslav mentioned, you could find out which account authorized the access from the "Reset OAuth Settings" menu. And then you could check whether that GitHub account has admin permission on the target account you are trying to synchronize.

            ZehuaA added a comment - jjohnson5 As Miroslav mentioned, you could find out which account authorized the access from the "Reset OAuth Settings" menu. And then you could check whether that GitHub account has admin permission on the target account you are trying to synchronize.

            I couldn't tell you what account this is under. I wasn't the one who originally set this up, so I'll bounce this back around internally until we have enough info to send in a proper support ticket.

            Thanks!

            Josh Johnson added a comment - I couldn't tell you what account this is under. I wasn't the one who originally set this up, so I'll bounce this back around internally until we have enough info to send in a proper support ticket. Thanks!

            MiroslavA added a comment -

            Hi Josh,

            Could you make sure, that the GitHub account which granted the access for Jira has administration permission on the repository? To find out the account go to "Reset OAuth Settings" where you can find "Authorizing account". If the account has not administration permission, could you regenerate access token (be sure that you are logged in as correct user in GitHub).

            If the issue remains, please submit the support ticket.

            Regards,

            Miroslav Stencel | Atlassian

            MiroslavA added a comment - Hi Josh, Could you make sure, that the GitHub account which granted the access for Jira has administration permission on the repository? To find out the account go to "Reset OAuth Settings" where you can find "Authorizing account". If the account has not administration permission, could you regenerate access token (be sure that you are logged in as correct user in GitHub). If the issue remains, please submit the support ticket. Regards, Miroslav Stencel | Atlassian

            Hi Zehua,

            In "Set up GitHub using OAuth rather than a user account name", I mean that the JIRA Configure DVCS Accounts page. There's simply an OAuth Key + Secret configured.

            Note that all of the previously broken GitHub repos now just report "Sync Failed", asking us to view the server logs.

            As we haven't submitted a support ticket yet, I suppose now is the time to do so?

            Josh Johnson added a comment - Hi Zehua, In "Set up GitHub using OAuth rather than a user account name", I mean that the JIRA Configure DVCS Accounts page. There's simply an OAuth Key + Secret configured. Note that all of the previously broken GitHub repos now just report "Sync Failed", asking us to view the server logs. As we haven't submitted a support ticket yet, I suppose now is the time to do so?

            ZehuaA added a comment -

            Hi Josh,

            When you said "set up GitHub using OAuth rather than a user account name", did you refer to the process of setting up the DVCS Account in JIRA or the configuration inside GitHub?

            Is there a support ticket for this issue? It will be much easier to track a problem if there's a support ticket. Our support engineers are much better at understanding the problems and tracking related issues.

            Regards,
            Zehua Liu

            ZehuaA added a comment - Hi Josh, When you said "set up GitHub using OAuth rather than a user account name", did you refer to the process of setting up the DVCS Account in JIRA or the configuration inside GitHub? Is there a support ticket for this issue? It will be much easier to track a problem if there's a support ticket. Our support engineers are much better at understanding the problems and tracking related issues. Regards, Zehua Liu

            Hi there,

            We've currently set up GitHub using OAuth rather than a user account name, and we're getting the same exception in our OnDemand instance. Various repositories in our setup are infinitely "synchronizing" change sets, and cannot be unlinked.

            The error that occurs when attempting to unlink is as follows:

            org.codehaus.jackson.map.JsonMappingException: Can not deserialize instance of com.atlassian.jira.plugins.dvcs.github.api.model.GitHubRepositoryHook[] out of START_OBJECT token at [Source: sun.net.www.protocol.http.HttpURLConnection$HttpInputStream@1a72689; line: 1, column: 1]

            Josh Johnson added a comment - Hi there, We've currently set up GitHub using OAuth rather than a user account name, and we're getting the same exception in our OnDemand instance. Various repositories in our setup are infinitely "synchronizing" change sets, and cannot be unlinked. The error that occurs when attempting to unlink is as follows: org.codehaus.jackson.map.JsonMappingException: Can not deserialize instance of com.atlassian.jira.plugins.dvcs.github.api.model.GitHubRepositoryHook[] out of START_OBJECT token at [Source: sun.net.www.protocol.http.HttpURLConnection$HttpInputStream@1a72689; line: 1, column: 1]

            ZehuaA added a comment -

            While we are working on a fix, as a workaround, you could try to connect to the GitHub account using a GitHub user that has administrator permission to the account.

            ZehuaA added a comment - While we are working on a fix, as a workaround, you could try to connect to the GitHub account using a GitHub user that has administrator permission to the account.

              zliu ZehuaA
              mstencel MiroslavA
              Affected customers:
              0 This affects my team
              Watchers:
              5 Start watching this issue

                Created:
                Updated:
                Resolved: