[mythtv-users] Anyone using Myth-Rec-to-Vid.py? Can't get it to log
Ian Evans
dheianevans at gmail.com
Tue Oct 10 01:57:15 UTC 2017
On Mon, Oct 9, 2017 at 8:37 PM, Stephen Worthington <
stephen_agent at jsw.gen.nz> wrote:
> On Mon, 09 Oct 2017 15:03:57 +1300, you wrote:
>
> >On Sun, 8 Oct 2017 13:42:47 -0400, you wrote:
> >
> >>Just curious if anyone is using Myth-Rec-to-Vid.py to move recordings to
> >>the video library. (https://www.mythtv.org/wiki/Myth-Rec-to-Vid.py)
> >>
> >>I was having problems with it failing 100% of the time and there was
> >>nothing in the logs. I decided to turn on logging with this command line
> >>which seems to follow the options:
> >>
> >>/usr/share/mythtv/Myth-Rec-to-Vid.py --loglevel=7
> --logpath=/var/log/mythtv
> >>--logfile=myth2vid.log --delete %JOBID%
> >>
> >>But I'm getting nothing. Anyone here getting it to log?
> >>
> >>Thanks.
> >
> >I am having a look at this. I am running Mythbuntu 16.04 with MythTV
> >v29+fixes. When I run Myth-Rec-to-Vid.py from the command line with
> >these options:
> >
> >--verbose=all --loglevel=debug
> >
> >I do get log output to the command line. I have yet to make it log to
> >a file, but with some added debug code I am finding that there is a
> >exception happening when it tries to talk to the database. That
> >exception is not being logged normally - I am only getting it because
> >of my debug code:
> >
> >root at mypvr:/var/log/mythtv# Myth-Rec-to-Vid.py --chanid=10073
> >--startdate="2017-10-05" --starttime="21:34:00" --offset="+12:00"
> >--verbose=all --loglevel=debug
> >Myth-Rec-to-Vid.py main()
> >Myth-Rec-to-Vid.py main() 1
> >Myth-Rec-to-Vid.py VIDEO.__init__()
> >Myth-Rec-to-Vid.py VIDEO.__init__() 2
> >2017-10-09 15:00:43.525048 D [14225] Python Database Connection Trying
> >database credentials from: /root/config.xml
> >2017-10-09 15:00:43.525166 I [14225] Python Database Connection
> >Attempting connection: sql://mythconverg@10.0.2.4:3306/
> >2017-10-09 15:00:43.525217 I [14225] Python Database Connection
> >Spawning new database connection
> >2017-10-09 15:00:43.527586 I [14225] Python Database Connection
> >Spawning new database connection
> >2017-10-09 15:00:43.528060 D [14225] Python Database Connection
> >Acquiring connection from pool
> >2017-10-09 15:00:43.528146 D [14225] Python Database Connection SELECT
> >data FROM settings WHERE value LIKE(%s) -- ('DBSchemaVer',)
> >2017-10-09 15:00:43.528669 D [14225] Python Database Connection
> >database callback received -- 0x7f5441e4faf8
> >2017-10-09 15:00:43.528856 D [14225] Python Database Connection
> >Releasing connection to pool
> >Myth-Rec-to-Vid.py VIDEO.__init__() 3
> >Myth-Rec-to-Vid.py VIDEO.__init__() 4
> >2017-10-09 15:00:43.529004 I [14225] Myth-Rec-to-Vid.py
> >Myth-Rec-to-Vid.py test log message
> >2017-10-09 15:00:43.529054 D [14225] Python Database Connection
> >Acquiring connection from pool
> >2017-10-09 15:00:43.529392 D [14225] Python Database Connection
> >database callback received -- 0x7f5441e4fb50
> >2017-10-09 15:00:43.529534 D [14225] Python Database Connection
> >Releasing connection to pool
> >Myth-Rec-to-Vid.py VIDEO.__init__() 5
> >Myth-Rec-to-Vid.py VIDEO.__init__() 6
> >2017-10-09 15:00:43.532419 D [14225] Python Database Connection
> >Loading existing connection -- sql://mythconverg@10.0.2.4:3306/
> >2017-10-09 15:00:43.532542 D [14225] Python Database Connection
> >Acquiring connection from pool
> >2017-10-09 15:00:43.532635 D [14225] Python Database Connection SELECT
> >data FROM settings WHERE value=%s AND hostname IS NULL LIMIT 1 --
> >('DBSchemaVer',)
> >2017-10-09 15:00:43.533082 D [14225] Python Database Connection
> >database callback received -- 0x7f5441e0d100
> >2017-10-09 15:00:43.533242 D [14225] Python Database Connection
> >Releasing connection to pool
> >2017-10-09 15:00:43.533316 D [14225] Python Database Connection
> >Loading existing connection -- sql://mythconverg@10.0.2.4:3306/
> >2017-10-09 15:00:43.533393 D [14225] Python Database Connection
> >Loading existing connection -- sql://mythconverg@10.0.2.4:3306/
> >2017-10-09 15:00:43.533461 D [14225] DBData Setup (Recorded) set
> >_table to recorded
> >2017-10-09 15:00:43.533502 D [14225] DBData Setup (Recorded) set
> >_logmodule to Python Recorded
> >2017-10-09 15:00:43.533546 D [14225] Python Database Connection
> >Acquiring connection from pool
> >2017-10-09 15:00:43.533603 D [14225] Python Database Connection DESC
> >recorded -- None
> >2017-10-09 15:00:43.535668 D [14225] Python Database Connection
> >database callback received -- 0x7f5441e0d100
> >2017-10-09 15:00:43.535836 D [14225] Python Database Connection
> >Releasing connection to pool
> >2017-10-09 15:00:43.535890 D [14225] DBData Setup (Recorded) set
> >_where to chanid=? AND starttime=?
> >2017-10-09 15:00:43.535931 D [14225] DBData Setup (Recorded) set
> >_setwheredat to self.chanid,self.starttime,
> >2017-10-09 15:00:43.536069 D [14225] Python Database Connection
> >Acquiring connection from pool
> >2017-10-09 15:00:43.536299 D [14225] Python Recorded SELECT * FROM
> >recorded WHERE chanid=%s AND starttime=%s -- [10073, datetime(2017,
> >10, 5, 9, 34)]
> >Myth-Rec-to-Vid.py main() 3
> >datetime(2017, 10, 5, 9, 34)=2017-10-05 09:34:00
> >Traceback (most recent call last):
> > File "/usr/local/bin/Myth-Rec-to-Vid.py", line 446, in <module>
> > main()
> > File "/usr/local/bin/Myth-Rec-to-Vid.py", line 337, in main
> > export = VIDEO(opts)
> > File "/usr/local/bin/Myth-Rec-to-Vid.py", line 85, in __init__
> > self.rec = Recorded((self.chanID,self.startTime), db=self.db)
> > File "/usr/lib/python2.7/dist-packages/MythTV/dataheap.py", line
> >342, in __init__
> > DBDataWrite.__init__(self, data, db)
> > File "/usr/lib/python2.7/dist-packages/MythTV/database.py", line
> >318, in __init__
> > DBData.__init__(self, data, db)
> > File "/usr/lib/python2.7/dist-packages/MythTV/database.py", line
> >180, in __init__
> > self._pull()
> > File "/usr/lib/python2.7/dist-packages/MythTV/database.py", line
> >388, in _pull
> > DBData._pull(self)
> > File "/usr/lib/python2.7/dist-packages/MythTV/database.py", line
> >204, in _pull
> > raise MythError('DBData() could not read from database')
> >MythTV.exceptions.MythError: DBData() could not read from database
> >2017-10-09 15:00:43.560526 D [14225] Python Database Connection
> >database callback received -- 0x7f5441e0d100
> >2017-10-09 15:00:43.560708 D [14225] Python Database Connection
> >Releasing connection to pool
> >
> >I will have to dig into how MythDB works to see what the error really
> >is.
>
> OK, my error was that I had given the wrong starttime for the
> recording. When Myth-Rec-to-Vid.py does not find a matching
> recording, it silently exits without doing anything. So this:
>
> Myth-Rec-to-Vid.py --chanid=10073 --startdate="2017-10-06"
> --starttime="08:29:00" --offset="+00:00" --verbose=all
> --loglevel=debug --logpath=/var/log/mythtv
> --logfile="Myth-Rec-to-Vid.log"
>
> works from the command line and produces a log file:
>
> /var/log/mythtv/Myth-Rec-to-Vid.py.20171010133236.17003.log
> _______________________________________________
>
Interesting. Any idea why it wasn't logging using the %JOBID% method?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mythtv.org/pipermail/mythtv-users/attachments/20171009/6bedbc53/attachment.html>
More information about the mythtv-users
mailing list