Page MenuHomeVyOS Platform

op mode commands failing with 'syntax error near then' in 2025.06.04-0020-rolling
Open, HighPublicBUG

Description

In the rolling release version vyOS 2025.06.04-0020, many commands in op mode are failing with the following error:

vyos@vyos:~$ show interfaces pppoe pppoe0 statistics
-vbash: syntax error near unexpected token `then'

vyos@vyos:~$ show interfaces bonding bond0 detail
-vbash: syntax error near unexpected token `then'

vyos@vyos:~$ show interfaces sstpc sstpc0 statistics
-vbash: syntax error near unexpected token `then'

vyos@vyos:~$ show login level
-vbash: syntax error near unexpected token `then'

vyos@vyos:~$ show webproxy log
-vbash: syntax error near unexpected token `then'

vyos@vyos:~$ show webproxy update-log
-vbash: syntax error near unexpected token `then'

vyos@vyos:~$ monitor log webproxy access-log
-vbash: syntax error near unexpected token `then'

vyos@vyos:~$ monitor log webproxy cache-log
-vbash: syntax error near unexpected token `then'


vyos@vyos:~$ install mok
-vbash: syntax error near unexpected token `then'


vyos@vyos:~$ monitor log certbot
-vbash: syntax error near unexpected token `then'

vyos@vyos:~$ update suricata
-vbash: syntax error near unexpected token `then'

It appears that any command in op mode that contains an if statement or conditional logic is failing with this syntax error.
The same commands work correctly in the previous rolling release version VyOS 2025.05.23-0019-rolling(I upgraded from this version) . I have installed a new vyos instance without any configrations and tested those commands with same errors.

Details

Version
-
Is it a breaking change?
Perfectly compatible
Issue type
Bug (incorrect behavior)
Forum thread
2025.06.04-0020

Event Timeline

opswill renamed this task from op mode commands fails to op mode commands failing with 'syntax error near then' in 2025.06.04-0020-rolling.
opswill created this object in space S1 VyOS Public.
Viacheslav raised the priority of this task from Low to High.Fri, Jun 6, 6:08 AM
Viacheslav changed the subtype of this task from "Task" to "Bug".
dmbaturin changed Is it a breaking change? from Unspecified (possibly destroys the router) to Perfectly compatible.
dmbaturin changed Issue type from Unspecified (please specify) to Bug (incorrect behavior).

Yes, embedded shell scripts are incompatible with the idea to execute op mode commands through a wrapper, which is required for permission checking.

This PR fixes many (but not all) involved commands: https://github.com/vyos/vyos-1x/pull/4550

show login level is already useless so this PR removes it: https://github.com/vyos/vyos-1x/pull/4551 (T7538)

More fixes will follow.

I found some other commands with same errors:

vyos@vyos:~$ update container image tailscale
-vbash: syntax error near unexpected token `then'

vyos@vyos:~$  monitor log wireless wpa-supplicant
-vbash: syntax error near unexpected token `then'

vyos@vyos:~$  monitor log wireless hostapd
-vbash: syntax error near unexpected token `then'

@opswill Thanks for searching! I found some more that we need to fix.

  • restart ntp
  • show environment

As this is unfixed in VyOS 2025.06.17-0020-rolling. Is there a workaround that allows i.e to update container images without removing/adding the complete image/config?