Ask for help and prompt error in setting console server

When setting the console server, the following error will be prompted:

vyos@vyos# set service console-server device ttyS0 speed 9600ls: cannot access ‘/dev/serial/by-bus’: No such file or directory
ls: cannot access ‘/dev/serial/by-bus’: No such file or directory

vyos@vyos# set service console-server device ls: cannot access ‘/dev/serial/by-bus’: No such file or directory
ls: cannot access ‘/dev/serial/by-bus’: No such file or directory

vyos@vyos:/dev$ show version
Version: VyOS 1.4-rolling-202102280559
Release Train: sagitta
Built by: autobuild@vyos.net
Built on: Sun 28 Feb 2021 05:59 UTC
Build UUID: 5df1afa6-f042-45ec-b4e5-455b57b260c4
Build Commit ID: 39ab069e421c6e
Architecture: x86_64
Boot via: installed image
System type: VMware guest
Hardware vendor: VMware, Inc.
Hardware model: VMware Virtual Platform
Hardware S/N: VMware-56 4d 25 73 9f e6 2e fb-ea a2 9f 73 7d 1e 64 4c
Hardware UUID: 73254d56-e69f-fb2e-eaa2-9f737d1e644c
Copyright: VyOS maintainers and contributors

thanks!

Hello @jnliujie,

Thanks! It looks like a bug, could you create a bug report on the https://phabricator.vyos.net/
I can propose some improvements, like checking is /dev/serial/ exists
https://github.com/vyos/vyos-1x/blob/current/interface-definitions/service_console-server.xml.in#L16
And change to

<script>if [ -d "/dev/serial" ]; then ls -1 /dev/serial/by-bus; fi</script>

Ok, Let me just check. Thank you…