Bug #47816
closedTER update error
0%
Description
(The following issue was reported by Markus Kappe on the User Group Austria Mailing list.)
Under certain conditions the TER update spinner does never stop.
(This has been reported before in #43539, but has been closed due to non-reproducibility.)
Inspecting the AJAX call reveals a
Fatal error: Maximum execution time of 30 seconds exceeded in /xxx/typo3_src-6.0.4/typo3/sysext/core/Classes/Charset/CharsetConverter.php on line 2090
This points to a wrong error handling and the user does not get any feedback.
The errorI found out that a query fails. (Insert of extension details), which has two consequences:
- Debugging is triggered, if configured accordingly (devIpMask, ...), which leads to a timeout explaining the sporadic occurrence of this error.
- Extensions of the currently fetched batch (50 pin it) are not inserted into the DB.
The DB error
The insert looks like this:
INSERT INTO tx_extensionmanager_domain_model_extension (extension_key, version, integer_version, alldownloadcounter, downloadcounter, title, ownerusername, author_name, author_email, authorcompany, last_updated, md5hash, repository, state, review_state, category, description, serialized_dependencies, update_comment)
VALUES ('qrcode', '1.0.0', 1000000, 155, 0, 'QR Code', 'b263', 'Bastian Braeu', 'bb@bftmedia.de', '', 1361908312, '3a7f3e83cbddbd910163ef5eb26d5937', 1, 999, 0, plugin, 'Display QR codes as content elements, embed as Fluidtemplate, or use the view helper in your own extensions.', 'a:1:{s:7:\"depends\";a:3:{s:3:\"cms\";s:12:\"6.0.0-6.0.99\";s:7:\"extbase\";s:12:\"6.0.0-6.0.99\";s:5:\"fluid\";s:12:\"6.0.0-6.0.99\";}}', 'TYPO3 CMS 6.0');
Error message: Unknown column 'plugin' in 'field list'.
Peculiarly the value "plugin" is not escaped!
A comparison with other SQL statements shows that this column usually contains a number.
Matching this against the original XML structure, where the SQL is generated from, shows that for working records there is a line <category>plugin</category>, whereas for non-working records this line contains a number, <category>3</category>.
Conclusion- The original data of the TER are wrong.
- Input data validation is not done properly.
The main reason for the timeout is the slow processing in TYPO3\CMS\Core\Encoder::encode() for the debug output of 21k.
After fixing this by using mbstring, another problem arose.
The debug output invalidates the JSON Output expected by the Ajax Calls.
Disabling debugging fixes the endless spinner problem, but quite some extensions are missing in the DB, due to the aborted insert statements.
Things to be done now:- Error message if the TER import has a problem (invalid JSON response)
- Correction of invalid data in TER (category)
- Validation before running the insert statement. (#46115)