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

github produces 404 when connected with MOST RECENT DVCS Jira AddIn

      NOTE: This bug report is for JIRA Software Server. Using JIRA Software Cloud? See the corresponding bug report.

      In my case this is reproducable

          Form Name

            [JSWSERVER-14012] github produces 404 when connected with MOST RECENT DVCS Jira AddIn

            Please re-open this issue. We are also getting a 404 when submitting the form despite following the steps described in https://support.atlassian.com/jira-cloud-administration/docs/integrate-with-github/, Step (2), to a tee.

            Brad Solomon added a comment - Please re-open this issue. We are also getting a 404 when submitting the form despite following the steps described in https://support.atlassian.com/jira-cloud-administration/docs/integrate-with-github/, Step (2), to a tee.

            gaylnabil added a comment -

            I have the same issues "Error 404" even if I added the right information

            gaylnabil added a comment - I have the same issues "Error 404" even if I added the right information

            I figured it out. Due to a previous administration, our internal access to JIRA is over HTTP, not HTTPS, and worse still, trying to go to HTTPS internally redirects to HTTP. (Yes, bad.)

            So the callback was trying to redirect me to HTTPS, but then I was getting redirected to HTTP and I guess without the proper cookie I was getting bounced to the JIRA home page.

            Tried again over an external network (which only uses HTTPS) and all was well.

            Thanks Miroslav, after about the 10th time I read your reply (and actually working on some issues with the HTTPS proxy over the weekend) this clicked for me. :-}

            Darryl Lee (Inactive) added a comment - I figured it out. Due to a previous administration, our internal access to JIRA is over HTTP, not HTTPS, and worse still, trying to go to HTTPS internally redirects to HTTP. (Yes, bad.) So the callback was trying to redirect me to HTTPS, but then I was getting redirected to HTTP and I guess without the proper cookie I was getting bounced to the JIRA home page. Tried again over an external network (which only uses HTTPS) and all was well. Thanks Miroslav, after about the 10th time I read your reply (and actually working on some issues with the HTTPS proxy over the weekend) this clicked for me. :-}

            Alex Slaughter added a comment - - edited

            Hi All,

            I am currently using JIRA 6.1.5 and DVCS 1.4.2.12.
            I get the error below when adding my organization.

            2014-02-08 08:28:31,969 http-bio-8080-exec-9 WARN alexs 508x18930x1 kpp7vw 10.0.48.4,127.0.0.1 /secure/admin/AddGithubOrganization.jspa [bitbucket.clientlibrary.request.BaseRemoteRequestor] Failed to properly execute request [GET https://github.com/api/1.0/users/notebowl],
            Params: org.apache.http.params.BasicHttpParams@2e2c505f,
            Response code 404

            [UPDATE] Forcing the tool to download the new DVCS version from url resolved the issue.

            Alex Slaughter added a comment - - edited Hi All, I am currently using JIRA 6.1.5 and DVCS 1.4.2.12. I get the error below when adding my organization. 2014-02-08 08:28:31,969 http-bio-8080-exec-9 WARN alexs 508x18930x1 kpp7vw 10.0.48.4,127.0.0.1 /secure/admin/AddGithubOrganization.jspa [bitbucket.clientlibrary.request.BaseRemoteRequestor] Failed to properly execute request [GET https://github.com/api/1.0/users/notebowl] , Params: org.apache.http.params.BasicHttpParams@2e2c505f, Response code 404 [UPDATE] Forcing the tool to download the new DVCS version from url resolved the issue.

            MiroslavA added a comment -

            darryll, If you are redirected to your JIRA home page instead of DVCS configuration page, it means that the Authorization callback URL in GitHub is different than the JIRA URL in browser you used when adding account. If Authorization callback URL is set to https://jira.company.com, you must also access your JIRA instance using the same URL when adding a new account.

            MiroslavA added a comment - darryll , If you are redirected to your JIRA home page instead of DVCS configuration page, it means that the Authorization callback URL in GitHub is different than the JIRA URL in browser you used when adding account. If Authorization callback URL is set to https://jira.company.com , you must also access your JIRA instance using the same URL when adding a new account.

            I triple-checked OAuth credentials and my JIRA URL. (To clarify, the Homepage URL and Authorization callback URL should be the JIRA root URL, yes? I'm using https://jira.company.com/)

            Darryl Lee (Inactive) added a comment - I triple-checked OAuth credentials and my JIRA URL. (To clarify, the Homepage URL and Authorization callback URL should be the JIRA root URL, yes? I'm using https://jira.company.com/ )

            JuliusA added a comment -

            Hey darryll, please double check your OAuth credentials for GitHub (both sides - GH and also JIRA).

            Note that URL in consumer/application GitHub configuration must match with your JIRA URL.

            JuliusA added a comment - Hey darryll , please double check your OAuth credentials for GitHub (both sides - GH and also JIRA). Note that URL in consumer/application GitHub configuration must match with your JIRA URL.

            @mstencel Huh. Any ideas then why I'm still seeing errors like:

            > 2014-01-25 01:36:26,769 http-8080-29 WARN darryll 96x2024776x3 1baur90 10.64.24.100,127.0.0.1 /secure/admin/AddGithubOrganization.jspa [bitbucket.clientlibrary.request.BaseRemoteRequestor] Failed to properly execute request [GET https://github.com/api/1.0/users/darryll],
            > Headers: [],
            > Params: org.apache.http.params.BasicHttpParams@4b8a880a,
            > Response code 404, response: <!DOCTYPE html>

            To clarify, I'm just trying to link to a regular GitHub account not GitHub Enterprise, so i don't know if the AddGithubOrganization is a misnomer or what.

            When I attempt to connect, I get redirected to the GitHub site, where I am prompted to Authorize the application, which I do. But upon entering my password (correctly, I checked), I get redirected back to my JIRA home page without any option to select repos to link. And returning to the DVCS configuration I do not see my linked GitHub account.

            Darryl Lee (Inactive) added a comment - @mstencel Huh. Any ideas then why I'm still seeing errors like: > 2014-01-25 01:36:26,769 http-8080-29 WARN darryll 96x2024776x3 1baur90 10.64.24.100,127.0.0.1 /secure/admin/AddGithubOrganization.jspa [bitbucket.clientlibrary.request.BaseRemoteRequestor] Failed to properly execute request [GET https://github.com/api/1.0/users/darryll] , > Headers: [], > Params: org.apache.http.params.BasicHttpParams@4b8a880a, > Response code 404, response: <!DOCTYPE html> To clarify, I'm just trying to link to a regular GitHub account not GitHub Enterprise, so i don't know if the AddGithubOrganization is a misnomer or what. When I attempt to connect, I get redirected to the GitHub site, where I am prompted to Authorize the application, which I do. But upon entering my password (correctly, I checked), I get redirected back to my JIRA home page without any option to select repos to link. And returning to the DVCS configuration I do not see my linked GitHub account.

            MiroslavA added a comment -

            darryll, the fix was backported also to 1.4.0.2 version.

            MiroslavA added a comment - darryll , the fix was backported also to 1.4.0.2 version.

            Hey all - I'm having this same problem but with v1.4.0.2 because we're still on JIRA 5.0.7. I see the release date for v1.4.0.2 is actually later than v1.4.3 (for JIRA 5.2.1-6.1.6). Was the fix for this issue backported to v1.4.0.2?

            If not, can you possibly roll a fix for it? Thanks!

            Darryl Lee (Inactive) added a comment - Hey all - I'm having this same problem but with v1.4.0.2 because we're still on JIRA 5.0.7. I see the release date for v1.4.0.2 is actually later than v1.4.3 (for JIRA 5.2.1-6.1.6). Was the fix for this issue backported to v1.4.0.2? If not, can you possibly roll a fix for it? Thanks!

            Yes, that fixed it. Thank you.

            Eric McIntyre added a comment - Yes, that fixed it. Thank you.

            MiroslavA added a comment -

            emcintyre, it could be an issue resolved in DCON-324. Would it be possible to upgrade to DVCS Connector 1.4.3?

            MiroslavA added a comment - emcintyre , it could be an issue resolved in DCON-324 . Would it be possible to upgrade to DVCS Connector 1.4.3?

            Another tidbit: I tried the same steps above, but with my personal GitHub account, rather than our organization's. I received the same error. However, it did first take me to the GitHub page that asks for authorization, which I granted.

            At this point, I remembered that the first time I tried with the Organization, it did the same thing. When I checked the JIRA logs, I see the following stack trace before the 404 error:

            2013-12-03 15:17:09,177 QuartzScheduler_Worker-1 ERROR ServiceRunner    com.atlassian.jira.plugins.dvcs.scheduler.DvcsScheduler:job [atlassian.jira.service.ServiceRunner] An error occured while trying to run service 'com.atlassian.jira.plugins.dvcs.scheduler.DvcsScheduler:job'. Invalid credentials
            com.atlassian.jira.plugins.dvcs.exception.SourceControlException$UnauthorisedException: Invalid credentials
                    at com.atlassian.jira.plugins.dvcs.spi.github.GithubCommunicator.getRepositories(GithubCommunicator.java:151)
                    at com.atlassian.jira.plugins.dvcs.service.remote.CachingCommunicator.getRepositories(CachingCommunicator.java:169)
                    at com.atlassian.jira.plugins.dvcs.service.RepositoryServiceImpl.syncRepositoryList(RepositoryServiceImpl.java:172)
                    at com.atlassian.jira.plugins.dvcs.service.RepositoryServiceImpl.syncRepositoryList(RepositoryServiceImpl.java:200)
                    at com.atlassian.jira.plugins.dvcs.scheduler.DvcsSchedulerJob.syncOrganizations(DvcsSchedulerJob.java:42)
                    at com.atlassian.jira.plugins.dvcs.scheduler.DvcsSchedulerJob.execute(DvcsSchedulerJob.java:27)
                    at com.atlassian.sal.jira.scheduling.JiraPluginSchedulerService.run(JiraPluginSchedulerService.java:94)
                    at com.atlassian.jira.service.JiraServiceContainerImpl.run(JiraServiceContainerImpl.java:61)
                    at com.atlassian.jira.service.ServiceRunner.execute(ServiceRunner.java:48)
                    at org.quartz.core.JobRunShell.run(JobRunShell.java:195)
                    at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:520)
            Caused by: org.eclipse.egit.github.core.client.RequestException: Bad credentials (401)
                    at org.eclipse.egit.github.core.client.GitHubClient.createException(GitHubClient.java:516)
                    at org.eclipse.egit.github.core.client.GitHubClient.get(GitHubClient.java:662)
                    at org.eclipse.egit.github.core.client.PageIterator.next(PageIterator.java:173)
                    at org.eclipse.egit.github.core.service.GitHubService.getAll(GitHubService.java:151)
                    at org.eclipse.egit.github.core.service.RepositoryService.getRepositories(RepositoryService.java:251)
                    ... 10 more
            2013-12-03 15:41:26,201 http-bio-8080-exec-25 WARN emcintyre 941x13644x1 1ohwa4d 172.20.1.204,0:0:0:0:0:0:0:1 /secure/admin/AddGithubOrganization.jspa [bitbucket.clientlibrary.request.BaseRemoteRequestor] Failed to properly execute request [GET https://github.com/api/1.0/users/macdaddyaz], 
            Params: org.apache.http.params.BasicHttpParams@3f41dba6, 
            Response code 404

            Eric McIntyre added a comment - Another tidbit: I tried the same steps above, but with my personal GitHub account, rather than our organization's. I received the same error. However, it did first take me to the GitHub page that asks for authorization, which I granted. At this point, I remembered that the first time I tried with the Organization, it did the same thing. When I checked the JIRA logs, I see the following stack trace before the 404 error: 2013-12-03 15:17:09,177 QuartzScheduler_Worker-1 ERROR ServiceRunner com.atlassian.jira.plugins.dvcs.scheduler.DvcsScheduler:job [atlassian.jira.service.ServiceRunner] An error occured while trying to run service 'com.atlassian.jira.plugins.dvcs.scheduler.DvcsScheduler:job'. Invalid credentials com.atlassian.jira.plugins.dvcs.exception.SourceControlException$UnauthorisedException: Invalid credentials at com.atlassian.jira.plugins.dvcs.spi.github.GithubCommunicator.getRepositories(GithubCommunicator.java:151) at com.atlassian.jira.plugins.dvcs.service.remote.CachingCommunicator.getRepositories(CachingCommunicator.java:169) at com.atlassian.jira.plugins.dvcs.service.RepositoryServiceImpl.syncRepositoryList(RepositoryServiceImpl.java:172) at com.atlassian.jira.plugins.dvcs.service.RepositoryServiceImpl.syncRepositoryList(RepositoryServiceImpl.java:200) at com.atlassian.jira.plugins.dvcs.scheduler.DvcsSchedulerJob.syncOrganizations(DvcsSchedulerJob.java:42) at com.atlassian.jira.plugins.dvcs.scheduler.DvcsSchedulerJob.execute(DvcsSchedulerJob.java:27) at com.atlassian.sal.jira.scheduling.JiraPluginSchedulerService.run(JiraPluginSchedulerService.java:94) at com.atlassian.jira.service.JiraServiceContainerImpl.run(JiraServiceContainerImpl.java:61) at com.atlassian.jira.service.ServiceRunner.execute(ServiceRunner.java:48) at org.quartz.core.JobRunShell.run(JobRunShell.java:195) at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:520) Caused by: org.eclipse.egit.github.core.client.RequestException: Bad credentials (401) at org.eclipse.egit.github.core.client.GitHubClient.createException(GitHubClient.java:516) at org.eclipse.egit.github.core.client.GitHubClient.get(GitHubClient.java:662) at org.eclipse.egit.github.core.client.PageIterator.next(PageIterator.java:173) at org.eclipse.egit.github.core.service.GitHubService.getAll(GitHubService.java:151) at org.eclipse.egit.github.core.service.RepositoryService.getRepositories(RepositoryService.java:251) ... 10 more 2013-12-03 15:41:26,201 http-bio-8080-exec-25 WARN emcintyre 941x13644x1 1ohwa4d 172.20.1.204,0:0:0:0:0:0:0:1 /secure/admin/AddGithubOrganization.jspa [bitbucket.clientlibrary.request.BaseRemoteRequestor] Failed to properly execute request [GET https://github.com/api/1.0/users/macdaddyaz], Params: org.apache.http.params.BasicHttpParams@3f41dba6, Response code 404

            Update: I just found that if I click "Try Again" on the dialog, then my browser does take me to the same GitHub 404 page.

            Eric McIntyre added a comment - Update: I just found that if I click "Try Again" on the dialog, then my browser does take me to the same GitHub 404 page.

            I am also getting a 404 error from the DVCS Connector. However, the error is occurring "under the covers" and I only see it in the logs, not in my browser.

            To reproduce:

            1. Registered a new application with our GitHub Organization to generate the OAuth info
            2. In JIRA, I went to the "DVCS Accounts" under "Add-Ons" -> "Source Control"
            3. Click "Link BitBucket or GitHub Account"
            4. In the popup dialog:
              • Host - "GitHub"
              • Team or User Account - "IDT911" (our GitHub Organization Name)
              • OAuth Key - GitHub Application Client ID
              • OAuth Secret - GitHub Application Client Secret
              • Click "Add"
            5. Error: "Failed adding the account: [Invalid credentials]"

            When I check the logs, I see this:

            2013-12-03 14:18:16,479 http-bio-8080-exec-21 WARN emcintyre 858x12721x1 16wvk5q 172.20.1.204,0:0:0:0:0:0:0:1 /secure/admin/AddGithubOrganization.jspa [bitbucket.clientlibrary.request.BaseRemoteRequestor] Failed to properly execute request [GET https://github.com/api/1.0/users/IDT911], 
            Params: org.apache.http.params.BasicHttpParams@31b15f1, 
            Response code 404

            I am running JIRA 6.1.2 (BTF), DVCS Connector 1.4.2.12.

            Eric McIntyre added a comment - I am also getting a 404 error from the DVCS Connector. However, the error is occurring "under the covers" and I only see it in the logs, not in my browser. To reproduce: Registered a new application with our GitHub Organization to generate the OAuth info In JIRA, I went to the "DVCS Accounts" under "Add-Ons" -> "Source Control" Click "Link BitBucket or GitHub Account" In the popup dialog: Host - "GitHub" Team or User Account - "IDT911" (our GitHub Organization Name) OAuth Key - GitHub Application Client ID OAuth Secret - GitHub Application Client Secret Click "Add" Error: "Failed adding the account: [Invalid credentials]" When I check the logs, I see this: 2013-12-03 14:18:16,479 http-bio-8080-exec-21 WARN emcintyre 858x12721x1 16wvk5q 172.20.1.204,0:0:0:0:0:0:0:1 /secure/admin/AddGithubOrganization.jspa [bitbucket.clientlibrary.request.BaseRemoteRequestor] Failed to properly execute request [GET https://github.com/api/1.0/users/IDT911], Params: org.apache.http.params.BasicHttpParams@31b15f1, Response code 404 I am running JIRA 6.1.2 (BTF), DVCS Connector 1.4.2.12.

            ischilling, what steps do we need to follow to reproduce this issue?

            Eric Dalgliesh added a comment - ischilling , what steps do we need to follow to reproduce this issue?

              Unassigned Unassigned
              ebbf38adca00 Ingo-Stefan Schilling
              Affected customers:
              4 This affects my team
              Watchers:
              9 Start watching this issue

                Created:
                Updated:
                Resolved: