inex / IXP-Manager

Full stack web application powering peering at over 200 Internet Exchange Points (IXPs) globally.

Home Page:https://www.ixpmanager.org/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Cannot add Cumulus Linux 4.3.0 Switch

labrack opened this issue · comments

ISSUE TYPE

Bug Report

OS

Ubuntu 20.04

VERSION
redacted@portal:/srv/ixpmanager$ cat version.php | grep APPLICATION
define( 'APPLICATION_VERSION', '6.3.0' );
define( 'APPLICATION_VERDATE', '2022110200' );
ENVIRONMENT
redacted@portal:~$ php -v
PHP 8.0.27 (cli) (built: Jan 13 2023 10:42:52) ( NTS )
Copyright (c) The PHP Group
Zend Engine v4.0.27, Copyright (c) Zend Technologies
    with Zend OPcache v8.0.27, Copyright (c), by Zend Technologies

redacted@portal:~$ dpkg -l | grep php
ii  libapache2-mod-php8.0                 1:8.0.27-2+ubuntu20.04.1+deb.sury.org+1                             amd64        server-side, HTML-embedded scripting language (Apache 2 module)
ii  php-common                            2:93+ubuntu20.04.1+deb.sury.org+2                                   all          Common files for PHP packages
ii  php8.0                                1:8.0.27-2+ubuntu20.04.1+deb.sury.org+1                             all          server-side, HTML-embedded scripting language (metapackage)
ii  php8.0-bcmath                         1:8.0.27-2+ubuntu20.04.1+deb.sury.org+1                             amd64        Bcmath module for PHP
ii  php8.0-cgi                            1:8.0.27-2+ubuntu20.04.1+deb.sury.org+1                             amd64        server-side, HTML-embedded scripting language (CGI binary)
ii  php8.0-cli                            1:8.0.27-2+ubuntu20.04.1+deb.sury.org+1                             amd64        command-line interpreter for the PHP scripting language
ii  php8.0-common                         1:8.0.27-2+ubuntu20.04.1+deb.sury.org+1                             amd64        documentation, examples and common module for PHP
ii  php8.0-curl                           1:8.0.27-2+ubuntu20.04.1+deb.sury.org+1                             amd64        CURL module for PHP
ii  php8.0-ds                             1.4.0-5+ubuntu20.04.1+deb.sury.org+1                                amd64        PHP extension providing efficient data structures for PHP 7
ii  php8.0-gd                             1:8.0.27-2+ubuntu20.04.1+deb.sury.org+1                             amd64        GD module for PHP
ii  php8.0-igbinary                       3.2.12+2.0.8-2+ubuntu20.04.1+deb.sury.org+1                         amd64        igbinary PHP serializer
ii  php8.0-intl                           1:8.0.27-2+ubuntu20.04.1+deb.sury.org+1                             amd64        Internationalisation module for PHP
ii  php8.0-mbstring                       1:8.0.27-2+ubuntu20.04.1+deb.sury.org+1                             amd64        MBSTRING module for PHP
ii  php8.0-memcache                       8.0+4.0.5.2+3.0.9~20170802.e702b5f9+-8+ubuntu20.04.1+deb.sury.org+1 amd64        memcache extension module for PHP
ii  php8.0-memcached                      3.2.0+2.2.0-3+ubuntu20.04.1+deb.sury.org+1                          amd64        memcached extension module for PHP, uses libmemcached
ii  php8.0-msgpack                        1:2.1.2-1+ubuntu20.04.1+deb.sury.org+1                              amd64        PHP extension for interfacing with MessagePack
ii  php8.0-mysql                          1:8.0.27-2+ubuntu20.04.1+deb.sury.org+1                             amd64        MySQL module for PHP
ii  php8.0-opcache                        1:8.0.27-2+ubuntu20.04.1+deb.sury.org+1                             amd64        Zend OpCache module for PHP
ii  php8.0-readline                       1:8.0.27-2+ubuntu20.04.1+deb.sury.org+1                             amd64        readline module for PHP
ii  php8.0-rrd                            2.0.3+1.1.3-7+ubuntu20.04.1+deb.sury.org+1                          amd64        PHP bindings to rrd tool system
ii  php8.0-snmp                           1:8.0.27-2+ubuntu20.04.1+deb.sury.org+1                             amd64        SNMP module for PHP
ii  php8.0-xml                            1:8.0.27-2+ubuntu20.04.1+deb.sury.org+1                             amd64        DOM, SimpleXML, XML, and XSL module for PHP
ii  php8.0-yaml                           2.2.2+2.1.0+2.0.4+1.3.2-6+ubuntu20.04.1+deb.sury.org+1              amd64        YAML-1.1 parser and emitter for PHP
ii  php8.0-zip                            1:8.0.27-2+ubuntu20.04.1+deb.sury.org+1                             amd64        Zip module for PHP
CONFIGURATION
redacted@portal:/srv/ixpmanager$ cat .env | egrep -v '(^#|^\s*$|^DB_|^APP_KEY|^HELPDESK|^IDENTITY|^MAIL_|^IXP_API_RIR_PASSWORD|^IXP_API_PEERING_DB_)'
APP_DEBUG=false
APP_URL="https://portal.redacted.net"
APP_TIMEZONE="UTC"
APP_LOG="single"
IXP_RESELLER_ENABLED=false
IXP_AS112_UI_ACTIVE=false
IXP_FE_FRONTEND_DISABLED_LOGO=false
GRAPHER_BACKENDS="dummy"
GRAPHER_CACHE_ENABLED=true
GRAPHER_BACKEND_MRTG_DBTYPE="rrd"
IXP_API_JSONEXPORTSCHEMA_PUBLIC=true
CACHE_DRIVER=memcached
IXP_IRRDB_BGPQ3_PATH=/usr/bin/bgpq3
SUMMARY

