chrony fail to start on overcloud node - Invalid command at line 10 in file /etc/chrony.conf

Bug #1802791 reported by Harald Jensås
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
tripleo
Triaged
High
Unassigned

Bug Description

[root@overcloud-controller-0 ~]# systemctl status chronyd
● chronyd.service - NTP client/server
   Loaded: loaded (/usr/lib/systemd/system/chronyd.service; enabled; vendor preset: enabled)
   Active: failed (Result: exit-code) since Sun 2018-11-11 20:34:47 UTC; 3min 9s ago
     Docs: man:chronyd(8)
           man:chrony.conf(5)
  Process: 17515 ExecStart=/usr/sbin/chronyd $OPTIONS (code=exited, status=1/FAILURE)
 Main PID: 671 (code=exited, status=0/SUCCESS)

Nov 11 20:34:47 overcloud-controller-0 systemd[1]: Starting NTP client/server...
Nov 11 20:34:47 overcloud-controller-0 chronyd[17517]: chronyd version 3.2 starting (+CMDMON +NTP +REFCLOCK +RTC +PRIVDROP +SCFILTER +SECHASH +SIGND +ASYNCDNS +IPV6 +DEBUG)
Nov 11 20:34:47 overcloud-controller-0 chronyd[17515]: Invalid command at line 10 in file /etc/chrony.conf
Nov 11 20:34:47 overcloud-controller-0 systemd[1]: chronyd.service: control process exited, code=exited status=1
Nov 11 20:34:47 overcloud-controller-0 systemd[1]: Failed to start NTP client/server.
Nov 11 20:34:47 overcloud-controller-0 systemd[1]: Unit chronyd.service entered failed state.
Nov 11 20:34:47 overcloud-controller-0 systemd[1]: chronyd.service failed.

[root@overcloud-controller-0 ~]# cat /etc/chrony.conf
# Do not manually edit this file.
# Managed by ansible-role-chrony
server 0.rhel.pool.ntp.org iburst
server 1.rhel.pool.ntp.org iburst
server 2.rhel.pool.ntp.org iburst
server 3.rhel.pool.ntp.org iburst
pool u'pool.ntp.org' iburst minpoll 6 maxpoll 10 # This does'nt look right.
bindcmdaddress 127.0.0.1
bindcmdaddress ::1
u'deny all' # This does'nt look right.
driftfile /var/lib/chrony/drift
logdir /var/log/chrony
rtcsync
makestep 1.0 3

There is a unicode issue, any ansible_group_vars that is a list or json (not string or integer) contain unicode strings. The ansible jinja template end up writing the strings with the u'<string>' format.

description: updated
description: updated
description: updated
description: updated
Revision history for this message
Harald Jensås (harald-jensas) wrote :

When I put this in the template:

{{ chrony_acl_rules }}

It renders:

[u"u'deny all'"]

Somehow the unicode string is wrapped inside the unicode string. As in:
  my_str = u"u'string'"

Revision history for this message
Harald Jensås (harald-jensas) wrote :

$ openstack stack show overcloud -f json -c outputs \
     | jq .outputs[0].output_value.Compute.ansible_group_vars
{
  "chrony_role_action": "all",
  "chrony_global_server_settings": "iburst minpoll 6 maxpoll 10",
  "chrony_ntp_servers": [],
  "chrony_global_pool_settings": "iburst minpoll 6 maxpoll 10",
  "chrony_manage_package": false,
  "chrony_ntp_pools": [
    "pool.ntp.org"
  ],
  "chrony_acl_rules": [
    "deny all"
  ]
}

Data looks fine in stack output ^^

$ cat /var/lib/mistral/config-download-latest/group_vars/Compute
Compute_pre_deployments:
  - NetworkDeployment
  - NovaComputeUpgradeInitDeployment
  - NovaComputeDeployment
  - ComputeHostsDeployment
  - ComputeAllNodesDeployment
  - ComputeAllNodesValidationDeployment
  - ComputeSwapDeployment
  - ComputeArtifactsDeploy
  - ComputeHostPrepDeployment

Compute_post_deployments: []

chrony_role_action: all
chrony_global_pool_settings: iburst minpoll 6 maxpoll 10
chrony_global_server_settings: iburst minpoll 6 maxpoll 10
any_errors_fatal: True
chrony_ntp_servers: []
max_fail_percentage: 15
chrony_manage_package: False
chrony_ntp_pools: [u'pool.ntp.org']
chrony_acl_rules: [u'deny all']

Config download not so good ^^

>>> import yaml
>>> with open('/var/lib/mistral/config-download-latest/group_vars/Compute', 'r') as file:
... data = yaml.load(file)
...
>>> print data.get('chrony_acl_rules')[0]
u'deny all'
>>> type(data.get('chrony_acl_rules')[0])
<type 'str'>

Revision history for this message
Alex Schultz (alex-schultz) wrote :

This has been fixed already, let me find the bug

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.