Univention Bugzilla – Bug 42619
TypeError: int() argument must be a string or a number, not 'NoneType'
Last modified: 2016-11-09 17:31:35 CET
Received a weird traceback: Version: - errata0 () Traceback (most recent call last): File "%PY2.7%/univention/management/console/protocol/modserver.py", line 271, in handle self.__handler.init() File "%PY2.7%/univention/management/console/modules/appcenter/__init__.py", line 148, in init self.uu = UniventionUpdater(False) File "%PY2.7%/univention/updater/tools.py", line 579, in __init__ self.ucr_reinit() File "%PY2.7%/univention/updater/tools.py", line 617, in ucr_reinit self.patchlevel = int(self.configRegistry['version/patchlevel']) TypeError: int() argument must be a string or a number, not 'NoneType'
There was a backup in /var/univention-backup/base.conf
I could imagine the cause: Bug #37402 occurred and made ucr.load() in a thread which resulted in a empty ucr dict. The appcenter then sets some variables and does ucr.save() which overwrites the file with only those variables set.
The following lines might be a misuse of UCR? $ git grep ucr\\.save python/appcenter-docker/actions/configure.py: _ucr.save() umc/python/appcenter/util.py: ucr.save()
Please add this bug to the YAML file as you committed changes already.
Removed ucr.save(), replaced handler_set with ucr_update, avoided two UCR instances in UMC App Center. univention-appcenter 5.0.22-22.228.201610201802 YAML added, merged to 4.2
Could not reproduce the issue. But the patch should make it better in any case. (In reply to Florian Best from comment #4) > The following lines might be a misuse of UCR? > $ git grep ucr\\.save > python/appcenter-docker/actions/configure.py: _ucr.save() > umc/python/appcenter/util.py: ucr.save() This has to be low level. This code writes /etc/univention/base.conf inside a container that has no UCR itself.
r73424 or some other commit broke Jenkins since 3 runs on all roles: <http://jenkins.knut.univention.de:8080/job/UCS-4.1/job/UCS-4.1-3/job/AutotestJoin/lastCompletedBuild/SambaVersion=s3,Systemrolle=slave/testReport/20_appcenter/20_can_apps_be_installed/test/> >[2016-10-22 20:44:27.037135] [ APP: xrdp ] >[2016-10-22 20:44:27.037145] broken packages: ['univention-xrdp'] >[2016-10-22 20:44:27.037153] output of apt-get install -s >[2016-10-22 20:44:27.236939] File: /etc/apt/sources.list.d/20_ucs-online-component.list >[2016-10-22 20:44:29.948209] File: /etc/apt/mirror.list >[2016-10-22 20:44:30.057120] File: /etc/apt/sources.list.d/15_ucs-online-version.list >[2016-10-22 20:44:37.141579] Executing the command: ['/usr/bin/apt-get', 'install', '-s', 'univention-xrdp'] >[2016-10-22 20:44:37.157305] Paketlisten werden gelesen... >[2016-10-22 20:44:37.190308] Abhängigkeitsbaum wird aufgebaut.... >[2016-10-22 20:44:37.191378] Statusinformationen werden eingelesen.... >(2016-10-22 20:44:37.215175) E: Paket univention-xrdp kann nicht gefunden werden.
I have adjusted the test case. The problem was a different UCR instance in the test than in the App Center
Please merge the ucs-test changes to 4.1-4. (In reply to Dirk Wiesenthal from comment #9) > I have adjusted the test case. The problem was a different UCR instance in > the test than in the App Center I don't understand this. Please explain further why no two UCR instances may exists. This worked previously.
Merged. I thought it was two different UCR instances that interfere with each other. After some debugging, I finally found out why the test failed: with UCSTestConfigRegistry() as ucr: ... cm = ComponentManager(ucr, uu) creates a ComponentManager that wants to add the component. But with the patch to umc-appcenter I do not do it with handler_set, but with ucr_update. And ucr_update uses: def ucr_update(ucr, changes): with ucr: changed = ucr.update(changes) And this __enter__ and __exit__ to a UCSTestConfigRegistry instance does revert changes before being able to commit it. In summary, you cannot use UCSTestConfigRegistry together with ucr_update. That's why the test failed: No component could be registered in the test.
OK, this sound valid. But the set UCR variables aren't reset anymore after executing the test. At least 'repository/app_center/server' is not reset if the test fails with some exception.
(In reply to Florian Best from comment #12) > OK, this sound valid. But the set UCR variables aren't reset anymore after > executing the test. At least 'repository/app_center/server' is not reset if > the test fails with some exception. Actually, it should have been reset. I have clarified the test in ucs-test 6.0.36-38.1549.201610270052 I have also improved UCR handling in the App Center. The Docker Container configuration code had some lock/load issues. This was not the cause of this very bug as it only applies to certain Docker Containers, but it is related to this bug. univention-appcenter 5.0.22-23.229.201610261703
OK: The change improves UCR handling. I could not reproduce the error. My guess is still that it has to do with Bug #37402 (which is fixed in UCS 4.2). OK: ucs-test adjustments OK: UCS 4.2/4.1-4 merge OK: YAML
<http://errata.software-univention.de/ucs/4.1/322.html>