# Getting 406 Not Acceptable Error While Running GitHub Connector in Docker for Elasticsearch

**URL:** <https://discuss.elastic.co/t/getting-406-not-acceptable-error-while-running-github-connector-in-docker-for-elasticsearch/378669>\
**Category:** Elastic Search\
**Tags:** docker, connectors\
**Created:** [May 28, 2025, 8:02pm UTC](https://discuss.elastic.co/t/getting-406-not-acceptable-error-while-running-github-connector-in-docker-for-elasticsearch/378669 "2025-05-28T20:02:22Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![zeeshan\_mohammed](https://avatars.discourse-cdn.com/v4/letter/z/c5a1d2/32.png) [@zeeshan\_mohammed](https://discuss.elastic.co/u/zeeshan_mohammed)\
**Post date:** [May 28, 2025, 8:02pm UTC](https://discuss.elastic.co/t/getting-406-not-acceptable-error-while-running-github-connector-in-docker-for-elasticsearch/378669/1 "2025-05-28T20:02:22Z")

</div>

Hi Team, I'm trying to run a GitHub connector inside a Docker container to ingest data into Elasticsearch (self-managed). The Docker container starts and connects to Elasticsearch successfully, but during the validation step, I keep getting a `406 Not Acceptable` error from the GitHub API.

Error:  
406, message='Not Acceptable', url=URL('https:///login?return\_to=https:///api')

config.yml file is as below

elasticsearch:  
host: https://:9200  
api\_key: "\<es\_api\_key\>"  
verify\_certs: false  
ssl\_show\_warn: false

connectors:

- connector\_id: "\<connector\_id\>"  
service\_type: "github"

What I’ve verified:

- The GitHub PAT works fine in Postman and other tools.
- The GitHub API URL is reachable from the host system.
- The `verify_certs` is disabled due to internal self-signed certs.
- The correct connector ID is configured.
- Docker has network access and can resolve the GitHub API domain.

Now question is:  
What could be causing this `406 Not Acceptable` response from the GitHub API?

---

<div class="post-metadata">

**Author:** ![Jedr\_Blaszyk](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jedr_blaszyk/32/127637_2.png) [@Jedr\_Blaszyk](https://discuss.elastic.co/u/Jedr_Blaszyk)\
**Post date:** [May 29, 2025, 7:52am UTC](https://discuss.elastic.co/t/getting-406-not-acceptable-error-while-running-github-connector-in-docker-for-elasticsearch/378669/2 "2025-05-29T07:52:42Z")

</div>

Hey @zeeshan_mohammed can you share what version of connectors are you using? The version should be part of the docker image name.

The error seems to be related to malformed (or even empty?) base URL to access github api. Are you syncing data from enterprise github server? Otherwise, [if you select github cloud](https://github.com/elastic/connectors/blob/main/connectors/sources/github.py#L1126C11-L1128C66) it should default to public github api.

Linking connector docs just in case this is configuration issue: [Elastic GitHub connector reference | Elastic Documentation](https://www.elastic.co/docs/reference/search-connectors/es-connectors-github#es-connectors-github-client-configuration)

Also, if you could share connector service logs with a full traceback it could help us with debugging!

---

<div class="post-metadata">

**Author:** ![zeeshan\_mohammed](https://avatars.discourse-cdn.com/v4/letter/z/c5a1d2/32.png) [@zeeshan\_mohammed](https://discuss.elastic.co/u/zeeshan_mohammed)\
**Post date:** [May 29, 2025, 4:38pm UTC](https://discuss.elastic.co/t/getting-406-not-acceptable-error-while-running-github-connector-in-docker-for-elasticsearch/378669/3 "2025-05-29T16:38:31Z")

</div>

Hi,  
Thanks for the reply.  
Elastic Connectors version is 8.14.0.0

 ![connector_configuration](https://us1.discourse-cdn.com/elastic/original/3X/2/5/25e0a7cda4ed2443dc4f73a01dd5f1e9d527659e.png)

## Config file looks like below

elasticsearch:  
host: https:/_ **.** _.com:9200  
api\_key: "MF9SUXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"  
verify\_certs: false  
ssl\_show\_warn: false

connectors:

- connector\_id: "8FtQp5YBd8qPwshEAMrV"  
service\_type: "github"

Below is the traceback  
[FMWK][15:59:46][ERROR] [Connector id: 8FtQp5YBd8qPwshEAMrV, index name: elastic-github-connector-cm] 406, message='Not Acceptable', url=URL('https:///login?return\_to=https:///api')  
Traceback (most recent call last):  
File "/app/connectors/services/job\_scheduling.py", line 96, in \_schedule  
await data\_source.validate\_config()  
File "/app/connectors/sources/github.py", line 1466, in validate\_config  
await self.\_remote\_validation()  
File "/app/connectors/sources/github.py", line 1428, in \_remote\_validation  
await self.\_validate\_personal\_access\_token\_scopes()  
File "/app/connectors/sources/github.py", line 1435, in \_validate\_personal\_access\_token\_scopes  
scopes = await self.github\_client.get\_personal\_access\_token\_scopes()  
File "/app/connectors/sources/github.py", line 870, in get\_personal\_access\_token\_scopes  
\_, headers, \_ = await self.\_get\_client.\_request(  
File "/app/lib/python3.10/site-packages/gidgethub/aiohttp.py", line 19, in \_request  
async with self.\_session.request(  
File "/app/lib/python3.10/site-packages/aiohttp/client.py", line 1197, in **aenter**  
self.\_resp = await self.\_coro  
File "/app/lib/python3.10/site-packages/aiohttp/client.py", line 696, in \_request  
resp.raise\_for\_status()  
File "/app/lib/python3.10/site-packages/aiohttp/client\_reqrep.py", line 1070, in raise\_for\_status  
raise ClientResponseError:  
aiohttp.client\_exceptions.ClientResponseError: 406, message='Not Acceptable', url=URL('https:///login?return\_to=https:///api')

Let me know if you need more info

---

<div class="post-metadata">

**Author:** ![Jedr\_Blaszyk](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jedr_blaszyk/32/127637_2.png) [@Jedr\_Blaszyk](https://discuss.elastic.co/u/Jedr_Blaszyk)\
**Post date:** [May 30, 2025, 7:54am UTC](https://discuss.elastic.co/t/getting-406-not-acceptable-error-while-running-github-connector-in-docker-for-elasticsearch/378669/4 "2025-05-30T07:54:46Z")

</div>

Hey, this does seem a bit weird. Unfortunately, I don’t have access to the GitHub Enterprise Server at the moment.

Could you try running the connector from source and add a log line where it fails? Here’s the spot:

> <https://github.com/elastic/connectors/blob/main/connectors/sources/github.py#L903>

(Also, make sure to override the [VERSION](https://github.com/elastic/connectors/blob/main/connectors/VERSION) to 8.14.0.)

We want to log the URL it’s trying to access.

The API path being hit in \_validate\_personal\_access\_token\_scopes is {url}/api/graphql. Can you check if that URL is reachable?
