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