Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RuntimeError: Command failed: % /usr/lib/waydroid/data/scripts/waydroid-net.sh start #903

Open
yichuang-zh opened this issue May 12, 2023 · 41 comments

Comments

@yichuang-zh
Copy link

yichuang-zh commented May 12, 2023

Describe the bug
A clear and concise description of what the bug is.
After run command "waydroid session start", the terminal shows:
[19:24:13] RuntimeError: Command failed: % /usr/lib/waydroid/data/scripts/waydroid-net.sh start

See the attachment for log.

Screenshots
If applicable, add screenshots to help explain your problem.

General information (please complete the following information):

  • $ waydroid -V
    1.4.1

  • Waydroid Images Version:
    20230422-GAPPS

Desktop (please complete the following information):

  • OS: Debian12 bookworm (virtual machine) [Host: Debian12 bookworm + gnome]

  • GPU: AMD 5800x

  • Kernel version(virtual machine): uname -r
    6.1.0-8-amd64

  • Kernel version(host machine): uname -r
    6.1.0-8-amd64

  • Host mesa version: glxinfo | grep "OpenGL verion"
    OpenGL version string: 4.6.0 NVIDIA 525.105.17

  • Host Desktop: Gnome 43.4

**Smartphone
No.

Additional context
I had installed a vmGuest: debian12 bookworm with gnome on my host(debian12 too), and installed waydroid on my vmGuest.

Logs (please upload as file)

@labo-China
Copy link

Getting the same problem here, running on ArchLinux with Kernel: 6.3.1-zen1-1-zen
This is my log

