Opened 13 years ago

Closed 12 years ago

#9820 closed Bug Report - General (Fixed)

Upgraded to 'master', lost IPV4 connectivity

Reported by: Ian Clark <mrrooster@…> Owned by: Raymond Wagner
Priority: minor Milestone: 0.25
Component: MythTV - General Version: Master Head
Severity: medium Keywords:
Cc: Ticket locked: no

Description

Hi All,

Just upgraded to the latest 'master' build, or more specifically:

2011-05-31 18:06:35.643 mythbackend version: master [v0.25pre-2076-g4d772e0] www.mythtv.org

And upon reboot the frontend couldn't connect to the backend.

A quick prod around with netstat showed the backend was listening on an IP6 address, but not an IP4 address, disabling ipv6 on the next reboot seems to have solved the issue.

Is this intentional? (and if so, what do I need to reconfigure to make it all work proper like.), or if not, should I file a bug report?


Any chance you can provide the output of running the backend with -v sockets with IPv6 enabled, as well as the output of ifconfig, and netstat -antu ?

If you could pop that into a ticket in trac I'll see what I can track down.


ian@pvr:~$ sudo netstat -pl | grep 6543
[sudo] password for ian:
tcp6       0      0 [::]:6543               [::]:*                  LISTEN      1632/mythbackend
ian@pvr:~$ sudo netstat -pl | grep backend
tcp6       0      0 [::]:6543               [::]:*                  LISTEN      1632/mythbackend
tcp6       0      0 [::]:6544               [::]:*                  LISTEN      1632/mythbackend
udp        0      0 255.255.255.255:1900    *:*                                 1632/mythbackend
udp        0      0 *:1900                  *:*                                 1632/mythbackend
ian@pvr:~$ sudo ifconfig
eth3      Link encap:Ethernet  HWaddr 00:c0:49:59:2b:de
          inet addr:192.168.0.121  Bcast:192.168.0.255  Mask:255.255.255.0
          inet6 addr: fe80::2c0:49ff:fe59:2bde/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:603 errors:0 dropped:0 overruns:0 frame:0
          TX packets:734 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:61255 (59.8 KiB)  TX bytes:144266 (140.8 KiB)
          Interrupt:18 Base address:0x2c00

lo        Link encap:Local Loopback
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:1012 errors:0 dropped:0 overruns:0 frame:0
          TX packets:1012 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:508234 (496.3 KiB)  TX bytes:508234 (496.3 KiB)

ian@pvr:~$ sudo netstat -antu
Active Internet connections (servers and established)
Proto Recv-Q Send-Q Local Address           Foreign Address         State
tcp        0      0 0.0.0.0:80              0.0.0.0:*               LISTEN
tcp        0      0 0.0.0.0:6000            0.0.0.0:*               LISTEN
tcp        0      0 0.0.0.0:4949            0.0.0.0:*               LISTEN
tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN
tcp        0      0 127.0.0.1:25            0.0.0.0:*               LISTEN
tcp        0      0 192.168.0.121:445       0.0.0.0:*               LISTEN
tcp        0      0 127.0.0.1:445           0.0.0.0:*               LISTEN
tcp        0      0 0.0.0.0:3306            0.0.0.0:*               LISTEN
tcp        0      0 192.168.0.121:139       0.0.0.0:*               LISTEN
tcp        0      0 127.0.0.1:139           0.0.0.0:*               LISTEN
tcp        0     18 192.168.0.121:4949      192.168.0.254:55884     ESTABLISHED
tcp        0     48 192.168.0.121:22        192.168.0.254:55885     ESTABLISHED
tcp        0      0 192.168.0.121:37355     192.168.0.254:445       ESTABLISHED
tcp6       0      0 :::6543                 :::*                    LISTEN
tcp6       0      0 :::6544                 :::*                    LISTEN
tcp6       0      0 :::6000                 :::*                    LISTEN
tcp6       0      0 :::6546                 :::*                    LISTEN
tcp6       0      0 :::6547                 :::*                    LISTEN
tcp6       0      0 :::22                   :::*                    LISTEN
tcp6       0      0 ::1:50560               ::1:6544                TIME_WAIT
tcp6       0      0 ::1:50558               ::1:6544                TIME_WAIT
tcp6       0      0 ::1:50565               ::1:6544                TIME_WAIT
tcp6       0      0 ::1:50564               ::1:6544                TIME_WAIT
udp        0      0 0.0.0.0:53721           0.0.0.0:*
udp        0      0 255.255.255.255:1900    0.0.0.0:*
udp        0      0 0.0.0.0:1900            0.0.0.0:*
udp        0      0 255.255.255.255:1900    0.0.0.0:*
udp        0      0 0.0.0.0:1900            0.0.0.0:*
udp        0      0 192.168.0.255:137       0.0.0.0:*
udp        0      0 192.168.0.121:137       0.0.0.0:*
udp        0      0 0.0.0.0:137             0.0.0.0:*
udp        0      0 192.168.0.255:138       0.0.0.0:*
udp        0      0 192.168.0.121:138       0.0.0.0:*
udp        0      0 0.0.0.0:138             0.0.0.0:*
udp6       0      0 :::6948                 :::*
ian@pvr:~$

