fields icon indicating copy to clipboard operation
fields copied to clipboard

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

Open demo-mail-vk opened this issue 2 months ago • 2 comments

Code of Conduct

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

Is there an existing issue for this?

  • [x] 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

demo-mail-vk avatar Nov 28 '25 06:11 demo-mail-vk

There has been no activity on this issue for some time and therefore it is considered stale and will be closed automatically in 10 days.

If this issue is related to a bug, please try to reproduce on latest release. If the problem persist, feel free to add a comment to revive this issue. If it is related to a new feature, please open a topic to discuss with community about this enhancement on suggestion website.

You may also consider taking a subscription to get professionnal support or contact GLPI editor team directly.

github-actions[bot] avatar Dec 13 '25 08:12 github-actions[bot]

Hi @demo-mail-vk,

I assume that in the table in question, one of the rows contains text in the ownerfieldfive column. Since this field handles a foreign key, it should always contain an integer. Could you please check this?

stonebuzz avatar Dec 19 '25 13:12 stonebuzz

There has been no activity on this issue for some time and therefore it is considered stale and will be closed automatically in 10 days.

If this issue is related to a bug, please try to reproduce on latest release. If the problem persist, feel free to add a comment to revive this issue. If it is related to a new feature, please open a topic to discuss with community about this enhancement on suggestion website.

You may also consider taking a subscription to get professionnal support or contact GLPI editor team directly.

github-actions[bot] avatar Jan 04 '26 08:01 github-actions[bot]