Validate_data broken in 23.05 if package has multiple sections

I came across that issue when I tried to get the "sshtunnel" package configured.

My minimal config looks as follows:

config server vpn1
        option user                     sshtunnel
        option hostname                 'myhost.doman.tld'
        option port                     22
        option IdentityFile             '/root/.ssh/server.sshtunnel.id_rsa'

#config tunnelR owrt-https
#       option server           vpn1
#       option remoteaddress    '*'
#       option remoteport       31443
#       option localaddress     ''
#       option localport                443

When I do a

root@wrt# validate_data "sshtunnel" "server" "vpn1" 'user:string(1)'
sshtunnel.nas2.user=sshtunnel validates as string(1) with true
root@wrt# echo $?

the validation works ok as expected.

But as soon as I uncomment the 2nd section in the config, then it raises an error:

root@wrt# validate_data "sshtunnel" "server" "vpn1" 'user:string(1)'
root@wrt# echo $?

The validation should stil be good as I only request to validate the section "server" for "vpn1" and nothing is changed there compated to the 1st attempt.

I tested this on 23.05 and 23.05.02, platform ath79/generic, build OpenWrt 23.05.2 r23630-842932a63d / LuCI openwrt-23.05 branch git-23.306.39416-c86c256

What happens if you remove the dash?

1 Like

This is because the configuration is invalid. Dashes are not allowed in section names.

1 Like

Holy shit, I invested hours in the debugging for such a stupid fault.
Yes, you are both fully right, my issue was the dash.

However, It would be great if this could be pushed to the logs by the validation scripts.

Thank you so much for your quick reply!

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.