Bug 42362 - AppCenter ImportError: No module named database
AppCenter ImportError: No module named database
Status: CLOSED FIXED
Product: UCS
Classification: Unclassified
Component: App Center
UCS 4.1
Other Linux
: P5 normal (vote)
: UCS 4.1-3-errata
Assigned To: Dirk Wiesenthal
Felix Botner
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2016-09-13 11:36 CEST by Florian Best
Modified: 2016-09-22 07:16 CEST (History)
2 users (show)

See Also:
What kind of report is it?: Bug Report
What type of bug is this?: 7: Crash: Bug causes crash or data loss
Who will be affected by this bug?: 2: Will only affect a few installed domains
How will those affected feel about the bug?: 5: Blocking further progress on the daily work
User Pain: 0.400
Enterprise Customer affected?:
School Customer affected?:
ISV affected?:
Waiting Support:
Flags outvoted (downgraded) after PO Review:
Ticket number: 2016091921000326, 2016091921000317, 2016091821000131, 2016091721000179, 2016091521000182, 2016091321000579, 2016091321000524, 2016091321000257, 2016092021000172, 2016092021000618, 2016092121000796
Bug group (optional): Error handling, External feedback
Max CVSS v3 score:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Florian Best univentionstaff 2016-09-13 11:36:39 CEST
Version: 4.1-3 errata262 (Vahr)

Traceback(5e4aa7948701189481af27899961af4e):
Failed to load module appcenter: No module named database
Traceback (most recent call last):
  File "%PY2.7%/univention/management/console/protocol/modserver.py", line 100, in _load_module
    self.__module = __import__(file_, [], [], modname)
  File "%PY2.7%/univention/management/console/modules/appcenter/__init__.py", line 61, in <module>
    from univention.appcenter import get_action, AppManager
  File "%PY2.7%/univention/appcenter/__init__.py", line 35, in <module>
    from univention.appcenter.actions import get_action, all_actions
  File "%PY2.7%/univention/appcenter/actions/__init__.py", line 275, in <module>
    __import__('univention.appcenter.actions.%s' % pymodule_name)
  File "%PY2.7%/univention/appcenter/actions/__init__.py", line 275, in <module>
    __import__('univention.appcenter.actions.%s' % pymodule_name)
  File "%PY2.7%/univention/appcenter/actions/docker_remove.py", line 38, in <module>
    from univention.appcenter.actions.docker_base import DockerActionMixin
  File "%PY2.7%/univention/appcenter/actions/docker_base.py", line 43, in <module>
    from univention.appcenter.database import DatabaseConnector, DatabaseError
ImportError: No module named database
Comment 1 Florian Best univentionstaff 2016-09-13 15:20:28 CEST
Reported again 4 times, 4.1-3 errata262 (Vahr)
Comment 2 Florian Best univentionstaff 2016-09-13 15:24:59 CEST
Caused by Bug #40857.

@Dirk:
If you introduce new files you need to symlink this in the preinst e.g.:

if [ "$1" = "upgrade" ] && dpkg --compare-versions "$2" lt 1.2.3.4; then
    ln -s /usr/share/pyshared/univention/foo.py /usr/lib/pymodules/python2.7/univention/foo.py
fi

And please vote for Bug #28497!
Comment 3 Dirk Wiesenthal univentionstaff 2016-09-13 15:29:10 CEST
from debian/python-univention-appcenter.preinst:

if [ "$1" = "upgrade" ] && dpkg --compare-versions "$2" lt 5.0.22-1; then
        ln -s /usr/share/pyshared/univention/appcenter/database.py /usr/lib/pymodules/python2.7/univention/appcenter/database.py
fi
Comment 4 Florian Best univentionstaff 2016-09-15 10:58:34 CEST
The same user reported this 3 times today:

Konnte das Modul appcenter nicht laden: cannot import name ucr_run_filter
Traceback (most recent call last):
  File "%PY2.7%/univention/management/console/protocol/modserver.py", line 100, in _load_module
    self.__module = __import__(file_, [], [], modname)
  File "%PY2.7%/univention/management/console/modules/appcenter/__init__.py", line 61, in <module>
    from univention.appcenter import get_action, AppManager
  File "%PY2.7%/univention/appcenter/__init__.py", line 35, in <module>
    from univention.appcenter.actions import get_action, all_actions
  File "%PY2.7%/univention/appcenter/actions/__init__.py", line 275, in <module>
    __import__('univention.appcenter.actions.%s' % pymodule_name)
  File "%PY2.7%/univention/appcenter/actions/docker_upgrade.py", line 36, in <module>
    from univention.appcenter.docker import rm as docker_rm
  File "%PY2.7%/univention/appcenter/docker.py", line 52, in <module>
    from univention.appcenter.ucr import ucr_save, ucr_is_false, ucr_get, ucr_run_filter
