Developer
Jul 19, 2012 at 6:48 AM
|
When I click the "Install a the database for a new site »" link I get an exception from N2 -- any idea why? The database exists but doesn't yet contain the N2 schema. These kinds of N2 deployment issues have been the bane of my existence
lately while working with Dynamico. If anyone could yield some insight as to why this is happening it would be much appreciated :-)
Server Error in '/' Application.
Table 'mw.n2item' doesn't exist
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error
and where it originated in the code.
Exception Details: MySql.Data.MySqlClient.MySqlException: Table 'mw.n2item' doesn't exist
Source Error:
Line 23: public ActionResult NotFound()
Line 24: {
Line 25: var closestMatch = Content.Traverse.Path(Request.AppRelativeCurrentExecutionFilePath.Trim('~', '/')).StopItem;
Line 26:
Line 27: var startPage = Content.Traverse.ClosestStartPage(closestMatch);
|
Source File: C:\Users\Ben\Dropbox\projects\xxx\MWMvc\Dinamico\Controllers\StartPageController.cs Line: 25
Stack Trace:
[MySqlException (0x80004005): Table 'mw.n2item' doesn't exist]
MySql.Data.MySqlClient.MySqlStream.ReadPacket() +276
MySql.Data.MySqlClient.NativeDriver.GetResult(Int32& affectedRow, Int32& insertedId) +68
MySql.Data.MySqlClient.Driver.GetResult(Int32 statementId, Int32& affectedRows, Int32& insertedId) +17
MySql.Data.MySqlClient.Driver.NextResult(Int32 statementId, Boolean force) +100
MySql.Data.MySqlClient.MySqlDataReader.NextResult() +785
MySql.Data.MySqlClient.MySqlCommand.ExecuteReader(CommandBehavior behavior) +1649
MySql.Data.MySqlClient.MySqlCommand.ExecuteDbDataReader(CommandBehavior behavior) +4
System.Data.Common.DbCommand.System.Data.IDbCommand.ExecuteReader() +12
NHibernate.AdoNet.AbstractBatcher.ExecuteReader(IDbCommand cmd) +279
NHibernate.Loader.Loader.GetResultSet(IDbCommand st, Boolean autoDiscoverTypes, Boolean callable, RowSelection selection, ISessionImplementor session) +240
NHibernate.Loader.Loader.DoQuery(ISessionImplementor session, QueryParameters queryParameters, Boolean returnProxies) +181
NHibernate.Loader.Loader.DoQueryAndInitializeNonLazyCollections(ISessionImplementor session, QueryParameters queryParameters, Boolean returnProxies) +126
NHibernate.Loader.Loader.LoadEntity(ISessionImplementor session, Object id, IType identifierType, Object optionalObject, String optionalEntityName, Object optionalIdentifier, IEntityPersister persister) +259
[GenericADOException: could not load an entity: [N2.ContentItem#2][SQL: SELECT contentite0_.ID as ID2_1_, contentite0_.ParentID as ParentID2_1_, contentite0_.Title as Title2_1_, contentite0_.Name as Name2_1_, contentite0_.ZoneName as ZoneName2_1_, contentite0_.TemplateKey as Template7_2_1_, contentite0_.TranslationKey as Translat8_2_1_, contentite0_.Created as Created2_1_, contentite0_.Updated as Updated2_1_, contentite0_.Published as Published2_1_, contentite0_.Expires as Expires2_1_, contentite0_.SortOrder as SortOrder2_1_, contentite0_.Visible as Visible2_1_, contentite0_.VersionOfID as Version15_2_1_, contentite0_.SavedBy as SavedBy2_1_, contentite0_.AncestralTrail as Ancestr17_2_1_, contentite0_.VersionIndex as Version18_2_1_, contentite0_.State as State2_1_, contentite0_.ChildState as ChildState2_1_, contentite0_.AlteredPermissions as Altered21_2_1_, contentite0_.Image as Image2_1_, contentite0_.Summary as Summary2_1_, contentite0_.Type as Type2_1_, contentite1_.ID as ID2_0_, contentite1_.ParentID as ParentID2_0_, contentite1_.Title as Title2_0_, contentite1_.Name as Name2_0_, contentite1_.ZoneName as ZoneName2_0_, contentite1_.TemplateKey as Template7_2_0_, contentite1_.TranslationKey as Translat8_2_0_, contentite1_.Created as Created2_0_, contentite1_.Updated as Updated2_0_, contentite1_.Published as Published2_0_, contentite1_.Expires as Expires2_0_, contentite1_.SortOrder as SortOrder2_0_, contentite1_.Visible as Visible2_0_, contentite1_.VersionOfID as Version15_2_0_, contentite1_.SavedBy as SavedBy2_0_, contentite1_.AncestralTrail as Ancestr17_2_0_, contentite1_.VersionIndex as Version18_2_0_, contentite1_.State as State2_0_, contentite1_.ChildState as ChildState2_0_, contentite1_.AlteredPermissions as Altered21_2_0_, contentite1_.Image as Image2_0_, contentite1_.Summary as Summary2_0_, contentite1_.Type as Type2_0_ FROM n2Item contentite0_ left outer join n2Item contentite1_ on contentite0_.ParentID=contentite1_.ID WHERE contentite0_.ID=?]]
NHibernate.Loader.Loader.LoadEntity(ISessionImplementor session, Object id, IType identifierType, Object optionalObject, String optionalEntityName, Object optionalIdentifier, IEntityPersister persister) +391
NHibernate.Loader.Entity.AbstractEntityLoader.Load(ISessionImplementor session, Object id, Object optionalObject, Object optionalId) +33
NHibernate.Loader.Entity.AbstractEntityLoader.Load(Object id, Object optionalObject, ISessionImplementor session) +17
NHibernate.Persister.Entity.AbstractEntityPersister.Load(Object id, Object optionalObject, LockMode lockMode, ISessionImplementor session) +104
NHibernate.Event.Default.DefaultLoadEventListener.LoadFromDatasource(LoadEvent event, IEntityPersister persister, EntityKey keyToLoad, LoadType options) +146
NHibernate.Event.Default.DefaultLoadEventListener.DoLoad(LoadEvent event, IEntityPersister persister, EntityKey keyToLoad, LoadType options) +470
NHibernate.Event.Default.DefaultLoadEventListener.Load(LoadEvent event, IEntityPersister persister, EntityKey keyToLoad, LoadType options) +93
NHibernate.Event.Default.DefaultLoadEventListener.ProxyOrLoad(LoadEvent event, IEntityPersister persister, EntityKey keyToLoad, LoadType options) +142
NHibernate.Event.Default.DefaultLoadEventListener.OnLoad(LoadEvent event, LoadType loadType) +381
NHibernate.Impl.SessionImpl.FireLoad(LoadEvent event, LoadType loadType) +318
NHibernate.Impl.SessionImpl.Get(String entityName, Object id) +344
NHibernate.Impl.SessionImpl.Get(Type entityClass, Object id) +288
NHibernate.Impl.SessionImpl.Get(Object id) +322
N2.Persistence.NH.ContentItemRepository.Get(Object id) in c:\Projekt\OSS\github\n2cms\n2cms\src\Framework\N2\Persistence\NH\ContentItemRepository.cs:22
N2.Web.UrlParser.get_StartPage() in c:\Projekt\OSS\github\n2cms\n2cms\src\Framework\N2\Web\UrlParser.cs:52
N2.Web.CachingUrlParserDecorator.get_StartPage() in c:\Projekt\OSS\github\n2cms\n2cms\src\Framework\N2\Web\CachingUrlParserDecorator.cs:40
N2.Collections.TraverseHelper.Path(String path, ContentItem startItem) in c:\Projekt\OSS\github\n2cms\n2cms\src\Framework\N2\Collections\TraverseHelper.cs:360
Dinamico.Controllers.StartPageController.NotFound() in C:\Users\Ben\Dropbox\projects\MiddlesexWater\MWMvc\Dinamico\Controllers\StartPageController.cs:25
lambda_method(Closure , ControllerBase , Object[] ) +62
System.Web.Mvc.ActionMethodDispatcher.Execute(ControllerBase controller, Object[] parameters) +14
System.Web.Mvc.ReflectedActionDescriptor.Execute(ControllerContext controllerContext, IDictionary`2 parameters) +214
System.Web.Mvc.ControllerActionInvoker.InvokeActionMethod(ControllerContext controllerContext, ActionDescriptor actionDescriptor, IDictionary`2 parameters) +27
System.Web.Mvc.<>c__DisplayClass15.<InvokeActionMethodWithFilters>b__12() +55
System.Web.Mvc.ControllerActionInvoker.InvokeActionMethodFilter(IActionFilter filter, ActionExecutingContext preContext, Func`1 continuation) +253
System.Web.Mvc.<>c__DisplayClass17.<InvokeActionMethodWithFilters>b__14() +21
System.Web.Mvc.ControllerActionInvoker.InvokeActionMethodWithFilters(ControllerContext controllerContext, IList`1 filters, ActionDescriptor actionDescriptor, IDictionary`2 parameters) +191
System.Web.Mvc.ControllerActionInvoker.InvokeAction(ControllerContext controllerContext, String actionName) +324
System.Web.Mvc.Controller.ExecuteCore() +106
System.Web.Mvc.ControllerBase.Execute(RequestContext requestContext) +91
System.Web.Mvc.ControllerBase.System.Web.Mvc.IController.Execute(RequestContext requestContext) +10
System.Web.Mvc.<>c__DisplayClassb.<BeginProcessRequest>b__5() +34
System.Web.Mvc.Async.<>c__DisplayClass1.<MakeVoidDelegate>b__0() +19
System.Web.Mvc.Async.<>c__DisplayClass8`1.<BeginSynchronous>b__7(IAsyncResult _) +10
System.Web.Mvc.Async.WrappedAsyncResult`1.End() +62
System.Web.Mvc.<>c__DisplayClasse.<EndProcessRequest>b__d() +48
System.Web.Mvc.SecurityUtil.<GetCallInAppTrustThunk>b__0(Action f) +7
System.Web.Mvc.SecurityUtil.ProcessInApplicationTrust(Action action) +22
System.Web.Mvc.MvcHandler.EndProcessRequest(IAsyncResult asyncResult) +60
System.Web.Mvc.MvcHandler.System.Web.IHttpAsyncHandler.EndProcessRequest(IAsyncResult result) +9
System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +9615056
System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +155
|
Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.17626
|
|
Developer
Jul 19, 2012 at 6:49 AM
|
and now this too
http://localhost:58410/Account/Login?ReturnUrl=%2fN2%2fInstallation%2fDefault.aspx
Server Error in '/' Application.
Table 'mw.n2item' doesn't exist
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the
error and where it originated in the code.
Exception Details: MySql.Data.MySqlClient.MySqlException: Table 'mw.n2item' doesn't exist
Source Error:
Line 23: public ActionResult NotFound()
Line 24: {
Line 25: var closestMatch = Content.Traverse.Path(Request.AppRelativeCurrentExecutionFilePath.Trim('~', '/')).StopItem;
Line 26:
Line 27: var startPage = Content.Traverse.ClosestStartPage(closestMatch);
|
Source File: C:\Users\Ben\Dropbox\projects\xxx\MWMvc\Dinamico\Controllers\StartPageController.cs Line: 25
Stack Trace:
[MySqlException (0x80004005): Table 'mw.n2item' doesn't exist]
MySql.Data.MySqlClient.MySqlStream.ReadPacket() +276
MySql.Data.MySqlClient.NativeDriver.GetResult(Int32& affectedRow, Int32& insertedId) +68
MySql.Data.MySqlClient.Driver.GetResult(Int32 statementId, Int32& affectedRows, Int32& insertedId) +17
MySql.Data.MySqlClient.Driver.NextResult(Int32 statementId, Boolean force) +100
MySql.Data.MySqlClient.MySqlDataReader.NextResult() +785
MySql.Data.MySqlClient.MySqlCommand.ExecuteReader(CommandBehavior behavior) +1649
MySql.Data.MySqlClient.MySqlCommand.ExecuteDbDataReader(CommandBehavior behavior) +4
System.Data.Common.DbCommand.System.Data.IDbCommand.ExecuteReader() +12
NHibernate.AdoNet.AbstractBatcher.ExecuteReader(IDbCommand cmd) +279
NHibernate.Loader.Loader.GetResultSet(IDbCommand st, Boolean autoDiscoverTypes, Boolean callable, RowSelection selection, ISessionImplementor session) +240
NHibernate.Loader.Loader.DoQuery(ISessionImplementor session, QueryParameters queryParameters, Boolean returnProxies) +181
NHibernate.Loader.Loader.DoQueryAndInitializeNonLazyCollections(ISessionImplementor session, QueryParameters queryParameters, Boolean returnProxies) +126
NHibernate.Loader.Loader.LoadEntity(ISessionImplementor session, Object id, IType identifierType, Object optionalObject, String optionalEntityName, Object optionalIdentifier, IEntityPersister persister) +259
[GenericADOException: could not load an entity: [N2.ContentItem#2][SQL: SELECT contentite0_.ID as ID2_1_, contentite0_.ParentID as ParentID2_1_, contentite0_.Title as Title2_1_, contentite0_.Name as Name2_1_, contentite0_.ZoneName as ZoneName2_1_, contentite0_.TemplateKey as Template7_2_1_, contentite0_.TranslationKey as Translat8_2_1_, contentite0_.Created as Created2_1_, contentite0_.Updated as Updated2_1_, contentite0_.Published as Published2_1_, contentite0_.Expires as Expires2_1_, contentite0_.SortOrder as SortOrder2_1_, contentite0_.Visible as Visible2_1_, contentite0_.VersionOfID as Version15_2_1_, contentite0_.SavedBy as SavedBy2_1_, contentite0_.AncestralTrail as Ancestr17_2_1_, contentite0_.VersionIndex as Version18_2_1_, contentite0_.State as State2_1_, contentite0_.ChildState as ChildState2_1_, contentite0_.AlteredPermissions as Altered21_2_1_, contentite0_.Image as Image2_1_, contentite0_.Summary as Summary2_1_, contentite0_.Type as Type2_1_, contentite1_.ID as ID2_0_, contentite1_.ParentID as ParentID2_0_, contentite1_.Title as Title2_0_, contentite1_.Name as Name2_0_, contentite1_.ZoneName as ZoneName2_0_, contentite1_.TemplateKey as Template7_2_0_, contentite1_.TranslationKey as Translat8_2_0_, contentite1_.Created as Created2_0_, contentite1_.Updated as Updated2_0_, contentite1_.Published as Published2_0_, contentite1_.Expires as Expires2_0_, contentite1_.SortOrder as SortOrder2_0_, contentite1_.Visible as Visible2_0_, contentite1_.VersionOfID as Version15_2_0_, contentite1_.SavedBy as SavedBy2_0_, contentite1_.AncestralTrail as Ancestr17_2_0_, contentite1_.VersionIndex as Version18_2_0_, contentite1_.State as State2_0_, contentite1_.ChildState as ChildState2_0_, contentite1_.AlteredPermissions as Altered21_2_0_, contentite1_.Image as Image2_0_, contentite1_.Summary as Summary2_0_, contentite1_.Type as Type2_0_ FROM n2Item contentite0_ left outer join n2Item contentite1_ on contentite0_.ParentID=contentite1_.ID WHERE contentite0_.ID=?]]
NHibernate.Loader.Loader.LoadEntity(ISessionImplementor session, Object id, IType identifierType, Object optionalObject, String optionalEntityName, Object optionalIdentifier, IEntityPersister persister) +391
NHibernate.Loader.Entity.AbstractEntityLoader.Load(ISessionImplementor session, Object id, Object optionalObject, Object optionalId) +33
NHibernate.Loader.Entity.AbstractEntityLoader.Load(Object id, Object optionalObject, ISessionImplementor session) +17
NHibernate.Persister.Entity.AbstractEntityPersister.Load(Object id, Object optionalObject, LockMode lockMode, ISessionImplementor session) +104
NHibernate.Event.Default.DefaultLoadEventListener.LoadFromDatasource(LoadEvent event, IEntityPersister persister, EntityKey keyToLoad, LoadType options) +146
NHibernate.Event.Default.DefaultLoadEventListener.DoLoad(LoadEvent event, IEntityPersister persister, EntityKey keyToLoad, LoadType options) +470
NHibernate.Event.Default.DefaultLoadEventListener.Load(LoadEvent event, IEntityPersister persister, EntityKey keyToLoad, LoadType options) +93
NHibernate.Event.Default.DefaultLoadEventListener.ProxyOrLoad(LoadEvent event, IEntityPersister persister, EntityKey keyToLoad, LoadType options) +142
NHibernate.Event.Default.DefaultLoadEventListener.OnLoad(LoadEvent event, LoadType loadType) +381
NHibernate.Impl.SessionImpl.FireLoad(LoadEvent event, LoadType loadType) +318
NHibernate.Impl.SessionImpl.Get(String entityName, Object id) +344
NHibernate.Impl.SessionImpl.Get(Type entityClass, Object id) +288
NHibernate.Impl.SessionImpl.Get(Object id) +322
N2.Persistence.NH.ContentItemRepository.Get(Object id) in c:\Projekt\OSS\github\n2cms\n2cms\src\Framework\N2\Persistence\NH\ContentItemRepository.cs:22
N2.Web.UrlParser.get_StartPage() in c:\Projekt\OSS\github\n2cms\n2cms\src\Framework\N2\Web\UrlParser.cs:52
N2.Web.CachingUrlParserDecorator.get_StartPage() in c:\Projekt\OSS\github\n2cms\n2cms\src\Framework\N2\Web\CachingUrlParserDecorator.cs:40
N2.Collections.TraverseHelper.Path(String path, ContentItem startItem) in c:\Projekt\OSS\github\n2cms\n2cms\src\Framework\N2\Collections\TraverseHelper.cs:360
Dinamico.Controllers.StartPageController.NotFound() in C:\Users\Ben\Dropbox\projects\MiddlesexWater\MWMvc\Dinamico\Controllers\StartPageController.cs:25
lambda_method(Closure , ControllerBase , Object[] ) +62
System.Web.Mvc.ActionMethodDispatcher.Execute(ControllerBase controller, Object[] parameters) +14
|
|
|
Coordinator
Jul 19, 2012 at 8:13 AM
|
The not found action and the login page tries to access the database before it's been created. The way I've tried to solve this is to redirect to the install page from an "installation checker", but in this case it seems the login page also tries to access
the database.
Try changing login page in web.config to n2/login.aspx
I'll see if I can put some guards around this.
|
|
Coordinator
Jul 19, 2012 at 11:08 PM
|
I'd like to know if checkInstallationStatus is false in web.config? There are some guards in this stack trace but they assume this setting is enabled.
|
|
Developer
Jul 20, 2012 at 4:48 PM
|
Navigating to ~/n2/login.aspx redirects me to http://localhost:58410/Account/Login?ReturnUrl=%2fn2%2flogin.aspx
Then, just like earlier,
Table 'mw2.n2item' doesn't exist
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: MySql.Data.MySqlClient.MySqlException: Table 'mw2.n2item' doesn't exist
checkInstallationStatus is indeed false.
<n2 xmlns="http://n2cms.com/schemas/configuration/v3">
<!-- If you install a database from scratch you'll need to insert some required pages.
This can be done by the web based installer located at http://yoursite/n2/installation/ -->
<host configSource="App_Data\n2_host.config" />
<engine>
<assemblies>
<!-- These assembly declarations are necessary in MEDIUM TRUST -->
</assemblies>
<!-- Update email to receive error reports -->
<errors action="Email" mailTo="" mailFrom="noreply@yourdomain.com" />
<!-- Globalization requires you to create additional start pages with a language -->
<globalization enabled="true" />
</engine>
<database connectionStringName="N2CMS" flavour="AutoDetect" caching="false" cacheProviderClass="NHibernate.Caches.SysCache2.SysCacheProvider, NHibernate.Caches.SysCache2"></database>
<edit>
<!-- Set checkInstallationStatus to false to disable redirect to install page -->
<installer checkInstallationStatus="false" />
<writers dynamic="true" />
<editors dynamic="true" />
<administrators dynamic="true" />
<images>
...
</images>
</edit>
</n2>
|
|
|
|
Looks like you may have run into an issue others were having with being redirected to /Account/Login. See this thread:
http://n2cms.codeplex.com/discussions/271854
Hope it helps.
|
|