aimeos / aimeos-typo3

TYPO3 e-commerce extension for ultra fast online shops, scalable marketplaces, complex B2B applications and #gigacommerce
https://aimeos.org/TYPO3
GNU General Public License v3.0
230 stars 741 forks source link

Exception when using postgresql database #200

Closed rhabacker closed 1 year ago

rhabacker commented 1 year ago

I installed typo3 version 11 using a postgresql database which works as expected. Then I installed aimos with

composer req aimeos/aimeos-typo3

After the installation I did run

$ typo3cms extension:setup

which returned:

  [ Doctrine\DBAL\Exception\ConnectionException ]                                                                              
  An exception occurred in driver: SQLSTATE[HY000] [1045] Access denied for user 'xxx'@'localhost' (using password: YES)  

Caused by:

  [ Doctrine\DBAL\Driver\PDO\Exception ]                                                      
  SQLSTATE[HY000] [1045] Access denied for user 'xxx'@'localhost' (using password: YES)  

Caused by:

  [ PDOException ]                                                                            
  SQLSTATE[HY000] [1045] Access denied for user 'xxx'@'localhost' (using password: YES)  

extension:setup [-e|--extension EXTENSION]

Running the same command with verbose display enabled

typo3cms extension:setup --verbose

returns:

Exception trace:
#0 ()
   vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOConnection.php:40
#1 PDO->__construct()
   vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOConnection.php:40
#2 Doctrine\DBAL\Driver\PDOConnection->__construct()
   vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOMySql/Driver.php:25
#3 Doctrine\DBAL\Driver\PDOMySql\Driver->connect()
   vendor/doctrine/dbal/lib/Doctrine/DBAL/Connection.php:412
#4 Doctrine\DBAL\Connection->connect()
   vendor/doctrine/dbal/lib/Doctrine/DBAL/Connection.php:1952
#5 Doctrine\DBAL\Connection->getWrappedConnection()
   vendor/aimeos/aimeos-base/src/DB/Statement/DBAL/Simple.php:73
#6 Aimeos\Base\DB\Statement\DBAL\Simple->execute()
   vendor/aimeos/aimeos-base/src/DB/Connection/DBAL.php:83
#7 Aimeos\Base\DB\Connection\DBAL->connect()
   vendor/aimeos/aimeos-base/src/DB/Connection/DBAL.php:38
#8 Aimeos\Base\DB\Connection\DBAL->__construct()
   vendor/aimeos/aimeos-base/src/DB/Manager/DBAL.php:194
#9 Aimeos\Base\DB\Manager\DBAL->create()
   vendor/aimeos/aimeos-base/src/DB/Manager/DBAL.php:99
#10 Aimeos\Base\DB\Manager\DBAL->get()
   vendor/aimeos/aimeos-core/src/MShop/Context.php:208
#11 Aimeos\MShop\Context->db()
   typo3conf/ext/aimeos/Classes/Setup.php:167
#12 Aimeos\Aimeos\Setup::schema()
   typo3conf/ext/aimeos/Classes/Setup.php:226
#13 Aimeos\Aimeos\Setup->schemaEvent()
   typo3/sysext/core/Classes/EventDispatcher/EventDispatcher.php:51
#14 TYPO3\CMS\Core\EventDispatcher\EventDispatcher->dispatch()
   typo3/sysext/adminpanel/Classes/Service/EventDispatcher.php:41
#15 TYPO3\CMS\Adminpanel\Service\EventDispatcher->dispatch()
   typo3/sysext/core/Classes/Database/Schema/SqlReader.php:75
#16 TYPO3\CMS\Core\Database\Schema\SqlReader->getTablesDefinitionString()
   typo3/sysext/extensionmanager/Classes/Utility/InstallUtility.php:373
#17 TYPO3\CMS\Extensionmanager\Utility\InstallUtility->updateDatabase()
   typo3/sysext/extensionmanager/Classes/Command/SetupExtensionsCommand.php:109
#18 TYPO3\CMS\Extensionmanager\Command\SetupExtensionsCommand->execute()
   vendor/symfony/console/Command/Command.php:298
#19 Symfony\Component\Console\Command\Command->run()
   vendor/symfony/console/Application.php:1040
#20 Symfony\Component\Console\Application->doRunCommand()
   vendor/helhum/typo3-console/Classes/Console/Mvc/Cli/Symfony/Application.php:189
