Opened 9 years ago

Closed 8 years ago

Last modified 8 years ago

#12340 closed Bug Report - General (fixed)

GenMythURL given IP address instead of hostname - Watch Recordings screen loading very slowly.

Reported by: Marlon Buchanan <marlonbuchanan@…> Owned by: Jonatan Lindblad
Priority: minor Milestone: 0.27.6
Component: MythTV - General Version: 0.27.4
Severity: medium Keywords: hostname, ip, mythcorecontext, genmythurl
Cc: Ticket locked: no

Description

Hi,

I recently upgraded from .25.2 to .27.4. Most things went smoothly except the watch recordings screen loads very slowly. I looked in the slave backend logs where the recordings are located and didn't see anything different in the logs. The frontend logs didn't have anything peculiar in them either so I moved on to the master backend logs. They were flooded with messages like below for every single recording (I have hundreds). I think this is related to the problem because I watched the logs as the watch recordings screen loaded multiple times and when these messages stop is when the screen loads. I get slow load times and these messages in the master backend log whenever I try to load the watch recordings screen from any frontend, or list the recordings in mythweb. I don't know any place where I specify an IP address where I should be specifying a hostname. My /etc/hostname files on all machines are set correctly.

MythTV version for all backends: v0.27.4-27-g40506c2 All backends are running ubuntu 12.04. Frontends are a mix of 12.04 and 14.04.

Excerpt from backend logs when loading a recording screen:

Dec 28 18:45:44 deathstroke mythbackend: mythbackend[11935]: C ProcessRequest? mythcorecontext.cpp:699 (GenMythURL) MythCoreContext::GenMythURL(192.168.1.20/16649_20141125163000.mpg): Given IP address instead of hostname (ID). This is invalid. Dec 28 18:45:44 deathstroke mythbackend: mythbackend[11935]: C ProcessRequest? mythcorecontext.cpp:699 (GenMythURL) MythCoreContext::GenMythURL(192.168.1.107/8109_20141125200000.mpg): Given IP address instead of hostname (ID). This is invalid. Dec 28 18:45:44 deathstroke mythbackend: mythbackend[11935]: C ProcessRequest? mythcorecontext.cpp:699 (GenMythURL) MythCoreContext::GenMythURL(192.168.1.108/8111_20141125200000.mpg): Given IP address instead of hostname (ID). This is invalid. Dec 28 18:45:44 deathstroke mythbackend: mythbackend[11935]: C ProcessRequest? mythcorecontext.cpp:699 (GenMythURL)

Please let me know what additional information I can provide. Thank you.

Change History (6)

comment:1 Changed 9 years ago by tuxokc@…

I'm seeing the same MBE log flood of "Given IP address instead of hostname"

I'm a PackRat?, so I've got 14,000+ recordings in the 'All Programs' display group, and this just brings my backend to its knees.

I see here: http://www.mythtv.org/pipermail/mythtv-users/2014-November/370326.html

that its not a defect per say, but a warning. But in my case it's a real show stopper. Every 30 seconds i get another 16,000+ lines flooding the MBE log, and the frontend reports the BE offline/online in that 30 second period

At the time of writing, the FE is just displaying my Default display group with 1865 recordings.

I'm running Fedora 21 [~]# mythbackend --version Please attach all output as a file in bug reports. MythTV Version : v0.27.4-6-ge0b0027 MythTV Branch : fixes/0.27 Network Protocol : 77 Library API : 0.27.20141016-1 QT Version : 4.8.6 Options compiled in:

linux release use_hidesyms using_alsa using_jack using_oss using_pulse using_pulseoutput using_backend using_bindings_perl using_bindings_python using_bindings_php using_crystalhd using_dvb using_firewire using_frontend using_hdhomerun using_ceton using_hdpvr using_ivtv using_joystick_menu using_libcec using_libcrypto using_libdns_sd using_libfftw3 using_libxml2 using_libudf using_lirc using_mheg using_opengl using_opengl_video using_qtwebkit using_qtscript using_qtdbus using_taglib using_v4l2 using_x11 using_xrandr using_xv using_bindings_perl using_bindings_python using_bindings_php using_mythtranscode using_opengl using_vaapi using_vdpau using_ffmpeg_threads using_mheg using_libass using_libxml2 using_libudf

comment:2 Changed 8 years ago by bj@…

I've seen this message being reported by my master backend, aswell. It showed slave backend IPs. All reported URLs referred to recordings taken on slave backends. I can trigger this easily by starting a dedicated frontend and open the "watch recordings" with some group that includes recordings done one slave backends while the slave backends are up.

Packet capture showed, frontend issued QUERY_RECORDINGS - which is handled in mythbackend/mainserver.cpp:MainServer::HandleQueryRecordings.

In my case (masterBackendOverride wasn't defined at that time), I ended up in this code:

                if (!backendIpMap.contains(hostname))
                    backendIpMap[hostname] =
                        gCoreContext->GetBackendServerIP(hostname);
                if (!backendPortMap.contains(hostname))
                    backendPortMap[hostname] =
                        gCoreContext->GetBackendServerPort(hostname);
                p->SetPathname(gCoreContext->GenMythURL(backendIpMap[hostname],
                                                        backendPortMap[hostname],
                                                        p->GetBasename()));

This seems to be the place where the IP (!!) of the slave is passed to GenMythUrl?.

Having an IP provided to the frontend avoids issues with name lookups on the frontend - but then it's pointless to have GenMythUrl? log a warning (maybe downgrade to debug/info?).

As pointed out, the log traffic caused by this is really excessive.

FYI: I was Loocking at my oldish 0.27.5-dmo1+bp1 deb-multimedia sources.

comment:3 Changed 8 years ago by stuartm

It's not a bug, but instead an instance of the code that needs fixing since it's incorrectly passing the IP address where a hostname MUST be used. The confusion here is because what mythtv means by hostname in this context is not the same as a hostname which resolves to an IP. The 'hostname' is in fact the 'backend name' and it must be used here in order to properly look up records in the database which use that same identifier.

The logging in GenMythUrl? is correctly noting that this is code which needs to be fixed.

comment:4 Changed 8 years ago by Jonatan Lindblad

Owner: set to Jonatan Lindblad
Status: newassigned

comment:5 Changed 8 years ago by Paul Harrison <pharrison@…>

Resolution: fixed
Status: assignedclosed

In 4b160dae3a72f48a27b51ec681521355131bbdb2/mythtv:

MainServer?: use the hostname not IP address in HandleQueryRecording?

Fixes #12340

(cherry picked from commit d58f3c7931ad8e277b72f29d89eee5fabc77deb0)
Signed-off-by: Jonatan Lindblad <jlindblad@…>

comment:6 Changed 8 years ago by Jonatan Lindblad

Milestone: unknown0.27.6
Note: See TracTickets for help on using tickets.