User Job reports error but completes
Moderator: Forum Moderators
Re: User Job reports error but completes
The standard DB port is 3306, but your user's is set to 0 (see: <Port>0</Port>
in your diff above.)
I'd change that in your home directory/.mythtv/config.xml and retry.
EDIT: a value of 0 should automatically select 3306
in your diff above.)
I'd change that in your home directory/.mythtv/config.xml and retry.
EDIT: a value of 0 should automatically select 3306
Re: User Job reports error but completes
He's also missing a condition and a code to emit. I don't know about an EOF marker too i.e.
If condition x:
Then emit status code
else condition Y:
do this
EOF
- dizygotheca
- Developer
- Posts: 267
- Joined: Wed Sep 03, 2014 9:02 am
Re: User Job reports error but completes
Depends on your Menu Theme. One of these should work for you.
For Default: Main Menu->Information Centre->System Status->4th Tab
For Classic: Main Menu->TV->System Status->...
For DVR: Main Menu->System Status->...
For Media Centre: Main Menu->Advanced->System Status->...
https://www.mythtv.org/wiki/User_Manual ... ion_Center
For Default: Main Menu->Information Centre->System Status->4th Tab
For Classic: Main Menu->TV->System Status->...
For DVR: Main Menu->System Status->...
For Media Centre: Main Menu->Advanced->System Status->...
https://www.mythtv.org/wiki/User_Manual ... ion_Center
Re: User Job reports error but completes
for the "Ocean Treks" recording you posted earlier the command would look like
the chanid and starttime are used to identify the recording you wish to interact with in the database. In the case of this script you can use one of two formats for the starttime a UTC timestamp("2018-01-27T14:30:00Z+07:00") or the format used in the filename(20180127143000). tzoffset is needed for the second option because the script converts it into the UTC timestamp and needs to add the +07:00 missing from the filename.
Code: Select all
/home/mythtv/transcode-h264-v2.py --chanid 1501 --starttime 20180127143000 --tzoffset 7
-
- Junior
- Posts: 28
- Joined: Tue Oct 11, 2016 4:35 pm
Re: User Job reports error but completes
I tried to run the script from the command line
and I got the following output:
Code: Select all
/home/mythtv/transcode-h264-v2.py --chanid 1501 --starttime 20180113143000 --tzoffset 7
chanid "1501"
utcstarttime "2018-01-13 21:30:00-05:00"
Traceback (most recent call last):
File "/home/mythtv/transcode-h264-v2.py", line 681, in <module>
main()
File "/home/mythtv/transcode-h264-v2.py", line 675, in main
runjob(chanid=opts.chanid, starttime=opts.starttime, tzoffset=opts.tzoffset)
File "/home/mythtv/transcode-h264-v2.py", line 172, in runjob
rec = Recorded((chanid, utcstarttime), db=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
Re: User Job reports error but completes
Your tzoffset should currently be -5 for The Bahamas. For some reason when i previously did the math my brain assumed 9:30pm.
Check your recording directory for the recording file(1501_20180113143000.ts). If the recording is set to start early it may be slightly different.
Daylight savings time can also be an issue with the tzoffset, it needs to be set to the value from the time of the recording.
Check your recording directory for the recording file(1501_20180113143000.ts). If the recording is set to start early it may be slightly different.
Daylight savings time can also be an issue with the tzoffset, it needs to be set to the value from the time of the recording.
-
- Junior
- Posts: 28
- Joined: Tue Oct 11, 2016 4:35 pm
Re: User Job reports error but completes
The script is running correctly so far with the correct timezone offset.
We'll see what the results are in a few hours.
Thanks for the help so far!
We'll see what the results are in a few hours.
Thanks for the help so far!
-
- Junior
- Posts: 28
- Joined: Tue Oct 11, 2016 4:35 pm
Re: User Job reports error but completes
So My command line encoding finished and I got this result:
Command Run:
is
Command Run:
Code: Select all
/home/mythtv/transcode-h264-v2.py --chanid 1501 --starttime 20171230143000 --tzoffset -5
And the output ofvalues ['frame=86380', 'fps=4.2', 'q=29.0', 'size=859394kB', 'time=00:24:00.09', 'bitrate=4888.7kbits/s', ''] (
framenum = 86380 fps = 4.20
Progress 100% encoding 4.2 frames per second ETA 0 mins
Read no lines of ffmpeg output for 0 secs. Possible hang?
Read no lines of ffmpeg output for 10 secs. Possible hang?
res = "[None]"
Traceback (most recent call last):
File "/home/mythtv/transcode-h264-v2.py", line 681, in <module>
main()
File "/home/mythtv/transcode-h264-v2.py", line 675, in main
runjob(chanid=opts.chanid, starttime=opts.starttime, tzoffset=opts.tzoffset)
File "/home/mythtv/transcode-h264-v2.py", line 519, in runjob
os.remove(infile)
OSError: [Errno 2] No such file or directory: '/Media/MythTV/Recordings/1501_20171230143000.ts'
Code: Select all
echo $?
1
Re: User Job reports error but completes
It is crashing when trying to delete the original/commercial edited file.
is '/Media/MythTV/Recordings/1501_20171230143000.ts' the correct full path to the recording file?
What OS are you using?
is '/Media/MythTV/Recordings/1501_20171230143000.ts' the correct full path to the recording file?
What OS are you using?
-
- Junior
- Posts: 28
- Joined: Tue Oct 11, 2016 4:35 pm
Re: User Job reports error but completes
That is what I thought too but the file isn't in the directory anymore.
/Media/MythTV/Recordings is the correct location.
Ubuntu 16.04
/Media/MythTV/Recordings is the correct location.
Ubuntu 16.04
Re: User Job reports error but completes
Around line 519 in the file, look for a line like: os.remove(infile).
Make it look like this:
That will prevent this error, but there may be more.
Out of curiosity, what does this return (run on the backend))
Make it look like this:
Code: Select all
if os.path.isfile(infile):
os.remove(fname)
Out of curiosity, what does this return (run on the backend))
Code: Select all
curl --silent --header Accept:Application/json localhost:6544/Myth/GetSetting?Key=SaveTranscoding\&HostName=_GLOBAL_
-
- Junior
- Posts: 28
- Joined: Tue Oct 11, 2016 4:35 pm
Re: User Job reports error but completes
The results of is:
I'm running another transcode to see what happens.
Thanks for the assist thus far!
Code: Select all
curl --silent --header Accept:Application/json localhost:6544/Myth/GetSetting?Key=SaveTranscoding\&HostName=_GLOBAL_
Thing I noticed that the .tmp files are not being deleted. Looking at the code to make the change suggested it looks to me like the .tmp files are not being deleted because of the error I'm getting. I could totally be wrong on this though.{"String": "0"}
I'm running another transcode to see what happens.
Thanks for the assist thus far!
-
- Junior
- Posts: 28
- Joined: Tue Oct 11, 2016 4:35 pm
Re: User Job reports error but completes
So the job I started last night has completed
and this is the end result
I got this:
I'm going to kick off a transcode job from mythweb but I think this is solved now?!?
Code: Select all
/home/mythtv/transcode-h264-v2.py --chanid 1501 --starttime 20180106143000 --tzoffset -5
When I do aProgress 100% encoding 4.1 frames per second ETA 0 mins
values ['frame=76447', 'fps=4.1', 'q=29.0', 'size=714121kB', 'time=00:21:14.52', 'bitrate=4590.0kbits/s', '']
framenum = 76447 fps = 4.10
Read no lines of ffmpeg output for 0 secs. Possible hang?
res = "[None]"
Duration 00:21:14.99
Duration ['00', '21', '14.99']
Duration in seconds "1274.99"
Duration in milliseconds "1274990"
Code: Select all
echo $?
I also checked and the .tmp file for the 1501_20180106143000 file was deleted.0
I'm going to kick off a transcode job from mythweb but I think this is solved now?!?
-
- Junior
- Posts: 28
- Joined: Tue Oct 11, 2016 4:35 pm
Re: User Job reports error but completes
So from mythweb the encoding completed and gave me a summary showing the compression % but didn't say it had completed successfully.
I started another transcode and when I checked this morning it said "Error: User Job returned non-zero" for the transcode that completed yesterday.
I'm running another job from the command line and I'll do an echo $? to see the output.
It looks like it's actually completing just fine and that it just isn't reporting nicely to Myth. Which in the end isn't a hug deal...
I started another transcode and when I checked this morning it said "Error: User Job returned non-zero" for the transcode that completed yesterday.
I'm running another job from the command line and I'll do an echo $? to see the output.
It looks like it's actually completing just fine and that it just isn't reporting nicely to Myth. Which in the end isn't a hug deal...
Re: User Job reports error but completes
It may not seem like a huge deal now, but after you have used it a few dozen times and find out what is broken it could be. Of course it could be its just not setting the return code properly.
You could try changing the end of the script to look like this
should set the return code to 0 if the rest of the script runs without error
You could try changing the end of the script to look like this
Code: Select all
if len(args) == 1:
runjob(jobid=args[0])
sys.exit(0)
elif opts.chanid and opts.starttime and opts.tzoffset is not None:
runjob(chanid=opts.chanid, starttime=opts.starttime, tzoffset=opts.tzoffset)
sys.exit(0)
else:
print 'Script must be provided jobid, or chanid, starttime and timezone offset.'
sys.exit(1)
if __name__ == '__main__':
main()
Code: Select all
sys.exit(0)