Page MenuHomeVyOS Platform

Set high-availability vrrp sync-group without members error
Closed, ResolvedPublicBUG

Description

Set high-availability vrrp sync-group without member
To reproduce in 1.4:

set high-availability vrrp sync-group foo

Commit:

Report time:      2022-01-05 14:34:49
Image version:    VyOS 1.4-rolling-202201050317
Release train:    sagitta

Built by:         [email protected]
Built on:         Wed 05 Jan 2022 03:17 UTC
Build UUID:       bf22c247-0094-4435-8153-b8fa7b906f61
Build commit ID:  645c891edc0169

Architecture:     x86_64
Boot via:         installed image
System type:      KVM guest

Hardware vendor:  QEMU
Hardware model:   Standard PC (Q35 + ICH9, 2009)
Hardware S/N:     
Hardware UUID:    8e21d64e-e498-475c-9866-290cd53a3b86

Traceback (most recent call last):
  File "/usr/libexec/vyos/conf_mode/high-availability.py", line 177, in <module>
    generate(c)
  File "/usr/libexec/vyos/conf_mode/high-availability.py", line 156, in generate
    render(VRRP.location['config'], 'high-availability/keepalived.conf.tmpl', ha)
  File "/usr/lib/python3/dist-packages/vyos/template.py", line 118, in render
    rendered = render_to_string(template, content, formater, location)
  File "/usr/lib/python3/dist-packages/vyos/template.py", line 87, in render_to_string
    rendered = template.render(content)
  File "/usr/lib/python3/dist-packages/jinja2/environment.py", line 1090, in render
    self.environment.handle_exception()
  File "/usr/lib/python3/dist-packages/jinja2/environment.py", line 832, in handle_exception
    reraise(*rewrite_traceback_stack(source=source))
  File "/usr/lib/python3/dist-packages/jinja2/_compat.py", line 28, in reraise
    raise value.with_traceback(tb)
  File "/usr/share/vyos/templates/high-availability/keepalived.conf.tmpl", line 97, in top-level template code
    {%   for name, group_config in vrrp.group.items() if group_config.disable is not defined %}
  File "/usr/lib/python3/dist-packages/jinja2/environment.py", line 471, in getattr
    return getattr(obj, attribute)
jinja2.exceptions.UndefinedError: 'dict object' has no attribute 'group'



[[high-availability]] failed
Commit failed
[edit]
[email protected]#

Latest 1.3 (with latest vyos-1x) commit:

Traceback (most recent call last):
  File "/usr/libexec/vyos/conf_mode/vrrp.py", line 162, in <module>
    generate(c)
  File "/usr/libexec/vyos/conf_mode/vrrp.py", line 141, in generate
    render(VRRP.location['config'], 'vrrp/keepalived.conf.tmpl', vrrp)
  File "/usr/lib/python3/dist-packages/vyos/template.py", line 117, in render
    rendered = render_to_string(template, content, formater, location)
  File "/usr/lib/python3/dist-packages/vyos/template.py", line 86, in render_to_string
    rendered = template.render(content)
  File "/usr/lib/python3/dist-packages/jinja2/asyncsupport.py", line 76, in render
    return original_render(self, *args, **kwargs)
  File "/usr/lib/python3/dist-packages/jinja2/environment.py", line 1008, in render
    return self.environment.handle_exception(exc_info, True)
  File "/usr/lib/python3/dist-packages/jinja2/environment.py", line 780, in handle_exception
    reraise(exc_type, exc_value, tb)
  File "/usr/lib/python3/dist-packages/jinja2/_compat.py", line 37, in reraise
    raise value.with_traceback(tb)
  File "/usr/share/vyos/templates/vrrp/keepalived.conf.tmpl", line 97, in top-level template code
    {%   for name, group_config in group.items() if group_config.disable is not defined %}
  File "/usr/lib/python3/dist-packages/jinja2/environment.py", line 430, in getattr
    return getattr(obj, attribute)
jinja2.exceptions.UndefinedError: 'group' is undefined

Most likely it after commit da724833 as 1.3.0 not affected

Details

Difficulty level
Easy (less than an hour)
Version
1.3-latest, VyOS 1.4-rolling-202201050317
Why the issue appeared?
Implementation mistake
Is it a breaking change?
Perfectly compatible
Issue type
Bug (incorrect behavior)

Related Objects

Mentioned In
1.3.1

Event Timeline

Viacheslav changed the task status from Open to Confirmed.Jan 5 2022, 12:44 PM
Viacheslav added a project: VyOS 1.4 Sagitta.
c-po claimed this task.
c-po triaged this task as High priority.
c-po changed Why the issue appeared? from Will be filled on close to Implementation mistake.
c-po changed Is it a breaking change? from Unspecified (possibly destroys the router) to Perfectly compatible.