#21 Helhum\Typo3Console\Mvc\Cli\Symfony\Application->doRunCommand()
   vendor/symfony/console/Application.php:301
#22 Symfony\Component\Console\Application->doRun()
   vendor/symfony/console/Application.php:171
#23 Symfony\Component\Console\Application->run()
   vendor/helhum/typo3-console/Classes/Console/Core/Kernel.php:118
#24 Helhum\Typo3Console\Core\Kernel->handle()
   vendor/helhum/typo3-console/Scripts/typo3-console.php:18
#25 {closure}()
   vendor/helhum/typo3-console/Scripts/typo3-console.php:20
#26 require()
   vendor/helhum/typo3-console/typo3cms:2
#27 include()
   vendor/bin/typo3cms:115

extension:setup [-e|--extension EXTENSION]

From the backtrace the frame #3 Doctrine\DBAL\Driver\PDOMySql\Driver->connect() indicates that aimeos picks up an incorrect database driver, which should be PDOPgSql in this case.

aimeos commented 1 year ago

PostgreSQL isn't supported up to now. We've added a change that may fix the problem: https://github.com/aimeos/aimeos-typo3/blob/master/Resources/Private/Config/resource.php#L8

Can you apply that to your local installation and check if it works?

rhabacker commented 1 year ago

Thanks for your support.

Unfortunally it does not work as expected with the installed php version 7.4.33.

As there are additional drivers mentioned at https://www.doctrine-project.org/projects/doctrine-dbal/en/latest/reference/configuration.html#driver I created a file test.php as:

<?php

$defaultConnection = array(
    'driver' => 'mysqli'
);

echo  ($defaultConnection['driver'] ?? 'mysql') !== 'mysqli' ?: 'mysql';
echo "\n";

$defaultConnection = array(
    'driver' => 'pgsql',
);

echo  ($defaultConnection['driver'] ?? 'mysql') !== 'mysqli' ?: 'mysql';
echo "\n";

$defaultConnection = array(
    'driver' => 'pdo_pgsql',
);

echo  ($defaultConnection['driver'] ?? 'mysql') !== 'mysqli' ?: 'mysql';
echo "\n";

and did run


$ php --version
PHP 7.4.33 (cli) (built: Jan  9 2023 12:00:00) ( NTS )
$ php test.php
mysql
1
1
aimeos commented 1 year ago

It depends on what you've set in your LocalConfiguration.php as driver for the connection. If you get it to work and can create a PR with the necessary (working) change, than we will merge it into the extension :-)

rhabacker commented 1 year ago

if you get it to work

I actually use $defaultConnection['driver'] ?? null;

rhabacker commented 1 year ago

can create a PR with the necessary (working) change

There are more changes required. After fixing the first issue I get:

[ Aimeos\Base\DB\Exception ]                                             
  SQLSTATE[42601]: Syntax error: 7 ERROR:  syntax error at or near "like"  
  LINE 1: SHOW TABLES like 'fe_users_%'                                    
                      ^: SHOW TABLES like 'fe_users_%'

This syntax is mysql specifiy used at the following locations.

$ grep -rn "SHOW " public/typo3conf/ext/aimeos

public/typo3conf/ext/aimeos/Classes/Setup.php:170:            $result = $conn->create('SHOW TABLES like \'' . $prefix . '%\'')->execute();
public/typo3conf/ext/aimeos/Classes/Setup.php:179:            $result = $conn->create('SHOW CREATE TABLE ' . $table)->execute();
rhabacker commented 1 year ago

$result = $conn->create('SHOW TABLES like \'' . $prefix . '%\'')->execute();

For postgresql this has to be

$result = $conn->create('SELECT tablename FROM pg_catalog.pg_tables where tablename ~ \'^' . $prefix . '\'')->execute();

and for

$result = $conn->create('SHOW CREATE TABLE ' . $table)->execute();

it has to be

 $result = $conn->create('CREATE TABLE IF NOT EXISTS ' . $table . '()')->execute();

How to detect current driver used, so that the correct syntax can be used depending on the driver ?

rhabacker commented 1 year ago

After applying the mentioned fixes related to the 'SHOW' syntax I did run:

typo3cms aimeos:setup   

which returned

...
Adding MShop type data for site "default"
Checking "attribute/type" type data
"exception":"Aimeos\\Base\\DB\\Exception: SQLSTATE[42601]: Syntax error: 7 ERROR:  syntax error at or near \"mshop\"
LINE 1: mshop/attribute/manager/type/newid
        ^: mshop/attribute/manager/type/newid in /srv/www/typo3/vendor/aimeos/aimeos-base/src/DB/Statement/DBAL/Simple.php:75
