Ticket #10535 (new Patch - Bug Fix)
Opened 14 months ago
Last modified 3 months ago
mythburn.py crash
| Reported by: | t.brackertz@… | Owned by: | |
|---|---|---|---|
| Priority: | minor | Milestone: | unknown |
| Component: | Plugin - MythArchive | Version: | Unspecified |
| Severity: | medium | Keywords: | |
| Cc: | Ticket locked: | no |
Description
Burn a DVD using mytharchive:
In the very end of the process the script tries to eject the burned DVD. If this is impossible it crashes with the following backtrace:
Failed to eject the disc!
chmod: Beim Setzen der Zugriffsrechte für „/mythpuffer/mytharchive/“: Die Operation ist nicht erlaubt
chmod: Beim Setzen der Zugriffsrechte für „/mythpuffer/mytharchive/logs“: Die Operation ist nicht erlaubt
chmod: Beim Setzen der Zugriffsrechte für „/mythpuffer/mytharchive/logs/mythburn.log“: Die Operation ist nicht erlaubt
chmod: Beim Setzen der Zugriffsrechte für „/mythpuffer/mytharchive/config“: Die Operation ist nicht erlaubt
chmod: Beim Setzen der Zugriffsrechte für „/mythpuffer/mytharchive/config/mydata.xml“: Die Operation ist nicht erlaubt
chmod: Beim Setzen der Zugriffsrechte für „/mythpuffer/mytharchive/work“: Die Operation ist nicht erlaubt
------------------------------------------------------------
Traceback (most recent call last):
File "/usr/share/mythtv/mytharchive/scripts/mythburn.py", line 5182, in main
processJob(job)
File "/usr/share/mythtv/mytharchive/scripts/mythburn.py", line 4980, in processJob
BurnDVDISO(title)
File "/usr/share/mythtv/mytharchive/scripts/mythburn.py", line 2335, in BurnDVDISO
tray(CDROM.CDROMEJECT)
File "/usr/share/mythtv/mytharchive/scripts/mythburn.py", line 2266, in tray
os.close(f)
UnboundLocalError: local variable 'f' referenced before assignment
------------------------------------------------------------
The produced DVD is fine. But the script leaves back a .lock-file which prevents the user from burning another DVD.
Path attached.
Attachments
Change History
Changed 14 months ago by t.brackertz@…
- Attachment mythburn.py.patch added
comment:1 Changed 14 months ago by business.weston@…
I'm seeing this issue in .25.
comment:2 Changed 3 months ago by Mike Kutner <videoguy1080@…>
I confirmed that the patch fixes the crash in 26.1. Thank you! On my system (Mythbuntu 12.04.1) there are two subsequent issues:
- the script calls 'pumount' which is not installed
- in any case the disc does not eject - likely because the script should call 'eject'
I recommend incorporating this patch into mythtv.
comment:3 Changed 3 months ago by t.brackertz@…
In earlyer versions of the script the programm eject was used. Now
r = ioctl(f,action, 0)
should eject the drive. The aim to change this was to avoid an additional dependency, get a clearer code and better error handling. This doesn't always work but eject didn't always work, either. So it was no regression.
I think we have to figure out, if using the scsi-eject command or some unlock-command has to be tried in addition.
comment:4 Changed 3 months ago by Mike Kutner <videoguy1080@…>
Ah - yes - you are absolutely correct. Your attached patch fixes the original issue and should be accepted.
I verified that my failure to eject is the same as http://code.mythtv.org/trac/ticket/4022. The root cause is that /lib/udev/rules.d/60-cdrom_id.rules locks the CD/DVD drive. I am not a python expert, but this change to mythburn.py fixes the failure to eject:
@@ -2254,6 +2254,8 @@ def BurnDVDISO(title):
waitForDrive()
res = False
f = os.open(dvddrivepath, os.O_RDONLY | os.O_NONBLOCK)
+ if (action == CDROM.CDROMEJECT):
+ ioctl(f, CDROM.CDROM_LOCKDOOR, 0)
try:
ioctl(f,action, 0)
res = True
I am not sure how this works for the case that the CD/DVD drive is not locked. Do you think that I should move this to a separate issue?
comment:5 Changed 3 months ago by t.brackertz@…
mythburn.py.patch_2 doesn't only fix the crash issue but gives a more robust eject-mechanism in addition. "eject" is used as fallback if installed.
Fixes http://code.mythtv.org/trac/ticket/4022 too
comment:6 Changed 3 months ago by Mike Kutner <videoguy1080@…>
I confirmed that mythburn.py.patch_2 fixes both the original issue and 4022 - thank you very much.

Path against current git (2012-4-1): mythtv/mythplugins/mytharchive/mythburn/scripts/mythburn.py