Skip to content

Inventory import fails when a process command line exceeds glpi_items_processes.cmd TEXT limit #25948

In review

Description

@Hugo-Cheng66

Code of Conduct

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

Disable plugins

  • I reproduce the issue with all plugins disabled

Is there an existing issue for this?

  • I have searched the existing issues

Version

11.0.7

Bug description

During an agent inventory import, GLPI fails with MySQL error 1406 when a reported process command line is longer than the capacity of the database column.

The affected column was confirmed as:

glpi_items_processes.cmd → TEXT → maximum length 65,535

Expected behavior:
GLPI should handle oversized process command lines safely (for example by using a larger column type or by applying a documented truncation policy). A single oversized process command line should not make the inventory import fail.

Actual behavior:
The inventory is reported as an Agent Error and the database insert/update fails.

Relevant log output

MySQL query error:
Data too long for column 'cmd' at row 1 (1406)

Page URL

Not applicable — the error occurs during agent inventory ingestion.

Steps To reproduce

  1. Run GLPI Agent 1.19 on a host that has a process with a command line longer than 65,535 characters/bytes.
  2. Send the computer inventory to GLPI 11.0.7.
  3. GLPI attempts to persist the process command line in glpi_items_processes.cmd.
  4. The inventory fails with MySQL error 1406: Data too long for column 'cmd' at row 1.

Your GLPI setup information

GLPI: 11.0.7
GLPI Agent: 1.19
Database server: MySQL 8.4.9

Verified database schema:

glpi_items_processes.cmd is TEXT with CHARACTER_MAXIMUM_LENGTH = 65535.

This is a production instance. Reproduction with all plugins disabled has not been performed.

Anything else?

The actual process command line, inventory payload, hostnames, IP addresses, domain names, and database identifiers are intentionally omitted because they may contain credentials or internal information.

No exact existing issue was found for this error. The failure appears to be in server-side inventory persistence rather than agent transport.

Activity

  1. added theissue type on Oct 15, 2026
  2. Maelys711 commented on Nov 24, 2026

    @Maelys711

    Hello, I reproduced the bug on 11.0.12 (MariaDB 11.8, Docker, without plugins) by sending a simulated inventory with curl containing a process whose command is 70 000 characters long. I get the same error: Data too long for column 'cmd' at row 1 (1406). With a 10 000 characters long command, the inventory is imported without errors, so the problem comes from the size of the column.

    The column glpi_items_processes.cmd is of type text (65 535 bytes). Locally, after ALTER TABLE glpi_items_processes MODIFY cmd longtext;, the inventory with 70 000 characters is imported correctly.

    I suggest changing cmd to longtext (as most text columns in GLPI): modification of glpi-empty.sql + new migration (based on update_11.0.2_to_11.0.3/processes.php) + a test in ProcessTest.php. Does this approach suit you, or would you prefer to truncate the command line? If it's OK, I can open a PR on 11.0/bugfixes.

    MariaDB [glpi]> ALTER TABLE glpi_items_processes MODIFY cmd longtext;
    Query OK, 1 row affected (0.097 sec)

    $ curl -s -H "Content-Type: application/json" --data @/tmp/inv-long-cmd.json http://localhost:8080/front/inventory.php
    {"RESPONSE":"SEND"}

  3. linked a pull request that will close this issueUpdate processes cmd column to longtext #26430on Nov 25, 2026
  4. added a commit that references this issue on Nov 25, 2026
    cafc0e0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions