Page MenuHomeVyOS Platform

Restarting Flow Accounting Fails
Needs testing, Requires assessmentPublicBUG

Description

An attempt to restart flow-accounting on VyOS 1.3-rolling-202005150117 results in:

vyos@cr01b-vyos:~$ restart flow-accounting
Traceback (most recent call last):
  File "/usr/libexec/vyos/op_mode/flow_accounting_op.py", line 199, in <module>
    message='Failed to restart flow-accounting')
  File "/usr/lib/python3/dist-packages/vyos/util.py", line 155, in cmd
    raise OSError(code, feedback)
InterruptedError: [Errno 4] Failed to restart flow-accounting
failed to run command: systemctl restart uacctd.service
returned:
exit code: 4

Additionally, another error occurs in configure mode:

vyos@cr01b-vyos# run restart flow-accounting 
VyOS had an issue completing a command.

We are sorry that you encountered a problem while using VyOS.
There are a few things you can do to help us (and yourself):
- Make sure you are running the latest version of the code available at
  https://downloads.vyos.io/rolling/current/amd64/vyos-rolling-latest.iso
- Consult the forum to see how to handle this issue
  https://forum.vyos.io
- Join our community on slack where our users exchange help and advice
  https://vyos.slack.com

When reporting problems, please include as much information as possible:
- do not obfuscate any data (feel free to contact us privately if your 
  business policy requires it)
- and include all the information presented below

Report Time:      2020-05-15 23:38:01
Image Version:    VyOS 1.3-rolling-202005150117
Release Train:    equuleus

Built by:         autobuild@vyos.net
Built on:         Fri 15 May 2020 01:17 UTC
Build UUID:       7f681145-4ff7-4822-8017-063b071c1f7a
Build Commit ID:  4689514248d6ab

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

Hardware vendor:  Red Hat
Hardware model:   KVM
Hardware S/N:     Unknown
Hardware UUID:    Unknown

Traceback (most recent call last):
  File "/usr/libexec/vyos/op_mode/flow_accounting_op.py", line 199, in <module>
    message='Failed to restart flow-accounting')
  File "/usr/lib/python3/dist-packages/vyos/util.py", line 155, in cmd
    raise OSError(code, feedback)
InterruptedError: [Errno 4] Failed to restart flow-accounting
failed to run command: systemctl restart uacctd.service
returned: 
exit code: 4

noteworthy:
cmd 'systemctl restart uacctd.service'
returned (out):

returned (err):
Failed to restart uacctd.service: Access denied
See system logs and 'systemctl status uacctd.service' for details.
[edit]

Details

Difficulty level
Unknown (require assessment)
Version
1.3-rolling-202005150117
Why the issue appeared?
Will be filled on close
Is it a breaking change?
Unspecified (possibly destroys the router)

Event Timeline

kroy changed the task status from Open to Needs testing.May 16 2020, 4:52 AM
kroy claimed this task.
kroy moved this task from Need Triage to In Progress on the VyOS 1.3 Equuleus board.
kroy added a subscriber: kroy.

PR510 should add the necessary sudo

Sometimes I wonder if we should just silently wrap every op mode command in sudo, at least those in the families other than show. It's hard to name a command that doesn't need sudo, and everyone (myself included!) has forgotten to add it at least once.

kroy added a comment.EditedMay 16 2020, 5:09 AM

@dmbaturin Maybe just anything that contains systemctl? Surely 100% of those will need it. But that also assumes anything called via /usr/lib/python3/dist-packages/vyos/util.py

As least that part of it seems like a simple fix. If something isn't using the cmd function out of that package it becomes more difficult.

pasik added a subscriber: pasik.May 16 2020, 8:11 AM

The run code could check the command name against a list of known "need sudo" commands and prepend it automagically so the command looks like normal but is auto-sudo'ed