Closed kiwib1b closed 2 months ago
To solve the problem we have reviewed the creation of the Database and launched the creation of the missing software table with the following result:
MariaDB [ocsinventory]> CREATE TABLE `software` (
-> `ID` bigint NOT NULL AUTO_INCREMENT,
-> `HARDWARE_ID` int NOT NULL,
-> `NAME_ID` int NOT NULL,
-> `PUBLISHER_ID` int NOT NULL,
-> `VERSION_ID` int NOT NULL,
-> `FOLDER` text,
-> `COMMENTS` text,
-> `FILENAME` varchar(255) DEFAULT NULL,
-> `FILESIZE` int DEFAULT '0',
-> `SOURCE` int DEFAULT NULL,
-> `GUID` varchar(255) DEFAULT NULL,
-> `LANGUAGE` varchar(255) DEFAULT NULL,
-> `INSTALLDATE` datetime DEFAULT NULL,
-> `BITSWIDTH` int DEFAULT NULL,
-> `ARCHITECTURE` varchar(255) DEFAULT NULL,
-> PRIMARY KEY (`ID`),
-> KEY `HARDWARE_ID` (`HARDWARE_ID`),
-> KEY `NAME_ID` (`NAME_ID`),
-> KEY `PUBLISHER_ID` (`PUBLISHER_ID`),
-> KEY `VERSION_ID` (`VERSION_ID`)
-> KEY `HARDWARE_ID_2` (`HARDWARE_ID`, `NAME_ID`, `VERSION_ID`) USING BTREE
-> ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3;
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'KEY `HARDWARE_ID_2` (`HARDWARE_ID`, `NAME_ID`, `VERSION_ID`) USING BTREE
) EN...' at line 22
It seems that the problem is here it fails to create the table during installation
We create the table following what is included in the installation script except for the creation of the KEYs, which we do one by one and it is done correctly
This solves all the errors we had in the agent registration
Hi @kiwib1b,
This has been fixed with PR https://github.com/OCSInventory-NG/OCSInventory-ocsreports/pull/1590, which was merged into our master branch on the ocsreports repository. Thank you for reporting the issue.
Regards, Léa
General informations
Operating system : Red Hat Enterprise Linux release 9.3 (Plow)
Server informations
Perl version : perl 5, version 32, subversion 1 (v5.32.1) built for x86_64-linux-thread-multi Mysql / Mariadb / Percona version : mariadb-server-10.5.22-1.el9_2.x86_64
OCS Inventory informations
Ocs server version : ocsinventory-server-2.12.1-1
Problem's description
I have a recently installed OCS server but agent dont works correctly. I am using both the official agent and fusion inventory.
With fusion inventory it gives me the following error:
It duplicates my entries because it is unable to delete duplicates since the software table is missing
With the OCS agent (OCS-NG_WINDOWS_AGENT_v2.10.1.0) on a Windows server it does not even register:
if I disable it from collecting software information it registers but it duplicates itself and does not delete like fusion inventory:
The problem with everything is that the software table is missing from the database, which generates duplicates and nothing is recorded if I activate it to collect the software information. I don't know why when I installed this table it wasn't created.