Mailing List Archive

Latest commits have broken UPNP database lookup
Hi David

As of 648a40d521ae31ecf7d762eb34b0f03e4f9cfb3f it fails
As of 708baf28f288cc693152d5cbfe8f6ecf7ff663bd it works correctly. All
commits between are yours.

Frontend connecting to the database by using UPNP is broken. These are
the error messages from the frontend

2017-11-13 14:21:55.692451 I Putting up the UPnP backend chooser
2017-11-13 14:22:02.020043 E MythXMLClient::GetConnectionInfo Failed -
(501) Not Authorized
2017-11-13 14:22:02.020051 E Access denied for andromeda: MythTV AV
Media Server. Wrong PIN?
2017-11-13 14:22:09.902742 E MythXMLClient::GetConnectionInfo Failed -
Version Mismatch (,) != (91,1348)
2017-11-13 14:22:09.902751 E GetConnectionInfo() failed for andromeda:
MythTV AV Media Server : Version Mismatch
2017-11-13 14:22:22.895200 E MythXMLClient::GetConnectionInfo Failed -
Version Mismatch (,) != (91,1348)
2017-11-13 14:22:22.895214 E GetConnectionInfo() failed for andromeda:
MythTV AV Media Server : Version Mismatch
2017-11-13 14:22:27.558620 E Failed to init MythContext, exiting.

This occurs on initial setup, and also on any subsequent connection if
the initial connection was via UPNP.

To test it -

Start backend, remove the frontend's config.xml and start frontend. You
need to have them running with different config.xml files (e.g. by
running under different user ids or overriding MYTHCONFDIR).

Correct operation:
If pin of 0000 was set in mythtv-setup the frontend will automatically
get the credentials from the backend via UPNP, and create the
config.xml. If another pin was used you will see the startup page. If
you select Search there and select the backend it will prompt for the
PIN and if you enter it correctly it will be connected.

Peter

_______________________________________________
mythtv-dev mailing list
mythtv-dev@mythtv.org
http://lists.mythtv.org/mailman/listinfo/mythtv-dev
http://wiki.mythtv.org/Mailing_List_etiquette
MythTV Forums: https://forum.mythtv.org
Re: Latest commits have broken UPNP database lookup [ In reply to ]
On Mon, 2017-11-13 at 14:50 -0500, Peter Bennett wrote:
> Start backend, remove the frontend's config.xml and start frontend.
> You
> need to have them running with different config.xml files (e.g. by
> running under different user ids or overriding MYTHCONFDIR).
>
> Correct operation:
> If pin of 0000 was set in mythtv-setup the frontend will
> automatically
> get the credentials from the backend via UPNP, and create the
> config.xml. If another pin was used you will see the startup page.
> If
> you select Search there and select the backend it will prompt for
> the
> PIN and if you enter it correctly it will be connected.

Will it ask before connecting? How do I keep my test/master frontend
from finding my 0.28/production backend and attempting to upgrade its
database? Run both test frontend and backend in a VM so there's no
traffic on my home network? Unplug the ethernet from my workstation
while testing? :-) I want to make sure I don't mess up my production
system.

David

_______________________________________________
mythtv-dev mailing list
mythtv-dev@mythtv.org
http://lists.mythtv.org/mailman/listinfo/mythtv-dev
http://wiki.mythtv.org/Mailing_List_etiquette
MythTV Forums: https://forum.mythtv.org
Re: Latest commits have broken UPNP database lookup [ In reply to ]
On 11/13/2017 04:55 PM, David Hampton wrote:
> Will it ask before connecting? How do I keep my test/master frontend
> from finding my 0.28/production backend and attempting to upgrade its
> database? Run both test frontend and backend in a VM so there's no
> traffic on my home network? Unplug the ethernet from my workstation
> while testing?:-) I want to make sure I don't mess up my production
> system.
>
> David
Hi David

If your backend PIN is 0000 and only one backend is running then it will
connect without even asking.

Run mythtv-setup on your production backend and set a unique pin that is
not 0000. That is what I do to prevent inadvertent connection to the
production system. Note the pin does not have to be 4 digits or numeric.
It can be a whole sentence, but only if it is 0000 will it connect
automatically.