When attempting to add a new switch that's running Cumulus Linux 4.3.0, I get a 500 error: Undefined array key 1

Laravel logs appear to point to line 44 in vendor_cumulus.php, a part of the OSS_SNMP library, however I polled the switch and ran it through the preg_match that OSS_SNMP uses, and there is definitely an index 1 in the $matches array, so I'm not sure what's going on.

redacted@portal:~$ snmpget -c redacted -v 2c someswitch.redacted.net .1.3.6.1.2.1.1.1.0
iso.3.6.1.2.1.1.1.0 = STRING: "Cumulus-Linux 4.3.0 (Linux Kernel 4.19.149-1+cl4.3u1)"

redacted@portal:~$ php -a
Interactive mode enabled

php > $sysDescr = 'Cumulus-Linux 4.3.0 (Linux Kernel 4.19.149-1+cl4.3u1)';
php > preg_match( '/Cumulus.Linux\s+([\d\.]+)\s+/', $sysDescr, $matches );
php > print_r($matches);
Array
(
    [0] => Cumulus-Linux 4.3.0
    [1] => 4.3.0
)
STEPS TO REPRODUCE

Navigate to https://$APP_URL/switch/create-by-snmp, enter resolvable host name and proper snmp v2c community, click the "next" button. Application error message immediately pops up.

EXPECTED RESULTS

Expected the switch to be added properly

ACTUAL RESULTS

Application error "500 Server Error :: Undefined array key 1" appears on screen.

IMPORTANCE

This is on a replacement server we're spinning up. No direct production impact

RELEVANT LOGS

See laravel log file at here

A moment after I posted this, I decided to compare the vendor_cumulus.php script included in the current version of ixpmanager to the script in the actual OSS_SNMP repo on github, and it looks like the version shipping with ixpmanager is behind and doesnt include the fix from opensolutions/OSS_SNMP#68

What's the best way (see: "won't break the next time I upgrade ixpmanager", hehe) to get that updated on my server? Hand-edit it? Wait for a patch?

triage: need to tag v1.0.3 on https://github.com/opensolutions/OSS_SNMP and update composer vendors.

@labrack: we'll get this fixed and added to https://github.com/inex/IXP-Manager/tree/release-v6. In the mean time, you could manually patch the file in OSS_SNMP - it was an annoying one-char change from the cumulus people, for no apparent reason, pfft

Now live in release-v6 branch.