wayvnc icon indicating copy to clipboard operation
wayvnc copied to clipboard

Relax address binding errors

Open ashrama opened this issue 7 months ago • 7 comments

After disabling ipv6 system wide (by adding ipv6.disable=1 to the cmdline.txt file) wayvnc service fails unless the /etc/wayvnc/config file is manually edited and the address=:: line is changed to address=0.0.0.0. This should not be required, and wayvnc should either fallback to ipv4 automatically if ipv6 is unavailable or at a minimum warn this is the issue.

Linux raspberrypi 6.12.25+rpt-rpi-2712 #1 SMP PREEMPT Debian 1:6.12.25-1+rpt1 (2025-04-30) aarch64 GNU/Linux wayvnc: 0.9-dev neatvnc: 0.9-dev aml: 0.3.0

journalctl -b -g wayvnc

May 30 22:15:35 raspberrypi systemd[1]: wayvnc.service: Failed with result 'exit-code'.
May 30 22:15:35 raspberrypi systemd[1]: Failed to start wayvnc.service - VNC Server.
May 30 22:15:35 raspberrypi systemd[1]: Dependency failed for wayvnc-control.service - VNC Control Service.
May 30 22:15:35 raspberrypi systemd[1]: wayvnc-control.service: Job wayvnc-control.service/start failed with result 'dependency'.
May 30 22:15:35 raspberrypi systemd[1]: wayvnc-generate-keys.service - WayVNC Key Generation was skipped because no trigger condition checks were met.
May 30 22:15:35 raspberrypi systemd[1]: wayvnc.service: Scheduled restart job, restart counter is at 21.
May 30 22:15:35 raspberrypi systemd[1]: Stopped wayvnc.service - VNC Server.
May 30 22:15:35 raspberrypi systemd[1]: wayvnc-generate-keys.service - WayVNC Key Generation was skipped because no trigger condition checks were met.
May 30 22:15:35 raspberrypi systemd[1]: Starting wayvnc.service - VNC Server...
May 30 22:15:35 raspberrypi systemd[1]: wayvnc.service: Main process exited, code=exited, status=1/FAILURE
May 30 22:17:05 raspberrypi systemd[1]: wayvnc.service: State 'stop-sigterm' timed out. Killing.
May 30 22:17:05 raspberrypi systemd[1]: wayvnc.service: Killing process 49076 (sh) with signal SIGKILL.
May 30 22:17:05 raspberrypi systemd[1]: wayvnc.service: Killing process 51255 (sleep) with signal SIGKILL.
May 30 22:17:05 raspberrypi systemd[1]: wayvnc.service: Failed with result 'exit-code'.
May 30 22:17:05 raspberrypi systemd[1]: Stopped wayvnc.service - VNC Server.

ashrama avatar May 31 '25 02:05 ashrama

Strict handling of errors is not a bug. However, handling could be made less strict or a flag could be added to relax requirements.

Handling of listening addresses is generic. There are no special cases for :: or 0.0.0.0.

However, if the error is turned into a warning (either via flag, or unconditionally), it would be possible to add both :: and 0.0.0.0 to the address option:

address=:: 0.0.0.0

If I remember correctly, the development snapshot that's running on your version of pios does not have this feature.

any1 avatar May 31 '25 08:05 any1

However, if the error is turned into a warning (either via flag, or unconditionally), it would be possible to add both :: and 0.0.0.0 to the address option:

Being able to specify both would be ideal. Are you saying this is an existing option in a newer release?

ashrama avatar May 31 '25 09:05 ashrama

Being able to specify both would be ideal. Are you saying this is an existing option in a newer release?

The listening on multiple addresses part is implemented, but it would fail and exit if you list both :: and 0.0.0.0 with an "address already in use" error.

any1 avatar May 31 '25 09:05 any1

Ok. Well I have it working now I guess, but ideally I still think having a fallback from ipv6 to ipv4 or vice versa would be more ideal as it will work automatically regardless of which is up. But I guess it depends which way you want to proceed.

ashrama avatar May 31 '25 10:05 ashrama

The fallback is a matter of integration in the distro, but there would still need to be a flag added to wayvnc to relax error handling for this. It's a low hanging fruit, so I might just pick it sooner than many others.

any1 avatar May 31 '25 11:05 any1

This is an interesting case, IMHO one could also treat a bind error on :: specifically with a retry using 0.0.0.0 so users don't have to list both and still can list multiple bind addresses where failure to bind on any single one causes an error and exit.

Consolatis avatar May 31 '25 19:05 Consolatis

IMHO one could also treat a bind error on :: specifically with a retry using 0.0.0.0 so users don't have to list both and still can list multiple bind addresses where binding on any single one causes an error and exit.

This is what I had in mind but better worded. Thanks.

ashrama avatar Jun 01 '25 03:06 ashrama