Moving Umbraco to new server and error all over website
Hi, we recently took over a website which uses Umbraco and is hosted on a new Windows Server 2008 (IIS7), I have been unable to get past the error 'Object reference not set to an instance of an object'. This error occurs on every page that I try and view and this is my first time using Windows Server 2008 and Umbraco (I am a Linux apache / nginx man myself) and I have no idea how to solve this.
From the old hosting company I got the files zip and DB .bak file and the advice to 'raise the permissions of the Umbraco user in the DB'. I have got the website set-up in IIS 7 and got FTP working so got the files up and was able to restore the DB backup in SQL Server 2012.
Today I found the Umbraco installation guide here (Guide Link) and followed the step to change the permissions on the folder and set-up the DB but when I created the new DB login I got a message saying that the user already existed (the DB user did already exist).
There were some .bin file version conflicts but I was able to solve them and the files I got from the old host didn't have any Umbraco config values in the web.config which meant I got a 'MVC Area path without the umbracoPathspecified' error. Setting this: '<add key="umbracoPath" value="/umbraco" /> (amongst other things) in web.config solved that error.
I do not know which version of Umbraco is being used and I did investigate ways to find out but was unable to get anywhere
Thanks for any help anyone can give me and apologies if I have just missed something basic, I have put the Stack Trace I get on some pages below:
On the homepage I get the following Stack Trace:
[InvalidOperationException: Cannot create an MVC Area path without the umbracoPath specified]
ASP.umbraco_umbraco_aspx.__BuildControlClientLoader() in c:\web_root\the_cornwall\Umbraco\umbraco.aspx:20
ASP.umbraco_umbraco_aspx.__BuildControl__control2() in c:\web_root\the_cornwall\Umbraco\umbraco.aspx:15
ASP.umbraco_umbraco_aspx.__BuildControlTree(umbraco_umbraco_aspx __ctrl) in c:\web_root\the_cornwall\Umbraco\umbraco.aspx:1
ASP.umbraco_umbraco_aspx.FrameworkInitialize() in c:\Windows\Microsoft.NET\Framework64\v4.0.30319\Temporary ASP.NET Files\root\f617adde\f3f1d6d4\App_Web_mdemwffx.14.cs:0
ASP.umbraco_umbraco_aspx.ProcessRequest(HttpContext context) in c:\Windows\Microsoft.NET\Framework64\v4.0.30319\Temporary ASP.NET Files\root\f617adde\f3f1d6d4\App_Web_mdemwffx.14.cs:0
Thanks for that, nail on the head, who would have thought that web.config would be completely overwritten with pretty much nothing that it originally had in it
I do have a new error now 'The network path was not found' should I post a new topic on this and include teh stack trace?
Just post the error in here - at a first glance it sounds like an issue with the connection string - Could it be a firewall issue or maybe even a VPN issue?
Thanks for the quick response Jan, here is the error it occurs on the homepage (/) but I can get to the /umbraco page with no trouble, just looking at the stack trace it looks like a problem with the DB could it be that somewhere the DB is defined but it is wrong for the new server? Also how do you configure the server to allow remote connections?
Thanks again
Exception Details: System.ComponentModel.Win32Exception: The network path was not found
Source Error:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
Stack Trace:
[Win32Exception (0x80004005): The network path was not found]
[SqlException (0x80131904): A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server)]
I was able to fix that last problem myself, turns out there was a DB config parameter that I needed to change, had some fun getting the user to work but got there in the end.
Now the website works but there are other problems occuring on the page: Error loading MacroEngine script (file: ) and some digging on Google suggests it could be related to Umbraco? I saw someone on StackOverflow turned on a debug get variable (?umbDebugShowTrace=true) but it didn't give me any extra information unfortunately.
Is this still related to Umbraco and can anyone help me get to the bottom of what is going on?
umbDebugShowtrace does not work on Umbraco 7. But you should be able to get some more hints about the error and the files where it's happening in the trace log in /App_Data/Logs - Do you see anything marked with "ERROR"?
In short macroErrors are related to Umbraco and it can be caused by different things. Most likely some code syntax that is not valid for some reason.
I got the following errors in the trace log, the code I have does come from a working live website, that error is repeated a couple of times but the number next to the timestamp goes up a bit each time:
2015-03-11 17:19:07,610 [53] WARN Umbraco.Web.Routing.DefaultUrlProvider - [Thread 58] Couldn't find any page with nodeId=2143. This is most likely caused by the page not being published.
2015-03-11 17:19:07,610 [53] WARN Umbraco.Web.Routing.DefaultUrlProvider - [Thread 58] Couldn't find any page with nodeId=1491. This is most likely caused by the page not being published.
2015-03-11 17:19:07,751 [53] WARN umbraco.macro - [Thread 58] Error loading MacroEngine script (file: , Type: ''. Exception: System.ApplicationException: Could not create an index searcher with the supplied lucene directory ---> System.IO.IOException: read past EOF
at Lucene.Net.Index.SegmentInfos.FindSegmentsFile.Run(IndexCommit commit)
at Lucene.Net.Search.IndexSearcher..ctor(Directory path, Boolean readOnly)
at Examine.LuceneEngine.Providers.LuceneSearcher.ValidateSearcher(Boolean forceReopen)
--- End of inner exception stack trace ---
at Examine.LuceneEngine.Providers.LuceneSearcher.ValidateSearcher(Boolean forceReopen)
at Examine.LuceneEngine.Providers.LuceneSearcher.GetSearchFields()
at UmbracoExamine.UmbracoExamineSearcher.GetSearchFields()
at UmbracoExamine.UmbracoExamineSearcher.CreateSearchCriteria(String type, BooleanOperation defaultOperation)
at umbraco.MacroEngines.ExamineBackedMedia.GetUmbracoMedia(Int32 id)
at umbraco.MacroEngines.Library.RazorLibraryCore.MediaById(Int32 Id)
at umbraco.MacroEngines.DynamicNode.MediaById(String Id)
at ASP._Page_macroScripts_flexslider_cshtml.Execute() in c:\web_root\the_cornwall\MacroScripts\flexslider.cshtml:line 13
at System.Web.WebPages.WebPageBase.ExecutePageHierarchy()
at System.Web.WebPages.WebPage.ExecutePageHierarchy()
at System.Web.WebPages.WebPageBase.ExecutePageHierarchy(WebPageContext pageContext, TextWriter writer, WebPageRenderingBase startPage)
at ASP._Page_App_Data_TEMP_Razor_inline_31b15e5339fbdd040baa06bad66a9aa3_cshtml.Execute() in c:\**web_directory**l\App_Data\TEMP\Razor\inline-31b15e5339fbdd040baa06bad66a9aa3.cshtml:line 7
at System.Web.WebPages.WebPageBase.ExecutePageHierarchy()
at System.Web.WebPages.WebPage.ExecutePageHierarchy()
at System.Web.WebPages.WebPageBase.ExecutePageHierarchy(WebPageContext pageContext, TextWriter writer, WebPageRenderingBase startPage)
at umbraco.MacroEngines.RazorMacroEngine.ExecuteRazor(MacroModel macro, INode currentPage)
at umbraco.MacroEngines.RazorMacroEngine.Execute(MacroModel macro, INode currentPage)
at umbraco.macro.loadMacroScript(MacroModel macro)
at umbraco.macro.renderMacro(Hashtable pageElements, Int32 pageId)
Looks like your hosting provider needs to set up write permissions for the app_data folder and everything under it. Umbraco is trying to write search indexes in it.
Thanks for looking into that, I am also the hosting provider (this is my first Windows server 2008 install) I looked on the permissions for the app_data folder and it looks like a load of users already have write permissions. What user is it I need to set write permissions for?
Thankyou both Sebastiaan and Jan, I have been able to solve the problems and get the website working :D. I sorted the permissions as per the link but there was still a problem so I did a bit of searching on the error and came across this Stack Overflow post http://stackoverflow.com/questions/18110298/umbraco-v6-1-3-lucene-index-corruption where they suggested deleting the indexes in /App_Data/TEMP and restarting the app pool. Did that and it worked.
Moving Umbraco to new server and error all over website
Hi, we recently took over a website which uses Umbraco and is hosted on a new Windows Server 2008 (IIS7), I have been unable to get past the error 'Object reference not set to an instance of an object'. This error occurs on every page that I try and view and this is my first time using Windows Server 2008 and Umbraco (I am a Linux apache / nginx man myself) and I have no idea how to solve this.
From the old hosting company I got the files zip and DB .bak file and the advice to 'raise the permissions of the Umbraco user in the DB'. I have got the website set-up in IIS 7 and got FTP working so got the files up and was able to restore the DB backup in SQL Server 2012.
Today I found the Umbraco installation guide here (Guide Link) and followed the step to change the permissions on the folder and set-up the DB but when I created the new DB login I got a message saying that the user already existed (the DB user did already exist).
There were some .bin file version conflicts but I was able to solve them and the files I got from the old host didn't have any Umbraco config values in the web.config which meant I got a 'MVC Area path without the umbracoPathspecified' error. Setting this: '<add key="umbracoPath" value="/umbraco" /> (amongst other things) in web.config solved that error.
I do not know which version of Umbraco is being used and I did investigate ways to find out but was unable to get anywhere
Thanks for any help anyone can give me and apologies if I have just missed something basic, I have put the Stack Trace I get on some pages below:
On the homepage I get the following Stack Trace:
[InvalidOperationException: Cannot create an MVC Area path without the umbracoPath specified]
Umbraco.Core.Configuration.GlobalSettings.get_UmbracoMvcArea() +343
Umbraco.Web.WebBootManager.Complete(Action`1 afterComplete) +32
Your web.config file is probably missing one or more entries, make sure to compare it to your local one. See this post for more information : https://our.umbraco.org/forum/getting-started/installing-umbraco/40574-Cannot-create-an-MVC-Area-path-without-the-umbracoPath-specified
Thanks for that, nail on the head, who would have thought that web.config would be completely overwritten with pretty much nothing that it originally had in it
I do have a new error now 'The network path was not found' should I post a new topic on this and include teh stack trace?
Thanks again
Hi Richard and welcome to our :)
Just post the error in here - at a first glance it sounds like an issue with the connection string - Could it be a firewall issue or maybe even a VPN issue?
/Jan
Thanks for the quick response Jan, here is the error it occurs on the homepage (/) but I can get to the /umbraco page with no trouble, just looking at the stack trace it looks like a problem with the DB could it be that somewhere the DB is defined but it is wrong for the new server? Also how do you configure the server to allow remote connections?
Thanks again
Exception Details: System.ComponentModel.Win32Exception: The network path was not found
Source Error:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
Stack Trace:
[Win32Exception (0x80004005): The network path was not found]
[SqlException (0x80131904): A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server)]
System.Data.ProviderBase.DbConnectionPool.TryGetConnection(DbConnection owningObject, UInt32 waitForMultipleObjectsTimeout, Boolean allowCreate, Boolean onlyOneCheckConnection, DbConnectionOptions userOptions, DbConnectionInternal& connection) +642
System.Data.ProviderBase.DbConnectionPool.TryGetConnection(DbConnection owningObject, TaskCompletionSource`1 retry, DbConnectionOptions userOptions, DbConnectionInternal& connection) +116
System.Data.ProviderBase.DbConnectionFactory.TryGetConnection(DbConnection owningConnection, TaskCompletionSource`1 retry, DbConnectionOptions userOptions, DbConnectionInternal oldConnection, DbConnectionInternal& connection) +1079
System.Data.ProviderBase.DbConnectionInternal.TryOpenConnectionInternal(DbConnection outerConnection, DbConnectionFactory connectionFactory, TaskCompletionSource`1 retry, DbConnectionOptions userOptions) +6610951
System.Data.SqlClient.SqlConnection.TryOpenInner(TaskCompletionSource`1 retry) +233
System.Data.SqlClient.SqlConnection.TryOpen(TaskCompletionSource`1 retry) +278
System.Data.SqlClient.SqlConnection.Open() +239
Microsoft.ApplicationBlocks.Data.SqlHelper.ExecuteReader(String connectionString, CommandType commandType, String commandText, SqlParameter[] commandParameters) +90
umbraco.DataLayer.SqlHelpers.SqlServer.SqlServerHelper.ExecuteReader(String commandText, SqlParameter[] parameters) +26
umbraco.DataLayer.SqlHelper`1.ExecuteReader(String commandText, IParameter[] parameters) +161
[SqlHelperException: Umbraco Exception (DataLayer): SQL helper exception in ExecuteReader]
umbraco.DataLayer.SqlHelper`1.ExecuteReader(String commandText, IParameter[] parameters) +361
umbraco.cms.businesslogic.web.Domain.<GetDomains>b__0() +145
Umbraco.Core.Cache.HttpRuntimeCacheProvider.GetCacheItem(String cacheKey, CacheItemPriority priority, CacheItemRemovedCallback refreshAction, CacheDependency cacheDependency, Nullable`1 timeout, Func`1 getCacheItem, Object syncLock) +218
Umbraco.Core.Cache.HttpRuntimeCacheProvider.GetCacheItem(String cacheKey, CacheItemPriority priority, CacheItemRemovedCallback refreshAction, CacheDependency cacheDependency, Nullable`1 timeout, Func`1 getCacheItem) +176
Umbraco.Core.Cache.HttpRuntimeCacheProvider.GetCacheItem(String cacheKey, CacheItemPriority priority, CacheItemRemovedCallback refreshAction, Nullable`1 timeout, Func`1 getCacheItem) +154
Umbraco.Core.Cache.HttpRuntimeCacheProvider.GetCacheItem(String cacheKey, CacheItemRemovedCallback refreshAction, Nullable`1 timeout, Func`1 getCacheItem) +143
Umbraco.Core.Cache.HttpRuntimeCacheProvider.GetCacheItem(String cacheKey, Nullable`1 timeout, Func`1 getCacheItem) +124
umbraco.cms.businesslogic.web.Domain.GetDomains(Boolean includeWildcards) +364
Umbraco.Web.Routing.PublishedContentRequestEngine.FindDomain() +257
Umbraco.Web.Routing.PublishedContentRequestEngine.PrepareRequest() +18
Umbraco.Web.UmbracoModule.ProcessRequest(HttpContextBase httpContext) +444
System.Web.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +92
System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +165
I was able to fix that last problem myself, turns out there was a DB config parameter that I needed to change, had some fun getting the user to work but got there in the end.
Now the website works but there are other problems occuring on the page: Error loading MacroEngine script (file: ) and some digging on Google suggests it could be related to Umbraco? I saw someone on StackOverflow turned on a debug get variable (?umbDebugShowTrace=true) but it didn't give me any extra information unfortunately.
Is this still related to Umbraco and can anyone help me get to the bottom of what is going on?
Thanks again
Hi Richard
umbDebugShowtrace does not work on Umbraco 7. But you should be able to get some more hints about the error and the files where it's happening in the trace log in /App_Data/Logs - Do you see anything marked with "ERROR"?
In short macroErrors are related to Umbraco and it can be caused by different things. Most likely some code syntax that is not valid for some reason.
/Jan
I got the following errors in the trace log, the code I have does come from a working live website, that error is repeated a couple of times but the number next to the timestamp goes up a bit each time:
2015-03-11 17:19:07,610 [53] WARN Umbraco.Web.Routing.DefaultUrlProvider - [Thread 58] Couldn't find any page with nodeId=2143. This is most likely caused by the page not being published.
2015-03-11 17:19:07,610 [53] WARN Umbraco.Web.Routing.DefaultUrlProvider - [Thread 58] Couldn't find any page with nodeId=1491. This is most likely caused by the page not being published.
2015-03-11 17:19:07,751 [53] WARN umbraco.macro - [Thread 58] Error loading MacroEngine script (file: , Type: ''. Exception: System.ApplicationException: Could not create an index searcher with the supplied lucene directory ---> System.IO.IOException: read past EOF
at Lucene.Net.Index.SegmentInfos.FindSegmentsFile.Run(IndexCommit commit)
at Lucene.Net.Search.IndexSearcher..ctor(Directory path, Boolean readOnly)
at Examine.LuceneEngine.Providers.LuceneSearcher.ValidateSearcher(Boolean forceReopen)
--- End of inner exception stack trace ---
at Examine.LuceneEngine.Providers.LuceneSearcher.ValidateSearcher(Boolean forceReopen)
at Examine.LuceneEngine.Providers.LuceneSearcher.GetSearchFields()
at UmbracoExamine.UmbracoExamineSearcher.GetSearchFields()
at UmbracoExamine.UmbracoExamineSearcher.CreateSearchCriteria(String type, BooleanOperation defaultOperation)
at umbraco.MacroEngines.ExamineBackedMedia.GetUmbracoMedia(Int32 id)
at umbraco.MacroEngines.Library.RazorLibraryCore.MediaById(Int32 Id)
at umbraco.MacroEngines.DynamicNode.MediaById(String Id)
at ASP._Page_macroScripts_flexslider_cshtml.Execute() in c:\web_root\the_cornwall\MacroScripts\flexslider.cshtml:line 13
at System.Web.WebPages.WebPageBase.ExecutePageHierarchy()
at System.Web.WebPages.WebPage.ExecutePageHierarchy()
at System.Web.WebPages.WebPageBase.ExecutePageHierarchy(WebPageContext pageContext, TextWriter writer, WebPageRenderingBase startPage)
at ASP._Page_App_Data_TEMP_Razor_inline_31b15e5339fbdd040baa06bad66a9aa3_cshtml.Execute() in c:\**web_directory**l\App_Data\TEMP\Razor\inline-31b15e5339fbdd040baa06bad66a9aa3.cshtml:line 7
at System.Web.WebPages.WebPageBase.ExecutePageHierarchy()
at System.Web.WebPages.WebPage.ExecutePageHierarchy()
at System.Web.WebPages.WebPageBase.ExecutePageHierarchy(WebPageContext pageContext, TextWriter writer, WebPageRenderingBase startPage)
at umbraco.MacroEngines.RazorMacroEngine.ExecuteRazor(MacroModel macro, INode currentPage)
at umbraco.MacroEngines.RazorMacroEngine.Execute(MacroModel macro, INode currentPage)
at umbraco.macro.loadMacroScript(MacroModel macro)
at umbraco.macro.renderMacro(Hashtable pageElements, Int32 pageId)
Looks like your hosting provider needs to set up write permissions for the app_data folder and everything under it. Umbraco is trying to write search indexes in it.
Thanks for looking into that, I am also the hosting provider (this is my first Windows server 2008 install) I looked on the permissions for the app_data folder and it looks like a load of users already have write permissions. What user is it I need to set write permissions for?
Your application pool has a user attached to it, that one should have permissions as listed here: https://our.umbraco.org/documentation/Installation/permissions.
Thankyou both Sebastiaan and Jan, I have been able to solve the problems and get the website working :D. I sorted the permissions as per the link but there was still a problem so I did a bit of searching on the error and came across this Stack Overflow post http://stackoverflow.com/questions/18110298/umbraco-v6-1-3-lucene-index-corruption where they suggested deleting the indexes in /App_Data/TEMP and restarting the app pool. Did that and it worked.
Thankyou both again for being so helpful.
is working on a reply...