Stack trace:
#0 /srv/www/typo3/vendor/aimeos/aimeos-core/src/MShop/Common/Manager/Base.php(376): Aimeos\\Base\\DB\\Statement\\DBAL\\Simple->execute()
#1 /srv/www/typo3/vendor/aimeos/aimeos-core/src/MShop/Common/Manager/Type/Base.php(140): Aimeos\\MShop\\Common\\Manager\\Base->newId()
#2 /srv/www/typo3/vendor/aimeos/aimeos-core/src/MShop/Common/Manager/Base.php(154): Aimeos\\MShop\\Common\\Manager\\Type\\Base->saveItem()
#3 /srv/www/typo3/vendor/aimeos/aimeos-core/src/MShop/Common/Manager/Decorator/Base.php(224): Aimeos\\MShop\\Common\\Manager\\Base->save()
#4 /srv/www/typo3/vendor/aimeos/aimeos-core/src/MShop/Common/Manager/Decorator/Base.php(224): Aimeos\\MShop\\Common\\Manager\\Decorator\\Base->save()
#5 /srv/www/typo3/vendor/aimeos/aimeos-core/setup/MShopAddTypeData.php(109): Aimeos\\MShop\\Common\\Manager\\Decorator\\Base->save()
#6 /srv/www/typo3/vendor/aimeos/aimeos-core/setup/MShopAddTypeData.php(53): Aimeos\\Upscheme\\Task\\MShopAddTypeData->update()
#7 /srv/www/typo3/vendor/aimeos/aimeos-core/setup/default/MShopAddTypeDataDefault.php(30): Aimeos\\Upscheme\\Task\\MShopAddTypeData->add()
#8 /srv/www/typo3/vendor/aimeos/upscheme/src/Up.php(341): Aimeos\\Upscheme\\Task\\MShopAddTypeDataDefault->up()
#9 /srv/www/typo3/vendor/aimeos/upscheme/src/Up.php(328): Aimeos\\Upscheme\\Up->runTasks()
#10 /srv/www/typo3/vendor/aimeos/upscheme/src/Up.php(172): Aimeos\\Upscheme\\Up->runTasks()
#11 /srv/www/typo3/vendor/aimeos/aimeos-core/Setup.php(84): Aimeos\\Upscheme\\Up->up()
#12 /srv/www/typo3/public/typo3conf/ext/aimeos/Classes/Command/SetupCommand.php(65): Aimeos\\Setup->up()
#13 /srv/www/typo3/vendor/symfony/console/Command/Command.php(298): Aimeos\\Aimeos\\Command\\SetupCommand->execute()
#14 /srv/www/typo3/vendor/symfony/console/Application.php(1040): Symfony\\Component\\Console\\Command\\Command->run()
#15 /srv/www/typo3/vendor/helhum/typo3-console/Classes/Console/Mvc/Cli/Symfony/Application.php(189): Symfony\\Component\\Console\\Application->doRunCommand()
#16 /srv/www/typo3/vendor/symfony/console/Application.php(301): Helhum\\Typo3Console\\Mvc\\Cli\\Symfony\\Application->doRunCommand()
#17 /srv/www/typo3/vendor/symfony/console/Application.php(171): Symfony\\Component\\Console\\Application->doRun()
#18 /srv/www/typo3/vendor/helhum/typo3-console/Classes/Console/Core/Kernel.php(118): Symfony\\Component\\Console\\Application->run()
#19 /srv/www/typo3/vendor/helhum/typo3-console/Scripts/typo3-console.php(18): Helhum\\Typo3Console\\Core\\Kernel->handle()
#20 /srv/www/typo3/vendor/helhum/typo3-console/Scripts/typo3-console.php(20): {closure}()
#21 /srv/www/typo3/vendor/helhum/typo3-console/typo3cms(2): require('/srv/www/typo3/...')
#22 /srv/www/typo3/vendor/bin/typo3cms(115): include('/srv/www/typo3/...')
#23 {main}"}

The term mshop/attribute/manager/type/newid is the complete sql string, which is not supported by postgresql.

aimeos commented 1 year ago

This means that the Aimeos config files aren't loaded because this is the key to the configuration for the SQL statement. Did you overwrite an mshop-related config somewhere?