I recommend also using different database names, user ids and passwords
for production and development. If everything is mythconverg / mythtv /
mythtv there may be more risk of inadvertently connecting to the wrong
place.

A remote frontend or backend will not update the backend database. I
don't know the details of how it checks, but it does log a message about
not being authorized to upgrade.

The times when I have inadvertently connected to my production system
were when I had a production frontend on my development machine, then
inadvertently started up a development backend. It goes to
.mythtv/config.xml and connects - PIN numbers or passwords do not
protect in this case because everything is in the config.xml. Nowadays I
have a set of scripts that isolate my various versions so that this type
of thing cannot happen. I avoid having a .mythtv directory at all on my
user id on the development system.

Let me know if you need more information.

Regards
Peter



_______________________________________________
mythtv-dev mailing list
mythtv-dev@mythtv.org
http://lists.mythtv.org/mailman/listinfo/mythtv-dev
http://wiki.mythtv.org/Mailing_List_etiquette
MythTV Forums: https://forum.mythtv.org
Re: Latest commits have broken UPNP database lookup [ In reply to ]
On Mon, 2017-11-13 at 14:50 -0500, Peter Bennett wrote:
> Hi David
>
> As of 648a40d521ae31ecf7d762eb34b0f03e4f9cfb3f it fails
> As of 708baf28f288cc693152d5cbfe8f6ecf7ff663bd it works
> correctly. All
> commits between are yours.
>
> Frontend connecting to the database by using UPNP is broken. These
> are
> the error messages from the frontend
>
> 2017-11-13 14:21:55.692451 I Putting up the UPnP backend chooser
> 2017-11-13 14:22:02.020043 E MythXMLClient::GetConnectionInfo Failed
> -
> (501) Not Authorized
> 2017-11-13 14:22:02.020051 E Access denied for andromeda: MythTV AV
> Media Server. Wrong PIN?
> 2017-11-13 14:22:09.902742 E MythXMLClient::GetConnectionInfo Failed
> -
> Version Mismatch (,) != (91,1348)
> 2017-11-13 14:22:09.902751 E GetConnectionInfo() failed for
> andromeda:
> MythTV AV Media Server : Version Mismatch
> 2017-11-13 14:22:22.895200 E MythXMLClient::GetConnectionInfo Failed
> -
> Version Mismatch (,) != (91,1348)
> 2017-11-13 14:22:22.895214 E GetConnectionInfo() failed for
> andromeda:
> MythTV AV Media Server : Version Mismatch
> 2017-11-13 14:22:27.558620 E Failed to init MythContext, exiting.
>
> This occurs on initial setup, and also on any subsequent connection
> if
> the initial connection was via UPNP.
>
> To test it -
>
> Start backend, remove the frontend's config.xml and start frontend.
> You
> need to have them running with different config.xml files (e.g. by
> running under different user ids or overriding MYTHCONFDIR).
>
> Correct operation:
> If pin of 0000 was set in mythtv-setup the frontend will
> automatically
> get the credentials from the backend via UPNP, and create the
> config.xml. If another pin was used you will see the startup page.
> If
> you select Search there and select the backend it will prompt for
> the
> PIN and if you enter it correctly it will be connected.

Peter,

I'm not seeing this behavior. I created a new Fedora26 virtual machine
for isolation purposes. On that system I downloaded and compiled the
master branch (at 648a40d5), and started mythbackend under my userid.
I then created another user, started a shell as that other user, and
ran mythfrontend. It seems to find the backend without any problem and
starts right up. I must be doing something wrong, because after
setting a pin and deleting the ~/.mythtv directory for the frontend,
the frontend will still connect without any problem and without asking
for a pin. I see this same behavior when running either 708baf28
(which works for you) or 648a40d5 (which fails for you).

I will keep playing with this and see if I can recreate the correct
behavior with 708baf28, and then the bad behavior of 648a40d5.

I have uploaded logs to pastebin. If you could give them a quick look
and see if you can spot what I'm doing wrong, I would appreciate it.

Frontend 64 no pin https://pastebin.com/4iSByVn6
Backend 64 no pin https://pastebin.com/GdbGx5mB

Frontend 70 no pin https://pastebin.com/Q5ijVF6p
Backend 70 no pin https://pastebin.com/bQLd0hZB

