Site crash & corrupted through simple module load.

Topics: Core, General
Mar 3, 2013 at 5:08 PM
Edited Mar 3, 2013 at 5:11 PM
I have recently chosen Orchard as my preferred CMS to develop and run a club web site. Having spent some hours working with Orchard ver 1.6 running on IIS 7 (configured for v4.0.30319 .Net Framework) adding pages and modules no problem.

Note that with modules I always do a load into a test copy of Orchard to establish operation.

I was enjoying working with and developing the live version when, after testing, I tried to load 'Upcoming Calendar Events - Version: 1.0' (CalendarPreview) module and, without warning the site crashed and has been corrupt and inoperable since. Whenever I try to run it in WebMatrix I get a 404 error unable to find '/'.

I have made many attempts to fix this, from running the 'package uninstall CalendarPreview' command (which didn't uninstall the module) through deleting the App_Data\cache.dat and App_Data\site\Default\Mapping.txt files and the CalendarPreview module folder. All to no avail as I am still getting the same error.

I am rather surprised that loading a simple module using the correct tool should result in such a catastropic failure.

Could somebody please suggest a way to get the website operational again. Surprisingly, I can't find any solution on the web.

I am extremely reluctant to rebuild the site from my last backup when there is a great risk that this may happen again.
Developer
Mar 4, 2013 at 12:02 AM
Excellent, this is the perfect example of why you should never install a module on a production site.

First of all, check the error logs in App_Data/Logs to find out where exactly the error is coming from. If it's indeed caused by the CalenderPreview module, you can disable it by going into the DB and removing all of its records from the following two tables:
  • Settings_ShellFeatureStateRecord
  • Settings_ShellFeatureRecord
  • Orchard_Framework_DataMigrationRecord
Recycle the AppPool and retry.
Mar 4, 2013 at 7:05 AM
Hi,

Thank you for the reply. You are right about never installing a module on a production site, thats why I have done all my development and testing work on a local copy. In fact, its because I had a server copy I was able to copy it back to my local machine to help with the testing.

I have carried out your suggested deletions from the tables and retried to run the app but it is still giving me the same error?

Here is a copy of the log file from this rerun:

2013-03-04 06:40:39,245 [6] Orchard.Environment.DefaultOrchardHost - A tenant could not be started: Default
NHibernate.PropertyNotFoundException: Could not find a setter for property 'Latitude' in class 'CalendarPreview.Models.CalendarPreviewRecord'
at NHibernate.Properties.BasicPropertyAccessor.GetSetter(Type type, String propertyName)
at NHibernate.Tuple.Entity.PocoEntityTuplizer.BuildPropertySetter(Property mappedProperty, PersistentClass mappedEntity)
at NHibernate.Tuple.Entity.AbstractEntityTuplizer..ctor(EntityMetamodel entityMetamodel, PersistentClass mappingInfo)
at NHibernate.Tuple.Entity.PocoEntityTuplizer..ctor(EntityMetamodel entityMetamodel, PersistentClass mappedEntity)
at NHibernate.Tuple.Entity.EntityEntityModeToTuplizerMapping..ctor(PersistentClass mappedEntity, EntityMetamodel em)
at NHibernate.Tuple.Entity.EntityMetamodel..ctor(PersistentClass persistentClass, ISessionFactoryImplementor sessionFactory)
at NHibernate.Persister.Entity.AbstractEntityPersister..ctor(PersistentClass persistentClass, ICacheConcurrencyStrategy cache, ISessionFactoryImplementor factory)
at NHibernate.Persister.Entity.SingleTableEntityPersister..ctor(PersistentClass persistentClass, ICacheConcurrencyStrategy cache, ISessionFactoryImplementor factory, IMapping mapping)
at NHibernate.Persister.PersisterFactory.CreateClassPersister(PersistentClass model, ICacheConcurrencyStrategy cache, ISessionFactoryImplementor factory, IMapping cfg)
at NHibernate.Impl.SessionFactoryImpl..ctor(Configuration cfg, IMapping mapping, Settings settings, EventListeners listeners)
at NHibernate.Cfg.Configuration.BuildSessionFactory()
at Orchard.Data.SessionFactoryHolder.BuildSessionFactory() in c:\Users\sebros\My Projects\Orchard\src\Orchard\Data\SessionFactoryHolder.cs:line 86
at Orchard.Data.SessionFactoryHolder.GetSessionFactory() in c:\Users\sebros\My Projects\Orchard\src\Orchard\Data\SessionFactoryHolder.cs:line 64
at Orchard.Data.SessionLocator.For(Type entityType) in c:\Users\sebros\My Projects\Orchard\src\Orchard\Data\SessionLocator.cs:line 29
at Orchard.Data.Repository1.get_Session() in c:\Users\sebros\My Projects\Orchard\src\Orchard\Data\Repository.cs:line 26
at Orchard.Data.Repository
1.get_Table() in c:\Users\sebros\My Projects\Orchard\src\Orchard\Data\Repository.cs:line 30
at Orchard.Data.Repository1.Fetch(Expression1 predicate) in c:\Users\sebros\My Projects\Orchard\src\Orchard\Data\Repository.cs:line 126
at Orchard.Data.Repository1.Get(Expression1 predicate) in c:\Users\sebros\My Projects\Orchard\src\Orchard\Data\Repository.cs:line 91
at Orchard.Data.Repository1.Orchard.Data.IRepository<T>.Get(Expression1 predicate) in c:\Users\sebros\My Projects\Orchard\src\Orchard\Data\Repository.cs:line 60
at Orchard.Core.Settings.Descriptor.ShellDescriptorManager.GetDescriptorRecord() in c:\Users\sebros\My Projects\Orchard\src\Orchard.Web\Core\Settings\Descriptor\ShellDescriptorManager.cs:line 57
at Orchard.Core.Settings.Descriptor.ShellDescriptorManager.GetShellDescriptor() in c:\Users\sebros\My Projects\Orchard\src\Orchard.Web\Core\Settings\Descriptor\ShellDescriptorManager.cs:line 30
at Orchard.Environment.ShellBuilders.ShellContextFactory.CreateShellContext(ShellSettings settings) in c:\Users\sebros\My Projects\Orchard\src\Orchard\Environment\ShellBuilders\ShellContextFactory.cs:line 66
at Orchard.Environment.DefaultOrchardHost.CreateShellContext(ShellSettings settings) in c:\Users\sebros\My Projects\Orchard\src\Orchard\Environment\DefaultOrchardHost.cs:line 174
at Orchard.Environment.DefaultOrchardHost.CreateAndActivateShells() in c:\Users\sebros\My Projects\Orchard\src\Orchard\Environment\DefaultOrchardHost.cs:line 134
2013-03-04 06:40:40,089 [6] Orchard.Environment.DefaultOrchardHost - A tenant could not be started: Default
NHibernate.PropertyNotFoundException: Could not find a setter for property 'Latitude' in class 'CalendarPreview.Models.CalendarPreviewRecord'
at NHibernate.Properties.BasicPropertyAccessor.GetSetter(Type type, String propertyName)
at NHibernate.Tuple.Entity.PocoEntityTuplizer.BuildPropertySetter(Property mappedProperty, PersistentClass mappedEntity)
at NHibernate.Tuple.Entity.AbstractEntityTuplizer..ctor(EntityMetamodel entityMetamodel, PersistentClass mappingInfo)
at NHibernate.Tuple.Entity.PocoEntityTuplizer..ctor(EntityMetamodel entityMetamodel, PersistentClass mappedEntity)
at NHibernate.Tuple.Entity.EntityEntityModeToTuplizerMapping..ctor(PersistentClass mappedEntity, EntityMetamodel em)
at NHibernate.Tuple.Entity.EntityMetamodel..ctor(PersistentClass persistentClass, ISessionFactoryImplementor sessionFactory)
at NHibernate.Persister.Entity.AbstractEntityPersister..ctor(PersistentClass persistentClass, ICacheConcurrencyStrategy cache, ISessionFactoryImplementor factory)
at NHibernate.Persister.Entity.SingleTableEntityPersister..ctor(PersistentClass persistentClass, ICacheConcurrencyStrategy cache, ISessionFactoryImplementor factory, IMapping mapping)
at NHibernate.Persister.PersisterFactory.CreateClassPersister(PersistentClass model, ICacheConcurrencyStrategy cache, ISessionFactoryImplementor factory, IMapping cfg)
at NHibernate.Impl.SessionFactoryImpl..ctor(Configuration cfg, IMapping mapping, Settings settings, EventListeners listeners)
at NHibernate.Cfg.Configuration.BuildSessionFactory()
at Orchard.Data.SessionFactoryHolder.BuildSessionFactory() in c:\Users\sebros\My Projects\Orchard\src\Orchard\Data\SessionFactoryHolder.cs:line 86
at Orchard.Data.SessionFactoryHolder.GetSessionFactory() in c:\Users\sebros\My Projects\Orchard\src\Orchard\Data\SessionFactoryHolder.cs:line 64
at Orchard.Data.SessionLocator.For(Type entityType) in c:\Users\sebros\My Projects\Orchard\src\Orchard\Data\SessionLocator.cs:line 29
at Orchard.Data.Repository1.get_Session() in c:\Users\sebros\My Projects\Orchard\src\Orchard\Data\Repository.cs:line 26
at Orchard.Data.Repository
1.get_Table() in c:\Users\sebros\My Projects\Orchard\src\Orchard\Data\Repository.cs:line 30
at Orchard.Data.Repository1.Fetch(Expression1 predicate) in c:\Users\sebros\My Projects\Orchard\src\Orchard\Data\Repository.cs:line 126
at Orchard.Data.Repository1.Get(Expression1 predicate) in c:\Users\sebros\My Projects\Orchard\src\Orchard\Data\Repository.cs:line 91
at Orchard.Data.Repository1.Orchard.Data.IRepository<T>.Get(Expression1 predicate) in c:\Users\sebros\My Projects\Orchard\src\Orchard\Data\Repository.cs:line 60
at Orchard.Core.Settings.Descriptor.ShellDescriptorManager.GetDescriptorRecord() in c:\Users\sebros\My Projects\Orchard\src\Orchard.Web\Core\Settings\Descriptor\ShellDescriptorManager.cs:line 57
at Orchard.Core.Settings.Descriptor.ShellDescriptorManager.GetShellDescriptor() in c:\Users\sebros\My Projects\Orchard\src\Orchard.Web\Core\Settings\Descriptor\ShellDescriptorManager.cs:line 30
at Orchard.Environment.ShellBuilders.ShellContextFactory.CreateShellContext(ShellSettings settings) in c:\Users\sebros\My Projects\Orchard\src\Orchard\Environment\ShellBuilders\ShellContextFactory.cs:line 66
at Orchard.Environment.DefaultOrchardHost.CreateShellContext(ShellSettings settings) in c:\Users\sebros\My Projects\Orchard\src\Orchard\Environment\DefaultOrchardHost.cs:line 174
at Orchard.Environment.DefaultOrchardHost.CreateAndActivateShells() in c:\Users\sebros\My Projects\Orchard\src\Orchard\Environment\DefaultOrchardHost.cs:line 134
2013-03-04 06:40:40,449 [10] Orchard.Environment.DefaultOrchardHost - A tenant could not be started: Default
NHibernate.PropertyNotFoundException: Could not find a setter for property 'Latitude' in class 'CalendarPreview.Models.CalendarPreviewRecord'
at NHibernate.Properties.BasicPropertyAccessor.GetSetter(Type type, String propertyName)
at NHibernate.Tuple.Entity.PocoEntityTuplizer.BuildPropertySetter(Property mappedProperty, PersistentClass mappedEntity)
at NHibernate.Tuple.Entity.AbstractEntityTuplizer..ctor(EntityMetamodel entityMetamodel, PersistentClass mappingInfo)
at NHibernate.Tuple.Entity.PocoEntityTuplizer..ctor(EntityMetamodel entityMetamodel, PersistentClass mappedEntity)
at NHibernate.Tuple.Entity.EntityEntityModeToTuplizerMapping..ctor(PersistentClass mappedEntity, EntityMetamodel em)
at NHibernate.Tuple.Entity.EntityMetamodel..ctor(PersistentClass persistentClass, ISessionFactoryImplementor sessionFactory)
at NHibernate.Persister.Entity.AbstractEntityPersister..ctor(PersistentClass persistentClass, ICacheConcurrencyStrategy cache, ISessionFactoryImplementor factory)
at NHibernate.Persister.Entity.SingleTableEntityPersister..ctor(PersistentClass persistentClass, ICacheConcurrencyStrategy cache, ISessionFactoryImplementor factory, IMapping mapping)
at NHibernate.Persister.PersisterFactory.CreateClassPersister(PersistentClass model, ICacheConcurrencyStrategy cache, ISessionFactoryImplementor factory, IMapping cfg)
at NHibernate.Impl.SessionFactoryImpl..ctor(Configuration cfg, IMapping mapping, Settings settings, EventListeners listeners)
at NHibernate.Cfg.Configuration.BuildSessionFactory()
at Orchard.Data.SessionFactoryHolder.BuildSessionFactory() in c:\Users\sebros\My Projects\Orchard\src\Orchard\Data\SessionFactoryHolder.cs:line 86
at Orchard.Data.SessionFactoryHolder.GetSessionFactory() in c:\Users\sebros\My Projects\Orchard\src\Orchard\Data\SessionFactoryHolder.cs:line 64
at Orchard.Data.SessionLocator.For(Type entityType) in c:\Users\sebros\My Projec
Developer
Mar 4, 2013 at 9:33 AM
Edited Mar 4, 2013 at 9:33 AM
It looks like there is still code / dlls from that module lingering somewhere. Make sure that you deleted the module from disk and check Dependencies and the Bin folder in the application root as well.
Mar 4, 2013 at 11:25 PM
Thanks again for your reply.

I have carried out all the following steps:
gone into the DB and removed all of records of 'CalenderPreview' from the following tables:

Settings_ShellFeatureStateRecord
Settings_ShellFeatureRecord
Orchard_Framework_DataMigrationRecord

I have deleted the following file(s):
the Module 'CalendarPreview'
\App_Data\cache.dat
\App_Data\Sites\Default\mappings.bin

I cannot see any revant DLL's in \Bin

Ran the website from Webmatrix and I still got the same error:

Server Error in '/' Application.

The resource cannot be found.
Description: HTTP 404. The resource you are looking for (or one of its dependencies) could have been removed, had its name changed, or is temporarily unavailable. Please review the following URL and make sure that it is spelled correctly.

Requested URL: /

I checked the Orchard Error log and a new record was created for today but it had no content.

Any ideas why loading a simple module (in this case 'Upcoming Calendar Events - Version: 1.0') would cause so much trouble when I preloaded it into my test Orchard 1.6 it worked perfectly?
Developer
Mar 5, 2013 at 12:44 AM
I don't know, but based on your error log there still must be a DLL somewhere. Did you delete the Dependencies folder too?
Mar 5, 2013 at 7:06 AM
Hi,

I hadn't deleted the Dependencies folder per se because I had misunderstood your suggestion.

I have again repeated all the steps listed in my last post this time including deleting the Dependencies folder and, regrettably, still getting the same errors.

Should I consider abandoning this and redo my work again on my server copy or is there any way I can recover the settings I have made into a new Orchard install?

Many thanks for your help.
Developer
Mar 5, 2013 at 10:20 AM
Sure, you could setup a new instance, copy over the App_Data/Sites/Default/Settings.txt and database file if you're using SQL CE, any Media folders, and any 3rd party modules and themes (including your own) and start fresh without having to redo your work.
Mar 6, 2013 at 8:41 AM
I have tried creating a new instance and copying the suggested files over, but to no avail, still getting the same error.

I have abandoned this approach now and resigned myself to reapplying the settings that I lost.

Thank you so much for the help and guidance you have given.