Feed manager failing to display some mojoPortal feeds

This is the place to report bugs and get support. When posting in this forum, please always provide as much detail as possible.

Please do not report problems with a custom build or custom code in this forum. If you are producing your own build from the source code and have problems or questions, ask in the developer forum, do not report it as a bug.

This is the place to report bugs and get support

When posting in this forum, please try to provide as many relevant details as possible. Particularly the following:

  • What operating system were you running when the bug appeared?
  • What database platform is your site using?
  • What version of mojoPortal are you running?
  • What version of .NET do you use?
  • What steps are necessary to reproduce the issue? Compare expected results vs actual results.
Please do not report problems with a custom build or custom code in this forum. If you are producing your own build from the source code and have problems or questions, ask in the developer forum.
This thread is closed to new posts. You must sign in to post in the forums.
3/23/2016 12:41:06 PM
Gravatar
Total Posts 503
feet planted firmly on the ground

Feed manager failing to display some mojoPortal feeds

Not a new issue, but still a problem. I have about 6 blogs in a site, and a feed manager bringing them together onto a page. Four display fine, two fail with this in the error log:

2016-03-23 16:16:21,407 ERROR xxx.xxx.xxx.xxx - en-GB - /home - mojoPortal.Web.FeedUI.FeedCache - There was a problem trying to read the feed for url https://mysite.com/Blog/RSS.aspx?p=200~180~-1.  Ignoring.

System.Xml.XmlException: Data at the root level is invalid. Line 1, position 1.

Since all of these are mojoPortal blogs within the same website, I'm unsure where to start. The configuration of each feed is done in the same way (all are absolute URLs with https). It appears to be a character encoding issue, and possibly it is triggered by something within the posts in the blog. Possibly relevant http://stackoverflow.com/questions/17947238/why-data-at-the-root-level-is-invalid-line-1-position-1-for-xml-document

Might it help to include a declaration like this at the top of the feed? <?xml version="1.0" encoding="ISO-8859-1"?>  When I analyse the XML it certainly complains about not being UTF-8.

Or might there be ways of loading the XML that are less prone to falling over as perhaps suggested by that StackOverflow page?

3/23/2016 1:12:28 PM
Gravatar
Total Posts 18444

Re: Feed manager failing to display some mojoPortal feeds

thing to consider is when feed manager makes a server side request for the feed it may be getting an error that you don't get in the web browser

and error response won't have any xml and therefore would log something like that since it is expecting xml and getting back most likely an html error page instead

you might review the iis logs to see what is being logged when the server side code requests the feed, ie look for a bad response code like 500 

3/24/2016 4:25:21 AM
Gravatar
Total Posts 503
feet planted firmly on the ground

Re: Feed manager failing to display some mojoPortal feeds

Hi Joe, thanks for that tip. I have checked the IIS logs and this is what I see:

2016-03-24 09:18:27 192.168.16.62 GET /Blog/RSS.aspx p=179~151~-1 443 - 82.69.43.209 Argotic-Syndication-Framework/2008.0.2.0 - 200 0 0 47
2016-03-24 09:18:27 192.168.16.62 GET /Blog/RSS.aspx p=200~180~-1 443 - 82.69.43.209 Argotic-Syndication-Framework/2008.0.2.0 - 200 0 0 15
2016-03-24 09:18:27 192.168.16.62 GET /Blog/RSS.aspx p=143~145~-1 443 - 82.69.43.209 Argotic-Syndication-Framework/2008.0.2.0 - 200 0 0 14
2016-03-24 09:18:27 192.168.16.62 GET /Blog/RSS.aspx p=481~594~-1 443 - 82.69.43.209 Argotic-Syndication-Framework/2008.0.2.0 - 200 0 0 25
2016-03-24 09:18:27 192.168.16.62 GET /Blog/RSS.aspx p=216~507~-1 443 - 82.69.43.209 Argotic-Syndication-Framework/2008.0.2.0 - 200 0 0 41
2016-03-24 09:18:29 192.168.16.62 GET /Blog/RSS.aspx p=476~582~-1 443 - 82.69.43.209 Argotic-Syndication-Framework/2008.0.2.0 - 200 0 0 39
2016-03-24 09:18:29 192.168.16.62 GET /Blog/RSS.aspx p=161~274~-1 443 - 82.69.43.209 Argotic-Syndication-Framework/2008.0.2.0 - 200 0 0 41

The lines I have made bold are the two blogs that throw errors every time, e.g.

2016-03-24 09:18:28,036 ERROR 1.2.3.4 - en-GB - / - mojoPortal.Web.FeedUI.FeedCache - There was a problem trying to read the feed for url https://mysite.com/Blog/RSS.aspx?p=143~145~-1.  Ignoring.
System.Xml.XmlException: Data at the root level is invalid. Line 1, position 1.

Can you suggest anything else to try?

3/24/2016 6:28:19 AM
Gravatar
Total Posts 18444

Re: Feed manager failing to display some mojoPortal feeds

Sorry, I'm about out of ideas. If any of those blogs are on role protected pages then it is still possible that the server side request is getting an empty 200 response.

There are ways of trying to work around it. ie a task that could read the feed periodically and dump it to a static xml file that the rss feature could point to instead of the dynamic feed url.

3/28/2016 12:35:44 PM
Gravatar
Total Posts 503
feet planted firmly on the ground

Re: Feed manager failing to display some mojoPortal feeds

I may have solved this, both in practice in my site plus a bug fix for mojoPortal.

The practical solution is to append &g={some guid} onto the URL of the problem feeds in the feed manager, where the guid is the one defined in app setting InternalFeedSecurityBypassKey as explained here https://www.mojoportal.com/using-the-blog-feed-in-feed-manager 

Then it loads fine in the Feed Manager. But this should have not been necessary, as I already had that app setting in place, and the documentation says that this will "pass the guid in the request for the feed and the blog rss page will allow it to be served if  it sees the correct guid".

I checked the code and found this below, which is never going to add the guid for a mojoPortal blog as it checks for ending in .aspx while our blogs end in stuff like "p=179~151~-1". 

        private static string FormatFeedUrl(string feedUrl, string siteRoot, string secureSiteRoot)
        {
            Guid internalSecurtyByPassKey = WebConfigSettings.InternalFeedSecurityBypassKey;

            if (internalSecurtyByPassKey != Guid.Empty)
            {
                if((feedUrl.StartsWith(siteRoot))||(feedUrl.StartsWith(secureSiteRoot)))
                {
                    if (feedUrl.EndsWith(".aspx"))
                    {
                        return feedUrl + "?g=" + internalSecurtyByPassKey.ToString();
                    }
                }

            }

So I think the XML parsing error I was seeing was because the blog module was returning nothing, because it is secured and the parameter was missing. So adding the guid parameter directly onto the feed url worked. However this does not explain why our other feeds worked, as they are also on secured pages! I think that the difference is that the blogs that were appearing had their feature instance security settings to permit all users to view (even though they were on secured pages), whereas the ones that did not display were role protected in the feature instance settings as well as being on secured pages. This is a little out of kilter with the documentation page referenced above, which suggests that the security bypass hack is determined by page-level security (e.g. "we do protect the feed with the same page roles"), but that's no big issue.

So the bug fix, if I have got the right end of this stick, is to fix (remove?) the check for the feed URL ending in .aspx and make the line something like

return feedUrl + "&g=" + internalSecurtyByPassKey.ToString();

(or if there could be a feed with .aspx, add an "else").

And a small clarification of the documentation page might be useful as well, to refer to feature instance security on the blog rather than page security.

 

 

You must sign in to post in the forums. This thread is closed to new posts.