Skip to content

Plugin upgrade fails from 1.20.6 to 1.23.1 during glpi 10.0.7 to 11.0.2 upgrade #1098

@demo-mail-vk

Description

@demo-mail-vk

Code of Conduct

  • I agree to follow this project's Code of Conduct

Is there an existing issue for this?

  • I have searched the existing issues

GLPI Version

11.0.2

Plugin version

1.20.6 --> 1.23.1

Bug description

Hi Team,

I believe during 1.20.6 --> 1.23.1 upgrade we are trying to alter the table column names and their specification
For example:


[2025-11-13 07:12:36] glpi.CRITICAL: *** Uncaught PHP Exception RuntimeException: "MySQL query error: Data truncated for column 'users_id_ownerfieldthree' at row 3 (1265) in SQL query "ALTER TABLE glpi_plugin_fields_softwarecustomfields CHANGE ownerfieldtwo users_id_ownerfieldthree INT unsigned NOT NULL DEFAULT 0 "." at DBmysql.php line 371

Most probably earlier it used to accept NULL or Empty values. Hence data in DB had NULL or empty strings

Are we not doing below

UPDATE glpi_plugin_fields_softwarecustomfields
SET ownerfieldtwo = 0
WHERE ownerfieldtwo IS NULL
OR ownerfieldtwo = '';

and then

ALTER TABLE glpi_plugin_fields_softwarecustomfields
CHANGE ownerfieldtwo users_id_ownerfieldthree INT UNSIGNED NOT NULL DEFAULT 0;

Should the end users take care of this scenario themselves?


[2025-11-13 07:15:40] glpi.CRITICAL: *** Uncaught PHP Exception RuntimeException: "MySQL query error: Truncated incorrect INTEGER value: 'John Victor P' (1292) in SQL query "ALTER TABLE glpi_plugin_fields_peripheralcustomfields CHANGE ownerfieldfive users_id_ownerfieldsix INT unsigned NOT NULL DEFAULT 0 "." at DBmysql.php line 371

Earlier the column ownerfieldfive has accepted varchar, hence usernames were being added (I understand it has to be users id. But somehow usernames are there in the DB)

Now we should map respective users with their ids? and then alter it ?

Please let me know if my understanding is right. And is this correct approach to be followed to fix this issues

Relevant log output

[2025-11-13 07:12:36] glpi.CRITICAL:   *** Uncaught PHP Exception RuntimeException: "MySQL query error: Data truncated for column 'users_id_ownerfieldthree' at row 3 (1265) in SQL query "ALTER TABLE `glpi_plugin_fields_softwarecustomfields` CHANGE `ownerfieldtwo` `users_id_ownerfieldthree` INT unsigned NOT NULL DEFAULT 0   "." at DBmysql.php line 371


[2025-11-13 07:15:40] glpi.CRITICAL:   *** Uncaught PHP Exception RuntimeException: "MySQL query error: Truncated incorrect INTEGER value: 'John Victor P' (1292) in SQL query "ALTER TABLE `glpi_plugin_fields_peripheralcustomfields` CHANGE `ownerfieldfive` `users_id_ownerfieldsix` INT unsigned NOT NULL DEFAULT 0   "." at DBmysql.php line 371

Page URL

No response

Steps To reproduce

Install GLPI 10.0.7 with fields version 1.20.6
Add Assets with NULL or Empty strings
Upgrade GLPI from version 10.0.7 to 11.0.2
Upgrade fields plugin from 1.20.6 to 1.23.1

Your GLPI setup information

No response

Anything else?

Was expecting the fields upgrade issues to be displayed on glpi tool UI, rather than getting inside vm and checking php_errors on by one
If its not feasible, should be fine

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions