WDCommunity / wdpksrc

Cross compilation framework to create native packages for the Western Digital My Cloud
BSD 3-Clause "New" or "Revised" License
218 stars 54 forks source link

[docker] [single bay mycloud] error initializing network controller #32

Closed gotschi closed 5 years ago

gotschi commented 5 years ago

i get this error when i start docker:

Error starting daemon: Error initializing network controller: error obtaining controller instance: failed to create NAT chain DOCKER: iptables failed: iptables --wait -t nat -N DOCKER: iptables v1.4.21: can't initialize iptables table `nat': Table does not exist (do you need to insmod?) Perhaps iptables or your kernel needs to be upgraded. (exit status 3)

What can I do about it? Is there a newer kernel for this device?

stefaang commented 5 years ago

What is the output of uname -r?

uname -r
lsmod | grep ip_tables
insmod ls /usr/local/modules/driver/ip_tables.ko

The devices with a 3.2 kernel (EX2, EX4) can't run docker.. I may need to remove the single bay mycloud from the list as well.

gotschi commented 5 years ago

uname -r 3.10.39

lsmod | grep ip_tables

ip_tables               9342  1 iptable_filter
x_tables               11477  8 iptable_filter,ip_tables,xt_limit,xt_LOG,xt_recent,xt_tcpudp,xt_state,xt_conntrack
stefaang commented 5 years ago

Thanks.. that looks fine actually. Have you tried to reboot? Eventually, provide the output of this script: https://github.com/moby/moby/blob/master/contrib/check-config.sh

gotschi commented 5 years ago

Yes I've tried rebooting and running scripts manually, here's the output: https://pastebin.com/ATaUprSc

the script does not run or I don't get it:

root@NAS root # ./check-config.sh 
warning: /proc/config.gz does not exist, searching other paths for kernel config ...
error: cannot find kernel config
  try running this script again, specifying the kernel config:
    CONFIG=/path/to/kernel/.config ./check-config.sh or ./check-config.sh /path/to/kernel/.config

and the startup of dockerd:https://pastebin.com/ZD1Z4nVz

just a quick guess but I think it fails in is_docker_setup because it returns NOK thanks anyway

stefaang commented 5 years ago

Here's my output

lsmod | grep tables
ip6_tables 15873 1 ip6table_filter, Live 0xffffffffc0359000
ip_tables 15171 2 iptable_nat,iptable_filter, Live 0xffffffffc033f000
x_tables 15016 13 ipt_MASQUERADE,xt_nat,xt_addrtype,ip6table_filter,ip6_tables,iptable_filter,ip_tables,xt_limit,xt_LOG,xt_recent,xt_tcpudp,xt_state,xt_conntrack, Live 0xffffffffc0303000

Which IP related kernel modules do you have available in your firmware? I have this

ls /usr/local/modules/driver/ip*
/usr/local/modules/driver/ip6_tables.ko       /usr/local/modules/driver/ip_tables.ko        /usr/local/modules/driver/ipt_MASQUERADE.ko   /usr/local/modules/driver/ipv6.ko
/usr/local/modules/driver/ip6_tunnel.ko       /usr/local/modules/driver/ip_tunnel.ko        /usr/local/modules/driver/iptable_filter.ko
/usr/local/modules/driver/ip6table_filter.ko  /usr/local/modules/driver/ipip.ko             /usr/local/modules/driver/iptable_nat.ko

I see you don't have the iptable_nat.ko as I do.

lsmod | grep nat
iptable_nat 1599 1 - Live 0xffffffffc0420000
nf_nat_masquerade_ipv4 1729 1 ipt_MASQUERADE, Live 0xffffffffc040c000
xt_nat 1809 0 - Live 0xffffffffc0408000
nf_nat_ipv4 4543 1 iptable_nat, Live 0xffffffffc03ee000
nf_nat 10637 3 nf_nat_masquerade_ipv4,xt_nat,nf_nat_ipv4, Live 0xffffffffc03dd000
ip_tables 15171 2 iptable_nat,iptable_filter, Live 0xffffffffc033f000
nf_conntrack 50279 7 nf_nat_masquerade_ipv4,nf_nat_ipv4,nf_nat,nf_conntrack_ipv6,nf_conntrack_ipv4,xt_state,xt_conntrack, Live 0xffffffffc030c000
x_tables 15016 13 ipt_MASQUERADE,xt_nat,xt_addrtype,ip6table_filter,ip6_tables,iptable_filter,ip_tables,xt_limit,xt_LOG,xt_recent,xt_tcpudp,xt_state,xt_conntrack, Live 0xffffffffc0303000

Worst case, you can snatch these kernel modules from the EX2 Ultra firmware (use binwalk to extract it).

Regarding that check_config script... there's a .config file in the kernel directory of the GPL source. I'm afraid it's not the last showstopper though.

gotschi commented 5 years ago

as you can see in the daemon logs there also seems to be no "overlay2" driver for this kernel, I think that might even be a bigger problem :D

'overlay' not found as a supported filesystem on this host. Please ensure kernel is new enough and has overlay support loaded. storage-driver=overlay

i will stick to armhf on a rpi, thanks for your quick response anyway!

stefaang commented 5 years ago

Aight. You may want to install debian armhf instead of the WD firmware, but I'll leave that up to you. I'll remove the MyCloud as a valid docker target. Thanks for your report!

gotschi commented 5 years ago

I put debian on a seagate single bay device before, it worked like a charm for over a year but then I've misconfigured something and couldn't get it to boot anymore. The Firmware was a tarball and needs to be installed via TFTP, but I have no clue how (Seagate does not provide a firmware flash utility and I don't know how the root is supposed to be written to the HD)

Could this also happen to the mycloud? Or is there some kind of Bootloader to always restore to WD Firmware?

stefaang commented 5 years ago

Here's the most interesting info https://drive.google.com/drive/folders/0B_6OlQ_H0PxVRXllYjY5RG1CZEU Check the community.wd.com forum for more.