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

Switch Ports API broken in IXP Manager v6 #734

Closed
Belthazaar opened this issue Aug 23, 2021 · 1 comment
Closed

Switch Ports API broken in IXP Manager v6 #734

Belthazaar opened this issue Aug 23, 2021 · 1 comment

Comments

@Belthazaar
Copy link

ISSUE TYPE

Bug Report

OS

Fresh install of :
Ubuntu 20.04.3 LTS

VERSION
define( 'APPLICATION_VERSION', '6.0.0' );
define( 'APPLICATION_VERDATE', '2021071400' );
ENVIRONMENT
# php -v
PHP 8.0.9 (cli) (built: Jul 30 2021 13:03:39) ( NTS )
Copyright (c) The PHP Group
Zend Engine v4.0.9, Copyright (c) Zend Technologies
    with Zend OPcache v8.0.9, Copyright (c), by Zend Technologies

# dpkg -l | grep php
ii  libapache2-mod-php8.0                8.0.9-1+ubuntu20.04.1+deb.sury.org+1                                amd64        server-side, HTML-embedded scripting language (Apache 2 module)
ii  php-common                           2:84+ubuntu20.04.1+deb.sury.org+1                                   all          Common files for PHP packages
ii  php-composer-ca-bundle               1.2.6-1                                                             all          utility library to find a path to the system CA bundle
ii  php-composer-semver                  1.5.1-1                                                             all          utilities, version constraint parsing and validation
ii  php-composer-spdx-licenses           1.5.3-1                                                             all          SPDX licenses list and validation library
ii  php-composer-xdebug-handler          1.4.0-1                                                             all          Restarts a process without Xdebug
ii  php-ds                               1.3.0-6+ubuntu20.04.1+deb.sury.org+1                                amd64        PHP extension providing efficient data structures for PHP 7
ii  php-json-schema                      5.2.9-1                                                             all          implementation of JSON schema
ii  php-memcache                         8.0+4.0.5.2+3.0.9~20170802.e702b5f9+-1+ubuntu20.04.1+deb.sury.org+2 amd64        memcache extension module for PHP
ii  php-memcached                        3.1.5+2.2.0-9+ubuntu20.04.1+deb.sury.org+1                          amd64        memcached extension module for PHP, uses libmemcached
ii  php-psr-container                    1.0.0-2                                                             all          Common Container Interface (PHP FIG PSR-11)
ii  php-psr-log                          1.1.2-1                                                             all          common interface for logging libraries
ii  php-rrd                              2.0.3+1.1.3-1+ubuntu20.04.1+deb.sury.org+1                          amd64        PHP bindings to rrd tool system
ii  php-symfony-console                  4.3.8+dfsg-1ubuntu1                                                 all          run tasks from the command line
ii  php-symfony-filesystem               4.3.8+dfsg-1ubuntu1                                                 all          basic filesystem utilities
ii  php-symfony-finder                   4.3.8+dfsg-1ubuntu1                                                 all          find files and directories
ii  php-symfony-process                  4.3.8+dfsg-1ubuntu1                                                 all          execute commands in sub-processes
ii  php-symfony-service-contracts        1.1.8-1                                                             all          Generic abstractions related to writing services
ii  php-yaml                             2.2.1+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                               8.0.9-1+ubuntu20.04.1+deb.sury.org+1                                all          server-side, HTML-embedded scripting language (metapackage)
ii  php8.0-bcmath                        8.0.9-1+ubuntu20.04.1+deb.sury.org+1                                amd64        Bcmath module for PHP
ii  php8.0-cgi                           8.0.9-1+ubuntu20.04.1+deb.sury.org+1                                amd64        server-side, HTML-embedded scripting language (CGI binary)
ii  php8.0-cli                           8.0.9-1+ubuntu20.04.1+deb.sury.org+1                                amd64        command-line interpreter for the PHP scripting language
ii  php8.0-common                        8.0.9-1+ubuntu20.04.1+deb.sury.org+1                                amd64        documentation, examples and common module for PHP
ii  php8.0-curl                          8.0.9-1+ubuntu20.04.1+deb.sury.org+1                                amd64        CURL module for PHP
ii  php8.0-ds                            1.3.0-6+ubuntu20.04.1+deb.sury.org+1                                amd64        PHP extension providing efficient data structures for PHP 7
ii  php8.0-gd                            8.0.9-1+ubuntu20.04.1+deb.sury.org+1                                amd64        GD module for PHP
ii  php8.0-igbinary                      3.2.4+2.0.8-1+ubuntu20.04.1+deb.sury.org+1                          amd64        igbinary PHP serializer
ii  php8.0-intl                          8.0.9-1+ubuntu20.04.1+deb.sury.org+1                                amd64        Internationalisation module for PHP
ii  php8.0-mbstring                      8.0.9-1+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+-1+ubuntu20.04.1+deb.sury.org+2 amd64        memcache extension module for PHP
ii  php8.0-memcached                     3.1.5+2.2.0-9+ubuntu20.04.1+deb.sury.org+1                          amd64        memcached extension module for PHP, uses libmemcached
ii  php8.0-msgpack                       2.1.2+0.5.7-6+ubuntu20.04.1+deb.sury.org+1                          amd64        PHP extension for interfacing with MessagePack
ii  php8.0-mysql                         8.0.9-1+ubuntu20.04.1+deb.sury.org+1                                amd64        MySQL module for PHP
ii  php8.0-opcache                       8.0.9-1+ubuntu20.04.1+deb.sury.org+1                                amd64        Zend OpCache module for PHP
ii  php8.0-readline                      8.0.9-1+ubuntu20.04.1+deb.sury.org+1                                amd64        readline module for PHP
ii  php8.0-rrd                           2.0.3+1.1.3-1+ubuntu20.04.1+deb.sury.org+1                          amd64        PHP bindings to rrd tool system
ii  php8.0-snmp                          8.0.9-1+ubuntu20.04.1+deb.sury.org+1                                amd64        SNMP module for PHP
ii  php8.0-xml                           8.0.9-1+ubuntu20.04.1+deb.sury.org+1                                amd64        DOM, SimpleXML, XML, and XSL module for PHP
ii  php8.0-yaml                          2.2.1+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                           8.0.9-1+ubuntu20.04.1+deb.sury.org+1                                amd64        Zip module for PHP
CONFIGURATION
# cat .env | egrep -v '(^#|^\s*$|^DB_|^APP_KEY|^HELPDESK|^IDENTITY|^MAIL_|^IXP_API_RIR_PASSWORD|^IXP_API_PEERING_DB_)'
APP_DEBUG=false
APP_URL="http://10.0.2.15"
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

