You are not logged in.

Announcement

 Téléchargez la dernière version stable de GLPI      -     Et vous, que pouvez vous faire pour le projet GLPI ? :  Contribuer
 Download last stable version of GLPI                      -     What can you do for GLPI ? :  Contribute

#1 2018-03-21 15:56:09

GubbelPiepmatz
Member
Registered: 2017-09-19
Posts: 12

cannot get server information after migrating glpi database

Hallo together,
the automatic sync between glpi and ocs database doesn't work. The script "ocsng_fullsync.sh" runs automatically but I get the message in the logfile "Thread #1: cannot get server information".

We have migrated the GLPI database to a new system.


Here are the infos of the old and the new system.

Old system:
CentOS 6.9
GLPI version 0.83.91 with OCS import plugin 1.6.1
OCS Database version 1.3.3

New system:
CentOS 7
GLPI version 9.2.1 with OCS Inventory NG plugin 1.4.3
OCS Database version 2.1.2

All installed from Remi's repository.

After fresh install on the new system, all was working.
After migrating the GLPI database (with the procedure with install.php and upgrading) to the new system, I can start the scripts to import, link and so on by hand and it's working. The fullsync script doesn't work (With error message "Thread #1: cannot get server information").

The area that throw this message is in the function SecondPass in the "ocsng_fullsync.php" file:

if (!$server->getFromDBbyOcsServer($ocsservers_id)) {
      echo "\tThread #" . $threadid . ": cannot get server information\n\n";
      return false;

Anyone knows what exactly this code snippet do? I cannot find the cause.

Many thx in advance for your support and effort.

Nice greetings

Last edited by GubbelPiepmatz (2018-03-21 16:34:49)

Offline

#2 2018-03-21 16:51:09

GubbelPiepmatz
Member
Registered: 2017-09-19
Posts: 12

Re: cannot get server information after migrating glpi database

Hallo,
I think I found the error. Something was wrong at the database migration/upgrades.
In the file /var/log/glpi/sql-errors.log there are issues that some columns cannot be found. It's the column "plugin_ocsinventoryng_ocsservers_id" from the table "glpi_plugin_ocsinventoryng_servers".
Next one is:
Error: Unknown column 'plugin_ocsinventoryng_ocsservers_id' in 'where clause' in the table "glpi_plugin_ocsinventoryng_notimportedcomputers"...
I will analyze the differences in the database, and then I will post it here again.
Nice greetings

Last edited by GubbelPiepmatz (2018-04-04 06:59:27)

Offline

#3 2018-03-22 10:16:27

GubbelPiepmatz
Member
Registered: 2017-09-19
Posts: 12

Re: cannot get server information after migrating glpi database

Hallo again,
if someone have the same issue.
After migrating the GLPI database from mysql (version 5.1.73) and GLPI (version 0.83.91) to MariaDB (version 5.5.56) and GLPI (version 9.2.1) missing columns in the glpi database.

Run the ocsng_fullsync.sh script by hand from the shell and check sql-errors.log.

In my case, I had to add a column named "plugin_ocsinventoryng_ocsservers_id" in the following tables of the database glpi:

- glpi_plugin_ocsinventoryng_servers
- glpi_plugin_ocsinventoryng_notimportedcomputers
- glpi_plugin_ocsinventoryng_threads
- glpi_plugin_ocsinventoryng_details

Since the columns are existing in the named tables, and entering the Server ID there, the script runs correctly.

Checking the sql-errors.log is always a good option.
;-)

Last edited by GubbelPiepmatz (2018-03-22 13:46:49)

Offline

Board footer

Powered by FluxBB