Backend referential integrity error

Antoine GUEVARA
Beiträge: 54
Registriert: 13 Apr 2011, 22:01
Wohnort: GIP RECIA - France

Backend referential integrity error

Beitragvon Antoine GUEVARA » 01 Dez 2014, 13:58

Hi,

When I try to re install a host with opsi-local-image, during the hwinvent I have this error :
Bild

This is my /etc/opsi/backendManager/dispatch.conf file :

Code: Alles auswählen

backend_.*         : mysql, file, opsipxeconfd                           
host_.*            : mysql , file, opsipxeconfd                             
productOnClient_.* : mysql, opsipxeconfd                             
configState_.*     : mysql, opsipxeconfd                                 
audit.*             : mysql, file                                                   
license.*          : mysql                                                         
softwareLicense.*  : mysql                                                   
.*                 : file


All packages are up-to-date ( 4.0.5 *** )

I think it is link to the mysql module, but anyone have already fix this issue ?

Thanks

Antoine

Antoine GUEVARA
Beiträge: 54
Registriert: 13 Apr 2011, 22:01
Wohnort: GIP RECIA - France

Re: Backend referential integrity error

Beitragvon Antoine GUEVARA » 01 Dez 2014, 14:00

I have to delete /var/lib/opsI/config/audit/<myclient>.hw and its works again ( for the first installation ), if I try an other install I have the same message backend integrity ....

Benutzeravatar
wolfbardo
uib-Team
Beiträge: 1157
Registriert: 01 Jul 2008, 12:10

Re: Backend referential integrity error

Beitragvon wolfbardo » 01 Dez 2014, 19:42

Hi Antoine,

your dispatch.conf is wrong

if you one a use the mysql backend, your dispatch.conf should look like

Code: Alles auswählen

backend_.*         : mysql, opsipxeconfd
host_.*            : mysql, opsipxeconfd
productOnClient_.* : mysql, opsipxeconfd
configState_.*     : mysql, opsipxeconfd
license.*          : mysql
softwareLicense.*  : mysql
audit.*            : mysql
.*                 : mysql


If you use the recommended standard backend, you should use

Code: Alles auswählen

# Recommended standard configuration (dhcpd not at the opsi server)
#    file as main backend, mysql as hw/sw invent
#     and license management backend and opsipxeconfd backend:
backend_.*         : file, mysql, opsipxeconfd
host_.*            : file, opsipxeconfd
productOnClient_.* : file, opsipxeconfd
configState_.*     : file, opsipxeconfd
license.*          : mysql
softwareLicense.*  : mysql
audit.*            : mysql
.*                 : file


regards,
bardo wolf


!!! ANMELDEN !!! opsi-Konferenz in Mainz am 02. / 03. März 2020 https://opsiconf.org

opsi workshops

https://uib.de/de/support-schulung/schulung/

Basis
23.-26.3.2020


opsi support by uib gmbh

http://www.uib.de

Antoine GUEVARA
Beiträge: 54
Registriert: 13 Apr 2011, 22:01
Wohnort: GIP RECIA - France

Re: Backend referential integrity error

Beitragvon Antoine GUEVARA » 02 Dez 2014, 08:46

Ok, thank you,

But now when I try to import file backend to mysql backend I always have this error :

Code: Alles auswählen

ERROR: Backend error: Failed to install package '/var/lib/opsi/repository/config-win-base_4.0.1-1.opsi' on depot 'opsixxxxxxxxx.fr': (1452, 'Cannot add or update a child row: a foreign key constraint fails (`opsixxxxxxx`.`PRODUCT_ON_DEPOT`, CONSTRAINT `PRODUCT_ON_DEPOT_ibfk_2` FOREIGN KEY (`depotId`) REFERENCES `HOST` (`hostId`))')


And I don't see my packages, depot is empty.

Thank you for your help.

Antoine

Antoine GUEVARA
Beiträge: 54
Registriert: 13 Apr 2011, 22:01
Wohnort: GIP RECIA - France