aimeos commented 1 year ago

How to detect current driver used, so that the correct syntax can be used depending on the driver ?

There seems to be only the way using those nasty GLOBAL variable: https://docs.typo3.org/m/typo3/reference-coreapi/main/en-us/ApiOverview/Database/Configuration/Index.html

rhabacker commented 1 year ago

This means that the Aimeos config files aren't loaded because this is the key to the configuration for the SQL statement. > Did you overwrite an mshop-related config somewhere?

No, the message is somehow unspecific - the typo3 installation by default uses driver pdo_pgsql, for which no newid entry is defined, see for example https://github.com/aimeos/aimeos-core/blob/master/config/mshop/attribute.php#L90.

aimeos commented 1 year ago

The database driver names are different in Aimeos and TYPO3. The later uses pdo_pgsql while Aimeos requires pgsql only. Therefore, you need to apply a mapping of the DB driver names.

rhabacker commented 1 year ago

Thanks for this tip - after I temporarily changed the value for the driver to pgsql at https://github.com/aimeos/aimeos-typo3/blob/3c170911bdd243a1208c8efd60f857aaacf5cd4e/Resources/Private/Config/resource.php#L8, the error no longer occurs.

rhabacker commented 1 year ago

After fixing the error mentioned in the previous comment, I get the following error when accessing a page from the shop

