Modify
Warning Please read the Ticket HowTo before creating or commenting on a ticket. Failure to do so may cause your ticket to be rejected or result in a slower response.

Opened 2 years ago

Closed 8 months ago

Last modified 8 months ago

#10535 closed Patch - Bug Fix (fixed)

mythburn.py crash

Reported by: t.brackertz@… Owned by: Stefan Brackertz <t.brackertz@…>
Priority: minor Milestone: 0.27
Component: Plugin - MythArchive Version: Master Head
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 (3)

mythburn.py.patch (1.1 KB) - added by t.brackertz@… 2 years ago.
Path against current git (2012-4-1): mythtv/mythplugins/mytharchive/mythburn/scripts/mythburn.py
mythburn.py.patch_2 (3.6 KB) - added by t.brackertz@… 14 months ago.
improved path
mythburn.py.path_3 (8.7 KB) - added by t.brackertz@… 9 months ago.
Improved version of the path against current git.

Download all attachments as: .zip

Change History (11)

Changed 2 years ago by t.brackertz@…

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

comment:1 Changed 2 years ago by business.weston@…

I'm seeing this issue in .25.

comment:2 Changed 14 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

https://bugs.launchpad.net/mythbuntu/+bug/1069823

  • 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 14 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 14 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?

Changed 14 months ago by t.brackertz@…

improved path

comment:5 Changed 14 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 14 months ago by Mike Kutner <videoguy1080@…>

I confirmed that mythburn.py.patch_2 fixes both the original issue and 4022 - thank you very much.

Changed 9 months ago by t.brackertz@…

Improved version of the path against current git.

comment:7 Changed 8 months ago by Stefan Brackertz <t.brackertz@…>

  • Owner set to Stefan Brackertz <t.brackertz@…>
  • Resolution set to fixed
  • Status changed from new to closed

In bf10280b5fcb90b4a011e656a863e551665881fc/mythtv:

mythburn.py: fix ejecting the DVD on some systems and file encoding fixes

Fixes #10535. Refs #4022.

Signed-off-by: Paul Harrison <pharrison@…>

comment:8 Changed 8 months ago by paulh

  • Milestone changed from unknown to 0.27
  • Version changed from Unspecified to Master Head

Add Comment

Modify Ticket

Action
as closed .
The resolution will be deleted. Next status will be 'new'.
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.