FOSSBilling \ Exception
Product not found FOSSBilling\Exception thrown with message "Product not found" Stacktrace: #7 FOSSBilling\Exception in /var/www/html/modules/Product/Api/Guest.php:83 #6 Box\Mod\Product\Api\Guest:get in /var/www/html/library/Api/Handler.php:111 #5 Api_Handler:__call in /var/www/html/modules/Order/Controller/Client.php:45 #4 Box\Mod\Order\Controller\Client:get_configure_product_by_slug in [internal]:0 #3 ReflectionMethod:invokeArgs in /var/www/html/library/Box/App.php:194 #2 Box_App:executeShared in /var/www/html/library/Box/App.php:331 #1 Box_App:processRequest in /var/www/html/library/Box/App.php:133 #0 Box_App:run in /var/www/html/index.php:109
Stack frames (8)
7
FOSSBilling\Exception
/modules/Product/Api/Guest.php:83
6
Box\Mod\Product\Api\Guest get
/library/Api/Handler.php:111
5
Api_Handler __call
/modules/Order/Controller/Client.php:45
4
Box\Mod\Order\Controller\Client get_configure_product_by_slug
[internal]:0
3
ReflectionMethod invokeArgs
/library/Box/App.php:194
2
Box_App executeShared
/library/Box/App.php:331
1
Box_App processRequest
/library/Box/App.php:133
0
Box_App run
/index.php:109
/var/www/html/modules/Product/Api/Guest.php
     * @throws \FOSSBilling\Exception
     */
    public function get($data)
    {
        if (!isset($data['id']) && !isset($data['slug'])) {
            throw new \FOSSBilling\Exception('Product ID or slug is missing');
        }
 
        $id = $data['id'] ?? null;
        $slug = $data['slug'] ?? null;
 
        $service = $this->getService();
        if ($id) {
            $model = $service->findOneActiveById($id);
        } else {
            $model = $service->findOneActiveBySlug($slug);
        }
 
        if (!$model instanceof \Model_Product) {
            throw new \FOSSBilling\Exception('Product not found');
        }
 
        return $service->toApiArray($model);
    }
 
    /**
     * Get paginated list of product categories.
     *
     * @return array
     */
    public function category_get_list($data)
    {
        $data['status'] = 'enabled';
        $service = $this->getService();
        [$sql, $params] = $service->getProductCategorySearchQuery($data);
        $per_page = $data['per_page'] ?? $this->di['pager']->getDefaultPerPage();
        $pager = $this->di['pager']->getPaginatedResultSet($sql, $params, $per_page);
        foreach ($pager['list'] as $key => $item) {
            $category = $this->di['db']->getExistingModelById('ProductCategory', $item['id'], 'Product category not found');
            $pager['list'][$key] = $this->getService()->toProductCategoryApiArray($category, true, $this->getIdentity());
Arguments
  1. "Product not found"
    
/var/www/html/library/Api/Handler.php
        $api->setDi($this->di);
        $api->setMod($bb_mod);
        $api->setIdentity($this->identity);
        $api->setIp($this->di['request']->getClientIp());
        if ($bb_mod->hasService()) {
            $api->setService($this->di['mod_service']($mod));
        }
 
        if (!method_exists($api, $method_name) || !is_callable([$api, $method_name])) {
            $reflector = new ReflectionClass($api);
            if (!$reflector->hasMethod('__call')) {
                throw new FOSSBilling\Exception(':type API call :method does not exist in module :module', [':type' => ucfirst((string) $this->type), ':method' => $method_name, ':module' => $mod], 740);
            }
        }
 
        $data = is_array($arguments) ? $arguments : [];
 
        $this->validateRequiredParams($api, $method_name, $data);
 
        return $api->{$method_name}($arguments);
    }
 
    /**
     * Validate required parameters for an API method using attributes.
     *
     * @param Api_Abstract $api         The API instance
     * @param string       $method_name The method name
     * @param array        $data        The data array passed to the method
     *
     * @throws FOSSBilling\InformationException If required parameters are missing
     */
    public function validateRequiredParams(Api_Abstract $api, string $method_name, array $data): void
    {
        try {
            $reflection = new ReflectionMethod($api, $method_name);
        } catch (ReflectionException) {
            // Method doesn't exist, skip validation
            return;
        }
 
Arguments
  1. array:1 [
      "slug" => "managed-wordpress"
    ]
    
/var/www/html/modules/Order/Controller/Client.php
    }
 
    public function register(\Box_App &$app): void
    {
        $app->get('/order', 'get_products', [], static::class);
        $app->get('/order/service', 'get_orders', [], static::class);
        $app->get('/order/:id', 'get_configure_product', ['id' => '[0-9]+'], static::class);
        $app->get('/order/:slug', 'get_configure_product_by_slug', ['slug' => '[a-z0-9-]+'], static::class);
        $app->get('/order/service/manage/:id', 'get_order', ['id' => '[0-9]+'], static::class);
    }
 
    public function get_products(\Box_App $app): string
    {
        return $app->render('mod_order_index');
    }
 
    public function get_configure_product_by_slug(\Box_App $app, $slug): string
    {
        $api = $this->di['api_guest'];
        $product = $api->product_get(['slug' => $slug]);
        $tpl = 'mod_service' . $product['type'] . '_order';
        if ($api->system_template_exists(['file' => $tpl . '.html.twig'])) {
            return $app->render($tpl, ['product' => $product]);
        }
 
        return $app->render('mod_order_product', ['product' => $product]);
    }
 
    public function get_configure_product(\Box_App $app, $id): string
    {
        $api = $this->di['api_guest'];
        $product = $api->product_get(['id' => $id]);
        $tpl = 'mod_service' . $product['type'] . '_order';
        if ($api->system_template_exists(['file' => $tpl . '.html.twig'])) {
            return $app->render($tpl, ['product' => $product]);
        }
 
        return $app->render('mod_order_product', ['product' => $product]);
    }
 
Arguments
  1. "product_get"
    
  2. array:1 [
      "slug" => "managed-wordpress"
    ]
    
[internal]
Arguments
  1. Box_AppClient {#184}
    
  2. "managed-wordpress"
    
/var/www/html/library/Box/App.php
 
        $timeCollector->startMeasure('executeShared', 'Reflecting module controller (shared mapping)');
        $class = new $classname();
        if ($class instanceof InjectionAwareInterface) {
            $class->setDi($this->di);
        }
        $reflection = new ReflectionMethod($class::class, $methodName);
        $args = [];
        $args[] = $this; // first param always app instance
 
        foreach ($reflection->getParameters() as $param) {
            if (isset($params[$param->name])) {
                $args[$param->name] = $params[$param->name];
            } elseif ($param->isDefaultValueAvailable()) {
                $args[$param->name] = $param->getDefaultValue();
            }
        }
        $timeCollector->stopMeasure('executeShared');
 
        return $reflection->invokeArgs($class, $args);
    }
 
    protected function execute($methodName, $params, $classname = null): string
    {
        /** @var TimeDataCollector $timeCollector */
        $timeCollector = $this->debugBar->getCollector('time');
 
        $timeCollector->startMeasure('execute', 'Reflecting module controller');
 
        $reflection = new ReflectionMethod(static::class, $methodName);
        $args = [];
 
        foreach ($reflection->getParameters() as $param) {
            if (isset($params[$param->name])) {
                $args[$param->name] = $params[$param->name];
            } elseif ($param->isDefaultValueAvailable()) {
                $args[$param->name] = $param->getDefaultValue();
            }
        }
 
Arguments
  1. Box\Mod\Order\Controller\Client {#387}
    
  2. array:2 [
      0 => Box_AppClient {#184}
      "slug" => "managed-wordpress"
    ]
    
/var/www/html/library/Box/App.php
 
                    return '';
                }
 
                return $this->render('mod_system_maintenance');
            }
        }
 
        /** @var TimeDataCollector $timeCollector */
        $timeCollector = $this->debugBar->getCollector('time');
 
        $timeCollector->startMeasure('sharedMapping', 'Checking shared mappings');
        $sharedCount = count($this->shared);
        for ($i = 0; $i < $sharedCount; ++$i) {
            $mapping = $this->shared[$i];
            $url = new Box_UrlHelper($mapping[0], $mapping[1], $mapping[3], $this->url);
            if ($url->match) {
                $timeCollector->stopMeasure('sharedMapping');
 
                return $this->executeShared($mapping[4], $mapping[2], $url->params);
            }
        }
        $timeCollector->stopMeasure('sharedMapping');
 
        // this class mappings
        $timeCollector->startMeasure('mapping', 'Checking mappings');
        $mappingsCount = count($this->mappings);
        for ($i = 0; $i < $mappingsCount; ++$i) {
            $mapping = $this->mappings[$i];
            $url = new Box_UrlHelper($mapping[0], $mapping[1], $mapping[3], $this->url);
            if ($url->match) {
                $timeCollector->stopMeasure('mapping');
 
                return $this->execute($mapping[2], $url->params);
            }
        }
        $timeCollector->stopMeasure('mapping');
 
        $e = new FOSSBilling\InformationException('Page :url not found', [':url' => $this->url], 404);
 
Arguments
  1. "Box\Mod\Order\Controller\Client"
    
  2. "get_configure_product_by_slug"
    
  3. array:1 [
      "slug" => "managed-wordpress"
    ]
    
/var/www/html/library/Box/App.php
    }
 
    public function run(): string
    {
        /** @var TimeDataCollector $timeCollector */
        $timeCollector = $this->debugBar->getCollector('time');
 
        $timeCollector->startMeasure('registerModule', 'Registering module routes');
        $this->registerModule();
        $timeCollector->stopMeasure('registerModule');
 
        $timeCollector->startMeasure('init', 'Initializing the app');
        $this->init();
        $timeCollector->stopMeasure('init');
 
        $timeCollector->startMeasure('checkperm', 'Checking access to module');
        $this->checkPermission();
        $timeCollector->stopMeasure('checkperm');
 
        return $this->processRequest();
    }
 
    /**
     * @param string $path
     */
    public function redirect($path): never
    {
        $location = $this->di['url']->link($path);
        header("Location: $location");
        exit;
    }
 
    public function render($fileName, $variableArray = []): string
    {
        return 'Rendering ' . $fileName;
    }
 
    public function sendFile($filename, $contentType, $path): false|int
    {
        header("Content-type: $contentType");
/var/www/html/index.php
 
// If HTTP error code has been passed, handle it.
if (!is_null($http_err_code)) {
    switch ($http_err_code) {
        case '404':
            $e = new FOSSBilling\Exception('Page :url not found', [':url' => $url], 404);
            echo $app->show404($e);
 
            break;
        default:
            $http_err_code = intval($http_err_code);
            http_response_code($http_err_code);
            $e = new FOSSBilling\Exception('HTTP Error :err_code occurred while attempting to load :url', [':err_code' => $http_err_code, ':url' => $url], $http_err_code);
            echo $app->render('error', ['exception' => $e]);
    }
    exit;
}
 
// If no HTTP error passed, run the app.
echo $app->run();
exit;
 

Environment & details:

Key Value
PHP Version
"8.3.30"
Error code
0
Instance ID
"CVC-FB-a1b2c3d4e5f6g7h8"
Key Value
_url
"/order/managed-wordpress"
empty
empty
empty
empty
Key Value
REDIRECT_HTTP_AUTHORIZATION
""
REDIRECT_STATUS
"200"
HTTP_AUTHORIZATION
""
HTTP_HOST
"hosting.cvcstaging.com"
HTTP_USER_AGENT
"Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; [email protected])"
HTTP_ACCEPT
"*/*"
HTTP_ACCEPT_ENCODING
"gzip, br"
HTTP_CDN_LOOP
"cloudflare; loops=1"
HTTP_CF_CONNECTING_IP
"216.73.216.30"
HTTP_CF_IPCOUNTRY
"US"
HTTP_CF_RAY
"9dbc3942088fa8fe-CMH"
HTTP_CF_VISITOR
"{"scheme":"https"}"
HTTP_X_FORWARDED_FOR
"104.23.197.192"
HTTP_X_FORWARDED_HOST
"hosting.cvcstaging.com"
HTTP_X_FORWARDED_PORT
"443"
HTTP_X_FORWARDED_PROTO
"https"
HTTP_X_FORWARDED_SERVER
"beast"
HTTP_X_REAL_IP
"104.23.197.192"
PATH
"/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
SERVER_SIGNATURE
"<address>Apache/2.4.66 (Debian) Server at hosting.cvcstaging.com Port 80</address>\n"
SERVER_SOFTWARE
"Apache/2.4.66 (Debian)"
SERVER_NAME
"hosting.cvcstaging.com"
SERVER_ADDR
"172.19.0.16"
SERVER_PORT
"80"
REMOTE_ADDR
"172.19.0.1"
DOCUMENT_ROOT
"/var/www/html"
REQUEST_SCHEME
"http"
CONTEXT_PREFIX
""
CONTEXT_DOCUMENT_ROOT
"/var/www/html"
SERVER_ADMIN
"webmaster@localhost"
SCRIPT_FILENAME
"/var/www/html/index.php"
REMOTE_PORT
"60174"
REDIRECT_URL
"/order/managed-wordpress"
GATEWAY_INTERFACE
"CGI/1.1"
SERVER_PROTOCOL
"HTTP/1.1"
REQUEST_METHOD
"GET"
QUERY_STRING
""
REQUEST_URI
"/order/managed-wordpress"
SCRIPT_NAME
"/index.php"
PHP_SELF
"/index.php"
REQUEST_TIME_FLOAT
1773417334.1645
REQUEST_TIME
1773417334
argv
[]
argc
0
Key Value
REDIS_PASSWORD
"SharedRedis2026Beast!"
HOSTNAME
"7fb9e2a04a84"
PHP_VERSION
"8.3.30"
APACHE_CONFDIR
"/etc/apache2"
REDIS_HOST
"shared-redis"
PHP_INI_DIR
"/usr/local/etc/php"
GPG_KEYS
"1198C0117593497A5EC5C199286AF1F9897469DC C28D937575603EB4ABB725861C0779DC5C0A9DE4 AFD8691FDAEDF03BDF6E460563F15A9B715376CA"
PHP_LDFLAGS
"-Wl,-O1 -pie"
PWD
"/var/www/html"
NODE_ENV
"production"
DB_PORT
"3306"
DB_USER
"fossbilling_staging"
APACHE_LOG_DIR
"/var/log/apache2"
LANG
"C"
APP_URL
"https://hosting.cvcstaging.com"
PHP_SHA256
"67f084d36852daab6809561a7c8023d130ca07fc6af8fb040684dd1414934d48"
SMTP_PORT
"1025"
APACHE_PID_FILE
"/var/run/apache2/apache2.pid"
PHPIZE_DEPS
"autoconf \t\tdpkg-dev \t\tfile \t\tg++ \t\tgcc \t\tlibc-dev \t\tmake \t\tpkg-config \t\tre2c"
DB_HOST
"lmb-mariadb"
PHP_URL
"https://www.php.net/distributions/php-8.3.30.tar.xz"
APACHE_RUN_GROUP
"www-data"
APACHE_LOCK_DIR
"/var/lock/apache2"
SHLVL
"0"
PHP_CFLAGS
"-fstack-protector-strong -fpic -fpie -O2 -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64"
REDIS_PORT
"6379"
DB_NAME
"fossbilling_staging"
APACHE_RUN_DIR
"/var/run/apache2"
APACHE_ENVVARS
"/etc/apache2/envvars"
APACHE_RUN_USER
"www-data"
PATH
"/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
SMTP_HOST
"mailpit"
DB_PASS
"QnvGwYsuPWPy3NuIHx6Zw"
PHP_ASC_URL
"https://www.php.net/distributions/php-8.3.30.tar.xz.asc"
PHP_CPPFLAGS
"-fstack-protector-strong -fpic -fpie -O2 -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64"
0. Whoops\Handler\PrettyPageHandler