You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@devlake.apache.org by "kunal-ppcd (via GitHub)" <gi...@apache.org> on 2026/02/09 04:52:49 UTC

[I] [Question][Github] GitHub PAT test connection failing with 400 Bad Request6 [incubator-devlake]

kunal-ppcd opened a new issue, #8702:
URL: https://github.com/apache/incubator-devlake/issues/8702

   <!--
   Licensed to the Apache Software Foundation (ASF) under one or more
   contributor license agreements.  See the NOTICE file distributed with
   this work for additional information regarding copyright ownership.
   The ASF licenses this file to You under the Apache License, Version 2.0
   (the "License"); you may not use this file except in compliance with
   the License.  You may obtain a copy of the License at
   
       http://www.apache.org/licenses/LICENSE-2.0
   
   Unless required by applicable law or agreed to in writing, software
   distributed under the License is distributed on an "AS IS" BASIS,
   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   See the License for the specific language governing permissions and
   limitations under the License.
   -->
   
   ## Question
   I created a GitHub PAT (classic) (Please note I am using github account of my 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/gin@v1.9.1/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/gin@v1.9.1/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/gin@v1.9.1/context.go:174\n  | github.com/gin-gonic/gin.CustomRecoveryWithWriter.func1\n  | \t/go/pkg/mod/github.com/gin-gonic/gin@v1.9.1/recovery.go:102\n  | github.com/gin-gonic/gin.(*Context).Next\n  | \t/go/pkg/mod/github.com/gin-gonic/gin@v1.9.1/context.go:174\n  | github.com/gin-gonic/gin.LoggerWithConfig.func1\n  | \t/go/p
 kg/mod/github.com/gin-gonic/gin@v1.9.1/logger.go:240\n  | github.com/gin-gonic/gin.(*Context).Next\n  | \t/go/pkg/mod/github.com/gin-gonic/gin@v1.9.1/context.go:174\n  | github.com/gin-gonic/gin.(*Engine).handleHTTPRequest\n  | \t/go/pkg/mod/github.com/gin-gonic/gin@v1.9.1/gin.go:620\n  | github.com/gin-gonic/gin.(*Engine).ServeHTTP\n  | \t/go/pkg/mod/github.com/gin-gonic/gin@v1.9.1/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\": 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.withSt
 ack (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
   Its the on-boarding process screen of Config UI.
   
   ## Additional context
   Add any other context here.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@devlake.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] [Question][Github] GitHub PAT test connection failing with 400 Bad Request6 [incubator-devlake]

Posted by "kunal-ppcd (via GitHub)" <gi...@apache.org>.
kunal-ppcd closed issue #8702: [Question][Github] GitHub PAT test connection failing with 400 Bad Request6
URL: https://github.com/apache/incubator-devlake/issues/8702


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@devlake.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] [Question][Github] GitHub PAT test connection failing with 400 Bad Request6 [incubator-devlake]

