# Filebeat receives HTTP 405 from Elasticsearch after 7.x -\> 8.1 upgrade

**URL:** https://discuss.elastic.co/t/filebeat-receives-http-405-from-elasticsearch-after-7-x-8-1-upgrade/303821
**Category:** Beats
**Tags:** filebeat
**Created:** [May 3, 2022, 11:26am UTC](https://discuss.elastic.co/t/filebeat-receives-http-405-from-elasticsearch-after-7-x-8-1-upgrade/303821 "2022-05-03T11:26:49Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![Specialist](https://avatars.discourse-cdn.com/v4/letter/s/e480ec/32.png) [@Specialist](https://discuss.elastic.co/u/Specialist)
#### Post date: [May 3, 2022, 11:26am UTC](https://discuss.elastic.co/t/filebeat-receives-http-405-from-elasticsearch-after-7-x-8-1-upgrade/303821/1 "2022-05-03T11:26:49Z")

</div>

Hi there,

since upgrading to v8.1 Filebeat no longer starts with the following error:

> Connection marked as failed because the onConnect callback failed: error loading template: failure while checking if template exists: 405 Method Not Allowed

Currently, the `flebeat_writer` user is supposed to have the following roles:

```auto
  filebeat_writer:
    cluster:
      - manage_ilm
      - manage_index_templates
      - manage_ingest_pipelines
      - monitor
      - read_ilm
      - read_pipeline
    indices:
      - names:
          - filebeat
          - filebeat-*
        privileges:
          - create_index
          - manage
          - write

```

Which roles are missing?

---

<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: [May 31, 2022, 11:27am UTC](https://discuss.elastic.co/t/filebeat-receives-http-405-from-elasticsearch-after-7-x-8-1-upgrade/303821/2 "2022-05-31T11:27:09Z")

</div>

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

---

<div class="post-metadata">

### Author: ![TiagoQueiroz](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/tiagoqueiroz/32/107061_2.png) [@TiagoQueiroz](https://discuss.elastic.co/u/TiagoQueiroz)
#### Post date: [June 16, 2022, 4:21pm UTC](https://discuss.elastic.co/t/filebeat-receives-http-405-from-elasticsearch-after-7-x-8-1-upgrade/303821/3 "2022-06-16T16:21:37Z")

</div>

Hi @Specialist,

It seems there is a missing configuration in the template section from Filebeat.  
I answered a very similar issue on GitHub, could you try the solution I posted there?

> <https://github.com/elastic/beats/issues/31909>
>
> Hey there, 
> I am trying to import a custom template using a json file from File…beat.
> Below you can find the section related to this operation and also the faced error.
> 
> Elasticsearch: 8.2.2
> Filebeat: 8.2.2
> OS: Container
> 
> Step to reproduce:
> \`filebeat.yml\` configuration file
> 
> \`\`\`
> \# # #======TEMPLATE
> setup.template.enabled: true
> setup.template.name: "logtmp"
> setup.template.pattern: "logtmp\*"
> setup.template.json.enabled: true
> setup.template.json.path: "/usr/share/filebeat/template.json"
> \`\`\`
> 
> error message:
> 
> \`{"log.level":"error","@timestamp":"2022-06-10T10:21:18.519Z","log.logger":"publisher\_pipeline\_output","log.origin":{"file.name":"pipeline/client\_worker.go","file.line":150},"message":"Failed to connect to backoff(elasticsearch(https://es-3:9200)): Connection marked as failed because the onConnect callback failed: error loading template: failure while checking if template exists: 405 Method Not Allowed: ","service.name":"filebeat","ecs.version":"1.6.0"}\`
> 
> 
> If I try just with \`setup.template.enabled:true\` , the standard Filebeat template will be loaded properly. If I try only with \`setup.template.json.enabled:true\` nothing will happen.
> Taking a look to ES Forum, I found also \[this discussion\](https://discuss.elastic.co/t/filebeat-receives-http-405-from-elasticsearch-after-7-x-8-1-upgrade/303821) without any reply

If it does not work for you, please post your Filebeat configuration and debug logs.