Unable to retrieve the switch ports via the API at /api/v4/switch/{id}/ports

Receive the following internal 500 error: Server Error :: count(): Argument #1 ($value) must be of type Countable|array, null given.

API call works on v5.7.0 but no longer on v6

STEPS TO REPRODUCE

Open api link in browser: /api/v4/switch/1/ports

EXPECTED RESULTS

Json Array filled with switchports

ACTUAL RESULTS

Receive the following internal 500 error: Server Error :: count(): Argument #1 ($value) must be of type Countable|array, null given.

IMPORTANCE

Currently, holding us back from upgrading to v6

RELEVANT LOGS
[2021-08-23 08:35:54] production.ERROR: count(): Argument #1 ($value) must be of type Countable|array, null given {"userId":1,"exception":"[object] (TypeError(code: 0): count(): Argument #1 ($value) must be of type Countable|array, null given at /srv/ixpmanager/app/Models/Aggregators/SwitcherAggregator.php:237)
[stacktrace]
#0 /srv/ixpmanager/app/Models/Aggregators/SwitcherAggregator.php(237): count()
#1 /srv/ixpmanager/app/Http/Controllers/Api/V4/SwitchController.php(62): IXP\\Models\\Aggregators\\SwitcherAggregator::allPorts()
#2 /srv/ixpmanager/vendor/laravel/framework/src/Illuminate/Routing/Controller.php(54): IXP\\Http\\Controllers\\Api\\V4\\SwitchController->ports()
#3 /srv/ixpmanager/vendor/laravel/framework/src/Illuminate/Routing/ControllerDispatcher.php(45): Illuminate\\Routing\\Controller->callAction()
#4 /srv/ixpmanager/vendor/laravel/framework/src/Illuminate/Routing/Route.php(254): Illuminate\\Routing\\ControllerDispatcher->dispatch()
#5 /srv/ixpmanager/vendor/laravel/framework/src/Illuminate/Routing/Route.php(197): Illuminate\\Routing\\Route->runController()
#6 /srv/ixpmanager/vendor/laravel/framework/src/Illuminate/Routing/Router.php(695): Illuminate\\Routing\\Route->run()
#7 /srv/ixpmanager/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(128): Illuminate\\Routing\\Router->Illuminate\\Routing\\{closure}()
#8 /srv/ixpmanager/app/Http/Middleware/AssertUserPrivilege.php(58): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#9 /srv/ixpmanager/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): IXP\\Http\\Middleware\\AssertUserPrivilege->handle()
#10 /srv/ixpmanager/app/Http/Middleware/ApiAuthenticate.php(110): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#11 /srv/ixpmanager/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): IXP\\Http\\Middleware\\ApiAuthenticate->handle()
#12 /srv/ixpmanager/app/Http/Middleware/ControllerEnabled.php(94): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#13 /srv/ixpmanager/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): IXP\\Http\\Middleware\\ControllerEnabled->handle()
#14 /srv/ixpmanager/vendor/laravel/framework/src/Illuminate/Routing/Middleware/SubstituteBindings.php(50): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#15 /srv/ixpmanager/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Illuminate\\Routing\\Middleware\\SubstituteBindings->handle()
#16 /srv/ixpmanager/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/VerifyCsrfToken.php(78): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#17 /srv/ixpmanager/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Illuminate\\Foundation\\Http\\Middleware\\VerifyCsrfToken->handle()
#18 /srv/ixpmanager/vendor/laravel/framework/src/Illuminate/View/Middleware/ShareErrorsFromSession.php(49): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#19 /srv/ixpmanager/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Illuminate\\View\\Middleware\\ShareErrorsFromSession->handle()
#20 /srv/ixpmanager/vendor/laravel/framework/src/Illuminate/Session/Middleware/StartSession.php(121): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#21 /srv/ixpmanager/vendor/laravel/framework/src/Illuminate/Session/Middleware/StartSession.php(64): Illuminate\\Session\\Middleware\\StartSession->handleStatefulRequest()
#22 /srv/ixpmanager/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Illuminate\\Session\\Middleware\\StartSession->handle()
#23 /srv/ixpmanager/vendor/laravel/framework/src/Illuminate/Cookie/Middleware/AddQueuedCookiesToResponse.php(37): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#24 /srv/ixpmanager/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Illuminate\\Cookie\\Middleware\\AddQueuedCookiesToResponse->handle()
#25 /srv/ixpmanager/vendor/laravel/framework/src/Illuminate/Cookie/Middleware/EncryptCookies.php(67): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#26 /srv/ixpmanager/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Illuminate\\Cookie\\Middleware\\EncryptCookies->handle()
#27 /srv/ixpmanager/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(103): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#28 /srv/ixpmanager/vendor/laravel/framework/src/Illuminate/Routing/Router.php(697): Illuminate\\Pipeline\\Pipeline->then()
#29 /srv/ixpmanager/vendor/laravel/framework/src/Illuminate/Routing/Router.php(672): Illuminate\\Routing\\Router->runRouteWithinStack()
#30 /srv/ixpmanager/vendor/laravel/framework/src/Illuminate/Routing/Router.php(636): Illuminate\\Routing\\Router->runRoute()
#31 /srv/ixpmanager/vendor/laravel/framework/src/Illuminate/Routing/Router.php(625): Illuminate\\Routing\\Router->dispatchToRoute()
#32 /srv/ixpmanager/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(166): Illuminate\\Routing\\Router->dispatch()
#33 /srv/ixpmanager/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(128): Illuminate\\Foundation\\Http\\Kernel->Illuminate\\Foundation\\Http\\{closure}()
#34 /srv/ixpmanager/vendor/barryvdh/laravel-debugbar/src/Middleware/InjectDebugbar.php(60): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#35 /srv/ixpmanager/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Barryvdh\\Debugbar\\Middleware\\InjectDebugbar->handle()
#36 /srv/ixpmanager/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/TransformsRequest.php(21): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#37 /srv/ixpmanager/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/ConvertEmptyStringsToNull.php(31): Illuminate\\Foundation\\Http\\Middleware\\TransformsRequest->handle()
#38 /srv/ixpmanager/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Illuminate\\Foundation\\Http\\Middleware\\ConvertEmptyStringsToNull->handle()
#39 /srv/ixpmanager/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/TransformsRequest.php(21): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#40 /srv/ixpmanager/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/TrimStrings.php(40): Illuminate\\Foundation\\Http\\Middleware\\TransformsRequest->handle()
#41 /srv/ixpmanager/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Illuminate\\Foundation\\Http\\Middleware\\TrimStrings->handle()
#42 /srv/ixpmanager/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/ValidatePostSize.php(27): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#43 /srv/ixpmanager/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Illuminate\\Foundation\\Http\\Middleware\\ValidatePostSize->handle()
#44 /srv/ixpmanager/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/PreventRequestsDuringMaintenance.php(86): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#45 /srv/ixpmanager/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Illuminate\\Foundation\\Http\\Middleware\\PreventRequestsDuringMaintenance->handle()
#46 /srv/ixpmanager/vendor/fruitcake/laravel-cors/src/HandleCors.php(52): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#47 /srv/ixpmanager/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Fruitcake\\Cors\\HandleCors->handle()
#48 /srv/ixpmanager/vendor/fideloper/proxy/src/TrustProxies.php(57): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#49 /srv/ixpmanager/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Fideloper\\Proxy\\TrustProxies->handle()
#50 /srv/ixpmanager/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(103): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#51 /srv/ixpmanager/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(141): Illuminate\\Pipeline\\Pipeline->then()
#52 /srv/ixpmanager/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(110): Illuminate\\Foundation\\Http\\Kernel->sendRequestThroughRouter()
#53 /srv/ixpmanager/public/index.php(89): Illuminate\\Foundation\\Http\\Kernel->handle()
#54 {main}
"}
@barryo barryo closed this as completed in cd21e1d Aug 23, 2021
@barryo
Copy link
Member

barryo commented Aug 23, 2021

Thanks @Belthazaar - fixed now and available in the release-v6 branch.

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

2 participants