Re: Backend referential integrity error

Beitragvon Antoine GUEVARA » 02 Dez 2014, 08:52

extract of :

opsi-convert file mysql


Code: Alles auswählen

Error occured: Failed to replicate object <ProductOnDepot productId 'win2k', depotId 'opsi.FQDN'>: (1452, 'Cannot add or update a child row: a foreign key constraint fails (`opsixxxxxxxx`.`PRODUCT_ON_DEPOT`, CONSTRAINT `PRODUCT_ON_DEPOT_ibfk_2` FOREIGN KEY (`depotId`) REFERENCES `HOST` (`hostId`))')====================        ]    93/107 
Error occured: Failed to replicate object <ProductOnDepot productId 'win7', depotId 'opsi.FQDN'>: (1452, 'Cannot add or update a child row: a foreign key constraint fails (`opsixxxxxxxx`.`PRODUCT_ON_DEPOT`, CONSTRAINT `PRODUCT_ON_DEPOT_ibfk_2` FOREIGN KEY (`depotId`) REFERENCES `HOST` (`hostId`))')======================       ]    94/107 
Error occured: Failed to replicate object <ProductOnDepot productId 'win7-x64', depotId 'opsi.FQDN'>: (1452, 'Cannot add or update a child row: a foreign key constraint fails (`opsixxxxxxxx`.`PRODUCT_ON_DEPOT`, CONSTRAINT `PRODUCT_ON_DEPOT_ibfk_2` FOREIGN KEY (`depotId`) REFERENCES `HOST` (`hostId`))')==================       ]    95/107 
Error occured: Failed to replicate object <ProductOnDepot productId 'win8', depotId 'opsi.FQDN'>: (1452, 'Cannot add or update a child row: a foreign key constraint fails (`opsixxxxxxxx`.`PRODUCT_ON_DEPOT`, CONSTRAINT `PRODUCT_ON_DEPOT_ibfk_2` FOREIGN KEY (`depotId`) REFERENCES `HOST` (`hostId`))')=======================      ]    96/107 
Error occured: Failed to replicate object <ProductOnDepot productId 'win8-x64-enterprise', depotId 'opsi.FQDN'>: (1452, 'Cannot add or update a child row: a foreign key constraint fails (`opsixxxxxxxx`.`PRODUCT_ON_DEPOT`, CONSTRAINT `PRODUCT_ON_DEPOT_ibfk_2` FOREIGN KEY (`depotId`) REFERENCES `HOST` (`hostId`))')=========     ]    97/107 
Error occured: Failed to replicate object <ProductOnDepot productId 'win8-x64', depotId 'opsi.FQDN'>: (1452, 'Cannot add or update a child row: a foreign key constraint fails (`opsixxxxxxxx`.`PRODUCT_ON_DEPOT`, CONSTRAINT `PRODUCT_ON_DEPOT_ibfk_2` FOREIGN KEY (`depotId`) REFERENCES `HOST` (`hostId`))')====================     ]    98/107 
Error occured: Failed to replicate object <ProductOnDepot productId 'win81', depotId 'opsi.FQDN'>: (1452, 'Cannot add or update a child row: a foreign key constraint fails (`opsixxxxxxxx`.`PRODUCT_ON_DEPOT`, CONSTRAINT `PRODUCT_ON_DEPOT_ibfk_2` FOREIGN KEY (`depotId`) REFERENCES `HOST` (`hostId`))')========================    ]    99/107 
Error occured: Failed to replicate object <ProductOnDepot productId 'win81-x64', depotId 'opsi.FQDN'>: (1452, 'Cannot add or update a child row: a foreign key constraint fails (`opsixxxxxxxx`.`PRODUCT_ON_DEPOT`, CONSTRAINT `PRODUCT_ON_DEPOT_ibfk_2` FOREIGN KEY (`depotId`) REFERENCES `HOST` (`hostId`))')====================    ]   100/107 
Error occured: Failed to replicate object <ProductOnDepot productId 'windomain', depotId 'opsi.FQDN'>: (1452, 'Cannot add or update a child row: a foreign key constraint fails (`opsixxxxxxxx`.`PRODUCT_ON_DEPOT`, CONSTRAINT `PRODUCT_ON_DEPOT_ibfk_2` FOREIGN KEY (`depotId`) REFERENCES `HOST` (`hostId`))')=====================   ]   101/107 
Error occured: Failed to replicate object <ProductOnDepot productId 'winvista', depotId 'opsi.FQDN'>: (1452, 'Cannot add or update a child row: a foreign key constraint fails (`opsixxxxxxxx`.`PRODUCT_ON_DEPOT`, CONSTRAINT `PRODUCT_ON_DEPOT_ibfk_2` FOREIGN KEY (`depotId`) REFERENCES `HOST` (`hostId`))')======================   ]   102/107 
Error occured: Failed to replicate object <ProductOnDepot productId 'winvista-x64', depotId 'opsi.FQDN'>: (1452, 'Cannot add or update a child row: a foreign key constraint fails (`opsixxxxxxxx`.`PRODUCT_ON_DEPOT`, CONSTRAINT `PRODUCT_ON_DEPOT_ibfk_2` FOREIGN KEY (`depotId`) REFERENCES `HOST` (`hostId`))')===================  ]   103/107 
Error occured: Failed to replicate object <ProductOnDepot productId 'winxppro', depotId 'opsi.FQDN'>: (1452, 'Cannot add or update a child row: a foreign key constraint fails (`opsixxxxxxxx`.`PRODUCT_ON_DEPOT`, CONSTRAINT `PRODUCT_ON_DEPOT_ibfk_2` FOREIGN KEY (`depotId`) REFERENCES `HOST` (`hostId`))')=======================  ]   104/107 
Error occured: Failed to replicate object <ProductOnDepot productId 'winxppro-x64', depotId 'opsi.FQDN'>: (1452, 'Cannot add or update a child row: a foreign key constraint fails (`opsixxxxxxxx`.`PRODUCT_ON_DEPOT`, CONSTRAINT `PRODUCT_ON_DEPOT_ibfk_2` FOREIGN KEY (`depotId`) REFERENCES `HOST` (`hostId`))')==================== ]   105/107 
Error occured: Failed to replicate object <ProductOnDepot productId 'wipedisk', depotId 'opsi.FQDN'>: (1452, 'Cannot add or update a child row: a foreign key constraint fails (`opsixxxxxxxx`.`PRODUCT_ON_DEPOT`, CONSTRAINT `PRODUCT_ON_DEPOT_ibfk_2` FOREIGN KEY (`depotId`) REFERENCES `HOST` (`hostId`))')

Benutzeravatar
wolfbardo
uib-Team
Beiträge: 1157
Registriert: 01 Jul 2008, 12:10

Re: Backend referential integrity error

Beitragvon wolfbardo » 02 Dez 2014, 15:38

mmh,

you where running with a somehow broken mysql-backend.
if you want to switch back to file-Backend, you can try

Code: Alles auswählen

opsi-convert file mysql


The other way around it would be good, if you have a opsi-backup (http://download.uib.de/opsi4.0/doc/html ... ual-backup)

regards,
bardo Wolf


!!! ANMELDEN !!! opsi-Konferenz in Mainz am 02. / 03. März 2020 https://opsiconf.org

opsi workshops

https://uib.de/de/support-schulung/schulung/

Basis
23.-26.3.2020


opsi support by uib gmbh

http://www.uib.de

Antoine GUEVARA
Beiträge: 54
Registriert: 13 Apr 2011, 22:01
Wohnort: GIP RECIA - France

Re: Backend referential integrity error

Beitragvon Antoine GUEVARA » 03 Dez 2014, 08:03

Hi,

Thank you for your reply, but I think there are problems with mysql and depot∕host with fqdn > 50 chars

Here is my bug topic.

viewtopic.php?f=6&t=7016

Regards,

Antoine