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

PDOException on running flow command database:setcharset with PHP8 / MariaDB #2724

Closed
vixe76 opened this issue Mar 8, 2022 · 9 comments
Closed

Comments

@vixe76
Copy link

vixe76 commented Mar 8, 2022

Description

Running ./flow database:setcharset with MariaDB / MySQL results in an PDOException

Exception in line 1853 of /data/Packages/Libraries/doctrine/dbal/lib/Doctrine/DBAL/Connection.php: There is no active transaction

13 PDO::rollBack()
12 Doctrine\DBAL\Connection::rollBack()
11 Neos\Flow\Command\DatabaseCommandController_Original::convertToCharacterSetAndCollation("utf8mb4", "utf8mb4_unicode_ci", NULL, false)
10 Neos\Flow\Command\DatabaseCommandController_Original::setCharsetCommand("utf8mb4", "utf8mb4_unicode_ci", NULL, false)
9 Neos\Flow\Cli\CommandController_Original::callCommandMethod()
8 Neos\Flow\Cli\CommandController_Original::processRequest(Neos\Flow\Cli\Request, Neos\Flow\Cli\Response)
7 Neos\Flow\Cli\Dispatcher_Original::dispatch(Neos\Flow\Cli\Request, Neos\Flow\Cli\Response)
6 Neos\Flow\Cli\CommandRequestHandler::Neos\Flow\Cli\{closure}()
5 Closure::__invoke()
4 Neos\Flow\Security\Context_Original::withoutAuthorizationChecks(Closure)
3 Neos\Flow\Cli\CommandRequestHandler::handleRequest()
2 Neos\Flow\Core\Bootstrap::run()
1 require("/data/Packages/Framework/Neos.Flow/Scripts/flow.php")

Affected Versions

Flow: 7.3

@sorenmalling
Copy link
Contributor

@vixe76 Can you try and use the $output argument of the setcharset command, and execute the generated SQL directly to the databsae, to see if we get a error from maraidb?

@vixe76
Copy link
Author

vixe76 commented Mar 8, 2022

The generated SQL runs without any error because there isn't a transaction contained.
I think the cause is the changed PDO transaction handling in PHP 8 for some statements (CREATE TABLE, ALTER TABLE, etc.).

https://www.doctrine-project.org/projects/doctrine-migrations/en/3.3/explanation/implicit-commits.html

@bwaidelich
Copy link
Member

This can be fixed in the command handler by removing the lines related to transactions (https://github.com/neos/flow-development-collection/blob/master/Neos.Flow/Classes/Command/DatabaseCommandController.php#L137)

For the record: Those transactions never worked (and could not be rolled back) but previously this was just ignored

@sorenmalling
Copy link
Contributor

Well, that was quick 🐎

@kdambekalns
Copy link
Member

Thanks for the report, @vixe76!

I have to admit that someone using / upgrading to PHP8 still is not on that charset, though. 😎

Or did you try running that for some other reason?

@vixe76
Copy link
Author

vixe76 commented Mar 8, 2022

The reason was a Flow 7.3 with PHP 8 Upgrade.

@kdambekalns
Copy link
Member

The reason was a Flow 7.3 with PHP 8 Upgrade.

Figured that much. I was just wondering if you actually needed that, because you were still on plain utf8. Pure curiosity. 😎

@vixe76
Copy link
Author

vixe76 commented Mar 10, 2022

You're right ... I'm really not needed that since the DB was with a prior Flow upgrade always on utf8mb. It was more a reflex to do that unreflected on every upgrade step by reading the release notes 🙈

@kdambekalns
Copy link
Member

You're right ... I'm really not needed

But probably very good you had that reflex, that's how you found a bug! 👍🏼

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

4 participants