[Question][Onboarding] GitHub PAT test connection failing with 400 Bad Request
Question
I created a GitHub PAT (classic) (Please note I used github account of my private organization) and tried testing connection with it in Onboarding configuration` but I got "Connection failed, check your token or connection". Could this be a restriction from my organization's GitHub or is it something else?
{ "code": 0, "success": false, "message": "attached stack trace\n -- stack trace:\n | github.com/apache/incubator-devlake/plugins/github/api.testGithubConnAccessTokenAuth\n | \t/app/plugins/github/api/connection_api.go:209\n | [...repeated from below...]\nWraps: (2) verify token failed (400)\nWraps: (3) attached stack trace\n -- stack trace:\n | github.com/apache/incubator-devlake/helpers/pluginhelper/api.(*ApiClient).Do\n | \t/app/helpers/pluginhelper/api/api_client.go:381\n | github.com/apache/incubator-devlake/helpers/pluginhelper/api.(*ApiClient).Get\n | \t/app/helpers/pluginhelper/api/api_client.go:408\n | github.com/apache/incubator-devlake/plugins/github/api.testGithubConnAccessTokenAuth\n | \t/app/plugins/github/api/connection_api.go:207\n | github.com/apache/incubator-devlake/plugins/github/api.testConnection\n | \t/app/plugins/github/api/connection_api.go:164\n | github.com/apache/incubator-devlake/plugins/github/api.TestConnection\n | \t/app/plugins/github/api/connection_api.go:79\n | github.com/apache/incubator-devlake/server/api.handlePluginCall.func1\n | \t/app/server/api/router.go:141\n | github.com/gin-gonic/gin.(*Context).Next\n | \t/go/pkg/mod/github.com/gin-gonic/[email protected]/context.go:174\n | github.com/apache/incubator-devlake/server/api.OAuth2ProxyAuthentication.func1\n | \t/app/server/api/middlewares.go:95\n | github.com/gin-gonic/gin.(*Context).Next\n | \t/go/pkg/mod/github.com/gin-gonic/[email protected]/context.go:174\n | github.com/apache/incubator-devlake/server/api.RestAuthentication.func1\n | \t/app/server/api/middlewares.go:117\n | github.com/gin-gonic/gin.(*Context).Next\n | \t/go/pkg/mod/github.com/gin-gonic/[email protected]/context.go:174\n | github.com/gin-gonic/gin.CustomRecoveryWithWriter.func1\n | \t/go/pkg/mod/github.com/gin-gonic/[email protected]/recovery.go:102\n | github.com/gin-gonic/gin.(*Context).Next\n | \t/go/pkg/mod/github.com/gin-gonic/[email protected]/context.go:174\n | github.com/gin-gonic/gin.LoggerWithConfig.func1\n | \t/go/pkg/mod/github.com/gin-gonic/[email protected]/logger.go:240\n | github.com/gin-gonic/gin.(*Context).Next\n | \t/go/pkg/mod/github.com/gin-gonic/[email protected]/context.go:174\n | github.com/gin-gonic/gin.(*Engine).handleHTTPRequest\n | \t/go/pkg/mod/github.com/gin-gonic/[email protected]/gin.go:620\n | github.com/gin-gonic/gin.(*Engine).ServeHTTP\n | \t/go/pkg/mod/github.com/gin-gonic/[email protected]/gin.go:576\n | net/http.serverHandler.ServeHTTP\n | \t/usr/local/go/src/net/http/server.go:2936\n | net/http.(*conn).serve\n | \t/usr/local/go/src/net/http/server.go:1995\n | runtime.goexit\n | \t/usr/local/go/src/runtime/asm_arm64.s:1172\nWraps: (4) Get "[https://api.github.com/user](https://api.github.com/user%5C)": tls: failed to verify certificate: x509: certificate signed by unknown authority\nWraps: (5) Get "https://api.github.com/user"\nWraps: (6) tls: failed to verify certificate\nWraps: (7) x509: certificate signed by unknown authority\nError types: (1) *withstack.withStack (2) *errutil.withPrefix (3) *withstack.withStack (4) *errutil.withPrefix (5) *url.Error (6) *tls.CertificateVerificationError (7) x509.UnknownAuthorityError", "causes": [ "Get "https://api.github.com/user": tls: failed to verify certificate: x509: certificate signed by unknown authority" ], "data": null }
Screenshots
If applicable, add screenshots to help explain.
Additional context
Add any other context here.
Hi @KunalKatariya! I'm Dosu and I’m helping the incubator-devlake team.
This error is not caused by your GitHub PAT or organization restrictions. The key issue is that the environment where DevLake is running does not trust GitHub's SSL certificate, resulting in the "x509: certificate signed by unknown authority" error. This usually happens if the OS or container running DevLake is missing up-to-date CA certificates, or if a proxy/firewall is intercepting SSL traffic with its own certificate that isn't trusted by default.
To fix this:
- Make sure your container or host has up-to-date CA certificates (for example, update or install the
ca-certificatespackage). - From inside the container or host, run
curl https://api.github.comto check if you get the same certificate error. - If your network uses a proxy or SSL inspection, add the proxy's CA certificate to the trust store.
- Only as a last resort, you can set the environment variable
IN_SECURE_SKIP_VERIFY=trueto bypass certificate checks, but this is insecure and not recommended for production use.
There are no known bugs in DevLake that would cause this—it's an environment or network trust issue. More details and troubleshooting steps are available in this discussion: see here.
To reply, just mention @dosu.
Share context across your team and agents. Try Dosu.
Got it, thank you! Closing the issue as I resolved it by setting ca-cert.pem and using that.