Unable to create api key

Hi all,
I have problem with generating api key using this command "#sudo -u apm-server apm-server apikey create --name user1-key". I'm receiving this error:

{"error":{"root_cause":[{"type":"feature_not_enabled_exception","reason":"api keys are not enabled","disabled.feature":"api_keys"}],"type":"feature_not_enabled_exception","reason":"api keys are not enabled","disabled.feature":"api_keys"},"status":400}

But api key is enabled in apm-server.yml config file. Here is output of "#sudo -u apm-server apm-server export config" command:

apm-server:
  api_key:
    enabled: true
    limit: 100
  host: elasticapm.node:8200
logging:
  ecs: true
  json: true
  metrics:
    enabled: false
output:
  elasticsearch:
    hosts:
    - elastic.node:9200
    password: ***
    username: apmtech
path:
  config: /etc/apm-server
  data: /var/lib/apm-server
  home: /usr/share/apm-server
  logs: /var/log/apm-server

APM server version is 7.12.1
Does anyone have any suggestion what is wrong?

Hi @samueliako ,
please ensure that API Key support is enabled in Elasticsearch, otherwise the APM Server CLI tool cannot create any API Keys.

1 Like

Hi @simitt,
You are right, API Keys is not enabled in Elasticsearch. Thank you very much for your answer and showing right direction!

This topic was automatically closed 20 days after the last reply. New replies are no longer allowed.