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

SNMP Credentials Issue #112

Closed
DYKenoby opened this issue May 11, 2022 · 6 comments
Closed

SNMP Credentials Issue #112

DYKenoby opened this issue May 11, 2022 · 6 comments

Comments

@DYKenoby
Copy link

After upgrade GLPI 9.5 to GLPI 10.
Unable to normally assosiate snmp credential with ip range.

After click assosiate button empty record appeared and Error in _log/php-errors.log

`[2022-05-11 19:14:04] glpiphplog.WARNING:   *** PHP Warning (2): Undefined array key "snmpcredentials_id" in /var/www/glpi/marketplace/glpiinventory/inc/iprange_snmpcredential.class.php at line 164
  Backtrace :
  ...entory/inc/iprange_snmpcredential.class.php:114 PluginGlpiinventoryIPRange_SNMPCredential->showItemForm()
  src/CommonGLPI.php:687                             PluginGlpiinventoryIPRange_SNMPCredential::displayTabContentForItem()
  ajax/common.tabs.php:107                           CommonGLPI::displayStandardTab()

[2022-05-11 19:14:04] glpiphplog.WARNING:   *** PHP Warning (2): Undefined array key "snmpcredentials_id" in /var/www/glpi/marketplace/glpiinventory/inc/iprange_snmpcredential.class.php at line 164
  Backtrace :
  ...entory/inc/iprange_snmpcredential.class.php:114 PluginGlpiinventoryIPRange_SNMPCredential->showItemForm()
  src/CommonGLPI.php:687                             PluginGlpiinventoryIPRange_SNMPCredential::displayTabContentForItem()
  ajax/common.tabs.php:107                           CommonGLPI::displayStandardTab()

[2022-05-11 19:14:04] glpiphplog.WARNING:   *** PHP Warning (2): Undefined array key "snmpcredentials_id" in /var/www/glpi/marketplace/glpiinventory/inc/iprange_snmpcredential.class.php at line 221
  Backtrace :
  ...entory/inc/iprange_snmpcredential.class.php:114 PluginGlpiinventoryIPRange_SNMPCredential->showItemForm()
  src/CommonGLPI.php:687                             PluginGlpiinventoryIPRange_SNMPCredential::displayTabContentForItem()
  ajax/common.tabs.php:107                           CommonGLPI::displayStandardTab()

[2022-05-11 19:14:04] glpiphplog.WARNING:   *** PHP Warning (2): Undefined array key "snmpversion" in /var/www/glpi/src/SNMPCredential.php at line 100
  Backtrace :
  ...entory/inc/iprange_snmpcredential.class.php:225 SNMPCredential->getRealVersion()
  ...entory/inc/iprange_snmpcredential.class.php:114 PluginGlpiinventoryIPRange_SNMPCredential->showItemForm()
  src/CommonGLPI.php:687                             PluginGlpiinventoryIPRange_SNMPCredential::displayTabContentForItem()
  ajax/common.tabs.php:107                           CommonGLPI::displayStandardTab()

[2022-05-11 19:14:04] glpiphplog.WARNING:   *** PHP Warning (2): Undefined array key "snmpcredentials_id" in /var/www/glpi/marketplace/glpiinventory/inc/iprange_snmpcredential.class.php at line 221
  Backtrace :
  ...entory/inc/iprange_snmpcredential.class.php:114 PluginGlpiinventoryIPRange_SNMPCredential->showItemForm()
  src/CommonGLPI.php:687                             PluginGlpiinventoryIPRange_SNMPCredential::displayTabContentForItem()
  ajax/common.tabs.php:107                           CommonGLPI::displayStandardTab()

[2022-05-11 19:14:04] glpiphplog.WARNING:   *** PHP Warning (2): Undefined array key "snmpversion" in /var/www/glpi/src/SNMPCredential.php at line 100
  Backtrace :
  ...entory/inc/iprange_snmpcredential.class.php:225 SNMPCredential->getRealVersion()
  ...entory/inc/iprange_snmpcredential.class.php:114 PluginGlpiinventoryIPRange_SNMPCredential->showItemForm()
  src/CommonGLPI.php:687                             PluginGlpiinventoryIPRange_SNMPCredential::displayTabContentForItem()
  ajax/common.tabs.php:107                           CommonGLPI::displayStandardTab()`

Capture1
Capture2

@steph461
Copy link

steph461 commented May 12, 2022

add user SNMP for exmample or create user snmp. Delete blank user
image
image

bug migration maybe

@DYKenoby
Copy link
Author

Good day, and thanks for your answer.
Unfortunatelly result the same:
image

@trasher
Copy link
Collaborator

trasher commented May 17, 2022

You probably had an issue during plugin migration. Restore your database, play the migration again; and check logs at this time.

@DYKenoby
Copy link
Author

DYKenoby commented May 18, 2022

Good day.
I found issue, it's look like sql table was not updated during migration...
I performed migration once again on backup image of 9.5 version with the same result.
Then i made clean installation of glpi 10 on new VM, then i found difference in sql database:
Colum in table "glpi_plugin_glpiinventory_ipranges_snmpcredentials" had old name "plugin_glpiinventory_configsecurities_id" in clean version it is "snmpcredentials_id" so i renamed it:

ALTER TABLE `glpi_plugin_glpiinventory_ipranges_snmpcredentials` CHANGE `plugin_glpiinventory_configsecurities_id` `snmpcredentials_id` INT(10) UNSIGNED NOT NULL DEFAULT '0';

Then new credentials added sucessfully.
image

@brunnersm
Copy link

@DYKenoby thanks for the solution!

@stonebuzz
Copy link
Contributor

I do not reproduce ATM

Maybe an inconsistency database.

I close this issue

feel free to reopen if needed

Best regards

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants