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

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?

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 it should default to public github api.

Linking connector docs just in case this is configuration issue: Elastic GitHub connector reference | Elastic Documentation

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

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

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

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:

(Also, make sure to override the 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?