Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error on generating "Licenses by expiration date" report #19

Closed
eduardomozart opened this issue Dec 6, 2022 · 1 comment
Closed

Error on generating "Licenses by expiration date" report #19

eduardomozart opened this issue Dec 6, 2022 · 1 comment
Assignees
Labels
bug Something isn't working
Milestone

Comments

@eduardomozart
Copy link
Contributor

eduardomozart commented Dec 6, 2022

When trying to generate the "Licenses by expiration date" report, the following errors are shown at the page and the report isn't generated:

Warning: mysqli::query(): Couldn't fetch mysqli in /home/robertinho/public_html/glpi/src/DBmysql.php on line 363

Warning: DBmysql::query(): Couldn't fetch mysqli in /home/robertinho/public_html/glpi/src/DBmysql.php on line 367

Warning: DBmysql::query(): Couldn't fetch mysqli in /home/robertinho/public_html/glpi/src/DBmysql.php on line 372

Warning: DBmysql::query(): Couldn't fetch mysqli in /home/robertinho/public_html/glpi/src/DBmysql.php on line 372

Warning: DBmysql::fetchQueryWarnings(): Couldn't fetch mysqli in /home/robertinho/public_html/glpi/src/DBmysql.php on line 1913

The following errors are thrown at <GLPI_ROOT>\files\_log\php-errors.log:

[2022-12-06 15:34:51] glpiphplog.WARNING:   *** PHP Warning (2): mysqli::query(): Couldn't fetch mysqli in /home/robertinho/public_html/glpi/src/DBmysql.php at line 363
  Backtrace :
  src/DBmysql.php:363                                mysqli->query()
  src/DBmysqlIterator.php:112                        DBmysql->query()
  src/DBmysql.php:1056                               DBmysqlIterator->execute()
  src/Session.php:903                                DBmysql->request()
  src/Session.php:1022                               Session::checkValidSessionId()
  plugins/reports/inc/autoreport.class.php:304       Session::checkRight()
  ...s/report/licensesexpires/licensesexpires.php:78 PluginReportsAutoReport->execute()
  
[2022-12-06 15:34:51] glpiphplog.WARNING:   *** PHP Warning (2): DBmysql::query(): Couldn't fetch mysqli in /home/robertinho/public_html/glpi/src/DBmysql.php at line 367
  Backtrace :
  src/DBmysqlIterator.php:112                        DBmysql->query()
  src/DBmysql.php:1056                               DBmysqlIterator->execute()
  src/Session.php:903                                DBmysql->request()
  src/Session.php:1022                               Session::checkValidSessionId()
  plugins/reports/inc/autoreport.class.php:304       Session::checkRight()
  ...s/report/licensesexpires/licensesexpires.php:78 PluginReportsAutoReport->execute()
  
[2022-12-06 15:34:51] glpiphplog.WARNING:   *** PHP Warning (2): DBmysql::query(): Couldn't fetch mysqli in /home/robertinho/public_html/glpi/src/DBmysql.php at line 372
  Backtrace :
  src/DBmysqlIterator.php:112                        DBmysql->query()
  src/DBmysql.php:1056                               DBmysqlIterator->execute()
  src/Session.php:903                                DBmysql->request()
  src/Session.php:1022                               Session::checkValidSessionId()
  plugins/reports/inc/autoreport.class.php:304       Session::checkRight()
  ...s/report/licensesexpires/licensesexpires.php:78 PluginReportsAutoReport->execute()
  
[2022-12-06 15:34:51] glpiphplog.WARNING:   *** PHP Warning (2): DBmysql::query(): Couldn't fetch mysqli in /home/robertinho/public_html/glpi/src/DBmysql.php at line 372
  Backtrace :
  src/DBmysqlIterator.php:112                        DBmysql->query()
  src/DBmysql.php:1056                               DBmysqlIterator->execute()
  src/Session.php:903                                DBmysql->request()
  src/Session.php:1022                               Session::checkValidSessionId()
  plugins/reports/inc/autoreport.class.php:304       Session::checkRight()
  ...s/report/licensesexpires/licensesexpires.php:78 PluginReportsAutoReport->execute()
  
[2022-12-06 15:34:51] glpiphplog.WARNING:   *** PHP Warning (2): DBmysql::fetchQueryWarnings(): Couldn't fetch mysqli in /home/robertinho/public_html/glpi/src/DBmysql.php at line 1913
  Backtrace :
  src/DBmysql.php:385                                DBmysql->fetchQueryWarnings()
  src/DBmysqlIterator.php:112                        DBmysql->query()
  src/DBmysql.php:1056                               DBmysqlIterator->execute()
  src/Session.php:903                                DBmysql->request()
  src/Session.php:1022                               Session::checkValidSessionId()
  plugins/reports/inc/autoreport.class.php:304       Session::checkRight()
  ...s/report/licensesexpires/licensesexpires.php:78 PluginReportsAutoReport->execute()

The following error are thrown at <GLPI_ROOT>\files\_log\sql-errors.log:

[2022-12-06 15:34:51] glpisqllog.ERROR: DBmysql::query() in /home/robertinho/public_html/glpi/src/DBmysql.php line 370
  *** MySQL query error:
  SQL: SELECT COUNT(*) AS count FROM `glpi_users` LEFT JOIN `glpi_profiles_users` ON (`glpi_profiles_users`.`users_id` = `glpi_users`.`id`) WHERE `glpi_users`.`id` = '14' AND `glpi_users`.`is_active` = '1' AND `glpi_users`.`is_deleted` = '0' AND `glpi_profiles_users`.`profiles_id` = '4' AND (`glpi_profiles_users`.`entities_id` = '0')
  Error: 
  Backtrace :
  src/DBmysqlIterator.php:112                        
  src/DBmysql.php:1056                               DBmysqlIterator->execute()
  src/Session.php:903                                DBmysql->request()
  src/Session.php:1022                               Session::checkValidSessionId()
  plugins/reports/inc/autoreport.class.php:304       Session::checkRight()
  ...s/report/licensesexpires/licensesexpires.php:78 PluginReportsAutoReport->execute()
  {"user":"14@cloud.ifantasy.com.br"} 

I'm using GLPI 10.0.5 and there's no License right now at my GLPI instance, but it will gonna have into the future.

When I'd run the query through PHPMyAdmin it runs successfully, so I believe that the SELECT COUNT query isn't allowed through the DBmysqlIterator or maybe some problem related to the entities permission (#18)?

@yllen yllen self-assigned this Dec 7, 2022
@yllen yllen added the bug Something isn't working label Dec 7, 2022
@yllen yllen added this to the 1.16.1 milestone Dec 7, 2022
@yllen
Copy link
Owner

yllen commented Dec 7, 2022

Corrected by #26

@yllen yllen closed this as completed Dec 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants