Bug 32817

Summary: Traceback: script not executable
Product: UCS Reporter: Philipp Hahn <hahn>
Component: System setupAssignee: Johannes Keiser <keiser>
Status: CLOSED FIXED QA Contact: Florian Best <best>
Severity: normal    
Priority: P5 CC: best, klaeser
Version: UCS 4.1Flags: best: Patch_Available+
Target Milestone: UCS 4.2-1-errata   
Hardware: Other   
OS: Linux   
What kind of report is it?: Development Internal What type of bug is this?: ---
Who will be affected by this bug?: --- How will those affected feel about the bug?: ---
User Pain: Enterprise Customer affected?:
School Customer affected?: ISV affected?:
Waiting Support: Flags outvoted (downgraded) after PO Review:
Ticket number: Bug group (optional): Cleanup, Error handling, Troubleshooting
Max CVSS v3 score:
Bug Depends on:    
Bug Blocks: 28670, 33091    
Attachments: Catch OSError

Description Philipp Hahn univentionstaff 2013-10-08 10:57:49 CEST
08.10.13 09:45:14.180  MODULE      ( INFO    ) : Running script /usr/lib/univention-system-setup/scripts/30_net/10in
terfaces.pyc

08.10.13 09:45:14.277  MODULE      ( WARN    ) : Exception during saving the settings: [Errno 13] Permission denied
  File "/usr/lib/pymodules/python2.6/notifier/threads.py", line 82, in _run
    tmp = self._function()
  File "/usr/lib/pymodules/python2.6/notifier/__init__.py", line 104, in __call__
    return self._function( *tmp, **self._kwargs )
  File "/usr/lib/pymodules/python2.6/univention/management/console/modules/setup/__init__.py", line 172, in _thread
    util.run_scripts( self._progressParser, restart )
  File "/usr/lib/pymodules/python2.6/univention/management/console/modules/setup/util.py", line 373, in run_scripts
    p = subprocess.Popen( scriptpath, stdout = subprocess.PIPE, stderr = subprocess.STDOUT )
  File "/usr/lib/python2.6/subprocess.py", line 623, in __init__
    errread, errwrite)
  File "/usr/lib/python2.6/subprocess.py", line 1141, in _execute_child
    raise child_exception

OSError: [Errno 13] Permission denied

Should catch OSError, because otherwise the browser-connection is stuck.
Comment 1 Philipp Hahn univentionstaff 2013-10-08 11:19:31 CEST
Created attachment 5502 [details]
Catch OSError
Comment 2 Alexander Kläser univentionstaff 2013-10-09 12:42:37 CEST
In which use case does this error happen?
Comment 3 Florian Best univentionstaff 2014-11-24 12:37:15 CET
Happened to me, too. Only occurs when doing manual interaction in one of the folders.
Comment 4 Florian Best univentionstaff 2017-02-09 17:13:10 CET
If you locally modify a script there might be a vim .swp file which causes this error.
Comment 5 Johannes Keiser univentionstaff 2017-07-06 15:51:56 CEST
(In reply to Philipp Hahn from comment #1)
> Created attachment 5502 [details]
> Catch OSError

Applied rebased patch:

r 80928
univention-system-setup (10.0.10-27) 
* Bug #32817: Applied patch from Philipp Hahn - Catch OSError for
setup scripts

YAML: r 80929
Comment 6 Johannes Keiser univentionstaff 2017-07-06 16:05:31 CEST
r 80930
univention-system-setup (10.0.10-28) 
* Bug #32817: Applied additional patch - cleanup
Comment 7 Florian Best univentionstaff 2017-07-07 15:08:23 CEST
The patch has been applied only for run_networkscrips() but not for run_scripts() - which was the actual function which should be patched.
Comment 8 Johannes Keiser univentionstaff 2017-07-07 16:10:00 CEST
(In reply to Florian Best from comment #7)
> The patch has been applied only for run_networkscrips() but not for
> run_scripts() - which was the actual function which should be patched.

r 80979
univention-system-setup (10.0.10-30) 
* Bug #32817: Applied additional patch: Catch OSError in run_scripts
Comment 9 Johannes Keiser univentionstaff 2017-07-07 16:26:00 CEST
(In reply to Johannes Keiser from comment #8)
> (In reply to Florian Best from comment #7)
> > The patch has been applied only for run_networkscrips() but not for
> > run_scripts() - which was the actual function which should be patched.
> 
> r 80979
> univention-system-setup (10.0.10-30) 
> * Bug #32817: Applied additional patch: Catch OSError in run_scripts

r 80981
univention-system-setup (10.0.10-31) 
* Bug #32817: Cleanup
Comment 10 Johannes Keiser univentionstaff 2017-07-07 16:41:02 CEST
r 80982
univention-system-setup (10.0.10-32) 
* Bug #32817: Minor cleanup
Comment 11 Florian Best univentionstaff 2017-07-08 13:30:17 CEST
OK: the logs now contain the error instead of a crash.
OK: run_scripts
OK: run_networkscripts
OK: YAML

08.07.17 13:17:40.325  MODULE      ( INFO    ) : Running script '['/usr/lib/univention-system-setup/scripts/15_keyboard/10keyboard']': pid=15380
08.07.17 13:17:40.389  MODULE      ( ERROR   ) : Failed to run '['/usr/lib/univention-system-setup/scripts/20_language/.10language.swp']': [Errno 13] Keine Berechtigung
08.07.17 13:17:40.400  MODULE      ( INFO    ) : Running script '['/usr/lib/univention-system-setup/scripts/20_language/10language']': pid=15387
08.07.17 13:17:40.413  MODULE      ( INFO    ) : Running script '['/usr/lib/univention-system-setup/scripts/20_language/11default_locale']': pid=15391
08.07.17 13:17:40.434  MODULE      ( INFO    ) : Running script '['/usr/lib/univention-system-setup/scripts/35_timezone/10timezone']': pid=15395
Comment 12 Erik Damrose univentionstaff 2017-07-26 14:39:11 CEST
<http://errata.software-univention.de/ucs/4.2/109.html>