Details

    • Bug
    • Resolution: Fixed
    • Minor
    • None
    • Professional Edition
    • Discovery

    Description

      Noticed some more errors during discovery

      [2021/09/12 14:55:42 +0200] discovery.php(3583610): Failed dbQuery (#1136 - Column count doesn't match value count at row 1), Query: INSERT INTO `ports` (``)  VALUES () ON DUPLICATE KEY UPDATE `if
      Vrf`=VALUES(`ifVrf`)[2021/09/12 15:44:47 +0200] discovery.php(531954): Failed dbQuery (#1267 - Illegal mix of collations (latin1_general_ci,IMPLICIT) and (utf8_general_ci,COERCIBLE) for operation '='), Query: SELECT 
      `neighbours`.*, UNIX_TIMESTAMP(`last_change`) AS `last_change_unixtime` FROM `neighbours` WHERE `port_id` = '12319601' AND `protocol` = 'lldp' AND `remote_hostname` = 'Dôme SD1' AND `remote_port` 
      = '00 07 5F AE 9B 55 '[2021/09/12 15:38:46 +0200] discovery.php(371725): Failed dbQuery (#1048 - Column 'remote_port' cannot be null), Query: INSERT INTO `neighbours` (`port_id`,`device_id`,`protocol`,`remote_port_id`,
      `remote_hostname`,`remote_port`,`remote_platform`,`remote_version`,`remote_address`,`autodiscovery_id`,`active`)  VALUES ('12292667','797','isdp',NULL,'ebr-swi-ligantes',NULL,NULL,NULL,NULL,NULL,'
      1')
      

      For the first error I am not sure which device caused it
      Second error see attached swidebug1
      Third error see attached swidebug2

      Attachments

        1. neighdebug.txt
          66 kB
          Kent Johannessen
        2. swidebug1.txt
          461 kB
          Kent Johannessen
        3. swidebug2.txt
          334 kB
          Kent Johannessen

        Activity

          [OBS-3865] DB errors during discovery

          Tnx.

          Anyway reset opcache added for future changes.

          landy Mike Stupalov added a comment - Tnx. Anyway reset opcache added for future changes.

          Hmm
          reverted some opcache settings;
          opcache.validate_timestamps=0
          opcache.revalidate_freq=0

          Seems not working with opcache.file_cache ? Not sure. Oh well, case closed!

          kentbjoh Kent Johannessen added a comment - Hmm reverted some opcache settings; opcache.validate_timestamps=0 opcache.revalidate_freq=0 Seems not working with opcache.file_cache ? Not sure. Oh well, case closed!

          It did not.
          I just tried on my test environment however and it works as expected. Opcache is not enabled here!

          Will see if I can find out why it didn't seem to clear!

          kentbjoh Kent Johannessen added a comment - It did not. I just tried on my test environment however and it works as expected. Opcache is not enabled here! Will see if I can find out why it didn't seem to clear!

          ok, added reset opcache in r11592 (when version update detected).

          clear opcache fixed error for you?

          landy Mike Stupalov added a comment - ok, added reset opcache in r11592 (when version update detected). clear opcache fixed error for you?
          kentbjoh Kent Johannessen added a comment - - edited

          Yep, no local changes. Also restarted all services because of opcache

          Edit: speaking of opcache, would it be an idea to do opcache_reset() when update is run? I don't think everyone knows to reload/restart php-fpm / httpd depending on their setup with php opcache

          kentbjoh Kent Johannessen added a comment - - edited Yep, no local changes. Also restarted all services because of opcache Edit: speaking of opcache, would it be an idea to do opcache_reset() when update is run? I don't think everyone knows to reload/restart php-fpm / httpd depending on their setup with php opcache

          Hrm, you sure that you not have local changes, because for your case neighbor should be ignored.

          STDOUT[
          agentIsdpCacheLocalIntf.1.1 = "1/0/1"
          agentIsdpCacheLocalIntf.1.2 = "1/0/1"
          agentIsdpCacheLocalIntf.1.3 = "1/0/1"
          agentIsdpCacheLocalIntf.1.4 = "1/0/1"
          agentIsdpCacheLocalIntf.1.5 = "1/0/1"
          agentIsdpCacheLocalIntf.1.6 = "1/0/1"
          agentIsdpCacheLocalIntf.1.7 = "1/0/1"
          agentIsdpCacheLocalIntf.1.8 = "1/0/1"
          agentIsdpCacheLocalIntf.1.9 = "1/0/1"
          agentIsdpCacheLocalIntf.1.10 = "1/0/1"
          agentIsdpCacheLocalIntf.1.11 = "1/0/1"
          agentIsdpCacheLocalIntf.1.12 = "1/0/1"
          agentIsdpCacheLocalIntf.1.13 = "1/0/1"
          agentIsdpCacheLocalIntf.1.14 = "1/0/1"
          agentIsdpCacheDeviceId.1.1 = "MikroTik - RB750Gr3 - "
          agentIsdpCacheDeviceId.1.2 = "loc-RTR01.fqdn.net"
          agentIsdpCacheDeviceId.1.3 = "loc-RTR02.fqdn.net"
          agentIsdpCacheDeviceId.1.4 = "loc-SWI-ADM01"
          agentIsdpCacheDeviceId.1.5 = "loc-SWI-DC-PROCESSO"
          agentIsdpCacheDeviceId.1.6 = "loc-SWI-ECD-MANUTENCAO"
          agentIsdpCacheDeviceId.1.7 = "loc-SWI-GO"
          agentIsdpCacheDeviceId.1.8 = "loc-SWI-SALA-CONTROLE"
          agentIsdpCacheDeviceId.1.9 = "SEPA89D21484323"
          agentIsdpCacheDeviceId.1.10 = "SEPE4C7226AD30D"
          agentIsdpCacheDeviceId.1.11 = "loc-swi-dc-ta"
          agentIsdpCacheDeviceId.1.12 = "loc-swi-expedicao"
          agentIsdpCacheDeviceId.1.13 = "loc-swi-ligantes"
          agentIsdpCacheDeviceId.1.14 = "loc-swi-manutencao"
          ]
          

                if (safe_empty($isdp['agentIsdpCacheDevicePort']) && safe_empty($isdp['agentIsdpCachePlatform']) &&
                    safe_empty($isdp['agentIsdpCacheAddress']) && safe_empty($isdp['agentIsdpCacheVersion'])) {
                  // All neighbour fields is empty, ignore
                  print_debug("Neighbour ignored: proto[isdp], ".$isdp['agentIsdpCacheDeviceId']);
                  continue;
                }
          

          (safe_empty() is mostly same as empty(), for undefined return true).

          landy Mike Stupalov added a comment - Hrm, you sure that you not have local changes, because for your case neighbor should be ignored. STDOUT[ agentIsdpCacheLocalIntf.1.1 = "1/0/1" agentIsdpCacheLocalIntf.1.2 = "1/0/1" agentIsdpCacheLocalIntf.1.3 = "1/0/1" agentIsdpCacheLocalIntf.1.4 = "1/0/1" agentIsdpCacheLocalIntf.1.5 = "1/0/1" agentIsdpCacheLocalIntf.1.6 = "1/0/1" agentIsdpCacheLocalIntf.1.7 = "1/0/1" agentIsdpCacheLocalIntf.1.8 = "1/0/1" agentIsdpCacheLocalIntf.1.9 = "1/0/1" agentIsdpCacheLocalIntf.1.10 = "1/0/1" agentIsdpCacheLocalIntf.1.11 = "1/0/1" agentIsdpCacheLocalIntf.1.12 = "1/0/1" agentIsdpCacheLocalIntf.1.13 = "1/0/1" agentIsdpCacheLocalIntf.1.14 = "1/0/1" agentIsdpCacheDeviceId.1.1 = "MikroTik - RB750Gr3 - " agentIsdpCacheDeviceId.1.2 = "loc-RTR01.fqdn.net" agentIsdpCacheDeviceId.1.3 = "loc-RTR02.fqdn.net" agentIsdpCacheDeviceId.1.4 = "loc-SWI-ADM01" agentIsdpCacheDeviceId.1.5 = "loc-SWI-DC-PROCESSO" agentIsdpCacheDeviceId.1.6 = "loc-SWI-ECD-MANUTENCAO" agentIsdpCacheDeviceId.1.7 = "loc-SWI-GO" agentIsdpCacheDeviceId.1.8 = "loc-SWI-SALA-CONTROLE" agentIsdpCacheDeviceId.1.9 = "SEPA89D21484323" agentIsdpCacheDeviceId.1.10 = "SEPE4C7226AD30D" agentIsdpCacheDeviceId.1.11 = "loc-swi-dc-ta" agentIsdpCacheDeviceId.1.12 = "loc-swi-expedicao" agentIsdpCacheDeviceId.1.13 = "loc-swi-ligantes" agentIsdpCacheDeviceId.1.14 = "loc-swi-manutencao" ] if (safe_empty( $isdp [ 'agentIsdpCacheDevicePort' ]) && safe_empty( $isdp [ 'agentIsdpCachePlatform' ]) && safe_empty( $isdp [ 'agentIsdpCacheAddress' ]) && safe_empty( $isdp [ 'agentIsdpCacheVersion' ])) { // All neighbour fields is empty, ignore print_debug( "Neighbour ignored: proto[isdp], " . $isdp [ 'agentIsdpCacheDeviceId' ]); continue ; } (safe_empty() is mostly same as empty(), for undefined return true).

          See attached

          kentbjoh Kent Johannessen added a comment - See attached

          Hrm, here seems little different snmp data, debug neighbors pls:

          ./discovery.php -m neighbours -h <device>
          

          landy Mike Stupalov added a comment - Hrm, here seems little different snmp data, debug neighbors pls: ./discovery.php -m neighbours -h <device>

          Seems to still have the isdp issue

          [2021/09/13 22:52:04 +0200] discovery.php(2356105): Failed dbQuery (#1048 - Column 'remote_port' cannot be null), Query: INSERT INTO `neighbours` (`port_id`,`device_id`,`protocol`,`remote_port_id`,`remote_hostname`,`remote_port`,`remote_platform`,`remote_version`,`remote_address`,`autodiscovery_id`,`active`)  VALUES ('12292667','797','isdp',NULL,'swi-manutencao',NULL,NULL,NULL,NULL,'946','1')
          

          kentbjoh Kent Johannessen added a comment - Seems to still have the isdp issue [ 2021 / 09 / 13 22 : 52 : 04 + 0200 ] discovery.php( 2356105 ): Failed dbQuery (# 1048 - Column 'remote_port' cannot be null ), Query: INSERT INTO `neighbours` (`port_id`,`device_id`,`protocol`,`remote_port_id`,`remote_hostname`,`remote_port`,`remote_platform`,`remote_version`,`remote_address`,`autodiscovery_id`,`active`) VALUES ( '12292667' , '797' , 'isdp' ,NULL, 'swi-manutencao' ,NULL,NULL,NULL,NULL, '946' , '1' )

          2nd issue also fixed in r11587.

          landy Mike Stupalov added a comment - 2nd issue also fixed in r11587.

          People

            landy Mike Stupalov
            kentbjoh Kent Johannessen
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: