Skip to content

[Bug][Jira][REST API] Jira DataCenter with SSO doesn't work with proxy #8632

Closed

Description

@pustelnik

Search before asking

  • I had searched in the issues and found no similar issues.

What happened

I created new Jira Server connection using https://devlake.apache.org/docs/Configuration/Jira/ docs. I need to use corporate proxy to access my jira. My jira instance has sso configured. When I test connection with proxy I have following error:

[GIN] 2025/11/03 - 08:08:53 | 200 | 318.61305ms | 172.28.0.8 | POST "/plugins/jira/connections/1/test" time="2025-11-03 08:09:01" level=error msg="HTTP 500 error\n\tcaused by: attached stack trace\n\t -- stack trace:\n\t | github.com/apache/incubator-devlake/helpers/pluginhelper/api.(*ApiClient).Do\n\t | \t/app/helpers/pluginhelper/api/api_client.go:376\n\t | github.com/apache/incubator-devlake/helpers/pluginhelper/api.(*ApiClient).Get\n\t | \t/app/helpers/pluginhelper/api/api_client.go:403\n\t | github.com/apache/incubator-devlake/helpers/pluginhelper/api.NewApiClient\n\t | \t/app/helpers/pluginhelper/api/api_client.go:146\n\t | github.com/apache/incubator-devlake/helpers/pluginhelper/api.NewApiClientFromConnection\n\t | \t/app/helpers/pluginhelper/api/api_client.go:81\n\t | github.com/apache/incubator-devlake/plugins/jira/api.testConnection\n\t | \t/app/plugins/jira/api/connection_api.go:50\n\t | github.com/apache/incubator-devlake/plugins/jira/api.TestExistingConnection\n\t | \t/app/plugins/jira/api/connection_api.go:158\n\t | github.com/apache/incubator-devlake/server/api.handlePluginCall.func1\n\t | \t/app/server/api/router.go:141\n\t | github.com/gin-gonic/gin.(*Context).Next\n\t | \t/go/pkg/mod/github.com/gin-gonic/gin@v1.9.1/context.go:174\n\t | github.com/apache/incubator-devlake/server/api.OAuth2ProxyAuthentication.func1\n\t | \t/app/server/api/middlewares.go:95\n\t | github.com/gin-gonic/gin.(*Context).Next\n\t | \t/go/pkg/mod/github.com/gin-gonic/gin@v1.9.1/context.go:174\n\t | github.com/apache/incubator-devlake/server/api.RestAuthentication.func1\n\t | \t/app/server/api/middlewares.go:117\n\t | github.com/gin-gonic/gin.(*Context).Next\n\t | \t/go/pkg/mod/github.com/gin-gonic/gin@v1.9.1/context.go:174\n\t | github.com/gin-gonic/gin.CustomRecoveryWithWriter.func1\n\t | \t/go/pkg/mod/github.com/gin-gonic/gin@v1.9.1/recovery.go:102\n\t | github.com/gin-gonic/gin.(*Context).Next\n\t | \t/go/pkg/mod/github.com/gin-gonic/gin@v1.9.1/context.go:174\n\t | github.com/gin-gonic/gin.LoggerWithConfig.func1\n\t | \t/go/pkg/mod/github.com/gin-gonic/gin@v1.9.1/logger.go:240\n\t | github.com/gin-gonic/gin.(*Context).Next\n\t | \t/go/pkg/mod/github.com/gin-gonic/gin@v1.9.1/context.go:174\n\t | github.com/gin-gonic/gin.(*Engine).handleHTTPRequest\n\t | \t/go/pkg/mod/github.com/gin-gonic/gin@v1.9.1/gin.go:620\n\t | github.com/gin-gonic/gin.(*Engine).ServeHTTP\n\t | \t/go/pkg/mod/github.com/gin-gonic/gin@v1.9.1/gin.go:576\n\t | net/http.serverHandler.ServeHTTP\n\t | \t/usr/local/go/src/net/http/server.go:2936\n\t | net/http.(*conn).serve\n\t | \t/usr/local/go/src/net/http/server.go:1995\n\t | runtime.goexit\n\t | \t/usr/local/go/src/runtime/asm_amd64.s:1598\n\tWraps: (2) Get \"https://my-jira-server.org.com.com/login.jsp?moskipsso=true&os_destination=https%!A(MISSING)%!F(MISSING)%!F(MISSING)my-jira-server.org.com.com%!F(MISSING)rest%!F(MISSING)\": **stopped after 10 redirects**\n\tWraps: (3) Get \"https://my-jira-server.org.com.com/login.jsp?moskipsso=true&os_destination=https%!A(MISSING)%!F(MISSING)%!F(MISSING)my-jira-server.org.com.com%!F(MISSING)rest%!F(MISSING)\"\n\tWraps: (4) stopped after 10 redirects\n\tError types: (1) *withstack.withStack (2) *errutil.withPrefix (3) *url.Error (4) *errors.errorString" [GIN] 2025/11/03 - 08:09:01 | 500 | 241.508463ms | 172.28.0.8 | POST "/plugins/jira/connections/1/test"

I run the same test on a system with direct access (no proxy required) and it worked without issues. After a little debugging I found a root cause. https://github.com/apache/incubator-devlake/blob/main/backend/helpers/pluginhelper/api/api_client.go#L146 sends a rquest to api root, which for my instance looks like this:
GET https://my-org-jira.com/rest/
HTTP/2 302

What do you expect to happen

Jira connection with proxy should be possible. All api's work behind proxy, just calling rest endpoint doesn't work. Sending a test request as part of client setup leads to unexpected behavior.

How to reproduce

  1. Configure connection to Jira Server with sso enabled
  2. Configure http proxy
  3. Test connection

Anything else

No response

Version

v1.0.2

Are you willing to submit PR?

  • Yes I am willing to submit a PR!

Code of Conduct

Activity

  1. added
    component/pluginsThis issue or PR relates to plugins
    priority/highThis issue is very important
    severity/p0This bug blocks key user journey and function
    on Nov 3, 2025
  2. github-actions commented on Jan 3, 2026

    @github-actions
    Contributor

    This issue has been automatically marked as stale because it has been inactive for 60 days. It will be closed in next 7 days if no further activity occurs.

  3. github-actions commented on Jan 10, 2026

    @github-actions
    Contributor

    This issue has been closed because it has been inactive for a long time. You can reopen it if you encounter the similar problem in the future.

  4. pustelnik commented on Nov 10, 2026

    @pustelnik
    ContributorAuthor

    I've opened a fix for this in #9360: it removes the connectivity request that NewApiClient sent to the endpoint root when a proxy is configured, and adds a regression test.

    This issue was auto-closed as stale and I can't reopen it myself. Could a maintainer reopen it so it can be closed by the PR?

  5. added a commit that references this issue on Nov 11, 2026
    ed75d2d
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Stalecomponent/pluginsThis issue or PR relates to pluginspriority/highThis issue is very importantseverity/p0This bug blocks key user journey and functiontype/bugThis issue is a bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions