inex / IXP-Manager

Full stack web application powering peering at over 200 Internet Exchange Points (IXPs) globally.
https://www.ixpmanager.org/
GNU General Public License v2.0
379 stars 164 forks source link

`/switch/store-by-snmp` fails with error 405 #905

Open rfc1036 opened 3 months ago

rfc1036 commented 3 months ago
ISSUE TYPE

Bug Report

OS

Ubuntu 24.04 LTS

VERSION
define( 'APPLICATION_VERSION', '6.4.1' );
define( 'APPLICATION_VERDATE', '2024060900' );
ENVIRONMENT
PHP 8.3.6 (cli) (built: Jun 13 2024 15:23:20) (NTS)
Copyright (c) The PHP Group
Zend Engine v4.3.6, Copyright (c) Zend Technologies
    with Zend OPcache v8.3.6, Copyright (c), by Zend Technologies

ii  php-common                                       2:93ubuntu2                                   all          Common files for PHP packages
ii  php-pear                                         1:1.10.13+submodules+notgz+2022032202-2build1 all          PEAR Base System
ii  php8.3                                           8.3.6-0ubuntu0.24.04.1                        all          server-side, HTML-embedded scripting language (metapackage)
ii  php8.3-bcmath                                    8.3.6-0ubuntu0.24.04.1                        amd64        Bcmath module for PHP
ii  php8.3-cli                                       8.3.6-0ubuntu0.24.04.1                        amd64        command-line interpreter for the PHP scripting language
ii  php8.3-common                                    8.3.6-0ubuntu0.24.04.1                        amd64        documentation, examples and common module for PHP
ii  php8.3-curl                                      8.3.6-0ubuntu0.24.04.1                        amd64        CURL module for PHP
ii  php8.3-fpm                                       8.3.6-0ubuntu0.24.04.1                        amd64        server-side, HTML-embedded scripting language (FPM-CGI binary)
ii  php8.3-gd                                        8.3.6-0ubuntu0.24.04.1                        amd64        GD module for PHP
ii  php8.3-igbinary                                  3.2.13-1ubuntu3                               amd64        igbinary PHP serializer
ii  php8.3-intl                                      8.3.6-0ubuntu0.24.04.1                        amd64        Internationalisation module for PHP
ii  php8.3-mbstring                                  8.3.6-0ubuntu0.24.04.1                        amd64        MBSTRING module for PHP
ii  php8.3-memcache                                  8.0+4.0.5.2+3.0.9~20170802.e702b5f9+-8ubuntu1 amd64        memcache extension module for PHP
ii  php8.3-memcached                                 3.2.0+2.2.0-4ubuntu3                          amd64        memcached extension module for PHP, uses libmemcached
ii  php8.3-msgpack                                   1:2.2.0~rc2-3ubuntu1                          amd64        PHP extension for interfacing with MessagePack
ii  php8.3-mysql                                     8.3.6-0ubuntu0.24.04.1                        amd64        MySQL module for PHP
ii  php8.3-opcache                                   8.3.6-0ubuntu0.24.04.1                        amd64        Zend OpCache module for PHP
ii  php8.3-readline                                  8.3.6-0ubuntu0.24.04.1                        amd64        readline module for PHP
ii  php8.3-rrd                                       2.0.3+1.1.3-7ubuntu3                          amd64        PHP bindings to rrd tool system
ii  php8.3-snmp                                      8.3.6-0ubuntu0.24.04.1                        amd64        SNMP module for PHP
ii  php8.3-xml                                       8.3.6-0ubuntu0.24.04.1                        amd64        DOM, SimpleXML, XML, and XSL module for PHP
ii  php8.3-yaml                                      2.2.2+2.1.0+2.0.4+1.3.2-6ubuntu1              amd64        YAML-1.1 parser and emitter for PHP
ii  php8.3-zip                                       8.3.6-0ubuntu0.24.04.1                        amd64        Zip module for PHP
CONFIGURATION
APP_DEBUG=false
APP_URL="https://manager.minap.it"
APP_TIMEZONE="Europe/Rome"
APP_LOG="daily"
APP_LOG_LEVEL=debug
IXP_RESELLER_ENABLED=false
IXP_AS112_UI_ACTIVE=false
IXP_FE_FRONTEND_DISABLED_LOGO=false
IXP_FE_FRONTEND_DISABLED_PEERING_MATRIX=true
GRAPHER_BACKENDS="mrtg"
GRAPHER_CACHE_ENABLED=true
GRAPHER_BACKEND_MRTG_DBTYPE="rrd"
GRAPHER_BACKEND_MRTG_WORKDIR="/var/lib/mrtg/"
GRAPHER_BACKEND_MRTG_LOGDIR="/var/lib/mrtg/"
IXP_API_JSONEXPORTSCHEMA_PUBLIC=true
VIEW_SKIN="minap"
VIEW_SMARTY_SKIN="minap"
CACHE_DRIVER=memcached
SESSION_DRIVER=memcached
DOCTRINE_PROXY_AUTOGENERATE=true
DOCTRINE_CACHE=memcached
DOCTRINE_CACHE_NAMESPACE=IXPMANAGERNAMESPACE
IXP_IRRDB_BGPQ3_PATH=/usr/bin/bgpq3
AUTH_PEERINGDB_ENABLED=true
PEERINGDB_OAUTH_CLIENT_ID="..."
PEERINGDB_OAUTH_CLIENT_SECRET="..."
PEERINGDB_OAUTH_REDIRECT="https://manager.minap.it/auth/login/peeringdb/callback"
IXP_FE_FRONTEND_DISABLED_CONSOLE=true
IXP_FE_FRONTEND_DISABLED_CUSTKIT=true
IXP_FE_FRONTEND_DISABLED_LOOKING_GLASS=false
IXP_FE_FRONTEND_DISABLED_FILTERED_PREFIXES=true
IXP_FE_LAYER2_ADDRESSES_CUST_CAN_EDIT=true
IXP_FE_LAYER2_ADDRESSES_CUST_PARAMS_MIN_ADDRESSES=1
IXP_FE_LAYER2_ADDRESSES_CUST_PARAMS_MAX_ADDRESSES=2
IXP_FE_LAYER2_ADDRESSES_EMAIL_ON_CUSTOMER_CHANGE=true
IXP_FE_LAYER2_ADDRESSES_EMAIL_ON_SUPERUSER_CHANGE=false
IXP_FE_LAYER2_ADDRESSES_EMAIL_ON_CHANGE_DEST="noc@minap.it"
GRAPHER_ACCESS_IXP=0
GRAPHER_ACCESS_SWITCH=0
GRAPHER_ACCESS_CUSTOMER=1
GRAPHER_ACCESS_TRUNK=0
TELESCOPE_ENABLED=false
SUMMARY

Trying to add by SNMP an unreachable switch fails with error 405.

STEPS TO REPRODUCE
EXPECTED RESULTS

One of these steps should at least provide some kind of user-friendly error instead of an HTTP error page.

ACTUAL RESULTS

I get a plain white page with:

The server returned a "405 Method Not Allowed".

IMPORTANCE

Major: I am unable to add the new switches.

RELEVANT LOGS
[2024-08-23 08:40:04] laravel.WARNING: Creation of dynamic property OSS_SNMP\SNMP::$_resultCache is deprecated in /srv/ixpmanager/vendor/opensolutions/oss-snmp/src/OSS_SNMP/SNMP.php on line 769  
[2024-08-23 08:40:24] laravel.WARNING: Return type of Foil\Template\Stack::count() should either be compatible with Countable::count(): int, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /srv/ixpmanager/vendor/foil/foil/src/Template/Stack.php on line 86  

(No stack traces because of #903.)

rfc1036 commented 3 months ago

After switching to PHP 8.0 I have been able to add new switches, but I am still getting these errors in the log.

If anybody else incautiously upgraded to Ubuntu 24.04 then they can easily add back PHP 8.0 with something like:

/etc/apt/sources.list.d/ondrej.list:

deb http://ppa.launchpad.net/ondrej/php/ubuntu noble main

/etc/apt/preferences.d/pin-php:

# do not install by default from the PPA
Package: *
Pin: release o=LP-PPA-ondrej-php
Pin-Priority: 100

# but allow installing this php-common if needed
Package: php-common
Pin: release o=LP-PPA-ondrej-php
Pin-Priority: 990
apt update
apt install $(dpkg -l | awk '/ php8\.3-/ {print $2}' | sed -re 's/^php8\.3-/php8.0-/') php8.0-mcrypt
a2disconf php8.3-fpm
a2enconf php8.0-fpm
systemctl reload apache2.service
nickhilliard commented 2 months ago

IXP Manager v6.x isn't supported on ubuntu 24.04.

IXP Manager v7.x is currently in development, and will use ubuntu 24.04 as the baseline platform, so it would be better to wait until 7.x is released before upgrading to ubuntu 24.04.

The bug in this issue is that there should be more graceful exception handling for switch discovery using snmp. We'll get this fixed.