# Variables in mender.conf are ignored and default used instead

**URL:** <https://hub.mender.io/t/variables-in-mender-conf-are-ignored-and-default-used-instead/2017>\
**Category:** General Discussions\
**Created:** [June 7, 2020, 6:40pm UTC](https://hub.mender.io/t/variables-in-mender-conf-are-ignored-and-default-used-instead/2017 "2020-06-07T18:40:18Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![markus4dev](https://avatars.discourse-cdn.com/v4/letter/m/dec6dc/32.png) [@markus4dev](https://hub.mender.io/u/markus4dev)\
**Post date:** [June 7, 2020, 6:40pm UTC](https://hub.mender.io/t/variables-in-mender-conf-are-ignored-and-default-used-instead/2017/1 "2020-06-07T18:40:18Z")

</div>

Hi!

I moved the `MENDER_SERVER_URL` variable from **local.info** into **mender.conf** and also `MENDER_UPDATE_POLL_INTERVAL_SECONDS`, `MENDER_INVENTORY_POLL_INTERVAL_SECONDS`, `MENDER_RETRY_POLL_INTERVAL_SECONDS` from **mender\_%.bbappend** into **mender.conf**

It looks like this in **mender.conf**

```
{
  "ServerURL": "https://my.mender.io",
  "UpdatePollIntervalSeconds": 180,
  "InventoryPollIntervalSeconds": 240,
  "RetryPollIntervalSeconds": 240
}

```

and the **mender\_%.bbappend**

```
FILESEXTRAPATHS_prepend := "${THISDIR}/files:"
SRC_URI_append = " file://mender.conf"

```

and everything is in recipes-mender. But when I run the client I get only the default settings.

I checked **/etc/mender/mender.conf**

```
{
    "InventoryPollIntervalSeconds": 28800,
    "RetryPollIntervalSeconds": 300,
    "ServerURL": "https://docker.mender.io",
    "TenantToken": "dummy",
    "UpdatePollIntervalSeconds": 1800
}

```

It seems that the **mender.conf** file is ignored during the build. During the build I get the following warning:

```
WARNING: mender-2.2.0-r0 do_prepare_mender_conf: Configuration key 'InventoryPollIntervalSeconds', found in mender.conf, conflicts with variable 'MENDER_INVENTORY_POLL_INTERVAL_SECONDS'. Choosing the latter.
WARNING: mender-2.2.0-r0 do_prepare_mender_conf: Configuration key 'RetryPollIntervalSeconds', found in mender.conf, conflicts with variable 'MENDER_RETRY_POLL_INTERVAL_SECONDS'. Choosing the latter.
WARNING: mender-2.2.0-r0 do_prepare_mender_conf: Configuration key 'ServerURL', found in mender.conf, conflicts with variable 'MENDER_SERVER_URL'. Choosing the latter.
WARNING: mender-2.2.0-r0 do_prepare_mender_conf: Configuration key 'UpdatePollIntervalSeconds', found in mender.conf, conflicts with variable 'MENDER_UPDATE_POLL_INTERVAL_SECONDS'. Choosing the latter.

```

I have removed the tmp directory and also run `bitbake -c cleansstate mender`. I don’t understand what I am missing?

Any tips what to check next?

Regards,  
Markus

---

<div class="post-metadata">

**Author:** ![mirzak](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/mirzak/32/2056_2.png) [@mirzak](https://hub.mender.io/u/mirzak)\
**Post date:** [June 8, 2020, 6:41am UTC](https://hub.mender.io/t/variables-in-mender-conf-are-ignored-and-default-used-instead/2017/2 "2020-06-08T06:41:25Z")

</div>

Hi @markus4dev,

I think this works by design.

You can provide configuration variables in two ways,

1. Using variables e.g `MENDER_INVENTORY_POLL_INTERVAL_SECONDS`
2. Providing a custom `mender.conf` file

If configuration options are in conflict, that is a configuration option is defined in both locations, the variable setting will take precedence.

If you want your `mender.conf` to be valid, you probably need to clear out the existing variables, e.g:

```auto
MENDER_INVENTORY_POLL_INTERVAL_SECONDS = ""
MENDER_RETRY_POLL_INTERVAL_SECONDS = ""
MENDER_SERVER_URL = ""
MENDER_UPDATE_POLL_INTERVAL_SECONDS = ""

```
