FOSSBilling \ Exception
Product not found FOSSBilling\Exception thrown with message "Product not found" Stacktrace: #8 FOSSBilling\Exception in /home/rc7/my/modules/Product/Api/Guest.php:74 #7 Box\Mod\Product\Api\Guest:get in /home/rc7/my/library/FOSSBilling/Api/Dispatcher.php:97 #6 FOSSBilling\Api\Dispatcher:dispatchWithArguments in /home/rc7/my/library/FOSSBilling/Api/Proxy.php:50 #5 FOSSBilling\Api\Proxy:__call in /home/rc7/my/modules/Order/Controller/Client.php:46 #4 Box\Mod\Order\Controller\Client:get_configure_product_by_slug in [internal]:0 #3 ReflectionMethod:invokeArgs in /home/rc7/my/library/Box/App.php:268 #2 Box_App:executeShared in /home/rc7/my/library/Box/App.php:399 #1 Box_App:processRequest in /home/rc7/my/library/Box/App.php:183 #0 Box_App:run in /home/rc7/my/index.php:115
Stack frames (9)
8
FOSSBilling\Exception
/modules/Product/Api/Guest.php:74
7
Box\Mod\Product\Api\Guest get
/library/FOSSBilling/Api/Dispatcher.php:97
6
FOSSBilling\Api\Dispatcher dispatchWithArguments
/library/FOSSBilling/Api/Proxy.php:50
5
FOSSBilling\Api\Proxy __call
/modules/Order/Controller/Client.php:46
4
Box\Mod\Order\Controller\Client get_configure_product_by_slug
[internal]:0
3
ReflectionMethod invokeArgs
/library/Box/App.php:268
2
Box_App executeShared
/library/Box/App.php:399
1
Box_App processRequest
/library/Box/App.php:183
0
Box_App run
/index.php:115
/home/rc7/my/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((int) $id);
        } else {
            $model = $service->findOneActiveBySlug($slug);
        }
 
        if (!$model instanceof 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';
 
        return $this->getService()->getPaginatedProductCategories($data);
    }
 
    /**
     * Get pairs of product categories.
     *
Arguments
  1. "Product not found"
    
/home/rc7/my/library/FOSSBilling/Api/Dispatcher.php
        $module = $this->getDi()['mod']($mod);
        $api->setDi($this->di);
        $api->setMod($module);
        $api->setIdentity($identity);
        $api->setIp($this->getDi()['request']->getClientIp());
        if ($module->hasService()) {
            $api->setService($this->getDi()['mod_service']($mod));
        }
 
        if (!method_exists($api, $methodName) || !is_callable([$api, $methodName])) {
            $reflector = new \ReflectionClass($api);
            if (!$reflector->hasMethod('__call')) {
                throw new Exception(':type API call :method does not exist in module :module', [':type' => ucfirst($role), ':method' => $methodName, ':module' => $mod], 740);
            }
        }
 
        $data = isset($arguments[0]) && is_array($arguments[0]) ? $arguments[0] : [];
        $this->validateRequiredParams($api, $methodName, $data);
 
        return $api->{$methodName}(...$this->normalizeArguments($api, $methodName, $arguments));
    }
 
    /**
     * Validate required parameters for an API method using attributes.
     *
     * @param AbstractApi $api        The API instance
     * @param string      $methodName The method name
     * @param array       $data       The data array passed to the method
     *
     * @throws InformationException If required parameters are missing
     */
    public function validateRequiredParams(AbstractApi $api, string $methodName, array $data): void
    {
        try {
            $reflection = new \ReflectionMethod($api, $methodName);
        } catch (\ReflectionException) {
            return;
        }
 
        $attributes = $reflection->getAttributes(RequiredParams::class);
/home/rc7/my/library/FOSSBilling/Api/Proxy.php
    }
 
    public function getIdentity(): object
    {
        return $this->identity;
    }
 
    public function getType(): string
    {
        return $this->type;
    }
 
    public function call(string $method, array $data = []): mixed
    {
        return $this->getDispatcher()->dispatch($this->identity, $method, $data);
    }
 
    public function __call($method, $arguments)
    {
        return $this->getDispatcher()->dispatchWithArguments($this->identity, (string) $method, $arguments);
    }
 
    private function getDispatcher(): Dispatcher
    {
        if ($this->di === null || !$this->di->offsetExists('api_dispatcher')) {
            throw new \LogicException('API proxy requires the api_dispatcher service');
        }
 
        $dispatcher = $this->di['api_dispatcher'];
        if (!$dispatcher instanceof Dispatcher) {
            throw new \LogicException('API dispatcher service must resolve to a FOSSBilling\Api\Dispatcher instance');
        }
 
        return $dispatcher;
    }
}
 