David

_______________________________________________
mythtv-dev mailing list
mythtv-dev@mythtv.org
http://lists.mythtv.org/mailman/listinfo/mythtv-dev
http://wiki.mythtv.org/Mailing_List_etiquette
MythTV Forums: https://forum.mythtv.org
Re: Latest commits have broken UPNP database lookup [ In reply to ]
On 11/13/2017 08:16 PM, David Hampton wrote:
> I'm not seeing this behavior. I created a new Fedora26 virtual machine
> for isolation purposes. On that system I downloaded and compiled the
> master branch (at 648a40d5), and started mythbackend under my userid.
> I then created another user, started a shell as that other user, and
> ran mythfrontend. It seems to find the backend without any problem and
> starts right up. I must be doing something wrong, because after
> setting a pin and deleting the ~/.mythtv directory for the frontend,
> the frontend will still connect without any problem and without asking
> for a pin. I see this same behavior when running either 708baf28
> (which works for you) or 648a40d5 (which fails for you).
If there is no config.xml it tries to connect to the database with
default settings, i.e. user id mythtv, password mythtv, database
mythconverg, server localhost. Is yours setup that way? If so it is not
a good test - change at least the database password.

Peter
_______________________________________________
mythtv-dev mailing list
mythtv-dev@mythtv.org
http://lists.mythtv.org/mailman/listinfo/mythtv-dev
http://wiki.mythtv.org/Mailing_List_etiquette
MythTV Forums: https://forum.mythtv.org
Re: Latest commits have broken UPNP database lookup [ In reply to ]
On Mon, 2017-11-13 at 22:11 -0500, Peter Bennett wrote:
>
> On 11/13/2017 08:16 PM, David Hampton wrote:
> > I'm not seeing this behavior. I created a new Fedora26 virtual
> > machine
> > for isolation purposes. On that system I downloaded and compiled
> > the
> > master branch (at 648a40d5), and started mythbackend under my
> > userid.
> > I then created another user, started a shell as that other user,
> > and
> > ran mythfrontend. It seems to find the backend without any problem
> > and
> > starts right up. I must be doing something wrong, because after
> > setting a pin and deleting the ~/.mythtv directory for the
> > frontend,
> > the frontend will still connect without any problem and without
> > asking
> > for a pin. I see this same behavior when running either 708baf28
> > (which works for you) or 648a40d5 (which fails for you).
>
> If there is no config.xml it tries to connect to the database with
> default settings, i.e. user id mythtv, password mythtv, database
> mythconverg, server localhost. Is yours setup that way? If so it is
> not
> a good test - change at least the database password.
>
> Peter

I can now recreate the problem. I'll start debugging it tomorrow.

David

_______________________________________________
mythtv-dev mailing list
mythtv-dev@mythtv.org
http://lists.mythtv.org/mailman/listinfo/mythtv-dev
http://wiki.mythtv.org/Mailing_List_etiquette
MythTV Forums: https://forum.mythtv.org
Re: Latest commits have broken UPNP database lookup [ In reply to ]
On 14/11/17 00:17, Peter Bennett wrote:
>
>
> On 11/13/2017 04:55 PM, David Hampton wrote:
>> Will it ask before connecting?  How do I keep my test/master frontend
>> from finding my 0.28/production backend and attempting to upgrade its
>> database?  Run both test frontend and backend in a VM so there's no
>> traffic on my home network?  Unplug the ethernet from my workstation
>> while testing?:-)   I want to make sure I don't mess up my production
>> system.
>>
>> David
> Hi David
>
> If your backend PIN is 0000 and only one backend is running then it will
> connect without even asking.
>
> Run mythtv-setup on your production backend and set a unique pin that is
> not 0000. That is what I do to prevent inadvertent connection to the
> production system. Note the pin does not have to be 4 digits or numeric.
> It can be a whole sentence, but only if it is 0000 will it connect
> automatically.
>
> I recommend also using different database names, user ids and passwords
> for production and development. If everything is mythconverg / mythtv /
> mythtv there may be more risk of inadvertently connecting to the wrong
> place.
>
> A remote frontend or backend will not update the backend database. I
> don't know the details of how it checks, but it does log a message about
> not being authorized to upgrade.
>
> The times when I have inadvertently connected to my production system
> were when I had a production frontend on my development machine, then
> inadvertently started up a development backend. It goes to
> .mythtv/config.xml and connects - PIN numbers or passwords do not
> protect in this case because everything is in the config.xml. Nowadays I
> have a set of scripts that isolate my various versions so that this type
> of thing cannot happen. I avoid having a .mythtv directory at all on my
> user id on the development system.
>
> Let me know if you need more information.

