Page MenuHomeVyOS Platform

Restarting flow accounting fails with systemd error
Closed, ResolvedPublicBUG

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:         [email protected]
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)
Issue type
Bug (incorrect behavior)

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.

@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.

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

This is fixed:

trae@cr01b-vyos:~$ restart flow-accounting
trae@cr01b-vyos:~$ show ver

Version:          VyOS 1.3-rolling-202101061750
Release Train:    equuleus

Built by:         [email protected]
Built on:         Wed 06 Jan 2021 17:51 UTC
Build UUID:       c08719af-583f-417e-b990-6adf715df70f
Build Commit ID:  432f3f96927a54

Architecture:     x86_64
Boot via:         installed image
System type:      bare metal

Hardware vendor:  Supermicro
Hardware model:   SYS-6019U-TN4R4T

Copyright:        VyOS maintainers and contributors
erkin renamed this task from Restarting Flow Accounting Fails to Restarting flow accounting fails with systemd error.Aug 30 2021, 6:12 AM
erkin set Issue type to Bug (incorrect behavior).
erkin removed a subscriber: Active contributors.