the log is quite large, so I've attached it.

Cheers,

Ian

Attachments (4)

myth_backend.log.gz (6.0 KB) - added by Ian Clark <mrrooster@…> 13 years ago.
Myth backend log with lots of lovely logging options turned on. :)
upnp-v6-1.diff (3.1 KB) - added by greg 13 years ago.
mythtv_ip6_disabled.png (46.6 KB) - added by anonymous 12 years ago.
mythtv_ip6_enabled.png (53.5 KB) - added by anonymous 12 years ago.

Download all attachments as: .zip

Change History (19)

Changed 13 years ago by Ian Clark <mrrooster@…>

Attachment: myth_backend.log.gz added

Myth backend log with lots of lovely logging options turned on. :)

comment:1 Changed 13 years ago by greg

Thanks for the info and the logs!

Would you might testing it with an updated checkout? I put in some fixes in the last day or so that might clear it up for you.

If it still fails there are somethings I forgot to ask are :

  1. Is this a combo Backend/Frontend? or seperate machines?
  1. Can you Send me the log output of starting up the frontend?

comment:2 Changed 13 years ago by greg

I'm also attaching a patch that might solve this for you.

Thanks

Changed 13 years ago by greg

Attachment: upnp-v6-1.diff added

comment:3 Changed 13 years ago by Ian Clark <mrrooster@…>

Hi Greg,

I've just updated to the latest master, the machine is rebooting now....

<time passes>

...

Well, that didn't work I'm afraid.

I'll try the patch when I get home in a few hours, see if that helps. :)

Cheers,

Ian

comment:4 Changed 13 years ago by mrrooster@…

Didn't work I'm afraid.

I dunno if it's any use, but if I change line 203 in mythtv/programs/mythbackend/mainserver.cpp to use QHostAddress::Any it seems to work, further logging suggests 'gCoreContext->MythHostAddressAny?()' is returning '::' (Assuming this should be '0.0.0.0'?)

Cheers,

Ian

comment:5 Changed 13 years ago by beirdo

Owner: set to greg
Status: newassigned

comment:6 Changed 13 years ago by paulh

Milestone: unknown0.25

comment:7 Changed 12 years ago by greg

Can you confirm for me if this is a combination fe/be box or are they on separate machines? And if they are on separate machines can you try manually telneting from the fe to the backend on port 6543 and see if you get a response (without your change in place?) your output show it is listenning so it's making me wonder if you or your distro have some sort of filter in place blocking all IPv6 traffic.

What distro is running on that backend?

Thanks

comment:8 Changed 12 years ago by mrrooster@…

Hi Greg,

Sorry for the lateness of this reply.... :)

It's a combo FE/BE machine, running almost debian 6. (It was debian 5, myth stopped compiling, so I apt-get'd my way to whatever they call their unstable distro, this was not too long before deb 6 was released.)

It's however running a 3.0.4 kernel

ian@pvr:~$ uname -a Linux pvr 3.0.4-pvr #1 SMP PREEMPT Sat Oct 29 21:37:38 BST 2011 i686 GNU/Linux

