Subject: RSS feed stopped working

Posted on: 02/08/2014 11:47am
By: thatlinuxbox

Not sure if this happened after the 2.1.0 upgrade or if my feed was broken previously.

When I visit my rss feed url in a browser (Chrome or Firefox) it does not seem to parse properly.

http://thatlinuxbox.com/blog/backend/geeklog.rss

Chrome says:

PHP Formatted Code
This page contains the following errors:

error on line 2 at column 13: attributes construct error


Running "xmllint" commandline tool on the file (on the server) gives the same error:

PHP Formatted Code
$ xmllint geeklog.rss
geeklog.rss:2: parser error : attributes construct error
<rss version="2.0"xmlns:atom="http://www.w3.org/2005/Atom">
                  ^
geeklog.rss:2: parser error : Couldn't find end of Start Tag rss line 2
<rss version="2.0"xmlns:atom="http://www.w3.org/2005/Atom">
                  ^
geeklog.rss:2: parser error : Extra content at the end of the document
<rss version="2.0"xmlns:atom="http://www.w3.org/2005/Atom">
                  ^


I have compared my geeklog.rss to the one here on geeklog.net and I cannot find a material difference. I have trackbacks and pingbacks disabled (which I think is why there is a difference in line 2 between my site and geeklog.net's rss feed).

https://www.geeklog.net/backend/geeklog.rss


I tried manually stripping out all of the "items" in case there was something in the data of the feed, but that didn't make a difference.

Re: RSS feed stopped working

Posted on: 02/08/2014 12:09pm
By: Dirk

Hmm, there should be a blank between the version="2.0" and the xmlns: bit. At least that shuts up xmllint.

That appears to be a bug in Geeklog's rss.feed.class.php

However, since the blank is missing in both your and geeklog.net's RSS file, I'm not sure why it won't parse yours. Did you try enabling the Trackbacks again, just for kicks?


Re: RSS feed stopped working

Posted on: 02/08/2014 02:17pm
By: thatlinuxbox

I enabled trackbacks.

RSS feed updated.

Browsers still complain and xmllint still complains about the same spot.

PHP Formatted Code
$ xmllint geeklog.rss
geeklog.rss:2: parser error : attributes construct error
<rss version="2.0"xmlns:trackback="http://madskills.com/public/xml/rss/module/tr
                  ^
geeklog.rss:2: parser error : Couldn't find end of Start Tag rss line 2
<rss version="
2.0"xmlns:trackback="http://madskills.com/public/xml/rss/module/tr
                  ^
geeklog.rss:2: parser error : Extra content at the end of the document
<rss version="2.0"xmlns:trackback="http://madskills.com/public/xml/rss/module/tr
                  ^



I tried adding a space there manually. This causes a different validation error.

PHP Formatted Code

$ xmllint geeklog.rss
geeklog.rss:20: namespace error : Namespace prefix dc on subject is not defined
<dc:subject>Dan Stoner and Family</dc:subject>
           ^
geeklog.rss:30: namespace error : Namespace prefix dc on subject is not defined
<dc:subject>Dan Stoner and Family</dc:subject>
           ^
geeklog.rss:40: namespace error : Namespace prefix dc on subject is not defined
<dc:subject>Dan Stoner and Family</dc:subject>
           ^
geeklog.rss:50: namespace error : Namespace prefix dc on subject is not defined
<dc:subject>Dan Stoner and Family</dc:subject>
           ^
geeklog.rss:60: namespace error : Namespace prefix dc on subject is not defined
<dc:subject>News</dc:subject>
           ^
geeklog.rss:70: namespace error : Namespace prefix dc on subject is not defined
<dc:subject>Silly or Interesting</dc:subject>
           ^
geeklog.rss:80: namespace error : Namespace prefix dc on subject is not defined
<dc:subject>Linux, Open Source, and Tech Stuff</dc:subject>

<snip>

 


Re: RSS feed stopped working

Posted on: 02/08/2014 02:31pm
By: thatlinuxbox

Looks like the file validates if I also get rid of the "dc:" part of the "dc:subject" tags.


Re: RSS feed stopped working

Posted on: 02/08/2014 02:40pm
By: Dirk

This missing blank is a new bug in Geeklog 2.1.0.

The missing declaration of the dc: namespace is not new (still a bug, but we've never declared it before).

So xmllint is correct in complaining about that. However, does Chrome (I don't have it installed) still not parse the feed after you add the missing blank (but with the dc: bits still there)?

FWIW, the missing namespace declaration for the dc: namespace should look something like this:

PHP Formatted Code
<rss version="2.0" xmlns:dc="http://dublincore.org/documents/dcmi-namespace/">

Re: RSS feed stopped working

Posted on: 02/08/2014 03:20pm
By: Dirk

Correction: We always added the dc: namespace as xmlns:dc="http://purl.org/dc/elements/1.1/"

This doesn't seem to work any more in Geeklog 2.1.0, though Frown

Re: RSS feed stopped working

Posted on: 02/08/2014 04:16pm
By: thatlinuxbox

Quote by: DirkHowever, does Chrome (I don't have it installed) still not parse the feed after you add the missing blank (but with the dc: bits still there)?


Chrome has the same issue as xmllint when the dc: bits are there.

PHP Formatted Code

This page contains the following errors:

error on line 20 at column 12: Namespace prefix dc on subject is not defined
 


I tried hacking around with rss.feed.class.php and feedparserbase.class.php to add the space and strip out the dc: part but couldn't the dc: part to work. Seemed easy enough, just changing the contents of a quoted string... However, after modifying the class file when I save a story the site hangs and a new rss file is not generated.


- Dan Stoner

Re: RSS feed stopped working

Posted on: 02/08/2014 04:34pm
By: Dirk

I've tracked the problem down to some code refactoring that was done prior to the release of 2.1.0. It seems the dc: namespace declaration disappears when more namespaces are added. I'm not sure why that happens, though. See the bugreport I linked to in my previous post.

Geeklog - Forum
https://www.geeklog.net/forum/viewtopic.php?showtopic=95756