Posted by "dosubot[bot] (via GitHub)" <gi...@apache.org>.
dosubot[bot] commented on issue #8702:
URL: https://github.com/apache/incubator-devlake/issues/8702#issuecomment-3869300662

   <!-- Greeting -->
   Hi @kunal-ppcd! I'm [Dosu](https://go.dosu.dev/dosubot) and I’m helping the incubator-devlake team.
   
   <!-- Answer -->
   This error is happening because the environment where DevLake is running doesn't trust GitHub's SSL certificate, not because of your PAT or any GitHub organization restriction. The key part of the error is `x509: certificate signed by unknown authority`, which means DevLake can't verify GitHub's certificate—usually due to missing CA certificates in the OS/container, or because a proxy/firewall is intercepting SSL traffic with its own certificate that isn't trusted by default.
   
   By default, DevLake verifies SSL certificates for all outgoing HTTPS connections. You can disable this check globally by setting the environment variable `IN_SECURE_SKIP_VERIFY=true`, but this is insecure and should only be used as a last resort [source](https://github.com/apache/incubator-devlake/blob/2c15ad880dce830c6512fa58039527cbf4745b8b/backend/helpers/pluginhelper/api/api_client.go#L58-L395).
   
   To troubleshoot:
   1. Check how DevLake is deployed (Docker, Kubernetes, etc). If it's in a container, make sure the container has up-to-date CA certificates (for example, install or update the `ca-certificates` package).
   2. From inside the container or host, run `curl https://api.github.com` to see if you get the same certificate error.
   3. If your network uses a proxy or SSL inspection, make sure the proxy's CA certificate is added to the container's trust store.
   4. Only if you can't resolve the trust issue, set `IN_SECURE_SKIP_VERIFY=true` in your environment, but be aware this disables all SSL certificate checks for all plugins and is not recommended for production [source](https://github.com/apache/incubator-devlake/blob/2c15ad880dce830c6512fa58039527cbf4745b8b/env.example#L65-L66).
   
   There are no known bugs or recent changes in DevLake that would cause this—it's an environment or network trust issue. If you need more details, enable DEBUG logging in DevLake to get more info about the connection attempts.
   
   
   <!-- Dosu Comment Footer -->
   *To reply, just mention [@dosu](https://go.dosu.dev/dosubot).*
   
   ---
   <sup>How did I do? [Good](https://app.dosu.dev/response-feedback/b3cf4a5a-b523-4056-889f-c30b53952bac?feedback_type=great_response) | [Irrelevant](https://app.dosu.dev/response-feedback/b3cf4a5a-b523-4056-889f-c30b53952bac?feedback_type=irrelevant_answer) | [Incorrect](https://app.dosu.dev/response-feedback/b3cf4a5a-b523-4056-889f-c30b53952bac?feedback_type=incorrect_sources) | [Verbose](https://app.dosu.dev/response-feedback/b3cf4a5a-b523-4056-889f-c30b53952bac?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/b3cf4a5a-b523-4056-889f-c30b53952bac?feedback_type=hallucination) | [Report 🐛](https://app.dosu.dev/response-feedback/b3cf4a5a-b523-4056-889f-c30b53952bac?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/b3cf4a5a-b523-4056-889f-c30b53952bac?feedback_type=other)</sup>
   
   [![Chat with Dosu](https://dosu.dev/dosu-chat-badge.svg)](https://app.dosu.dev/b4e8e847-d479-4541-83a8-d88d83fea5c9/ask?utm_source=github)&nbsp;[![Open in Cursor](https://dosu.dev/dosu-in-cursor.svg)](https://cursor.com/link/prompt?text=This%20error%20is%20happening%20because%20the%20environment%20where%20DevLake%20is%20running%20doesn%27t%20trust%20GitHub%27s%20SSL%20certificate%2C%20not%20because%20of%20your%20PAT%20or%20any%20GitHub%20organization%20restriction.%20The%20key%20part%20of%20the%20error%20is%20%60x509%3A%20certificate%20signed%20by%20unknown%20authority%60%2C%20which%20means%20DevLake%20can%27t%20verify%20GitHub%27s%20certificate%E2%80%94usually%20due%20to%20missing%20CA%20certificates%20in%20the%20OS/container%2C%20or%20because%20a%20proxy/firewall%20is%20intercepting%20SSL%20traffic%20with%20its%20own%20certificate%20that%20isn%27t%20trusted%20by%20default.%0A%0ABy%20default%2C%20DevLake%20verifies%20SSL%20certificates%20for%20all%20outgoing%20HTTPS%20connections
 .%20You%20can%20disable%20this%20check%20globally%20by%20setting%20the%20environment%20variable%20%60IN_SECURE_SKIP_VERIFY%3Dtrue%60%2C%20but%20this%20is%20insecure%20and%20should%20only%20be%20used%20as%20a%20last%20resort%20%5Bsource%5D%28https%3A//github.com/apache/incubator-devlake/blob/2c15ad880dce830c6512fa58039527cbf4745b8b/backend/helpers/pluginhelper/api/api_client.go%23L58-L395%29.%0A%0ATo%20troubleshoot%3A%0A1.%20Check%20how%20DevLake%20is%20deployed%20%28Docker%2C%20Kubernetes%2C%20etc%29.%20If%20it%27s%20in%20a%20container%2C%20make%20sure%20the%20container%20has%20up-to-date%20CA%20certificates%20%28for%20example%2C%20install%20or%20update%20the%20%60ca-certificates%60%20package%29.%0A2.%20From%20inside%20the%20container%20or%20host%2C%20run%20%60curl%20https%3A//api.github.com%60%20to%20see%20if%20you%20get%20the%20same%20certificate%20error.%0A3.%20If%20your%20network%20uses%20a%20proxy%20or%20SSL%20inspection%2C%20make%20sure%20the%20proxy%27s%20CA%20certificate%20i
 s%20added%20to%20the%20container%27s%20trust%20store.%0A4.%20Only%20if%20you%20can%27t%20resolve%20the%20trust%20issue%2C%20set%20%60IN_SECURE_SKIP_VERIFY%3Dtrue%60%20in%20your%20environment%2C%20but%20be%20aware%20this%20disables%20all%20SSL%20certificate%20checks%20for%20all%20plugins%20and%20is%20not%20recommended%20for%20production%20%5Bsource%5D%28https%3A//github.com/apache/incubator-devlake/blob/2c15ad880dce830c6512fa58039527cbf4745b8b/env.example%23L65-L66%29.%0A%0AThere%20are%20no%20known%20bugs%20or%20recent%20changes%20in%20DevLake%20that%20would%20cause%20this%E2%80%94it%27s%20an%20environment%20or%20network%20trust%20issue.%20If%20you%20need%20more%20details%2C%20enable%20DEBUG%20logging%20in%20DevLake%20to%20get%20more%20info%20about%20the%20connection%20attempts.)&nbsp;[![Join Discord](https://img.shields.io/badge/join-5865F2?logo=discord&logoColor=white&label=)](https://go.dosu.dev/discord-bot)&nbsp;[![Share on X](https://img.shields.io/badge/X-share-black)](https://
 twitter.com/intent/tweet?text=%40dosu_ai%20helped%20me%20solve%20this%20issue!&url=https%3A//github.com/apache/incubator-devlake/issues/8702)


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@devlake.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org