Which part of my output, sorry, I'm a little confused? I've disabled IP6 (which forces the listening to happen on IP4), so am currently running an unmodified copy of whatever current was when compiled.

If I re-enable IP 6 I get the following:-

pvr:/home/ian# netstat -an --program | grep mythbackend tcp6 0 0 :::6543 :::* LISTEN 1682/mythbackend tcp6 0 0 :::6544 :::* LISTEN 1682/mythbackend udp 0 0 255.255.255.255:1900 0.0.0.0:* 1682/mythbackend udp 0 0 239.255.255.250:1900 0.0.0.0:* 1682/mythbackend unix 3 [ ] STREAM CONNECTED 9433 1682/mythbackend unix 3 [ ] STREAM CONNECTED 6921 1682/mythbackend unix 3 [ ] STREAM CONNECTED 3917 1682/mythbackend unix 3 [ ] STREAM CONNECTED 3892 1682/mythbackend unix 3 [ ] STREAM CONNECTED 8730 1682/mythbackend unix 3 [ ] STREAM CONNECTED 6902 1682/mythbackend unix 3 [ ] STREAM CONNECTED 3884 1682/mythbackend unix 3 [ ] STREAM CONNECTED 3881 1682/mythbackend unix 3 [ ] STREAM CONNECTED 3879 1682/mythbackend unix 3 [ ] STREAM CONNECTED 3861 1682/mythbackend unix 3 [ ] STREAM CONNECTED 8677 1682/mythbackend unix 3 [ ] STREAM CONNECTED 8311 1682/mythbackend unix 3 [ ] STREAM CONNECTED 2693 1682/mythbackend pvr:/home/ian#

I've attached a couple of screenshots, hopefully they'll illustrate better....

If you want me to investigate what I changed I can look at this further over the weekend.

Cheers,

Ian

Changed 12 years ago by anonymous

Attachment: mythtv_ip6_disabled.png added

Changed 12 years ago by anonymous

Attachment: mythtv_ip6_enabled.png added

comment:9 Changed 12 years ago by mrrooster@…

... just one more thing.

Just to confirm, there's no firewall at all running on this machine. (It's not internet facing.)

Cheers,

Ian

comment:10 Changed 12 years ago by mrrooster@…

.... Just another one more thing... :)

This is the main connection to the backend, from another frontend, UPnP is listening correctly on IP4 when IP6 is enabled.

It's just the backend not listening on 6543 that's the issue....

Oh, as I forgot to format the previous cut'n'paste, here it is again...

pvr:/home/ian# netstat -an --program | grep mythbackend
tcp6       0      0 :::6543                 :::*                    LISTEN      1682/mythbackend
tcp6       0      0 :::6544                 :::*                    LISTEN      1682/mythbackend
udp        0      0 255.255.255.255:1900    0.0.0.0:*                           1682/mythbackend
udp        0      0 239.255.255.250:1900    0.0.0.0:*                           1682/mythbackend
unix  3      [ ]         STREAM     CONNECTED     9433     1682/mythbackend
unix  3      [ ]         STREAM     CONNECTED     6921     1682/mythbackend
unix  3      [ ]         STREAM     CONNECTED     3917     1682/mythbackend
unix  3      [ ]         STREAM     CONNECTED     3892     1682/mythbackend
unix  3      [ ]         STREAM     CONNECTED     8730     1682/mythbackend
unix  3      [ ]         STREAM     CONNECTED     6902     1682/mythbackend
unix  3      [ ]         STREAM     CONNECTED     3884     1682/mythbackend
unix  3      [ ]         STREAM     CONNECTED     3881     1682/mythbackend
unix  3      [ ]         STREAM     CONNECTED     3879     1682/mythbackend
unix  3      [ ]         STREAM     CONNECTED     3861     1682/mythbackend
unix  3      [ ]         STREAM     CONNECTED     8677     1682/mythbackend
unix  3      [ ]         STREAM     CONNECTED     8311     1682/mythbackend
unix  3      [ ]         STREAM     CONNECTED     2693     1682/mythbackend
pvr:/home/ian#