ImportError: cannot import name ucr_run_filter
Comment 5 Florian Best univentionstaff 2016-09-15 11:01:30 CEST
(In reply to Dirk Wiesenthal from comment #3)
> from debian/python-univention-appcenter.preinst:
> 
> if [ "$1" = "upgrade" ] && dpkg --compare-versions "$2" lt 5.0.22-1; then
>         ln -s /usr/share/pyshared/univention/appcenter/database.py
> /usr/lib/pymodules/python2.7/univention/appcenter/database.py
> fi

 5.0.22-1 != 5.0.22-12.218.201609071505
Comment 6 Florian Best univentionstaff 2016-09-18 16:32:59 CEST
Version: 4.1-3 errata268 (Vahr)

Remark: Frische Installation in einer Virtuellen Maschine. UCS 4.1-3 (vollständig aktualisiert)
Host: Ubuntu 16.04.1 mit KVM/Qemu (vollständig aktualisiert)
Comment 7 Florian Best univentionstaff 2016-09-18 16:33:17 CEST
Version: 4.1-3 errata262 (Vahr)

Remark: sehr geehrte Damen und Herren,
diese Fehlermeldung erhalte ich an einem frisch installiertem UCS.
Bisher wurde UCS genutzt um über das APPCenter einige Apps zu installieren.
Anschließend wurde über die Console über apt-get update && upgrade geupdated.
Nach einem reboot reagiert das System mit dem beigefügten Fehler.
mit freundlichen Grüßen
Comment 8 Florian Best univentionstaff 2016-09-18 16:34:23 CEST
Reported again, 4.1-3 errata268 (Vahr)
Comment 9 Florian Best univentionstaff 2016-09-19 11:20:01 CEST
Reported again, 3 times, 4.1-3 errata268 (Vahr)
Comment 10 Dirk Wiesenthal univentionstaff 2016-09-20 01:10:30 CEST
Fixed in
  univention-appcenter 5.0.22-17.223.201609200055

Currently, it looks like python-univention-appcenter failed to install for some reason (not yet known). But univention-appcenter-docker succeeded to install which caused the traceback as this package assumes python-univention-appcenter to be at the same version. Made this assumption explicit in debian/control.

Unfortunately, as the reason for all this is still unclear, QA can only verify that this fix solves the problem given that the theory about broken packages is correct.
Comment 11 Florian Best univentionstaff 2016-09-20 12:34:29 CEST
Reported again, 4.1-3 errata268 (Vahr)
Comment 12 Dirk Wiesenthal univentionstaff 2016-09-20 15:59:14 CEST
Problem was Bug#42450. The fix applied here should indeed prevent this traceback.
Comment 13 Felix Botner univentionstaff 2016-09-20 17:21:36 CEST
FAIL - yaml

OK - univention-appcenter-* packages depend on 
     python-univention-appcenter (= ${source:Version})
OK - merged to 4.2-0
Comment 14 Dirk Wiesenthal univentionstaff 2016-09-20 17:23:45 CEST
YAML added
Comment 15 Felix Botner univentionstaff 2016-09-21 09:48:02 CEST
univention-appcenter:
  Installiert:           5.0.22-17.223.201609200055
  Installationskandidat: 5.0.22-17.223.201609200055
  Versionstabelle:
 *** 5.0.22-17.223.201609200055 0
        500 http://192.168.0.10/build2/ ucs_4.1-0-errata4.1-3/all/ Packages


-> more univention-appcenter.yaml 
...fix: 5.0.22-16.222.201609200036

5.0.22-16... != 5.0.22-17
Comment 16 Dirk Wiesenthal univentionstaff 2016-09-21 09:51:48 CEST
Fixed in r72710
Comment 17 Felix Botner univentionstaff 2016-09-21 10:46:09 CEST
OK
Comment 18 Florian Best univentionstaff 2016-09-21 13:40:16 CEST
Reported again, 4.1-3 errata268 (Vahr)
Comment 19 Janek Walkenhorst univentionstaff 2016-09-21 14:30:26 CEST
<http://errata.software-univention.de/ucs/4.1/272.html>
Comment 20 Florian Best univentionstaff 2016-09-21 17:55:20 CEST
Reported again, 4.1-3 errata268 (Vahr)