Skip to content

CLI console installation failed without "--username" #313

@flegastelois

Description

@flegastelois

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.9.1

Bug description

When using the new bin/console marketplace:upgrade command, which handles downloading and installing the mreporting plugin, we encounter a fatal error.

This issue is also reproducible when running bin/console plugin:install mreporting without providing the --username parameter.

The plugin should be fixed so that it no longer requires the --username parameter, and instead automatically grants the necessary rights (config:update, config:read) to all “super-admin” profiles, as done in the core method.

By the way, there shouldn’t be a specific table to manage permissions for this plugin.

[2025-11-10 10:02:51] glpi.ERROR:   *** Error while installing plugin `mreporting`, error was: `MySQL query error: Column 'profiles_id' cannot be null (1048) in SQL query "INSERT INTO `glpi_plugin_mreporting_profiles` (`profiles_id`, `reports`, `right`) VALUES (NULL, '1', '1')".`.
  Backtrace :
  ./src/DBmysql.php:371                              
  ./src/DBmysql.php:1488                             DBmysql->doQuery()
  ./marketplace/mreporting/inc/profile.class.php:217 DBmysql->updateOrInsert()
  ./marketplace/mreporting/hook.php:249              PluginMreportingProfile::addRightToProfile()
  ./src/Plugin.php:1200                              plugin_mreporting_install()
  ...Glpi/Console/Marketplace/UpgradeCommand.php:186 Plugin->install()
  ./vendor/symfony/console/Command/Command.php:326   Glpi\Console\Marketplace\UpgradeCommand->execute()
  ./vendor/symfony/console/Application.php:1088      Symfony\Component\Console\Command\Command->run()
  ./src/Glpi/Console/Application.php:330             Symfony\Component\Console\Application->doRunCommand()
  ./vendor/symfony/console/Application.php:324       Glpi\Console\Application->doRunCommand()
  ./vendor/symfony/console/Application.php:175       Symfony\Component\Console\Application->doRun()
  ./bin/console:144                                  Symfony\Component\Console\Application->run()

Relevant log output

Page URL

No response

Steps To reproduce

No response

Your GLPI setup information

No response

Anything else?

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions