Orchard Feeds Aggregator

Jan 18, 2011 at 8:33 PM

Hi all, I'm trying to build a "page" with the Orchard Feeds Aggregator module.

I think I'll be fine with creating the Content Type to add that module but I can't seem to add a new feed.

For example, I've created a blog (on Orchard) with this URL:

http://www.denverazure.com/rss?containerid=33

But when I try to add that feed, I get this error:

"Creating feed failed: Invalid feed"
I'm hoping someone has had this working and can help out...otherwise, I'll create a bug in Issue Tracker.
Thanks,
Jayson
Developer
Jan 18, 2011 at 10:30 PM

I just uploaded a new version of the module to http://orchardproject.net/gallery/Packages/Modules/Details/Feeds-Aggregator-1-1. I didn't really do anything that I may associate with the repro you're getting but I've tried the feed you're suggesting and it seemed to work fine. Each feed has a name and a feed URL. The feed URL is the address you just provided. This needs to be the full address including the schema, port, etc as it is used like it is to fetch the feed (i.e. www.denverazure.com etc will not work but http://www.denverazure.com etc does).

Jan 18, 2011 at 11:32 PM

Hi anderod, thanks for the quick reply.

I just installed the 1.1 version and tried it again but I'm still getting the same error.

Here the exact values that I'm providing:

Name: Jayson's Cloudy Blog

Feed Url: http://www.denverazure.com/rss?containerid=33

Number of articles: 5

Owner: Jayson Go

 

I've also tried the default 0 value for Number of articles and Owner is already defaulted to my current User (Administrator role).

The Feed Url I'm providing is straight out of the Address Bar from my browser, which in IE's case, detects it correctly as a feed and displays the "Blog" view of it.

 

I wonder, is the Field being used for the Feed Url be potentially tied to a validation rule that may be different on my site than yours (where it is working)?

Jan 18, 2011 at 11:47 PM

So I looked at the source code, and found this in FeedService.cs

public bool IsValidFeedUrl(string url) {
            try {
                using (XmlReader xmlReader = XmlReader.Create(url)) {
                    XmlDocument xmlDocument = new XmlDocument();
                    xmlDocument.Load(xmlReader);

                    XmlNodeList xmlNodeList = xmlDocument.SelectNodes("rss");
                    if (xmlNodeList != null && xmlNodeList.Count > 0) {
                        return true;
                    }
                }

                return false;
            } catch {
                return false;
            }
        }

 

I inspected the payload from the URL that I've been providing and it does have an "rss" node.  

Now, judging from the fact that it actually takes a long time prior to the error to be displayed, I wonder if there's an exception being thrown from XmlReader.Create(...)

It may be a FileNotFoundException or SecurityException exception [1].

Thoughts?

 

 

[1] http://msdn.microsoft.com/en-us/library/w8k674bf.aspx 

Jan 19, 2011 at 3:01 AM

Shoot, I was way off... I checked the error logs and found this:

 

Log Name:     Application

Source:       ASP.NET 4.0.30319.0

Date:         1/18/2011 9:41:26 PM

Event ID:     1309

Task Category: Web Event

Level:         Warning

Keywords:     Classic

User:         N/A

Computer:     NNDEDICATED027

Description:

Event code: 3005

Event message: An unhandled exception has occurred.

Event time: 1/18/2011 9:41:26 PM

Event time (UTC): 1/19/2011 2:41:26 AM

Event ID: 3952c519a76b4ed296038bbfc475ade4

Event sequence: 35

Event occurrence: 3

Event detail code: 0

 

Application information:

   Application domain: /LM/W3SVC/13/ROOT-1-129398782545693505

   Trust level: Full

   Application Virtual Path: /

   Application Path: D:\sites\com.denverazure\www\

   Machine name: NNDEDICATED027

 

Process information:

   Process ID: 3120

   Process name: w3wp.exe

   Account name: NT AUTHORITY\NETWORK SERVICE

 

Exception information:

   Exception type: SqlException

   Exception message: Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding.

   at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection)

   at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection)

   at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning()

   at System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj)

   at System.Data.SqlClient.SqlDataReader.ConsumeMetaData()

   at System.Data.SqlClient.SqlDataReader.get_MetaData()

   at System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString)

   at System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async)

   at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, DbAsyncResult result)

   at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method)

   at System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior behavior, String method)

   at System.Data.SqlClient.SqlCommand.ExecuteDbDataReader(CommandBehavior behavior)

   at System.Data.Common.DbCommand.System.Data.IDbCommand.ExecuteReader()

   at NHibernate.AdoNet.AbstractBatcher.ExecuteReader(IDbCommand cmd)

   at NHibernate.Loader.Loader.GetResultSet(IDbCommand st, Boolean autoDiscoverTypes, Boolean callable, RowSelection selection, ISessionImplementor session)

   at NHibernate.Loader.Loader.DoQuery(ISessionImplementor session, QueryParameters queryParameters, Boolean returnProxies)

   at NHibernate.Loader.Loader.DoQueryAndInitializeNonLazyCollections(ISessionImplementor session, QueryParameters queryParameters, Boolean returnProxies)

   at NHibernate.Loader.Loader.LoadCollection(ISessionImplementor session, Object id, IType type)

 

 

 

Request information:

   Request URL: http://www.denverazure.com/rss?containerid=33

   Request path: /rss

   User host address: 216.249.107.61

   User:

   Is authenticated: False

   Authentication Type:

   Thread account name: NT AUTHORITY\NETWORK SERVICE

 

Thread information:

   Thread ID: 10

   Thread account name: NT AUTHORITY\NETWORK SERVICE

   Is impersonating: False

   Stack trace:   at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection)

   at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection)

   at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning()

   at System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj)

   at System.Data.SqlClient.SqlDataReader.ConsumeMetaData()

   at System.Data.SqlClient.SqlDataReader.get_MetaData()

   at System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString)

   at System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async)

   at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, DbAsyncResult result)

   at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method)

   at System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior behavior, String method)

   at System.Data.SqlClient.SqlCommand.ExecuteDbDataReader(CommandBehavior behavior)

   at System.Data.Common.DbCommand.System.Data.IDbCommand.ExecuteReader()

   at NHibernate.AdoNet.AbstractBatcher.ExecuteReader(IDbCommand cmd)

   at NHibernate.Loader.Loader.GetResultSet(IDbCommand st, Boolean autoDiscoverTypes, Boolean callable, RowSelection selection, ISessionImplementor session)

   at NHibernate.Loader.Loader.DoQuery(ISessionImplementor session, QueryParameters queryParameters, Boolean returnProxies)

   at NHibernate.Loader.Loader.DoQueryAndInitializeNonLazyCollections(ISessionImplementor session, QueryParameters queryParameters, Boolean returnProxies)

   at NHibernate.Loader.Loader.LoadCollection(ISessionImplementor session, Object id, IType type)

 

 

Custom event details: Event Xml:

<Event xmlns="http://schemas.microsoft.com/win/2004/08/events/event">

<System>

   <Provider Name="ASP.NET 4.0.30319.0" />

   <EventID Qualifiers="32768">1309</EventID>

   <Level>3</Level>

   <Task>3</Task>

   <Keywords>0x80000000000000</Keywords>

   <TimeCreated SystemTime="2011-01-19T02:41:26.000Z" />

   <EventRecordID>11686</EventRecordID>

   <Channel>Application</Channel>

   <Computer>NNDEDICATED027</Computer>

   <Security />

</System>

<EventData>

   <Data>3005</Data>

   <Data>An unhandled exception has occurred.</Data>

   <Data>1/18/2011 9:41:26 PM</Data>

   <Data>1/19/2011 2:41:26 AM</Data>

   <Data>3952c519a76b4ed296038bbfc475ade4</Data>

   <Data>35</Data>

   <Data>3</Data>

   <Data>0</Data>

   <Data>/LM/W3SVC/13/ROOT-1-129398782545693505</Data>

   <Data>Full</Data>

   <Data>/</Data>

   <Data>D:\sites\com.denverazure\www\</Data>

   <Data>NNDEDICATED027</Data>

   <Data>

   </Data>

   <Data>3120</Data>

   <Data>w3wp.exe</Data>

   <Data>NT AUTHORITY\NETWORK SERVICE</Data>

   <Data>SqlException</Data>

   <Data>Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding.

   at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection)

   at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection)

   at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning()

   at System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj)

   at System.Data.SqlClient.SqlDataReader.ConsumeMetaData()

   at System.Data.SqlClient.SqlDataReader.get_MetaData()

   at System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString)

   at System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async)

   at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, DbAsyncResult result)

   at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method)

   at System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior behavior, String method)

   at System.Data.SqlClient.SqlCommand.ExecuteDbDataReader(CommandBehavior behavior)

   at System.Data.Common.DbCommand.System.Data.IDbCommand.ExecuteReader()

   at NHibernate.AdoNet.AbstractBatcher.ExecuteReader(IDbCommand cmd)

   at NHibernate.Loader.Loader.GetResultSet(IDbCommand st, Boolean autoDiscoverTypes, Boolean callable, RowSelection selection, ISessionImplementor session)

   at NHibernate.Loader.Loader.DoQuery(ISessionImplementor session, QueryParameters queryParameters, Boolean returnProxies)

   at NHibernate.Loader.Loader.DoQueryAndInitializeNonLazyCollections(ISessionImplementor session, QueryParameters queryParameters, Boolean returnProxies)

   at NHibernate.Loader.Loader.LoadCollection(ISessionImplementor session, Object id, IType type)

 

</Data>

   <Data>http://www.denverazure.com/rss?containerid=33</Data>

   <Data>/rss</Data>

   <Data>216.249.107.61</Data>

   <Data>

   </Data>

   <Data>False</Data>

   <Data>

   </Data>

   <Data>NT AUTHORITY\NETWORK SERVICE</Data>

   <Data>10</Data>

   <Data>NT AUTHORITY\NETWORK SERVICE</Data>

   <Data>False</Data>

   <Data>   at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection)

   at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection)

   at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning()

   at System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj)

   at System.Data.SqlClient.SqlDataReader.ConsumeMetaData()

   at System.Data.SqlClient.SqlDataReader.get_MetaData()

   at System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString)

   at System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async)

   at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, DbAsyncResult result)

   at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method)

   at System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior behavior, String method)

   at System.Data.SqlClient.SqlCommand.ExecuteDbDataReader(CommandBehavior behavior)

   at System.Data.Common.DbCommand.System.Data.IDbCommand.ExecuteReader()

   at NHibernate.AdoNet.AbstractBatcher.ExecuteReader(IDbCommand cmd)

   at NHibernate.Loader.Loader.GetResultSet(IDbCommand st, Boolean autoDiscoverTypes, Boolean callable, RowSelection selection, ISessionImplementor session)

   at NHibernate.Loader.Loader.DoQuery(ISessionImplementor session, QueryParameters queryParameters, Boolean returnProxies)

   at NHibernate.Loader.Loader.DoQueryAndInitializeNonLazyCollections(ISessionImplementor session, QueryParameters queryParameters, Boolean returnProxies)

   at NHibernate.Loader.Loader.LoadCollection(ISessionImplementor session, Object id, IType type)

</Data>

</EventData>

</Event>

 

 

So it looks like a timeout issue...but the interesting thing is, the rest of the site works.

Just some background, I'm running this on a dedicated Server 2008.  I can take that very URL and load it on the same box without encountering a timeout.  Is it because the process calling XmlReader.Create is running as NETWORK SERVICE?  But why the timeout?

 

Developer
Jan 19, 2011 at 3:24 AM

I believe you're on the right track. Could you check if the same happens when you access the gallery module ? (e.g. Gallery -> Modules).

Jan 19, 2011 at 3:32 AM

I'm actually able to access Gallery -> Modules.  In fact, that's how I have been installing all of my modules.

Any other ideas what I should look at configuring?

Developer
Jan 19, 2011 at 6:23 AM
Edited Jan 19, 2011 at 6:28 AM

Have you tried setting it up in a clean website (not changed by 1.0 installation) ? im asking this because one of the things i fixed in v1.0 was that for some feeds the provided description was larger than the field in the DB.

Jan 19, 2011 at 2:28 PM
andrerod wrote:

Have you tried setting it up in a clean website (not changed by 1.0 installation) ? 

Can you clarify this statement?

I think what you mean is, have I tried setting up a new website with v1.1 of the Feeds Aggregator, where v1.0 was never installed prior.

 

Does Orchard provide an "uninstall" feature?  Are there tables that I can simply drop? Or a column that I can ALTER the field size?

 

BTW, I was able to add other feeds that do not originate from my Orchard blog.

Developer
Jan 19, 2011 at 7:47 PM
Edited Jan 19, 2011 at 7:49 PM

Exactly. So the problem must really be the one I suggest.

 

At the moment Orchard does not indeed provide an uninstall feature which removes the data. However, you should be able to drop the tables from prior installation.

 

If you are running Orchard on SQL CE by using an utility like:

http://sqlcetoolbox.codeplex.com/releases/view/54842

or by installating Visual Studio 2010 SP1.

You should point the utility of your choice to : App_Data\Sites\Default\Orchard.sdf.

 

Or using SQL Management Studio if using SQL Server.

 

You should drop the Contrib_FeedsAggregator_* tables.

Jan 20, 2011 at 3:43 PM

Hi Andre,

(FYI, my datastore is SQL SERVER 2008, not CE)

I went ahead and deleted all the Contrib_FeedsAggregator_* tables and unfortunately it does not reinstall those tables.  So, I spun up a new Orchard site, and scripted those tables out.

After doing so, I unfortunately still get the same error.  I also tried adding that same url to the new site that I just spun up and I get the same error.

 

I'll keep investigating on my side since it sounds like the issue is related to the fact that I'm running this on my dedicated server.  I'll also upgrade to SQL R2.  I'll report back whatever I find.

Developer
Jan 20, 2011 at 11:19 PM

Ok. I just tried the setup on Win7 + IIS7 + SQL 2008 and it worked just fine on a fresh orchard install. I can hook up and see the feed you suggest.

 

Regarding your installation.

- access your SQL Management studio and hook it to your DB and run the following

drop table Orchard_Contrib_FeedsAggregator_FeedNewsRecord

drop table Orchard_Contrib_FeedsAggregator_FeedPartRecord

drop table Orchard_Contrib_FeedsAggregator_FeedsAggregatorFeedRecord

drop table Orchard_Contrib_FeedsAggregator_FeedsAggregatorPartRecord

delete fromOrchard_Settings_ShellFeatureRecor  d

where

Name='Contrib.FeedsAggregator'

delete

 from Orchard_Settings_ShellFeaturestateRecord

where

Name='Contrib.FeedsAggregator'

delete

 from Orchard_Orchard_Framework_DataMigrationRecord

where

DataMigrationClass=

'Contrib.FeedsAggregator.Migrations'

 

 Then go to app_data\cache.dat and remove Contrib.FeedAggregator from there. save. Then go to Web.config and add a space somewhere (just to make the file beeing update and force a IIS refresh). save.

 

Then you should be able to reenable the feeds module fine.

 

Note: The only reason why you need to do this is because you are running on a live system and, unfortunately, from v1.0 to v1.1 of feeds aggregator (since it was only up for less than 1 day) i did not include migration scripts which would handle this for you. I probably should have and we're always learning ...



Hope it helps,

Andre

Developer
Jan 20, 2011 at 11:27 PM

Also if it still happens, try to attach VS to your IIS instance and track the exact exception point down. You can do that by:

- accessing the page for the feed configuration normally in IE

- open VS and point it to orchard source as synched from orchard.codeplex.com

- compile the project from source

- go to debug -> Attach to Process -> select w3wp.exe (if multiple, there should be one that says managed code 4.0)

- enable breaking on all exceptions by going to debug -> exceptions -> and select CLR exceptions

- press save after filling up the data on IE. VS should pick up and display the exception together with the place in orchard code where it happened...

Jan 21, 2011 at 1:29 AM

Andre, thanks for the info.

I do know the module works with 'external' feeds.  Can you do me a favor and try to create a blog on the very same orchard install and then try to add it?  I have a feeling that the db timeout is being caused at the data layer (possibly a table lock, or something).  I'll profile SQL also and see what's going on.

But if you can just try that for me, I would really appreciate the confirmation (either way).

Thanks,
Jayson 

Developer
Jan 21, 2011 at 1:38 AM

I'm confused... That exception happens when you try to register a feed under dashboard -> feeds -> add. How can u be getting it when a feed is attached to a blog or blog post ?

In any case... i tried it just now and it worked fine. If you still have issues. please contact me privately and I'd be glad to try to help further ...

Jan 21, 2011 at 3:44 AM

Yes, the timeout exception happens when i add my own feed using dashboard > feeds > add.  The same cannot be said for external feeds.

I have sent you a private message :)

Thanks.

Developer
Jan 21, 2011 at 3:52 AM

Oh... I see what you mean... you're adding a feed that your orchard installation is generating into a feed aggregator of that same orchard installation. That, I have not tried :) Let's discuss this privately to see if we can figure it out.

Jan 21, 2011 at 4:03 AM

exactly :)

Jan 24, 2011 at 8:27 PM

Hi Andre, i sent you a private message last week... but I'm not sure if it made it.  I provided you with more details there.

Thanks... and also, since you know what I'm trying to do now... can you just do a quick test to see if you can add your own orchard blog to the Feeds Aggregator of the same orchard installation.

Developer
Jan 24, 2011 at 8:38 PM
Edited Jan 24, 2011 at 8:49 PM

Hi Jayson,


Unfortunately I've been busy with other topics and therefore still didnt had time to look at that after our discussions on what exactly you were trying to achieve. Pointing the feed aggregator to a feed of the same page is something i have not developed the module for so it's not a supported scenario for now - I didn't considered it to be a main scenario :) I aim at creating a new version in the future that will support (handle) that. Of course, if you feel like it, you can contribute your own fix for it and do a push request into http://orchardfeeds.codeplex.com/.

Andre

Jan 24, 2011 at 8:48 PM

No problem.  What I want for my website is for a few people with their own blogs that will aggregate onto one blog page.

I think what I'll do is right my own module for it.  Thanks!

Developer
Jan 24, 2011 at 9:08 PM
Edited Jan 24, 2011 at 9:09 PM

Yes. As I replied to you I understood the problem now just didnt had the time to look at it yet :(

New contributions are always welcome and if you take that route feel free to upload it to http://orchardproject.net/gallery/ :)

Jan 24, 2011 at 11:11 PM

actually I have a fix for it.  ill submit it orchardfeeds, now.

do you think you'll be able to review it and publish a new version or can you upgrade me to contributor?

Developer
Jan 24, 2011 at 11:17 PM

Awesome :) Sure. I'll add you as contributor.

Jan 25, 2011 at 4:13 AM

It's fixed.  I decided to fix it on tip and not on a fork (I hope that's okay).

When you get a chance, can you push a 1.2 version out to the gallery?

Thanks!