Variables in mender.conf are ignored and default used instead

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

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:

MENDER_INVENTORY_POLL_INTERVAL_SECONDS = ""
MENDER_RETRY_POLL_INTERVAL_SECONDS = ""
MENDER_SERVER_URL = ""
MENDER_UPDATE_POLL_INTERVAL_SECONDS = ""
1 Like