(023860) [22:38:41] Starting waydroid session
(019537) [22:38:41] % /usr/lib/waydroid/data/scripts/waydroid-net.sh start
vnic is waydroid0
Warning: Extension udp revision 0 not supported, missing kernel module?
iptables v1.8.9 (legacy): can't initialize iptables table filter': Table does not exist (do you need to insmod?) Perhaps iptables or your kernel needs to be upgraded. Failed to setup waydroid-net. Warning: Extension udp revision 0 not supported, missing kernel module? iptables v1.8.9 (legacy): can't initialize iptables table filter': Table does not exist (do you need to insmod?)
Perhaps iptables or your kernel needs to be upgraded.
Warning: Extension tcp revision 0 not supported, missing kernel module?
iptables v1.8.9 (legacy): can't initialize iptables table filter': Table does not exist (do you need to insmod?) Perhaps iptables or your kernel needs to be upgraded. Warning: Extension udp revision 0 not supported, missing kernel module? iptables v1.8.9 (legacy): can't initialize iptables table filter': Table does not exist (do you need to insmod?)
Perhaps iptables or your kernel needs to be upgraded.
Warning: Extension tcp revision 0 not supported, missing kernel module?
iptables v1.8.9 (legacy): can't initialize iptables table filter': Table does not exist (do you need to insmod?) Perhaps iptables or your kernel needs to be upgraded. iptables v1.8.9 (legacy): can't initialize iptables table filter': Table does not exist (do you need to insmod?)
Perhaps iptables or your kernel needs to be upgraded.
iptables v1.8.9 (legacy): can't initialize iptables table filter': Table does not exist (do you need to insmod?) Perhaps iptables or your kernel needs to be upgraded. Warning: Extension MASQUERADE revision 0 not supported, missing kernel module? iptables v1.8.9 (legacy): can't initialize iptables table nat': Table does not exist (do you need to insmod?)
Perhaps iptables or your kernel needs to be upgraded.
Warning: Extension udp revision 0 not supported, missing kernel module?
Warning: Extension CHECKSUM revision 0 not supported, missing kernel module?
iptables v1.8.9 (legacy): can't initialize iptables table `mangle': Table does not exist (do you need to insmod?)
Perhaps iptables or your kernel needs to be upgraded.
(019537) [22:38:41] ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
(019537) [22:38:41] NOTE: The failed command's output is above the ^^^ line in the log file: /var/lib/waydroid/waydroid.log
(023860) [22:38:41] org.freedesktop.DBus.Python.RuntimeError: Traceback (most recent call last):
File "/usr/lib/python3.11/site-packages/dbus/service.py", line 715, in _message_cb
retval = candidate_method(self, *args, **keywords)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/waydroid/tools/actions/container_manager.py", line 34, in Start
do_start(self.args, session)
File "/usr/lib/waydroid/tools/actions/container_manager.py", line 138, in do_start
tools.helpers.run.user(args, command)
File "/usr/lib/waydroid/tools/helpers/run.py", line 58, in user
return tools.helpers.run_core.core(args, msg, cmd, working_dir, output,
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/waydroid/tools/helpers/run_core.py", line 343, in core
check_return_code(args, code, log_message)
File "/usr/lib/waydroid/tools/helpers/run_core.py", line 219, in check_return_code
raise RuntimeError("Command failed: " + log_message)
RuntimeError: Command failed: % /usr/lib/waydroid/data/scripts/waydroid-net.sh start

@FranGamer1892
Copy link

I am having the exact same issue as yichuang-zh.

@FranGamer1892
Copy link

Fixed it by installing "iptables". I am surprised it was not in Debian bookworm already.

@yichuang-zh
Copy link
Author

yichuang-zh commented May 15, 2023

I

Fixed it by installing "iptables". I am surprised it was not in Debian bookworm already.

I installed iptables the way you did, but it created a new problem.
In the terminal:

~$ waydroid session start [06:59:59] Failed to start Clipboard manager service, check logs [07:00:48] Android with user 0 is ready
But when I clicked waydroid, nothing happened.

Here is the log file:

waydroid.log

@FranGamer1892
Copy link

FranGamer1892 commented May 16, 2023 via email

@yichuang-zh
Copy link
Author

yichuang-zh commented May 16, 2023

The output is:
`Starting waydroid session

Failed to start Clipboard manager service, check logs`

Then nothing happened.

waydroid.log

@iTzVoko
Copy link

iTzVoko commented Jul 28, 2023

Fixed it by installing "iptables". I am surprised it was not in Debian bookworm already.

Thank you. I'm surprised that this package fixed the issue successfully.

@TNTBOMBOM
Copy link

Wow, iptables has been deprecated from official Debian releases for 4 years, and Waydroid is still experiencing this issue until now.

@ckcr4lyf
Copy link

FYI, I had the same error message, but from the logs I got:

(3983835) [12:23:51] % /usr/lib/waydroid/data/scripts/waydroid-net.sh start
vnic is waydroid0

dnsmasq: failed to create listening socket for 192.168.240.1: Address already in use
Failed to setup waydroid-net.
Failed to setup waydroid-net.

Turns out it needs to bind something on port 53, and I had piHole setup to listen on 0.0.0.0:53 . Changing piHole settings allowed me to start it.

@TNTBOMBOM
Copy link

TNTBOMBOM commented Aug 18, 2023

FYI, I had the same error message, but from the logs I got:

(3983835) [12:23:51] % /usr/lib/waydroid/data/scripts/waydroid-net.sh start
vnic is waydroid0

dnsmasq: failed to create listening socket for 192.168.240.1: Address already in use
Failed to setup waydroid-net.
Failed to setup waydroid-net.

Turns out it needs to bind something on port 53, and I had piHole setup to listen on 0.0.0.0:53 . Changing piHole settings allowed me to start it.

Unrelated to the issue here. Nevertheless waydroid is another anbox which is dead.

@BakaJzon
Copy link

My host machine powered off due to power outage. Now, I can't launch waydroid anymore.
This is the output of ip addr show

1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host noprefixroute 
       valid_lft forever preferred_lft forever
2: enp4s0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc fq_codel state DOWN group default qlen 1000
    link/ether b0:25:aa:58:ea:fe brd ff:ff:ff:ff:ff:ff
3: wlo1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default qlen 1000
    link/ether c8:58:c0:23:a0:23 brd ff:ff:ff:ff:ff:ff
    altname wlp0s20f3
    inet 192.168.10.5/24 brd 192.168.10.255 scope global dynamic noprefixroute wlo1
       valid_lft 86180sec preferred_lft 86180sec
    inet6 fe80::9322:293a:bc3b:b675/64 scope link noprefixroute 
       valid_lft forever preferred_lft forever

waydroid.log

@ckcr4lyf
Copy link

This is the output of ip addr show

How about the output of netstat -ntlp | grep 53 ?

@BakaJzon
Copy link

BakaJzon commented Aug 19, 2023

How about the output of netstat -ntlp | grep 53 ?

Nothing here, since virtual network device waydroid0 was missing

@ckcr4lyf
Copy link

Nothing here, since virtual network device waydroid0 was missing

Even without that device, it is possible some app on your machine is bound to 0.0.0.0:53 , so when waydroid0 interface is made, port 53 is already bound to by this guy, and then dnsmasq within waydroid fails to start.

@BakaJzon
Copy link

(000724) [17:16:09] % /usr/lib/waydroid/data/scripts/waydroid-net.sh start
vnic is waydroid0

dnsmasq: failed to create listening socket for 192.168.240.1: Address already in use
Failed to setup waydroid-net.
Failed to setup waydroid-net.
(000724) [17:16:09] ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
(000724) [17:16:09] NOTE: The failed command's output is above the ^^^ line in the log file: /var/lib/waydroid/waydroid.log
(002517) [17:16:09] org.freedesktop.DBus.Python.RuntimeError: Traceback (most recent call last):
  File "/usr/lib/python3.11/site-packages/dbus/service.py", line 712, in _message_cb
    retval = candidate_method(self, *args, **keywords)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/waydroid/tools/actions/container_manager.py", line 34, in Start
    do_start(self.args, session)
  File "/usr/lib/waydroid/tools/actions/container_manager.py", line 138, in do_start
    tools.helpers.run.user(args, command)
  File "/usr/lib/waydroid/tools/helpers/run.py", line 58, in user
    return tools.helpers.run_core.core(args, msg, cmd, working_dir, output,
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/waydroid/tools/helpers/run_core.py", line 343, in core
    check_return_code(args, code, log_message)
  File "/usr/lib/waydroid/tools/helpers/run_core.py", line 219, in check_return_code
    raise RuntimeError("Command failed: " + log_message)
RuntimeError: Command failed: % /usr/lib/waydroid/data/scripts/waydroid-net.sh start

(002517) [17:16:09] RuntimeError: Command failed: % /usr/lib/waydroid/data/scripts/waydroid-net.sh start
(002558) [17:16:21] % tail -n 60 -F /var/lib/waydroid/waydroid.log
(002558) [17:16:21] *** output passed to waydroid stdout, not to this log ***

@ckcr4lyf
Copy link

@BakaJzon on your host system check if anything is listening on port 53. That can cause issues.

@BakaJzon
Copy link

I'm pretty sure there‘s nothing listening on it!

[xxx@xxx ~]$ ss -ntlp | grep 53
[xxx@xxx ~]$ waydroid session start
[19:06:13] RuntimeError: Command failed: % /usr/lib/waydroid/data/scripts/waydroid-net.sh start

@ckcr4lyf
Copy link

@BakaJzon try ss -nulp | grep 53 , there may be a UDP socket (especially since it's port 53, likely some DNS stuffs)

@GSI
Copy link

GSI commented Oct 3, 2023

Here's the error log from a current (edge) postmarketOS (Alpine Linux derivate) on Kernel 6.5.5-sdm845, in case it's of any use:

waydroid-net.log

The problem persists regardless of something occupying port 53 or not as per netstat -ntlp | grep 53.

@ckcr4lyf
Copy link

ckcr4lyf commented Oct 4, 2023

@GSI from your logs, the error is different to dnsmasq: failed to create listening socket for 192.168.240.1: Address already in use , which is related to the port 53 thing.

The iptables errors:

Warning: Extension tcp revision 0 not supported, missing kernel module?
Warning: Extension MASQUERADE revision 0 not supported, missing kernel module?
iptables v1.8.9 (nf_tables):  RULE_APPEND failed (No such file or directory): rule in chain POSTROUTING
Failed to setup waydroid-net.
Warning: Extension udp revision 0 not supported, missing kernel module?

seem more like some problem in your Kernel. Can you try it on a "mainstream" distribution and see if it makes a difference? Or try just using iptables

@GSI
Copy link

GSI commented Oct 4, 2023

Can you try it on a "mainstream" distribution

If I don't need a graphical environment, I could try to replicate the issue on a remote Alpine machine, which is the next-closest thing to pmOS and still "mainstream". Anything else doesn't have a Kernel with binderfs ...

Or try just using iptables

How would I do that?

@ckcr4lyf
Copy link

ckcr4lyf commented Oct 4, 2023

How would I do that?

If you've a terminal in your OS, you can try configuring the iptables firewall, and or see if it even exists?

By mainstream I don't mean graphical at all, it could be Ubuntu / Debian pure TTY/headless even. But the error seems more to be a problem with the distribution not having iptables (or netfilter)

@GSI
Copy link

GSI commented Oct 4, 2023

Oh. I highly doubt the issue would be reproducible in Debian and its direct derivatives - otherwise this issue would likely have many more participants.

Is there anything I may run manually to help debug on the current system?

For now, here is some more information about environment:

# iptables -V
iptables v1.8.9 (nf_tables)

# nft -v
nftables v1.0.8 (Old Doc Yak #2)

# iptables -L
Chain INPUT (policy ACCEPT)
target     prot opt source               destination

Chain FORWARD (policy ACCEPT)
target     prot opt source               destination

Chain OUTPUT (policy ACCEPT)
target     prot opt source               destination

@GSI
Copy link

GSI commented Oct 4, 2023

I just cross-checked with another system also running postmarketOS but on Kernel 6.4.14. The issue is not present there.

All versions (nft 1.0.8, iptables 1.8.9, waydroid 1.4.1) - and actually pretty much the entire installation - are exactly the same.

Where it works - 6.4.14 Kernel:

# lsmod | grep net
nft_reject_inet        12288  1
nf_reject_ipv4         12288  1 nft_reject_inet
nf_reject_ipv6         16384  1 nft_reject_inet
nft_reject             12288  1 nft_reject_inet

Where it fails - 6.5.5 Kernel:

# lsmod | grep net
nft_reject_inet        12288  1
nf_reject_ipv4         12288  1 nft_reject_inet
nf_reject_ipv6         16384  1 nft_reject_inet
nft_reject             12288  1 nft_reject_inet
nf_tables             245760  120 nft_ct,nft_reject_inet,nft_reject
nfnetlink              20480  1 nf_tables

Are there any other kernel modules I should check for?

@ckcr4lyf
Copy link

ckcr4lyf commented Oct 4, 2023

Not sure personally, I think opening a bug report in your operating system's bug tracker may be a place to start.

@GSI
Copy link

GSI commented Oct 4, 2023

After trying several variants of one of the failing commands (iptables -w -I INPUT -i waydroid0 -p udp --dport 67 -j ACCEPT) I found out that the issue is resolved by installing the iptables-legacy package.

Its version is shown as iptables v1.8.9 (legacy). Maybe there's a way to make this work with iptables v1.8.9 (nf_tables) too. Otherwise, maybe waydroid-net.sh could perform a check and output a meaningful error message based on it.

@wold9168
Copy link

wold9168 commented Nov 10, 2023

same problem.
waydroid version is 1.4.2.
iptables version is 1.8.9(legacy).
Nothing has been changed after the last normal shutdown (of the waydroid), except the proxy.
But after I restore the proxy setting, waydroid still doesn't work.

Distro is Arch Linux, DE is Plasma 5.27.9 (X11).
Waydroid used to run in weston.

@wold9168
Copy link

same problem. waydroid version is 1.4.2. iptables version is 1.8.9(legacy). Nothing has been changed after the last normal shutdown (of the waydroid), except the proxy. But after I restore the proxy setting, waydroid still doesn't work.

Distro is Arch Linux, DE is Plasma 5.27.9 (X11). Waydroid used to run in weston.

OK, even if nothing in my computer has been changed, it works again.
And I don't know why.
weird......

@NJBA
Copy link

NJBA commented Dec 27, 2023

Fixed it by installing "iptables". I am surprised it was not in Debian bookworm already.

How to use Iptables??

@lambdadeltakay
Copy link

Also having this issue which is odd because before waydroid started but with no internet

@BrandowLucas
Copy link

@lambdadeltakay I experienced the exactly same as you.

@kaitlynkittyy
Copy link

kaitlynkittyy commented Mar 11, 2024

I'm experiencing something similar, and there's a chance it's related to ipv6 being disabled on my system, although I'm not sure.
System: Arch Linux

vnic is waydroid0
/usr/lib/waydroid/data/scripts/waydroid-net.sh: line 154: /proc/sys/net/ipv6/conf/waydroid0/accept_dad: No such file or directory

dnsmasq: failed to create listening socket for 192.168.240.1: Address already in use
Failed to setup waydroid-net.
Failed to setup waydroid-net.

@ckcr4lyf
Copy link

@kaitlynkittyy can you use netstat to see listening ports?

@kaitlynkittyy
Copy link

kaitlynkittyy commented Mar 11, 2024

@kaitlynkittyy can you use netstat to see listening ports?

There are quite a few(and I mean a LOT), but nothing on that specific address.

Also i was able to resolve this issue for myself just now by commenting out line 154 of the script and stopping the dnsmasq service

Edit: This resulted in no network connection within waydroid, but I was able to start it at least

@ckcr4lyf
Copy link

To be clear, there doesn't need to be something on that address, since it could also be 0.0.0.0 (which would mean on any new interface/address automatically)

@kaitlynkittyy
Copy link

To be clear, there doesn't need to be something on that address, since it could also be 0.0.0.0 (which would mean on any new interface/address automatically)

True, I had forgotten that, but there's still nothing on 0.0.0.0 either.

@RickMintEC
Copy link

RickMintEC commented Mar 14, 2024

Hey @yichuang-zh @kaitlynkittyy @ckcr4lyf @lambdadeltakay @wold9168 In Debian 12 sudo apt remove --purge bind9-* and sudo apt remove --purge bind9 dnsutils systemd-resolved dnsmasq waydroid run 0 problems it worked for me.

@I-Want-ToBelieve
Copy link

I-Want-ToBelieve commented Apr 11, 2024

❯ sudo -E ss -nulp | grep 53
[sudo] password for i.want.to.believe: 
UNCONN 0      0                               0.0.0.0:5353       0.0.0.0:*    users:(("avahi-daemon",pid=1602,fd=11))    
UNCONN 0      0                            127.2.0.17:53         0.0.0.0:*    users:((".v2ray-wrapped",pid=2279,fd=11))  
UNCONN 0      0                                     *:53               *:*    users:((".v2ray-wrapped",pid=2279,fd=9))

It works fine after stopping v2raya

@PackageInstaller
Copy link

❯ sudo -E ss -nulp | grep 53
[sudo] password for i.want.to.believe: 
UNCONN 0      0                               0.0.0.0:5353       0.0.0.0:*    users:(("avahi-daemon",pid=1602,fd=11))    
UNCONN 0      0                            127.2.0.17:53         0.0.0.0:*    users:((".v2ray-wrapped",pid=2279,fd=11))  
UNCONN 0      0                                     *:53               *:*    users:((".v2ray-wrapped",pid=2279,fd=9))

It works fine after stopping v2raya

thx,bro,its solved my problem

@1000oaks
Copy link

1000oaks commented May 8, 2024

I found that the script fails at

    dnsmasq $LXC_DHCP_CONFILE_ARG $LXC_DOMAIN_ARG $LXC_DHCP_PING_ARG -u ${DNSMASQ_USER} \
            --strict-order --bind-interfaces --pid-file="${varrun}"/dnsmasq.pid \
            --listen-address ${LXC_ADDR} --dhcp-range ${LXC_DHCP_RANGE} \
            --dhcp-lease-max=${LXC_DHCP_MAX} --dhcp-no-override \
            --except-interface=lo --interface=${LXC_BRIDGE} \
            --dhcp-leasefile="${varlib}"/misc/dnsmasq.${LXC_BRIDGE}.leases \
            --dhcp-authoritative $LXC_IPV6_ARG # || cleanup

It seems that this command fails on my computer when dnsmasq on my hostOS and WayDroid want to "take care of" waydroid0 both.

After I add a line of except-interface=waydroid0 to /etc/dnsmasq.conf on my host OS, killing and restarting dnsmasq on my hostOS again, then running waydroid show-full-ui, now my hostOS and WayDroid container have network connection and are able to handle domains both.

@kaitlynkittyy
Copy link

kaitlynkittyy commented May 15, 2024

I found that the script fails at

    dnsmasq $LXC_DHCP_CONFILE_ARG $LXC_DOMAIN_ARG $LXC_DHCP_PING_ARG -u ${DNSMASQ_USER} \
            --strict-order --bind-interfaces --pid-file="${varrun}"/dnsmasq.pid \
            --listen-address ${LXC_ADDR} --dhcp-range ${LXC_DHCP_RANGE} \
            --dhcp-lease-max=${LXC_DHCP_MAX} --dhcp-no-override \
            --except-interface=lo --interface=${LXC_BRIDGE} \
            --dhcp-leasefile="${varlib}"/misc/dnsmasq.${LXC_BRIDGE}.leases \
            --dhcp-authoritative $LXC_IPV6_ARG # || cleanup

It seems that this command fails on my computer when dnsmasq on my hostOS and WayDroid want to "take care of" waydroid0 both.

After I add a line of except-interface=waydroid0 to /etc/dnsmasq.conf on my host OS, killing and restarting dnsmasq on my hostOS again, then running waydroid show-full-ui, now my hostOS and WayDroid container have network connection and are able to handle domains both.

This fixed it for me under one condition, dnsmasq CANNOT be running before I launch waydroid, or it entirely fails. (which in my use case is completely broken, as I need dnsmasq running always.)

Edit: I have also since re-enabled ipv6 on my system.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests