mysqli_sql_exception Error

HTTP 500 Whoops, looks like something went wrong.

mysqli object is not fully initialized

Exceptions 2

Error

  1. return str_replace(',', '.', (string) $text);
  2. }
  3. $this->connect();
  4. $result = $this->connection->real_escape_string((string) $text);
  5. if ($extra) {
  6. $result = addcslashes($result, '%_');
  7. }
  1. return str_replace(',', '.', (string) $text);
  2. }
  3. $this->connect();
  4. $result = $this->connection->real_escape_string((string) $text);
  5. if ($extra) {
  6. $result = addcslashes($result, '%_');
  7. }
  1. }
  2. return $text;
  3. }
  4. return '\'' . ($escape ? $this->escape($text) : $text) . '\'';
  5. }
  6. /**
  7. * Quotes a binary string to database requirements for use in database queries.
  8. *
  1. )
  2. ->join(
  3. 'LEFT',
  4. $db->quoteName('#__extensions', 'e'),
  5. $db->quoteName('e.element') . ' = ' . $db->quoteName('s.template')
  6. . ' AND ' . $db->quoteName('e.type') . ' = ' . $db->quote('template')
  7. . ' AND ' . $db->quoteName('e.client_id') . ' = ' . $db->quoteName('s.client_id')
  8. );
  9. $db->setQuery($query);
  1. if ($cache->contains($cacheId)) {
  2. $templates = $cache->get($cacheId);
  3. } else {
  4. $templates = $this->bootComponent('templates')->getMVCFactory()
  5. ->createModel('Style', 'Administrator')->getSiteTemplates();
  6. foreach ($templates as &$template) {
  7. // Create home element
  8. if ($template->home == 1 && !isset($template_home) || $this->getLanguageFilter() && $template->home == $tag) {
  9. $template_home = clone $template;
  1. public function render(\Throwable $error): string
  2. {
  3. $app = Factory::getApplication();
  4. // Get the current template from the application
  5. $template = $app->getTemplate(true);
  6. // Push the error object into the document
  7. $this->getDocument()->setError($error);
  8. // Add registry file for the template asset
  1. 'subject' => $app,
  2. 'document' => $renderer->getDocument(),
  3. ])
  4. );
  5. $data = $renderer->render($error);
  6. // If nothing was rendered, just use the message from the Exception
  7. if (empty($data)) {
  8. $data = $error->getMessage();
  9. }
  1. * @since 3.10.0
  2. */
  3. public static function handleException(\Throwable $error)
  4. {
  5. static::logException($error);
  6. static::render($error);
  7. }
  8. /**
  9. * Render the error page based on an exception.
  10. *
ExceptionHandler::handleException() in /var/www/html/rubicsisorg/libraries/src/Application/CMSApplication.php (line 334)
  1. );
  2. // Trigger the onError event.
  3. $this->dispatchEvent('onError', $event);
  4. ExceptionHandler::handleException($event->getError());
  5. }
  6. // Trigger the onBeforeRespond event.
  7. $this->dispatchEvent(
  8. 'onBeforeRespond',
CMSApplication->execute() in /var/www/html/rubicsisorg/includes/app.php (line 58)
  1. // Set the application as global app
  2. \Joomla\CMS\Factory::$application = $app;
  3. // Execute the application.
  4. $app->execute();
require_once('/var/www/html/rubicsisorg/includes/app.php') in /var/www/html/rubicsisorg/index.php (line 54)
  1. // ... die
  2. die();
  3. }
  4. // Run the application - All executable code should be triggered through this file
  5. require_once __DIR__ . '/includes/app.php';

mysqli_sql_exception

Connection refused

  1. $this->options['ssl']['cipher']
  2. );
  3. }
  4. // Attempt to connect to the server, use error suppression to silence warnings and allow us to throw an Exception separately.
  5. $connected = @$this->connection->real_connect(
  6. $this->options['host'],
  7. $this->options['user'],
  8. $this->options['password'],
  9. null,
  10. $this->options['port'],
  1. $this->options['ssl']['cipher']
  2. );
  3. }
  4. // Attempt to connect to the server, use error suppression to silence warnings and allow us to throw an Exception separately.
  5. $connected = @$this->connection->real_connect(
  6. $this->options['host'],
  7. $this->options['user'],
  8. $this->options['password'],
  9. null,
  10. $this->options['port'],
  1. // Check if the server was disconnected.
  2. if (!$this->connected()) {
  3. try {
  4. // Attempt to reconnect.
  5. $this->connection = null;
  6. $this->connect();
  7. } catch (ConnectionFailureException $e) {
  8. // If connect fails, ignore that exception and throw the normal exception.
  9. throw $exception;
  10. }
  1. $this->statement->setFetchMode($fetchMode, $class);
  2. }
  3. }
  4. // Execute the query and get the result set cursor.
  5. $this->execute();
  6. // Get all of the rows from the result set as objects of type $class.
  7. while ($row = $this->fetchObject()) {
  8. if ($key) {
  9. $array[$row->$key] = $row;
  1. $this->connect();
  2. $result = [];
  3. // Set the query to get the table fields statement.
  4. $fields = $this->setQuery('SHOW FULL COLUMNS FROM ' . $this->quoteName($this->escape($table)))->loadObjectList();
  5. // If we only want the type as the value add just that to the list.
  6. if ($typeOnly) {
  7. foreach ($fields as $field) {
  8. $result[$field->Field] = preg_replace('/[(0-9)]/', '', $field->Type);
MysqliDriver->getTableColumns() in /var/www/html/rubicsisorg/libraries/src/Table/Table.php (line 260)
  1. $key = $db->getServerType() . ':' . $db->getName() . ':' . $this->_tbl;
  2. if (!isset(self::$tableFields[$key]) || $reload) {
  3. // Lookup the fields for this table only once.
  4. $name = $this->_tbl;
  5. $fields = $db->getTableColumns($name, false);
  6. if (empty($fields)) {
  7. throw new \UnexpectedValueException(\sprintf('No columns found for %s table', $name));
  8. }
  1. $this->_tbl_key = $this->getKeyName();
  2. $this->setDatabase($db);
  3. // Initialise the table properties.
  4. $fields = $this->getFields();
  5. if ($fields) {
  6. foreach ($fields as $name => $v) {
  7. // Add the field if it is not already present.
  8. if (!$this->hasField($name)) {
  1. *
  2. * @since 1.7.0
  3. */
  4. public function __construct(DatabaseInterface $db, ?DispatcherInterface $dispatcher = null)
  5. {
  6. parent::__construct('#__users', 'id', $db, $dispatcher);
  7. // Initialise.
  8. $this->id = 0;
  9. $this->sendEmail = 0;
  10. }
  1. if (Factory::getContainer()->has($tableClass)) {
  2. return Factory::getContainer()->get($tableClass);
  3. }
  4. // Instantiate a new table class and return it.
  5. return new $tableClass($db);
  6. }
  7. /**
  8. * Add a filesystem path where Table should search for table class files.
  9. *
  1. $tabletype['name'] = $type;
  2. $tabletype['prefix'] = $prefix;
  3. }
  4. // Create the user table object
  5. return Table::getInstance($tabletype['name'], $tabletype['prefix']);
  6. }
  7. /**
  8. * Method to bind an associative array of data to a user object
  9. *
  1. * @since 1.7.0
  2. */
  3. public function load($id)
  4. {
  5. // Create the user table object
  6. $table = static::getTable();
  7. // Load the UserModel object based on the user id or throw a warning.
  8. if (!$table->load($id)) {
  9. // Reset to guest user
  10. $this->guest = 1;
  1. // Create the user parameters object
  2. $this->_params = new Registry();
  3. // Load the user if it exists
  4. if (!empty($identifier)) {
  5. $this->load($identifier);
  6. } else {
  7. // Initialise
  8. $this->id = 0;
  9. $this->sendEmail = 0;
  10. $this->guest = 1;
  1. *
  2. * @since 4.0.0
  3. */
  4. public function loadUserById(int $id): User
  5. {
  6. return new User($id);
  7. }
  8. /**
  9. * Method to get an instance of a user for the given username.
  10. *
UserFactory->loadUserById() in /var/www/html/rubicsisorg/libraries/src/User/User.php (line 324)
  1. return Factory::getContainer()->get(UserFactoryInterface::class)->loadUserById($id);
  2. }
  3. // Check if the user ID is already cached.
  4. if (empty(self::$instances[$id])) {
  5. self::$instances[$id] = Factory::getContainer()->get(UserFactoryInterface::class)->loadUserById($id);
  6. }
  7. return self::$instances[$id];
  8. }
  1. if (!($instance instanceof User)) {
  2. $instance = User::getInstance();
  3. }
  4. } elseif (!($instance instanceof User) || \is_string($id) || $instance->id !== $id) {
  5. // Check if we have a string as the id or if the numeric id is the current instance
  6. $instance = User::getInstance($id);
  7. }
  8. return $instance;
  9. }
  1. foreach ($items as &$item) {
  2. $item->slug = $item->id . ':' . $item->alias;
  3. $item->catslug = $item->catid . ':' . $item->category_alias;
  4. $item->username = Factory::getUser($item->created_by)->name;
  5. $item->profile_image = $item->profile_image ?? '';
  6. $item->link = Route::_(version_compare($JoomlaVersion, '4.0.0', '>=') ? Joomla\Component\Content\Site\Helper\RouteHelper::getArticleRoute($item->slug, $item->catid, $item->language) : ContentHelperRoute::getArticleRoute($item->slug, $item->catid, $item->language));
  7. $attribs = json_decode($item->attribs);
  8. $item->tags = new TagsHelper;
SppagebuilderHelperArticles::getArticles() in /var/www/html/rubicsisorg/components/com_sppagebuilder/router.php (line 155)
  1. if (!\class_exists('SppagebuilderHelperArticles')) {
  2. require_once JPATH_ROOT . '/components/com_sppagebuilder/helpers/articles.php';
  3. }
  4. $articlesCount = \SppagebuilderHelperArticles::getArticlesCount();
  5. $articles = \SppagebuilderHelperArticles::getArticles($articlesCount);
  6. foreach ($articles as $article) {
  7. if ($article->alias === $alias) {
  8. return 'articles';
  9. }
  10. }
SppagebuilderRouterBase::getCollectionTypeFromAlias() in /var/www/html/rubicsisorg/components/com_sppagebuilder/router.php (line 195)
  1. return $vars;
  2. }
  3. // determine collection type based on alias
  4. $collectionType = static::getCollectionTypeFromAlias($segments[0]);
  5. $collectionItemIds = static::getCollectionItemIdsFromSlugs($segments);
  6. $isValidCollectionPage = false;
SppagebuilderRouterBase::parseRoute() in /var/www/html/rubicsisorg/components/com_sppagebuilder/router.php (line 590)
  1. return $segments;
  2. }
  3. public function parse(&$segments)
  4. {
  5. $vars = SppagebuilderRouterBase::parseRoute($segments);
  6. if (count($vars))
  7. {
  8. $segments = array();
  9. }
SppagebuilderRouter->parse() in /var/www/html/rubicsisorg/libraries/src/Router/SiteRouter.php (line 287)
  1. if (\count($segments)) {
  2. // Handle component route
  3. $component = preg_replace('/[^A-Z0-9_\.-]/i', '', $uri->getVar('option'));
  4. $crouter = $this->getComponentRouter($component);
  5. $uri->setQuery(array_merge($uri->getQuery(true), $crouter->parse($segments)));
  6. }
  7. $route = implode('/', $segments);
  8. }
SiteRouter->parseSefRoute() in /var/www/html/rubicsisorg/libraries/src/Router/Router.php (line 423)
  1. if (!\array_key_exists('parse' . $stage, $this->rules)) {
  2. throw new \InvalidArgumentException(\sprintf('The %s stage is not registered. (%s)', $stage, __METHOD__));
  3. }
  4. foreach ($this->rules['parse' . $stage] as $rule) {
  5. $rule($this, $uri);
  6. }
  7. }
  8. /**
  9. * Process the build uri query data based on custom defined rules
Router->processParseRules() in /var/www/html/rubicsisorg/libraries/src/Router/Router.php (line 158)
  1. // Do the preprocess stage of the URL parse process
  2. $this->processParseRules($uri, self::PROCESS_BEFORE);
  3. // Do the main stage of the URL parse process
  4. $this->processParseRules($uri);
  5. // Do the postprocess stage of the URL parse process
  6. $this->processParseRules($uri, self::PROCESS_AFTER);
  7. // Check if all parts of the URL have been parsed.
  1. // Get the full request URI.
  2. $uri = clone Uri::getInstance();
  3. // It is not possible to inject the SiteRouter as it requires a SiteApplication
  4. // and we would end in an infinite loop
  5. $result = $this->getContainer()->get(SiteRouter::class)->parse($uri, true);
  6. $active = $this->getMenu()->getActive();
  7. if (
  8. $active !== null
  1. // Mark afterInitialise in the profiler.
  2. JDEBUG ? $this->profiler->mark('afterInitialise') : null;
  3. // Route the application
  4. $this->route();
  5. // Mark afterRoute in the profiler.
  6. JDEBUG ? $this->profiler->mark('afterRoute') : null;
  7. if (!$this->isHandlingMultiFactorAuthentication()) {
  1. $this->sanityCheckSystemVariables();
  2. $this->setupLogging();
  3. $this->createExtensionNamespaceMap();
  4. // Perform application routines.
  5. $this->doExecute();
  6. // If we have an application document object, render it.
  7. if ($this->document instanceof \Joomla\CMS\Document\Document) {
  8. // Render the application output.
  9. $this->render();
CMSApplication->execute() in /var/www/html/rubicsisorg/includes/app.php (line 58)
  1. // Set the application as global app
  2. \Joomla\CMS\Factory::$application = $app;
  3. // Execute the application.
  4. $app->execute();
require_once('/var/www/html/rubicsisorg/includes/app.php') in /var/www/html/rubicsisorg/index.php (line 54)
  1. // ... die
  2. die();
  3. }
  4. // Run the application - All executable code should be triggered through this file
  5. require_once __DIR__ . '/includes/app.php';

Stack Traces 2

[2/2] Error
Error:
mysqli object is not fully initialized

  at /var/www/html/rubicsisorg/libraries/vendor/joomla/database/src/Mysqli/MysqliDriver.php:347
  at mysqli->real_escape_string()
     (/var/www/html/rubicsisorg/libraries/vendor/joomla/database/src/Mysqli/MysqliDriver.php:347)
  at Joomla\Database\Mysqli\MysqliDriver->escape()
     (/var/www/html/rubicsisorg/libraries/vendor/joomla/database/src/DatabaseDriver.php:1467)
  at Joomla\Database\DatabaseDriver->quote()
     (/var/www/html/rubicsisorg/administrator/components/com_templates/src/Model/StyleModel.php:712)
  at Joomla\Component\Templates\Administrator\Model\StyleModel->getSiteTemplates()
     (/var/www/html/rubicsisorg/libraries/src/Application/SiteApplication.php:460)
  at Joomla\CMS\Application\SiteApplication->getTemplate()
     (/var/www/html/rubicsisorg/libraries/src/Error/Renderer/HtmlRenderer.php:50)
  at Joomla\CMS\Error\Renderer\HtmlRenderer->render()
     (/var/www/html/rubicsisorg/libraries/src/Exception/ExceptionHandler.php:139)
  at Joomla\CMS\Exception\ExceptionHandler::render()
     (/var/www/html/rubicsisorg/libraries/src/Exception/ExceptionHandler.php:73)
  at Joomla\CMS\Exception\ExceptionHandler::handleException()
     (/var/www/html/rubicsisorg/libraries/src/Application/CMSApplication.php:334)
  at Joomla\CMS\Application\CMSApplication->execute()
     (/var/www/html/rubicsisorg/includes/app.php:58)
  at require_once('/var/www/html/rubicsisorg/includes/app.php')
     (/var/www/html/rubicsisorg/index.php:54)                
[1/2] mysqli_sql_exception
mysqli_sql_exception:
Connection refused

  at /var/www/html/rubicsisorg/libraries/vendor/joomla/database/src/Mysqli/MysqliDriver.php:236
  at mysqli->real_connect()
     (/var/www/html/rubicsisorg/libraries/vendor/joomla/database/src/Mysqli/MysqliDriver.php:236)
  at Joomla\Database\Mysqli\MysqliDriver->connect()
     (/var/www/html/rubicsisorg/libraries/vendor/joomla/database/src/DatabaseDriver.php:670)
  at Joomla\Database\DatabaseDriver->execute()
     (/var/www/html/rubicsisorg/libraries/vendor/joomla/database/src/DatabaseDriver.php:1304)
  at Joomla\Database\DatabaseDriver->loadObjectList()
     (/var/www/html/rubicsisorg/libraries/vendor/joomla/database/src/Mysqli/MysqliDriver.php:539)
  at Joomla\Database\Mysqli\MysqliDriver->getTableColumns()
     (/var/www/html/rubicsisorg/libraries/src/Table/Table.php:260)
  at Joomla\CMS\Table\Table->getFields()
     (/var/www/html/rubicsisorg/libraries/src/Table/Table.php:204)
  at Joomla\CMS\Table\Table->__construct()
     (/var/www/html/rubicsisorg/libraries/src/Table/User.php:61)
  at Joomla\CMS\Table\User->__construct()
     (/var/www/html/rubicsisorg/libraries/src/Table/Table.php:352)
  at Joomla\CMS\Table\Table::getInstance()
     (/var/www/html/rubicsisorg/libraries/src/User/User.php:596)
  at Joomla\CMS\User\User::getTable()
     (/var/www/html/rubicsisorg/libraries/src/User/User.php:871)
  at Joomla\CMS\User\User->load()
     (/var/www/html/rubicsisorg/libraries/src/User/User.php:277)
  at Joomla\CMS\User\User->__construct()
     (/var/www/html/rubicsisorg/libraries/src/User/UserFactory.php:53)
  at Joomla\CMS\User\UserFactory->loadUserById()
     (/var/www/html/rubicsisorg/libraries/src/User/User.php:324)
  at Joomla\CMS\User\User::getInstance()
     (/var/www/html/rubicsisorg/libraries/src/Factory.php:380)
  at Joomla\CMS\Factory::getUser()
     (/var/www/html/rubicsisorg/components/com_sppagebuilder/helpers/articles.php:191)
  at SppagebuilderHelperArticles::getArticles()
     (/var/www/html/rubicsisorg/components/com_sppagebuilder/router.php:155)
  at SppagebuilderRouterBase::getCollectionTypeFromAlias()
     (/var/www/html/rubicsisorg/components/com_sppagebuilder/router.php:195)
  at SppagebuilderRouterBase::parseRoute()
     (/var/www/html/rubicsisorg/components/com_sppagebuilder/router.php:590)
  at SppagebuilderRouter->parse()
     (/var/www/html/rubicsisorg/libraries/src/Router/SiteRouter.php:287)
  at Joomla\CMS\Router\SiteRouter->parseSefRoute()
     (/var/www/html/rubicsisorg/libraries/src/Router/Router.php:423)
  at Joomla\CMS\Router\Router->processParseRules()
     (/var/www/html/rubicsisorg/libraries/src/Router/Router.php:158)
  at Joomla\CMS\Router\Router->parse()
     (/var/www/html/rubicsisorg/libraries/src/Application/SiteApplication.php:767)
  at Joomla\CMS\Application\SiteApplication->route()
     (/var/www/html/rubicsisorg/libraries/src/Application/SiteApplication.php:243)
  at Joomla\CMS\Application\SiteApplication->doExecute()
     (/var/www/html/rubicsisorg/libraries/src/Application/CMSApplication.php:304)
  at Joomla\CMS\Application\CMSApplication->execute()
     (/var/www/html/rubicsisorg/includes/app.php:58)
  at require_once('/var/www/html/rubicsisorg/includes/app.php')
     (/var/www/html/rubicsisorg/index.php:54)                
An Error Occurred: Whoops, looks like something went wrong.

Sorry, there was a problem we could not recover from.

The server returned a "500 - Whoops, looks like something went wrong."

Help me resolve this