Page MenuHomePhabricator

syslog host no longer accepts a port
Backport candidate, NormalPublicBUG

Description

In crux/rolling, it's allowed to set a port for the syslog host. It appears that this isn't possible in Equulues

# set system syslog host 10.22.22.108:1514

  Invalid host FQDN or IP address
  Value validation failed
  Set failed

Details

Difficulty level
Normal (likely a few hours)
Version
1.3
Why the issue appeared?
Design mistake
Is it a breaking change?
Perfectly compatible

Event Timeline

kroy created this task.Dec 4 2019, 5:06 AM
c-po added a subscriber: c-po.EditedDec 4 2019, 8:20 AM

Can this please be splittet in a host and a port node? Only WireGuard uses this notation all other services have a dedicated port node

hagbard claimed this task.Dec 4 2019, 4:09 PM
hagbard triaged this task as Normal priority.Dec 4 2019, 4:51 PM
hagbard changed Difficulty level from Unknown (require assessment) to Normal (likely a few hours).
hagbard changed Why the issue appeared? from Will be filled on close to Design mistake.
hagbard changed the task status from Open to In progress.Dec 4 2019, 4:58 PM
hagbard moved this task from Need Triage to In Progress on the VyOS 1.3 Equuleus board.

Actually I found out that the address:port wasn't implemented at all even if you were able to set it, it never was used within the config. I have that fixed now (not pushed yet). I also moved that part within the nodes, so it's going to be:

set system syslog global facility all level 'info'
set system syslog global facility protocols level 'debug'
set system syslog host 10.100.100.1 facility all level 'all'
set system syslog host 10.100.100.1 port '555'
set system syslog host 10.100.100.1 protocol 'tcp'
set system syslog host 10.100.100.2 facility kern level 'all'

Currently I check if facility and level is set, but I could make *.* as default target if it's not defined or so. Not sure if that would be necessary. I need to write a migration script only for the changed protocol node and if the syntax address:port exists, I gotta rewrite that then too.

kroy added a comment.Dec 4 2019, 5:59 PM

It actually does work, if only by accident

host 10.22.22.108:1514 {
     facility all {
         level all
         protocol udp
     }
 }

Results in:

admin@edge:~$ cat /etc/rsyslog.d/vyos-rsyslog.conf 

## generated by syslog.py ##
## file based logging
$PreserveFQDN on
$outchannel global,/var/log/messages,262144,/usr/sbin/logrotate /etc/logrotate.d/vyos-rsyslog
*.info;local7.debug :omfile:$global
## remote logging
*.* @10.22.22.108:1514

Ah yes, it's taken entirely from the string, my fault I tested with the version you can only use an IP address.

hagbard changed the task status from In progress to Needs testing.Dec 4 2019, 11:40 PM
This comment was removed by hagbard.
hagbard changed the task status from Needs testing to In progress.Dec 5 2019, 4:07 PM
hagbard changed the task status from In progress to Needs testing.Dec 6 2019, 6:24 PM
This comment was removed by hagbard.
kroy added a comment.Dec 6 2019, 11:10 PM

Built a fresh rolling. It failed with:

[ system syslog host 10.22.22.108:1514 ]
Invalid host FQDN or IP address

[[system syslog]] failed
kroy added a comment.Dec 6 2019, 11:12 PM

Trying to apply the fix manually:

admin@edge# set system syslog host 10.22.22.108 port 1514
[edit]
admin@edge# commit
save
[ system syslog ]
Traceback (most recent call last):
  File "/usr/libexec/vyos/conf_mode/system-syslog.py", line 328, in <module>
    c = get_config()
  File "/usr/libexec/vyos/conf_mode/system-syslog.py", line 201, in get_config
    'proto': proto
UnboundLocalError: local variable 'proto' referenced before assignment

[[system syslog]] failed
Commit failed
[edit]
admin@edge#
pasik added a subscriber: pasik.Dec 8 2019, 7:00 PM

@kroy Please let me know if you still experience any issues (setting the port or migration).

kroy added a comment.Dec 10 2019, 7:09 PM

@hagbard Confirmed fix. Migration worked perfectly.

host 10.22.22.108:514 {
    facility all {
        level all
        protocol udp
    }
}

to

host 10.22.22.108 {
    facility all {
        level all
        protocol udp
    }
    port 514
}

and it looks like the rsyslogd.conf is correct:

*.* @10.22.22.108:514
hagbard closed this task as Resolved.Dec 10 2019, 7:10 PM
hagbard reopened this task as Backport candidate.
hagbard moved this task from In Progress to Finished on the VyOS 1.3 Equuleus board.
hagbard moved this task from Needs Triage to Backlog on the VyOS 1.2 Crux (VyOS 1.2.5) board.