# Cfgfile - is not read after first failed attempt

**URL:** <https://discuss.elastic.co/t/cfgfile-is-not-read-after-first-failed-attempt/227041>\
**Category:** Beats\
**Created:** [April 8, 2020, 2:19am UTC](https://discuss.elastic.co/t/cfgfile-is-not-read-after-first-failed-attempt/227041 "2020-04-08T02:19:07Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![newmember](https://avatars.discourse-cdn.com/v4/letter/n/ce7236/32.png) [@newmember](https://discuss.elastic.co/u/newmember)\
**Post date:** [April 8, 2020, 2:19am UTC](https://discuss.elastic.co/t/cfgfile-is-not-read-after-first-failed-attempt/227041/1 "2020-04-08T02:19:07Z")

</div>

I thought it was interesting observation that the changed cfgfile was not re-read after the first attempt failed, until I restarted filebeat.  
Maybe there is an option I am missing to re-read failed config files.

```auto
filebeat.config.inputs:
  enabled: true
  path: /tmp/inputs.d/*.yml
  reload.enabled: true
  reload.period: 60s

```

Steps:

1. Created an inputs.d/ folder
2. Added to the filebeat.yml to read new cfgfile changes every 60s
3. Added a new cfgfile in the folder with a .yml extension
4. cfgfile is read the first time with an error
5. corrected the the error
6. cfgfile is not read again until filebeat service is restarted.

```auto
root@chris-Standard-PC-Q35-ICH9-2009:/tmp# grep cfgfile /var/log/filebeat/filebeat.2
2020-04-07T16:27:23.837-0600 DEBUG [cfgfile] cfgfile/reload.go:137 Checking module configs from: /etc/filebeat/modules.d/*.yml
2020-04-07T16:27:23.837-0600 DEBUG [cfgfile] cfgfile/reload.go:151 Number of module configs found: 0
2020-04-07T16:27:23.837-0600 INFO cfgfile/reload.go:175 Config reloader started
2020-04-07T16:27:23.837-0600 INFO cfgfile/reload.go:175 Config reloader started
2020-04-07T16:27:23.838-0600 DEBUG [cfgfile] cfgfile/reload.go:205 Scan for new config files
2020-04-07T16:27:23.838-0600 DEBUG [cfgfile] cfgfile/reload.go:224 Number of module configs found: 0
2020-04-07T16:27:23.838-0600 DEBUG [reload] cfgfile/list.go:62 Starting reload procedure, current runners: 0
2020-04-07T16:27:23.838-0600 DEBUG [reload] cfgfile/list.go:80 Start list: 0, Stop list: 0
2020-04-07T16:27:23.838-0600 INFO cfgfile/reload.go:235 Loading of config files completed.
2020-04-07T16:28:23.838-0600 DEBUG [cfgfile] cfgfile/reload.go:205 Scan for new config files
2020-04-07T16:28:23.838-0600 DEBUG [cfgfile] cfgfile/cfgfile.go:193 Load config from file: /tmp/inputs.d/a.yml
2020-04-07T16:28:23.838-0600 ERROR cfgfile/reload.go:284 Error loading config from file '/tmp/inputs.d/a.yml', error invalid config: config file ("/tmp/inputs.d/a.yml") can only be writable by the owner but the permissions are "-rw-rw-r--" (to fix the permissions use: 'chmod go-w /tmp/inputs.d/a.yml')
2020-04-07T16:28:23.838-0600 DEBUG [cfgfile] cfgfile/reload.go:224 Number of module configs found: 0
2020-04-07T16:28:23.838-0600 DEBUG [reload] cfgfile/list.go:62 Starting reload procedure, current runners: 0
2020-04-07T16:28:23.838-0600 DEBUG [reload] cfgfile/list.go:80 Start list: 0, Stop list: 0
2020-04-07T16:29:23.839-0600 DEBUG [cfgfile] cfgfile/reload.go:205 Scan for new config files
2020-04-07T16:30:23.840-0600 DEBUG [cfgfile] cfgfile/reload.go:205 Scan for new config files
2020-04-07T16:31:23.841-0600 DEBUG [cfgfile] cfgfile/reload.go:205 Scan for new config files
2020-04-07T16:32:23.842-0600 DEBUG [cfgfile] cfgfile/reload.go:205 Scan for new config files
2020-04-07T16:33:23.842-0600 DEBUG [cfgfile] cfgfile/reload.go:205 Scan for new config files

```

Thanks

---

<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 6, 2020, 4:25am UTC](https://discuss.elastic.co/t/cfgfile-is-not-read-after-first-failed-attempt/227041/2 "2020-05-06T04:25:45Z")

</div>

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