# Precondition 'apm integration installed' failed

**URL:** <https://discuss.elastic.co/t/precondition-apm-integration-installed-failed/314388>\
**Category:** APM\
**Tags:** server\
**Created:** [September 14, 2022, 8:34am UTC](https://discuss.elastic.co/t/precondition-apm-integration-installed-failed/314388 "2022-09-14T08:34:14Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Maksym\_Postument](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/maksym_postument/32/106661_2.png) [@Maksym\_Postument](https://discuss.elastic.co/u/Maksym_Postument)\
**Post date:** [September 14, 2022, 8:34am UTC](https://discuss.elastic.co/t/precondition-apm-integration-installed-failed/314388/1 "2022-09-14T08:34:14Z")

</div>

Hello, i am trying to setup apm server (legacy). I successfully deployed apm server with eck to kubernetes. But when i check logs i see error message related to integration. I created integration from kibana UI, but still getting the same error.

 ![apm1](https://us1.discourse-cdn.com/elastic/original/3X/3/b/3b513c589cd050c5fb96da215b2d309706d960f3.png)

And i don't see any data in kibana

 ![apm2](https://us1.discourse-cdn.com/elastic/original/3X/5/7/5778019217219f1d2ac9d1ab8f5fccdd31ffc02e.png)

I see this index templates created

 ![apm_indexes](https://us1.discourse-cdn.com/elastic/original/3X/0/c/0caab16c7ec0bca6af5e8ce4e6636dbaef15b52f.png)

But don't see any data stream created. APM config:

```auto
apm-server:
  host: :8200
  kibana:
    enabled: true
    host: https://kibana
    password: pass
    ssl:
      certificate_authorities:
      - config/kibana-certs/ca.crt
    username: elastic-common-cluster-apm-kb-user
  secret_token: ${SECRET_TOKEN}
  ssl:
    certificate: /mnt/elastic-internal/http-certs/tls.crt
    enabled: true
    key: /mnt/elastic-internal/http-certs/tls.key
logging:
  level: debug
output:
  logstash:
    hosts:
    - logstash:5044
    index: apm-server
setup:
  template:
    enabled: true

```

and logstash config for apm

```auto
filter {
  if [@metadata][beat] == "apm"{
    if [processor][event] == "sourcemap" {
      mutate {
        add_field => { "[@metadata][index]" => "%{[@metadata][beat]}-%{[@metadata][version]}-%{[processor][event]}" }
      }
    } else {
      mutate {
        add_field => { "[@metadata][index]" => "%{[@metadata][beat]}-%{[@metadata][version]}-%{[processor][event]}-%{+yyyy.MM.dd}" }
      }
    }
  }
}

output {
  if [agent][type] == "filebeat" {
    elasticsearch {
      hosts => ["elastic9200"]
      index => "app-%{[logtype]}-%{[@metadata][ds_name]}"
      ilm_enabled => false
      action => create
      ssl => true
      cacert => "/usr/share/elasticsearch/config/http-certs/ca.crt"
      user => "${ELASTICSEARCH_USERNAME}"
      password => "${ELASTICSEARCH_PASSWORD}"
    }
  } else if [agent][type] == "metricbeat" or [agent][type] == "auditbeat" or [agent][type] == "heartbeat" or [@metadata][beat] == "apm" {
    elasticsearch {
      hosts => ["elastic:9200"]
      index => "%{[@metadata][beat]}-%{[@metadata][version]}" 
      ilm_enabled => false
      action => create
      ssl => true
      cacert => "/usr/share/elasticsearch/config/http-certs/ca.crt"
      user => "${ELASTICSEARCH_USERNAME}"
      password => "${ELASTICSEARCH_PASSWORD}"
    }
}

```

**Kibana version** : 8.4.1

**Elasticsearch version** :8.4.1

**APM Server version** :8.4.1

**APM Agent language and version** : opentelemtry, postman

**Browser version** : latest chrome

**Original install method (e.g. download page, yum, deb, from source, etc.) and version**: eck operator

**Fresh install or upgraded from other version?** both

**Is there anything special in your setup?** Logstash as output

**Provide logs and/or server output (if relevant)**:

```auto
{"log.level":"error","@timestamp":"2022-09-14T08:23:35.643Z","log.logger":"beater","log.origin":{"file.name":"beater/waitready.go","file.line":62},"message":"precondition 'apm integration installed' failed: error querying Kibana for integration package status: unexpected HTTP status: 403 Forbidden ({\"statusCode\":403,\"error\":\"Forbidden\",\"message\":\"Forbidden\"}): to remediate, please install the apm integration: https://ela.st/apm-integration-quickstart","service.name":"apm-server","ecs.version":"1.6.0"}

```

---

<div class="post-metadata">

**Author:** ![axw](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/axw/32/28197_2.png) [@axw](https://discuss.elastic.co/u/axw)\
**Post date:** [September 15, 2022, 4:48am UTC](https://discuss.elastic.co/t/precondition-apm-integration-installed-failed/314388/2 "2022-09-15T04:48:43Z")

</div>

> [@Maksym\_Postument](#):
>
> `403 Forbidden ({\"statusCode\":403,\"error\":\"Forbidden\",\"message\":\"Forbidden\"})`

The suggested remediation action ("please install the apm integration") is a misleading in this case. The issue appears to be that your Kibana credentials do not allow APM Server to query the installed integration packages.

You can either expand the privileges of `elastic-common-cluster-apm-kb-user`, or you can set `apm-server.data_streams.wait_for_integration: false` in your APM Server configuration, which will cause APM Server to index data without first waiting for the integration to be installed.

---

<div class="post-metadata">

**Author:** ![Maksym\_Postument](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/maksym_postument/32/106661_2.png) [@Maksym\_Postument](https://discuss.elastic.co/u/Maksym_Postument)\
**Post date:** [September 21, 2022, 12:09pm UTC](https://discuss.elastic.co/t/precondition-apm-integration-installed-failed/314388/3 "2022-09-21T12:09:58Z")

</div>

I switched to using elasticsearch as output and issue gone

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [October 12, 2022, 8:10am UTC](https://discuss.elastic.co/t/precondition-apm-integration-installed-failed/314388/4 "2022-10-12T08:10:30Z")

</div>

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