/home/rc7/my/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]);
    }
 
[internal]
/home/rc7/my/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): mixed
    {
        /** @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();
            }
        }
 
/home/rc7/my/library/Box/App.php
 
                    return $apiController->renderJson(null, $exc);
                }
 
                return $this->renderResponse('mod_system_maintenance', [], 503);
            }
        }
 
        /** @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, $this->getRequest()->getMethod());
            if ($url->match) {
                $timeCollector->stopMeasure('sharedMapping');
 
                return $this->normalizeResponse($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, $this->getRequest()->getMethod());
            if ($url->match) {
                $timeCollector->stopMeasure('mapping');
 
                return $this->normalizeResponse($this->execute($mapping[2], $url->params));
            }
        }
        $timeCollector->stopMeasure('mapping');
 
        $e = new FOSSBilling\InformationException('Page :url not found', [':url' => $this->url], 404);
 
/home/rc7/my/library/Box/App.php
 
    public function run(): Response
    {
        /** @var TimeDataCollector $timeCollector */
        $timeCollector = $this->debugBar->getCollector('time');
 
        try {
            $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();
        } catch (AuthenticationRequiredException $e) {
            if ($e->getArea() === 'admin') {
                $this->di['set_return_uri'];
 
                return new RedirectResponse($this->di['url']->adminLink('staff/login'));
            }
 
            $this->di['set_return_uri'];
 
            return new RedirectResponse($this->di['url']->link('login'));
        } catch (EmailValidationRequiredException) {
            return new RedirectResponse($this->di['url']->link('client/profile'));
        } catch (HttpResponseException $e) {
            return $e->getResponse();
        }
    }
 
    /**
     * @param string $path
     */
/home/rc7/my/index.php
$timeCollector?->stopMeasure('translate');
 
// If HTTP error code has been passed, handle it.
if (!is_null($http_err_code)) {
    $http_err_code = intval($http_err_code);
    switch ($http_err_code) {
        case 404:
            $e = new FOSSBilling\Exception('Page :url not found', [':url' => $url], 404);
            $app->show404($e)->send();
 
            break;
        default:
            $e = new FOSSBilling\Exception('HTTP Error :err_code occurred while attempting to load :url', [':err_code' => $http_err_code, ':url' => $url], $http_err_code);
            (new Response($app->render('error', ['exception' => $e]), $http_err_code))->send();
    }
    exit;
}
 
// If no HTTP error passed, run the app.
$app->run()->send();
exit;
 

Environment & details:

Key Value
PHP Version
"8.3.31"
Error code
0
Instance ID
"5106b12f-0286-4b2f-9ffe-e105f473087c"
Key Value
_url
"/order/2-vcpu-4-gb-ram-150-gb-sas-5980"
empty
empty
empty
empty
Key Value
USER
"rc7"
HOME
"/home/rc7"
HTTP_HOST
"my.rc7.net"
HTTP_ACCEPT_ENCODING
"gzip, br, zstd, deflate"
HTTP_USER_AGENT
"Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)"
HTTP_ACCEPT
"*/*"
REDIRECT_STATUS
"200"
SERVER_NAME
"my.rc7.net"
SERVER_PORT
"443"
SERVER_ADDR
"38.75.225.39"
REMOTE_PORT
"36357"
REMOTE_ADDR
"216.73.217.13"
SERVER_SOFTWARE
"nginx/1.28.1"
GATEWAY_INTERFACE
"CGI/1.1"
HTTPS
"on"
REQUEST_SCHEME
"https"
SERVER_PROTOCOL
"HTTP/2.0"
DOCUMENT_ROOT
"/home/rc7/my"
DOCUMENT_URI
"/index.php"
REQUEST_URI
"/order/2-vcpu-4-gb-ram-150-gb-sas-5980"
SCRIPT_NAME
"/index.php"
CONTENT_LENGTH
""
CONTENT_TYPE
""
REQUEST_METHOD
"GET"
QUERY_STRING
"_url=/order/2-vcpu-4-gb-ram-150-gb-sas-5980"
SCRIPT_FILENAME
"/home/rc7/my/index.php"
PATH_INFO
""
FCGI_ROLE
"RESPONDER"
PHP_SELF
"/index.php"
REQUEST_TIME_FLOAT
1782588781.6732
REQUEST_TIME
1782588781
empty
0. Whoops\Handler\PrettyPageHandler