I have this set in my wrapper scripts for frontend / backend etc

MYTHCONFDIR=$HOME/.mythtv-prod/

so anything prod is automatically configured to use a non standard
location for it's configuration.

I also have separate database, and use a non standard backend port
(7544 vs 6544) for my development setup. As a consequence I can
run both my prod and dev backend instances on the same physical
hardware.

I also split my dual tuners across both backends. I have a dual
DVB-T and dual DVB-S2, so both dev and prod have 1x DVB-t and 1x
DVB-S2 tuner available.

One crucial detail i've just noticed I missed, is that both the
prod (fixes/29) and dev (master) instances install to different
non standard paths. The wrapper scripts i've mentioned above
also set PATH, LD_LIBRARY_PATH and PYTHONPATH to include the
non standard location

I did do a full write up on this once. If it's of interest to
people I can look into documenting this on the wiki.


Regards
Stuart


_______________________________________________
mythtv-dev mailing list
mythtv-dev@mythtv.org
http://lists.mythtv.org/mailman/listinfo/mythtv-dev
http://wiki.mythtv.org/Mailing_List_etiquette
MythTV Forums: https://forum.mythtv.org
Re: Latest commits have broken UPNP database lookup [ In reply to ]
On Tue, 2017-11-14 at 00:12 -0500, David Hampton wrote:
> On Mon, 2017-11-13 at 22:11 -0500, Peter Bennett wrote:
> >
> > On 11/13/2017 08:16 PM, David Hampton wrote:
> > > I'm not seeing this behavior. I created a new Fedora26 virtual
> > > machine
> > > for isolation purposes. On that system I downloaded and compiled
> > > the
> > > master branch (at 648a40d5), and started mythbackend under my
> > > userid.
> > > I then created another user, started a shell as that other user,
> > > and
> > > ran mythfrontend. It seems to find the backend without any
> > > problem
> > > and
> > > starts right up. I must be doing something wrong, because after
> > > setting a pin and deleting the ~/.mythtv directory for the
> > > frontend,
> > > the frontend will still connect without any problem and without
> > > asking
> > > for a pin. I see this same behavior when running either 708baf28
> > > (which works for you) or 648a40d5 (which fails for you).
> >
> > If there is no config.xml it tries to connect to the database with
> > default settings, i.e. user id mythtv, password mythtv, database
> > mythconverg, server localhost. Is yours setup that way? If so it is
> > not
> > a good test - change at least the database password.
> >
> > Peter
>
> I can now recreate the problem. I'll start debugging it tomorrow.

Problem resolved. I mis-interpreted an entry in the Qt Meta-Object
documentation and thought that registering the service object pointers
with the Meta-Object system was redundant, so I removed it. Oops.
Adding the registration code back seems to have solved the problem.

David

_______________________________________________
mythtv-dev mailing list
mythtv-dev@mythtv.org
http://lists.mythtv.org/mailman/listinfo/mythtv-dev
http://wiki.mythtv.org/Mailing_List_etiquette
MythTV Forums: https://forum.mythtv.org
Re: Latest commits have broken UPNP database lookup [ In reply to ]
On 11/14/2017 10:03 PM, David Hampton wrote:
> Problem resolved. I mis-interpreted an entry in the Qt Meta-Object
> documentation and thought that registering the service object pointers
> with the Meta-Object system was redundant, so I removed it. Oops.
> Adding the registration code back seems to have solved the problem.
>
Thank you. It is all working again.

Regards
Peter
_______________________________________________
mythtv-dev mailing list
mythtv-dev@mythtv.org
http://lists.mythtv.org/mailman/listinfo/mythtv-dev
http://wiki.mythtv.org/Mailing_List_etiquette
MythTV Forums: https://forum.mythtv.org