timeout in atom feed generation (again)

Found a bug? Tell us!!
Post Reply
hanno
Regular
Posts: 72
Joined: Fri May 20, 2005 8:04 am
Contact:

timeout in atom feed generation (again)

Post by hanno »

After updating to 2.1.2 (from 2.1.1) I get a timeout on my atom feed (https://blog.hboeck.de/feeds/atom.xml).

I had such a bug before in 2016, reported here [1], but back then it disappeared when I moved from serendipity 2.0 to 2.1. Seems the bug is back now for whatever reason...

Any help appreciated...

[1] viewtopic.php?f=3&t=20765
Last edited by hanno on Thu Mar 29, 2018 8:49 am, edited 1 time in total.
thh
Regular
Posts: 419
Joined: Thu Oct 26, 2006 2:38 pm
Location: Stuttgart, Germany
Contact:

Re: timeout in atom feed generation (again)

Post by thh »

hanno wrote:After updating to 2.1.1
To avoid confusion: it's 2.1.2, I think, according to your blog.

(Sorry, can't comment on the bug itself any further ...)
hanno
Regular
Posts: 72
Joined: Fri May 20, 2005 8:04 am
Contact:

Re: timeout in atom feed generation (again)

Post by hanno »

thh wrote:To avoid confusion: it's 2.1.2, I think, according to your blog.
True, I have edited the original post to clarify/correct.
yellowled
Regular
Posts: 7111
Joined: Fri Jan 13, 2006 11:46 am
Location: Eutin, Germany
Contact:

Re: timeout in atom feed generation (again)

Post by yellowled »

Well, since at least I can not reproduce it in 2.1.2, it is at least likely that there is something specific to your installation that creates this. Any "special" technical features (already on PHP 7.2, using PostgreSQL, etc.)? Are you maybe using any (event) plugins that somehow mess with the feed generation? How do the settings in your syndication (sidebar) plugin look like? Any fancy redirecting in the .htaccess going on?

YL
hanno
Regular
Posts: 72
Joined: Fri May 20, 2005 8:04 am
Contact:

Re: timeout in atom feed generation (again)

Post by hanno »

I'm pretty sure it's not one of the plugins, disabling practically everything doesn't change things.
Also same thing happens when I completely remove the htaccess and access the non-rewritten atom url.

No error in the logs whatsoever... running on PHP 7.1. I'm a bit lost what to look for.
onli
Regular
Posts: 2825
Joined: Tue Sep 09, 2008 10:04 pm
Contact:

Re: timeout in atom feed generation (again)

Post by onli »

It is related to the atom version parsing. https://blog.hboeck.de/feeds/atom2.0.xml works fine. It might be the discover_rss function call in https://github.com/s9y/Serendipity/blob ... ss.php#L22 that somehow times out, and isn't `list($version) = ...` really strange code that should not work at all? Maybe that was vodoo that stopped working as was intended in PHP 7.1. https://secure.php.net/manual/en/function.list.php even has a warning in that direction.

Could you test whether changing in your rss.php the code from

Code: Select all

list($version) = serendipity_discover_rss($_GET['file'], $_GET['ext']);
to

Code: Select all

$version = serendipity_discover_rss($_GET['file'], $_GET['ext'])[0];
fixes the bug?

If not, another solution would be to add a redirect from atom.xml to atom2.0.xml.
hanno
Regular
Posts: 72
Joined: Fri May 20, 2005 8:04 am
Contact:

Re: timeout in atom feed generation (again)

Post by hanno »

onli wrote:It is related to the atom version parsing. https://blog.hboeck.de/feeds/atom2.0.xml works fine.
That enables the rss feed, because there is no atom 2.0. Your proposed change doesn't work.

By adding debugging statements I figured out the line it hangs is this:
$serendipity['smarty']->display($metadata['template_file']);
hanno
Regular
Posts: 72
Joined: Fri May 20, 2005 8:04 am
Contact:

Re: timeout in atom feed generation (again)

Post by hanno »

hanno wrote:By adding debugging statements I figured out the line it hangs is this:
$serendipity['smarty']->display($metadata['template_file']);
Answering to myself: I think this gave me a hint where the problem was heading.
I use my own theme and that comes back from a much older s9y version. Maybe there's some incompatibility, in any case replacing the feed_atom1.0.tpl with the one from the default theme seems to fix things. Not sure why, here's the differences between the files:

> <?xml-stylesheet href="{serendipity_getFile file='atom.css'}" type="text/css" ?>
14d14
< <link rel="stylesheet" href="{serendipity_getFile file='atom.css'}" type="text/css" />
50,51c50,53
< <content type="html">
< <![CDATA[{$entry.feed_body} {$entry.feed_ext}]]>
---
> <content type="xhtml" xml:base="{$serendipityBaseURL}">
> <div xmlns="http://www.w3.org/1999/xhtml">
> {$entry.feed_body} {$entry.feed_ext}
> </div>


In any case: For me it's fixed now, thanks everyone who tried to help.
Post Reply