comment:11 in reply to:  10 Changed 12 years ago by Bill Meek <keemllib@…>

Replying to mrrooster@…:

Ian, your netstat looks fine. Below is an example of a frontend connected over IPv4 with IPv6 enabled. Running v0.25pre-3814-g6cf957e on Mythbuntu 11.10 (3.0.0 kernel.)

bill@mc1:/etc$ sudo netstat -pant|grep mythbackend
tcp6       0      0 :::6543                 :::*                    LISTEN      1683/mythbackend
tcp6       0      0 :::6544                 :::*                    LISTEN      1683/mythbackend
tcp6       0      0 192.168.1.223:6543      192.168.1.200:44216     ESTABLISHED 1683/mythbackend
tcp6       0      0 192.168.1.223:6543      192.168.1.200:44215     ESTABLISHED 1683/mythbackend

I suspect some kind of configuration issue.

If you want to put a copy of the failing frontend log on pastbin.com, I'd be happy to look at it. Or return to the mythtv-users list (or send private mail to keemllib at gmail.)

comment:12 Changed 12 years ago by beirdo

Status: assignedinfoneeded

Please try this again with the current code on master.

comment:13 Changed 12 years ago by mrrooster@…

No luck I'm afraid.

Mythweb can't connect to the backend...

$ mythbackend --version
Please attach all output as a file in bug reports.
MythTV Version : v0.25pre-4221-g23bf614
MythTV Branch : master
Network Protocol : 72
Library API : 0.25.20120128-1
QT Version : 4.6.3
Options compiled in:
 linux profile use_hidesyms using_alsa using_oss using_pulse using_pulseoutput using_backend using_bindings_python using_bindings_php using_dvb using_frontend using_hdhomerun using_ceton using_hdpvr using_iptv using_ivtv using_joystick_menu using_libcrypto using_libxml2 using_lirc using_mheg using_opengl_video using_qtwebkit using_qtscript using_qtdbus using_v4l2 using_v4l1 using_x11 using_xrandr using_xv using_bindings_python using_bindings_php using_mythtranscode using_opengl using_vdpau using_ffmpeg_threads using_live using_mheg using_libxml2
$ ls -l `which mythbackend`
-rwxr-xr-x 1 root staff 12715233 Jan 30 09:19 /usr/local/mythtv/bin/mythbackend
$  netstat -a | grep 6543
tcp6       0      0 [::]:6543               [::]:*                  LISTEN
$

This is with net.ipv6.bindv6only = 1

If I change this, or disable ip6, everything is fine:

root@pvr:/home/ian# sysctl  net.ipv6.bindv6only 
net.ipv6.bindv6only = 1
root@pvr:/home/ian# sysctl  net.ipv6.bindv6only=0
net.ipv6.bindv6only = 0
root@pvr:/home/ian# /etc/init.d/myth-backend stop
Stopping Myth backend....done.
root@pvr:/home/ian# /etc/init.d/myth-backend start
Starting Myth backend....done.
root@pvr:/home/ian# netstat -a | grep 6543
tcp        0      0 localhost:43338         localhost:6543          ESTABLISHED
tcp        0      0 localhost:43337         localhost:6543          ESTABLISHED
tcp6       0      0 [::]:6543               [::]:*                  LISTEN
tcp6       0      0 localhost:6543          localhost:43338         ESTABLISHED
tcp6       0      0 localhost:6543          localhost:43337         ESTABLISHED
root@pvr:/home/ian#

comment:14 Changed 12 years ago by Raymond Wagner

Owner: changed from greg to Raymond Wagner
Status: infoneededassigned

Patch forthcoming to listen specifically to the addresses specified in the database, rather than a blanket "any" that is subject to the bindv6only issues.

comment:15 Changed 12 years ago by Raymond Wagner

Resolution: Fixed
Status: assignedclosed

Alter various listen servers to bind to discrete addresses.

Fixes #9820

Branch: master
Changeset: 37385baff83eea77116d13e22be96b74cfde2cec

Note: See TracTickets for help on using tickets.