Seite 1 von 1

opsi-product-updater

Verfasst: 02 Sep 2010, 11:12
von untouchable
Hallo Opsi-Gemeinde

Habe heute gesehen, dass diverse Netboot Produkte aktualisiert wurden. Wollte natürlich die Aktualisierungen
sofort einspielen.
Dafür habe ich mich des Befehls opsi-product-updater -i -vv bedient.

Offenbar konnte nicht alle Produkte aktualisiert werden.
Folgender Log wurde nach dem Update ausgegeben:

Traceback:
line 304 in 'installPackage' in file '/usr/lib/pymodules/python2.6/OPSI/Backend/Depotserver.py'
line 1 in 'product_deleteObjects' in file '<string>'
line 502 in '_executeMethod' in file '/usr/lib/pymodules/python2.6/OPSI/Backend/Backend.py'
line 1 in '<module>' in file '<string>'
line 1 in 'product_deleteObjects' in file '<string>'
line 287 in '_dispatchMethod' in file '/usr/lib/pymodules/python2.6/OPSI/Backend/BackendManager.py'
line 1 in '<module>' in file '<string>'
line 1377 in 'product_deleteObjects' in file '/usr/lib/pymodules/python2.6/OPSI/Backend/MySQL.py'
line 320 in 'delete' in file '/usr/lib/pymodules/python2.6/OPSI/Backend/MySQL.py'
line 343 in 'execute' in file '/usr/lib/pymodules/python2.6/OPSI/Backend/MySQL.py'
line 166 in 'execute' in file '/usr/lib/pymodules/python2.6/MySQLdb/cursors.py'
line 35 in 'defaulterrorhandler' in file '/usr/lib/pymodules/python2.6/MySQLdb/connections.py'
==>>> (1451, 'Cannot delete or update a parent row: a foreign key constraint fails (`opsi`.`PRODUCT_PROPERTY_STATE`, CONSTRAINT `PRODUCT_PROPERTY_STATE_ibfk_1` FOREIGN KEY (`productId`) REFERENCES `PRODUCT` (`productId`))')
Traceback:
line 904 in '<module>' in file '/usr/bin/opsi-product-updater'
line 898 in 'main' in file '/usr/bin/opsi-product-updater'
line 512 in 'processUpdates' in file '/usr/bin/opsi-product-updater'
line 1 in 'depot_installPackage' in file '<string>'
line 502 in '_executeMethod' in file '/usr/lib/pymodules/python2.6/OPSI/Backend/Backend.py'
line 1 in '<module>' in file '<string>'
line 1 in 'depot_installPackage' in file '<string>'
line 502 in '_executeMethod' in file '/usr/lib/pymodules/python2.6/OPSI/Backend/Backend.py'
line 1 in '<module>' in file '<string>'
line 1 in 'depot_installPackage' in file '<string>'
line 502 in '_executeMethod' in file '/usr/lib/pymodules/python2.6/OPSI/Backend/Backend.py'
line 1 in '<module>' in file '<string>'
line 113 in 'depot_installPackage' in file '/usr/lib/pymodules/python2.6/OPSI/Backend/Depotserver.py'
line 315 in 'installPackage' in file '/usr/lib/pymodules/python2.6/OPSI/Backend/Depotserver.py'
==>>> Backend error: Failed to install package '/var/lib/opsi/repository/opsi-client-agent_4.0-3.opsi' on depot 'opsi40.qsdomain.local': (1451, 'Cannot delete or update a parent row: a foreign key constraint fails (`opsi`.`PRODUCT_PROPERTY_STATE`, CONSTRAINT `PRODUCT_PROPERTY_STATE_ibfk_1` FOREIGN KEY (`productId`) REFERENCES `PRODUCT` (`productId`))')
ERROR: Backend error: Failed to install package '/var/lib/opsi/repository/opsi-client-agent_4.0-3.opsi' on depot 'opsi40.qsdomain.local': (1451, 'Cannot delete or update a parent row: a foreign key constraint fails (`opsi`.`PRODUCT_PROPERTY_STATE`, CONSTRAINT `PRODUCT_PROPERTY_STATE_ibfk_1` FOREIGN KEY (`productId`) REFERENCES `PRODUCT` (`productId`))')

Was könnte hier der Fehler sein?

Gruss untouchable

Re: opsi-product-updater

Verfasst: 02 Sep 2010, 11:43
von j.schneider
Hallo,

ich denke, dass daran eine "veraltete" Datenbank schuld ist.
Wir haben seit der Beta noch Änderungen vorgenommen.
Erst einmal bitte auf die neuesten Versionen Upgraden.
In der /etc/apt/sources.list

Code: Alles auswählen

deb http://download.uib.de/debian lucid opsi4.0
ersetzen durch:

Code: Alles auswählen

deb http://download.opensuse.org/repositories/home:/uibmz:/opsi:/opsi40/xUbuntu_10.04/ ./
Dann:

Code: Alles auswählen

apt-get update; apt-get upgrade
Dann am besten die Datenbank neu erstellen (hierbei gehen alle Daten verloren):

Code: Alles auswählen

echo 'drop database opsi;' | mysql -u root -p
opsi-setup --configure-mysql
opsi-setup --init-current-config
Wenn die Datenbank erhalten werden soll, dann bitte vorher in das File-Backend konvertieren:

Code: Alles auswählen

opsi-convert mysql file
Und nachher dann zurück:

Code: Alles auswählen

opsi-convert file mysql

GELÖST: opsi-product-updater

Verfasst: 02 Sep 2010, 13:19
von untouchable
Hallo Herr Schneider

Besten Dank für Ihre Anwort.
Hat bestens funktioniert.

Gruss

A. Hofstetter