Sun, 12 Mar 2023 09:56:11 +0000 [ALERT] request="f484c789154a8" component="TYPO3.CMS.Frontend.ContentObject.Exception.ProductionExceptionHandler": Oops, an error occurred! Code: 2023031209561151888c45- Exception:  SQLSTATE[42601]: Syntax error: 7 ERROR:  syntax error at or near \"USE\"
LINE 6:      LEFT JOIN \"mshop_index_catalog\" AS mindca USE INDEX (\"i...
                                                       ^: 
                SELECT COUNT(*) AS \"count\"
                FROM (
                    SELECT mpro.\"id\"
                    FROM \"mshop_product\" mpro
                    LEFT JOIN \"mshop_index_catalog\" AS mindca USE INDEX (\"idx_msindca_s_ca_lt_po\", \"unq_msindca_p_s_cid_lt_po\") ON mindca.\"prodid\" = mpro.\"id\"
                    WHERE ( ( mpro.\"siteid\" IN ('') ) AND ( mindca.\"catid\" IS NOT NULL AND ( ( mpro.\"status\" = 1 ) AND ( mpro.\"type\" = 'event' OR mpro.\"start\" IS NULL OR mpro.\"start\" <= '2023-03-12 09:56:00' ) AND ( mpro.\"end\" IS NULL OR mpro.\"end\" >= '2023-03-12 09:56:00' ) ) ) )
                    GROUP BY mpro.\"id\"
                    ORDER BY mpro.\"id\"
                    OFFSET 0 ROWS FETCH NEXT 10000 ROWS ONLY
                ) AS list
             in /srv/www/typo3/vendor/aimeos/aimeos-base/src/DB/Statement/DBAL/Simple.php:75
Stack trace:
#0 /srv/www/typo3/vendor/aimeos/aimeos-core/src/MShop/Common/Manager/Base.php(524): Aimeos\\Base\\DB\\Statement\\DBAL\\Simple->execute()
#1 /srv/www/typo3/vendor/aimeos/aimeos-core/src/MShop/Common/Manager/Base.php(890): Aimeos\\MShop\\Common\\Manager\\Base->getSearchResults()
#2 /srv/www/typo3/vendor/aimeos/aimeos-core/src/MShop/Index/Manager/DBBase.php(441): Aimeos\\MShop\\Common\\Manager\\Base->searchItemsBase()
#3 /srv/www/typo3/vendor/aimeos/aimeos-core/src/MShop/Index/Manager/Standard.php(529): Aimeos\\MShop\\Index\\Manager\\DBBase->searchItemsIndexBase()
#4 /srv/www/typo3/vendor/aimeos/aimeos-core/src/MShop/Common/Manager/Decorator/Depth.php(59): Aimeos\\MShop\\Index\\Manager\\Standard->search()
#5 /srv/www/typo3/vendor/aimeos/aimeos-core/src/MShop/Common/Manager/Decorator/Lazy.php(42): Aimeos\\MShop\\Common\\Manager\\Decorator\\Depth->search()
#6 /srv/www/typo3/vendor/aimeos/ai-controller-frontend/src/Controller/Frontend/Product/Standard.php(514): Aimeos\\MShop\\Common\\Manager\\Decorator\\Lazy->search()
#7 /srv/www/typo3/vendor/aimeos/ai-client-html/src/Client/Html/Catalog/Lists/Standard.php(281): Aimeos\\Controller\\Frontend\\Product\\Standard->search()
#8 /srv/www/typo3/vendor/aimeos/ai-client-html/src/Client/Html/Common/Decorator/Base.php(67): Aimeos\\Client\\Html\\Catalog\\Lists\\Standard->data()
#9 /srv/www/typo3/vendor/aimeos/ai-client-html/src/Client/Html/Common/Decorator/Context.php(48): Aimeos\\Client\\Html\\Common\\Decorator\\Base->data()
#10 /srv/www/typo3/vendor/aimeos/ai-client-html/src/Client/Html/Catalog/Lists/Standard.php(208): Aimeos\\Client\\Html\\Common\\Decorator\\Context->data()
#11 /srv/www/typo3/vendor/aimeos/ai-client-html/src/Client/Html/Common/Decorator/Exceptions.php(82): Aimeos\\Client\\Html\\Catalog\\Lists\\Standard->header()
#12 /srv/www/typo3/vendor/aimeos/ai-client-html/src/Client/Html/Common/Decorator/Base.php(92): Aimeos\\Client\\Html\\Common\\Decorator\\Exceptions->header()
#13 /srv/www/typo3/public/typo3conf/ext/aimeos/Classes/Controller/AbstractController.php(165): Aimeos\\Client\\Html\\Common\\Decorator\\Base->header()
#14 /srv/www/typo3/public/typo3conf/ext/aimeos/Classes/Controller/CatalogController.php(98): Aimeos\\Aimeos\\Controller\\AbstractController->getClientOutput()
#15 /srv/www/typo3/public/typo3/sysext/extbase/Classes/Mvc/Controller/ActionController.php(575): Aimeos\\Aimeos\\Controller\\CatalogController->listAction()
#16 /srv/www/typo3/public/typo3/sysext/extbase/Classes/Mvc/Controller/ActionController.php(492): TYPO3\\CMS\\Extbase\\Mvc\\Controller\\ActionController->callActionMethod()
#17 /srv/www/typo3/public/typo3/sysext/extbase/Classes/Mvc/Dispatcher.php(96): TYPO3\\CMS\\Extbase\\Mvc\\Controller\\ActionController->processRequest()
#18 /srv/www/typo3/public/typo3/sysext/extbase/Classes/Mvc/Web/FrontendRequestHandler.php(46): TYPO3\\CMS\\Extbase\\Mvc\\Dispatcher->dispatch()
#19 /srv/www/typo3/public/typo3/sysext/extbase/Classes/Core/Bootstrap.php(165): TYPO3\\CMS\\Extbase\\Mvc\\Web\\FrontendRequestHandler->handleRequest()
#20 /srv/www/typo3/public/typo3/sysext/extbase/Classes/Core/Bootstrap.php(148): TYPO3\\CMS\\Extbase\\Core\\Bootstrap->handleFrontendRequest()
#21 /srv/www/typo3/public/typo3/sysext/frontend/Classes/ContentObject/ContentObjectRenderer.php(5409): TYPO3\\CMS\\Extbase\\Core\\Bootstrap->run()
#22 /srv/www/typo3/public/typo3/sysext/frontend/Classes/ContentObject/UserContentObject.php(44): TYPO3\\CMS\\Frontend\\ContentObject\\ContentObjectRenderer->callUserFunction()
#23 /srv/www/typo3/public/typo3/sysext/frontend/Classes/ContentObject/ContentObjectRenderer.php(801): TYPO3\\CMS\\Frontend\\ContentObject\\UserContentObject->render()
#24 /srv/www/typo3/public/typo3/sysext/frontend/Classes/ContentObject/ContentObjectRenderer.php(737): TYPO3\\CMS\\Frontend\\ContentObject\\ContentObjectRenderer->render()
#25 /srv/www/typo3/public/typo3/sysext/frontend/Classes/Controller/TypoScriptFrontendController.php(2837): TYPO3\\CMS\\Frontend\\ContentObject\\ContentObjectRenderer->cObjGetSingle()
#26 /srv/www/typo3/public/typo3/sysext/frontend/Classes/Controller/TypoScriptFrontendController.php(2795): TYPO3\\CMS\\Frontend\\Controller\\TypoScriptFrontendController->processNonCacheableContentPartsAndSubstituteContentMarkers()
#27 /srv/www/typo3/public/typo3/sysext/frontend/Classes/Controller/TypoScriptFrontendController.php(2764): TYPO3\\CMS\\Frontend\\Controller\\TypoScriptFrontendController->recursivelyReplaceIntPlaceholdersInContent()
#28 /srv/www/typo3/public/typo3/sysext/frontend/Classes/Http/RequestHandler.php(165): TYPO3\\CMS\\Frontend\\Controller\\TypoScriptFrontendController->INTincScript()
#29 /srv/www/typo3/public/typo3conf/ext/pdfviewhelpers/Classes/Middleware/Frontend/StopOutputMiddleware.php(19): TYPO3\\CMS\\Frontend\\Http\\RequestHandler->handle()
#30 /srv/www/typo3/public/typo3/sysext/core/Classes/Http/MiddlewareDispatcher.php(172): Bithost\\Pdfviewhelpers\\Middleware\\Frontend\\StopOutputMiddleware->process()
#31 /srv/www/typo3/public/typo3/sysext/core/Classes/Middleware/ResponsePropagation.php(34): class@anonymous->handle()
#32 /srv/www/typo3/public/typo3/sysext/core/Classes/Http/MiddlewareDispatcher.php(172): TYPO3\\CMS\\Core\\Middleware\\ResponsePropagation->process()
#33 /srv/www/typo3/public/typo3/sysext/frontend/Classes/Middleware/OutputCompression.php(48): class@anonymous->handle()
#34 /srv/www/typo3/public/typo3/sysext/core/Classes/Http/MiddlewareDispatcher.php(172): TYPO3\\CMS\\Frontend\\Middleware\\OutputCompression->process()
#35 /srv/www/typo3/public/typo3conf/ext/dp_cookieconsent/Classes/Middleware/PlainRenderingMiddleware.php(30): class@anonymous->handle()
#36 /srv/www/typo3/public/typo3/sysext/core/Classes/Http/MiddlewareDispatcher.php(172): DirkPersky\\DpCookieconsent\\Middleware\\PlainRenderingMiddleware->process()
#37 /srv/www/typo3/public/typo3/sysext/adminpanel/Classes/Middleware/AdminPanelDataPersister.php(44): class@anonymous->handle()
#38 /srv/www/typo3/public/typo3/sysext/core/Classes/Http/MiddlewareDispatcher.php(172): TYPO3\\CMS\\Adminpanel\\Middleware\\AdminPanelDataPersister->process()
#39 /srv/www/typo3/public/typo3/sysext/adminpanel/Classes/Middleware/AdminPanelRenderer.php(45): class@anonymous->handle()
#40 /srv/www/typo3/public/typo3/sysext/core/Classes/Http/MiddlewareDispatcher.php(172): TYPO3\\CMS\\Adminpanel\\Middleware\\AdminPanelRenderer->process()
#41 /srv/www/typo3/public/typo3/sysext/frontend/Classes/Middleware/ContentLengthResponseHeader.php(45): class@anonymous->handle()
#42 /srv/www/typo3/public/typo3/sysext/core/Classes/Http/MiddlewareDispatcher.php(172): TYPO3\\CMS\\Frontend\\Middleware\\ContentLengthResponseHeader->process()
#43 /srv/www/typo3/public/typo3/sysext/frontend/Classes/Middleware/ShortcutAndMountPointRedirect.php(79): class@anonymous->handle()
#44 /srv/www/typo3/public/typo3/sysext/core/Classes/Http/MiddlewareDispatcher.php(172): TYPO3\\CMS\\Frontend\\Middleware\\ShortcutAndMountPointRedirect->process()
#45 /srv/www/typo3/public/typo3/sysext/frontend/Classes/Middleware/PrepareTypoScriptFrontendRendering.php(78): class@anonymous->handle()
#46 /srv/www/typo3/public/typo3/sysext/core/Classes/Http/MiddlewareDispatcher.php(172): TYPO3\\CMS\\Frontend\\Middleware\\PrepareTypoScriptFrontendRendering->process()
#47 /srv/www/typo3/public/typo3conf/ext/taxajax/Classes/Middleware/XajaxHandler.php(52): class@anonymous->handle()
#48 /srv/www/typo3/public/typo3/sysext/core/Classes/Http/MiddlewareDispatcher.php(172): JambageCom\\Taxajax\\Middleware\\XajaxHandler->process()
#49 /srv/www/typo3/public/typo3/sysext/frontend/Classes/Middleware/TypoScriptFrontendInitialization.php(104): class@anonymous->handle()
#50 /srv/www/typo3/public/typo3/sysext/core/Classes/Http/MiddlewareDispatcher.php(172): TYPO3\\CMS\\Frontend\\Middleware\\TypoScriptFrontendInitialization->process()
#51 /srv/www/typo3/public/typo3/sysext/frontend/Classes/Middleware/PageArgumentValidator.php(132): class@anonymous->handle()
#52 /srv/www/typo3/public/typo3/sysext/core/Classes/Http/MiddlewareDispatcher.php(172): TYPO3\\CMS\\Frontend\\Middleware\\PageArgumentValidator->process()
#53 /srv/www/typo3/public/typo3/sysext/frontend/Classes/Middleware/PreviewSimulator.php(66): class@anonymous->handle()
#54 /srv/www/typo3/public/typo3/sysext/core/Classes/Http/MiddlewareDispatcher.php(172): TYPO3\\CMS\\Frontend\\Middleware\\PreviewSimulator->process()
#55 /srv/www/typo3/public/typo3/sysext/adminpanel/Classes/Middleware/SqlLogging.php(58): class@anonymous->handle()
#56 /srv/www/typo3/public/typo3/sysext/core/Classes/Http/MiddlewareDispatcher.php(172): TYPO3\\CMS\\Adminpanel\\Middleware\\SqlLogging->process()
#57 /srv/www/typo3/public/typo3/sysext/frontend/Classes/Middleware/PageResolver.php(106): class@anonymous->handle()
#58 /srv/www/typo3/public/typo3/sysext/core/Classes/Http/MiddlewareDispatcher.php(172): TYPO3\\CMS\\Frontend\\Middleware\\PageResolver->process()
#59 /srv/www/typo3/public/typo3/sysext/frontend/Classes/Middleware/StaticRouteResolver.php(80): class@anonymous->handle()
#60 /srv/www/typo3/public/typo3/sysext/core/Classes/Http/MiddlewareDispatcher.php(172): TYPO3\\CMS\\Frontend\\Middleware\\StaticRouteResolver->process()
#61 /srv/www/typo3/public/typo3/sysext/frontend/Classes/Middleware/SiteBaseRedirectResolver.php(94): class@anonymous->handle()
#62 /srv/www/typo3/public/typo3/sysext/core/Classes/Http/MiddlewareDispatcher.php(172): TYPO3\\CMS\\Frontend\\Middleware\\SiteBaseRedirectResolver->process()
#63 /srv/www/typo3/public/typo3/sysext/adminpanel/Classes/Middleware/AdminPanelInitiator.php(55): class@anonymous->handle()
#64 /srv/www/typo3/public/typo3/sysext/core/Classes/Http/MiddlewareDispatcher.php(172): TYPO3\\CMS\\Adminpanel\\Middleware\\AdminPanelInitiator->process()
#65 /srv/www/typo3/public/typo3/sysext/frontend/Classes/Middleware/FrontendUserAuthenticator.php(97): class@anonymous->handle()
#66 /srv/www/typo3/public/typo3/sysext/core/Classes/Http/MiddlewareDispatcher.php(172): TYPO3\\CMS\\Frontend\\Middleware\\FrontendUserAuthenticator->process()
#67 /srv/www/typo3/public/typo3/sysext/frontend/Classes/Middleware/BackendUserAuthenticator.php(78): class@anonymous->handle()
#68 /srv/www/typo3/public/typo3/sysext/core/Classes/Http/MiddlewareDispatcher.php(172): TYPO3\\CMS\\Frontend\\Middleware\\BackendUserAuthenticator->process()
#69 /srv/www/typo3/public/typo3/sysext/frontend/Classes/Middleware/MaintenanceMode.php(55): class@anonymous->handle()
#70 /srv/www/typo3/public/typo3/sysext/core/Classes/Http/MiddlewareDispatcher.php(172): TYPO3\\CMS\\Frontend\\Middleware\\MaintenanceMode->process()
#71 /srv/www/typo3/public/typo3/sysext/frontend/Classes/Middleware/EidHandler.php(64): class@anonymous->handle()
#72 /srv/www/typo3/public/typo3/sysext/core/Classes/Http/MiddlewareDispatcher.php(172): TYPO3\\CMS\\Frontend\\Middleware\\EidHandler->process()
#73 /srv/www/typo3/public/typo3/sysext/frontend/Classes/Middleware/SiteResolver.php(65): class@anonymous->handle()
#74 /srv/www/typo3/public/typo3/sysext/core/Classes/Http/MiddlewareDispatcher.php(172): TYPO3\\CMS\\Frontend\\Middleware\\SiteResolver->process()
#75 /srv/www/typo3/public/typo3conf/ext/div2007/Classes/Middleware/StoreRequest.php(77): class@anonymous->handle()
#76 /srv/www/typo3/public/typo3/sysext/core/Classes/Http/MiddlewareDispatcher.php(172): JambageCom\\Div2007\\Middleware\\StoreRequest->process()
#77 /srv/www/typo3/public/typo3/sysext/core/Classes/Middleware/NormalizedParamsAttribute.php(45): class@anonymous->handle()
#78 /srv/www/typo3/public/typo3/sysext/core/Classes/Http/MiddlewareDispatcher.php(172): TYPO3\\CMS\\Core\\Middleware\\NormalizedParamsAttribute->process()
#79 /srv/www/typo3/public/typo3/sysext/core/Classes/Middleware/VerifyHostHeader.php(55): class@anonymous->handle()
#80 /srv/www/typo3/public/typo3/sysext/core/Classes/Http/MiddlewareDispatcher.php(172): TYPO3\\CMS\\Core\\Middleware\\VerifyHostHeader->process()
#81 /srv/www/typo3/public/typo3/sysext/frontend/Classes/Middleware/TimeTrackerInitialization.php(58): class@anonymous->handle()
#82 /srv/www/typo3/public/typo3/sysext/core/Classes/Http/MiddlewareDispatcher.php(172): TYPO3\\CMS\\Frontend\\Middleware\\TimeTrackerInitialization->process()
#83 /srv/www/typo3/public/typo3/sysext/core/Classes/Http/MiddlewareDispatcher.php(78): class@anonymous->handle()
#84 /srv/www/typo3/public/typo3/sysext/core/Classes/Http/AbstractApplication.php(86): TYPO3\\CMS\\Core\\Http\\MiddlewareDispatcher->handle()
#85 /srv/www/typo3/public/typo3/sysext/frontend/Classes/Http/Application.php(69): TYPO3\\CMS\\Core\\Http\\AbstractApplication->handle()
#86 /srv/www/typo3/public/typo3/sysext/core/Classes/Http/AbstractApplication.php(100): TYPO3\\CMS\\Frontend\\Http\\Application->handle()
#87 /srv/www/typo3/public/index.php(20): TYPO3\\CMS\\Core\\Http\\AbstractApplication->run()
#88 /srv/www/typo3/public/index.php(21): {closure}()
#89 {main}","code":"2023031209561151888c45"}
rhabacker commented 1 year ago

The mentioned problem arises from the mapping being fixed to MySQL at https://github.com/aimeos/aimeos-typo3/blob/3c170911bdd243a1208c8efd60f857aaacf5cd4e/Resources/Private/Config/mshop.php#L11

aimeos commented 1 year ago

Yes, that's another point. We need to choose the manager class based on the driver value and use PgSQL instead: https://github.com/aimeos/aimeos-core/blob/master/src/MShop/Index/Manager/PgSQL.php

If the configuration is correct, PostgreSQL support will work out of the box for Aimeos.

rhabacker commented 1 year ago

We need to choose the manager class based on the driver value and use PgSQL instead:

From a db connection this can be retrieved by using

$c = get_class($conn->getRawObject()->getDriver());
$s = explode('\\', $c);
$classname = $s[count($s)-2];

How to get the connection object on that location ?

aimeos commented 1 year ago

If you did the mapping in the Resources/Private/Config/resource.php file, you get the driver/adapter name using: $context->config('resource/db/adapter')

rhabacker commented 1 year ago

@aimeos: How does it work with backporting the changes from #201 and #202 to the stable branch https://github.com/aimeos/aimeos-typo3/tree/2022.10, which is the base for the composer package https://extensions.typo3.org/extension/aimeos ?

aimeos commented 1 year ago

We do that and already did that for the merged PR. You can use the 2022.10.x-dev versions until a new release is tagged:

composer req aimeos/aimeos-typo3:2022.10.x-dev