Catchable fatal error in s9e_renderer_... after upgrading from 3.0.14 to 3.2.0

Get help with installation and running phpBB 3.2.x here. Please do not post bug reports, feature requests, or extension related questions here.
DeletedUser65749
I am too lazy to register

Catchable fatal error in s9e_renderer_... after upgrading from 3.0.14 to 3.2.0

Post by DeletedUser65749 »

Hi.

I have upgraded a phpBB 3.0.14 instance to 3.2.0 following the steps here viewtopic.php?f=556&t=2376856#convert3. Unfortunately some topics are not loading and showing just this error:
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/s9e/text-formatter/src/Renderer.php on line 20: DOMDocument::loadXML(): Opening and ending tag mismatch: IMG line 4 and s in Entity, line: 4
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/s9e/text-formatter/src/Renderer.php on line 20: DOMDocument::loadXML(): Opening and ending tag mismatch: r line 1 and e in Entity, line: 4
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/s9e/text-formatter/src/Renderer.php on line 20: DOMDocument::loadXML(): Extra content at the end of the document in Entity, line: 4

Catchable fatal error: Argument 1 passed to s9e_renderer_11b8900c948ee3905b88e0d73c22e8446e585ad5::at() must be an instance of DOMNode, null given, called in /home/epicnet/mozilla.sk/forum/cache/production/s9e_renderer_11b8900c948ee3905b88e0d73c22e8446e585ad5.php on line 31 and defined in /home/epicnet/mozilla.sk/forum/cache/production/s9e_renderer_11b8900c948ee3905b88e0d73c22e8446e585ad5.php on line 34
Is this some DB issue, or where should I start looking? The warnings above the error look like some problem with BBCode parsing.
User avatar
david63
Registered User
Posts: 19850
Joined: Thu Dec 19, 2002 8:08 am
Location: Lancashire, UK
Contact:

Re: Catchable fatal error in s9e_renderer_... after upgrading from 3.0.14 to 3.2.0

Post by david63 »

BBCode parsing changed in 3.2 and I am guessing that you have one, or more, custom bbcodes that are not compatible.
David
Remember: You only know what you know and - you don't know what you don't know!
My CDB Contributions | How to install an extension
I will not be accepting translations for any of my extensions in Github - please post any translations in the appropriate topic.
No support requests via PM or email as they will be ignored
User avatar
JoshyPHP
Code Contributor
Posts: 1276
Joined: Mon Jul 11, 2011 12:28 am

Re: Catchable fatal error in s9e_renderer_... after upgrading from 3.0.14 to 3.2.0

Post by JoshyPHP »

No custom BBCode should be able to generate that kind of errors. It's more likely that an extension modifies the XML in a way that is not compatible.

:arrow: Disable each extension until the error stops happening. You'll know which extension causes it, then contact the extension's author about it.
I wrote the library that handles markup in phpBB 3.2+.
DeletedUser65749
I am too lazy to register

Re: Catchable fatal error in s9e_renderer_... after upgrading from 3.0.14 to 3.2.0

Post by DeletedUser65749 »

Thank you david63. I quickly managed to recover 3.0.14 from the backups. Than I checked the customer BBCoded and there was one (acronym=). I have removed all its usages (one users signature) and the BBCode itself, upgraded to 3.2.0 once again and everything worked for a short while, but got broken after few reloads again.

JoshyPHP, I haven't installed any extensions after upgrading to phpBB 3.2.0. Even disabled VigLink.
DeletedUser65749
I am too lazy to register

Re: Catchable fatal error in s9e_renderer_... after upgrading from 3.0.14 to 3.2.0

Post by DeletedUser65749 »

When I delete cache/production, the first load works, but any next fails with the error.
DeletedUser65749
I am too lazy to register

Re: Catchable fatal error in s9e_renderer_... after upgrading from 3.0.14 to 3.2.0

Post by DeletedUser65749 »

JoshyPHP wrote:
Sun Jul 02, 2017 1:43 pm
No custom BBCode should be able to generate that kind of errors. It's more likely that an extension modifies the XML in a way that is not compatible.
Where is the parsed XML stored, so I can check its content?

EDIT: I have echoed the $xml variable from the renderer and it really is malformed - the starting <s> and <e> tags are missing:

Code: Select all

<r>Firefoc - Nástroje - Možnosti - Všeobecné<br/>
a tu zafajknúť predvoľbu "Vždy kontrolovať, či je Firefox predvoleným prehliadačom"<br/>
<br/>
<IMG src="http://imgbank.cz/images/2017/06/17/ff.jpg">-[img]</s><URL url="http://imgbank.cz/images/2017/06/17/ff.jpg">http://imgbank.cz/images/2017/06/17/ff.jpg</URL>-[/img]</e></IMG><br/>
<br/>
<URL url="https://support.mozilla.org/sk/kb/ako-nastavit-firefox-za-predvoleny-prehliadac">-[url=https://support.mozilla.org/sk/kb/ako-nastavit-firefox-za-predvoleny-prehliadac]</s>Ako nastaviĹĄ Firefox za predvolenĂ˝ prehliadaÄŤ?-[/url]</e></URL></r>
But in the posts table I see:

Code: Select all

<r>Firefoc - Nástroje - Možnosti - Všeobecné<br/>
a tu zafajknúť predvoľbu "Vždy kontrolovať, či je Firefox predvoleným prehliadačom"<br/>
<br/>
<IMG src="http://imgbank.cz/images/2017/06/17/ff.jpg"><s>[img]</s><URL url="http://imgbank.cz/images/2017/06/17/ff.jpg">http://imgbank.cz/images/2017/06/17/ff.jpg</URL><e>[/img]</e></IMG><br/>
<br/>
<URL url="https://support.mozilla.org/sk/kb/ako-nastavit-firefox-za-predvoleny-prehliadac"><s>[url=https://support.mozilla.org/sk/kb/ako-nastavit-firefox-za-predvoleny-prehliadac]</s>Ako nastaviť Firefox za predvolený prehliadač?<e>[/url]</e></URL></r>
DeletedUser65749
I am too lazy to register

Re: Catchable fatal error in s9e_renderer_... after upgrading from 3.0.14 to 3.2.0

Post by DeletedUser65749 »

OK, I have not idea how they got there, but there were unexpected tags <r>, <t>, <s> and <e>. So I have run couple of updated over the posts table to remove them and everything works. More interesting is, that only about last 100 post were affected.

Code: Select all

UPDATE `MY-DB-PREFIX_posts`
SET `post_text` = REPLACE(`post_text`, '<t>', '')
WHERE `post_text` LIKE '%<t>%';

UPDATE `MY-DB-PREFIX_posts`
SET `post_text` = REPLACE(`post_text`, '</t>', '')
WHERE `post_text` LIKE '%</t>%';

UPDATE `MY-DB-PREFIX_posts`
SET `post_text` = REPLACE(`post_text`, '<r>', '')
WHERE `post_text` LIKE '%<r>%';

UPDATE `MY-DB-PREFIX_posts`
SET `post_text` = REPLACE(`post_text`, '</r>', '')
WHERE `post_text` LIKE '%</r>%';

UPDATE `MY-DB-PREFIX_posts`
SET `post_text` = REPLACE(`post_text`, '<s>', '')
WHERE `post_text` LIKE '%<s>%';

UPDATE `MY-DB-PREFIX_posts`
SET `post_text` = REPLACE(`post_text`, '</s>', '')
WHERE `post_text` LIKE '%</s>%';

UPDATE `MY-DB-PREFIX_posts`
SET `post_text` = REPLACE(`post_text`, '<e>', '')
WHERE `post_text` LIKE '%<e>%';

UPDATE `MY-DB-PREFIX_posts`
SET `post_text` = REPLACE(`post_text`, '</e>', '')
WHERE `post_text` LIKE '%</e>%';
User avatar
JoshyPHP
Code Contributor
Posts: 1276
Joined: Mon Jul 11, 2011 12:28 am

Re: Catchable fatal error in s9e_renderer_... after upgrading from 3.0.14 to 3.2.0

Post by JoshyPHP »

Those queries will irremediably corrupt your data without solving anything. You should probably stop doing that right now and work on finding how the well-formed XML from the database becomes malformed when it reaches the renderer.
I wrote the library that handles markup in phpBB 3.2+.
DeletedUser65749
I am too lazy to register

Re: Catchable fatal error in s9e_renderer_... after upgrading from 3.0.14 to 3.2.0

Post by DeletedUser65749 »

I have done this on staging server only, no worry. But in case the tags should be there and not removed, why they are missing in the older posts? And why got the first <s> and <e> removed? As mentioned above, there is no other code that the content of phpbb zip download from phpbb.com yesterday. I have tried to replay the upgrade with config.php only, but the result is the same.
User avatar
JoshyPHP
Code Contributor
Posts: 1276
Joined: Mon Jul 11, 2011 12:28 am

Re: Catchable fatal error in s9e_renderer_... after upgrading from 3.0.14 to 3.2.0

Post by JoshyPHP »

Good, then you should restore your dump so you work on clean data.
mstanke wrote:
Sun Jul 02, 2017 2:58 pm
As mentioned above, there is no other code that the content of phpbb zip download from phpbb.com yesterday.
If you're 100% sure that none of the files have been modified and there is no extensions in your ext dir then I have no idea. Something replaces <s> and <e> with -; Does that ring any bell?

I see that the XML in your database is UTF-8 (Nástroje) whereas the malformed XML passed to the renderer has mojibake (Nástroje). Could it be related? It could be due to your copy/pasting though.
I wrote the library that handles markup in phpBB 3.2+.
DeletedUser65749
I am too lazy to register

Re: Catchable fatal error in s9e_renderer_... after upgrading from 3.0.14 to 3.2.0

Post by DeletedUser65749 »

I will check the encoding, but that's probably how the browser saw the output without encoding specification. Better to output to a file.

But what I wonder is whether the database update actually completes correctly. There were no error, but looking at another forum, which I have updated few months ago, the tags mentioned above are in all posts. While now on this forum, there are in the first ~100 latest posts only, but not in the older. Is there any way how to debug the database update process? Maybe I can test on another server with different setup, if the problem is not hidden there.
User avatar
JoshyPHP
Code Contributor
Posts: 1276
Joined: Mon Jul 11, 2011 12:28 am

Re: Catchable fatal error in s9e_renderer_... after upgrading from 3.0.14 to 3.2.0

Post by JoshyPHP »

It's a cron job that does that going from newest to oldest. Eventually all the posts are converted to XML.
I wrote the library that handles markup in phpBB 3.2+.
DeletedUser65749
I am too lazy to register

Re: Catchable fatal error in s9e_renderer_... after upgrading from 3.0.14 to 3.2.0

Post by DeletedUser65749 »

OK, I should have an hour or so to test this again afternoon. Is it the cron.php, or another? I will try to run it manually few times to see, what will happen. Maybe it's just not executed properly and posts not converted as expected.
User avatar
JoshyPHP
Code Contributor
Posts: 1276
Joined: Mon Jul 11, 2011 12:28 am

Re: Catchable fatal error in s9e_renderer_... after upgrading from 3.0.14 to 3.2.0

Post by JoshyPHP »

I don't know about the cron, I guess you'd have to keep reloading the forum index. You can also do that process via cli with the reparser:reparse. That said, it won't do anything since the XML in your database is correct. The only thing that matters is how the well-formed XML from the database becomes malformed when it reaches the renderer.
I wrote the library that handles markup in phpBB 3.2+.
DeletedUser65749
I am too lazy to register

Re: Catchable fatal error in s9e_renderer_... after upgrading from 3.0.14 to 3.2.0

Post by DeletedUser65749 »

Digging into the code, I have finally found it, and... it was caused by word censoring. Someone has added word

Code: Select all

<*>
to be replaced by

Code: Select all

-
Interesting is, it matched only the two tags and not any other.
Post Reply

Return to “[3.2.x] Support Forum”

cron