Changed IIS directory in DotNetNuke leads to portal enumeration problems - iis

I moved the files in my DNN Community Edition (5.6) to another disk with the same path. I adjusted the IIS server's home directory's local path to new location (from C: to D:).
When going to the home page the server fails, unable to find the portals associated with the website:
[NullReferenceException: Object reference not set to an instance of an object.]
DotNetNuke.Common.Initialize.CacheMappedDirectory() in D:\Inetpub\wwwroot\DotNetNuke_Community\DotNetNuke_Community_05.06.05_Source\Library\Common\Initialize.vb:59
DotNetNuke.Common.Initialize.InitializeApp(HttpApplication app) in D:\Inetpub\wwwroot\DotNetNuke_Community\DotNetNuke_Community_05.06.05_Source\Library\Common\Initialize.vb:149
DotNetNuke.Common.Initialize.Init(HttpApplication app) in D:\Inetpub\wwwroot\DotNetNuke_Community\DotNetNuke_Community_05.06.05_Source\Library\Common\Initialize.vb:228
DotNetNuke.Common.Global.Global_BeginRequest(Object sender, EventArgs e) in D:\Inetpub\wwwroot\DotNetNuke_Community\DotNetNuke_Community_05.06.05_Source\Website\App_Code\Global.asax.vb:135
System.Web.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +148
System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +75
The web.config had no absolute paths in it. So, I've turned my attention to the database for setting the path for Portal 0, my only portal.
I've tried modifying the Home Directory entry in Table from Portals/0 to D:/Inetpub/wwwroot/DotNetNuke_Community/DotNetNuke_Community_05.06.05_Source/Website/Portals/0
without luck.
Your suggestions are appreciated.

The first thing I would check is to make sure you have the proper permissions configured on the new folder. You shouldn't need to change the HomeDirectory entry.

Related

Sitecore 8.1 : Could not compute value for ComputedIndexField

We just upgraded to Sitecore 8.1 from 7.2. Search engine is Lucene and xDB disabled. The solution is hosted in ms azure cloud services Web Apps.
We noticed that the CMS CA is quiet slow. While looking at logs noticed a number of error logged below:
13876 2015:12:18 05:21:44 ERROR Could not compute value for ComputedIndexField: _content for indexable: sitecore://web/{2E25F9D3-BBBF-4160-BAE1-1EE4E701BD9B}?lang=en&ver=1
Exception: System.UnauthorizedAccessException
Message: Access to the path 'D:\App_Data\data\mediaIndexing\b3cd2fa1-9671-498f-9534-a94ad5a21923-Mypolicy.pdf' is denied.
Source: mscorlib
at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
at System.IO.File.InternalDelete(String path, Boolean checkHost)
at System.IO.File.Delete(String path)
at Sitecore.ContentSearch.ComputedFields.MediaItemIFilterTextExtractor.ComputeFieldValue(IIndexable indexable)
at Sitecore.ContentSearch.ComputedFields.MediaItemContentExtractor.ComputeFieldValue(IIndexable indexable)
at Sitecore.ContentSearch.LuceneProvider.LuceneDocumentBuilder.AddComputedIndexFields()
Could someone please suggest why sitecore is looking for Web forms for marketing index which we don't need it?
Thanks
There is nothing about WFFM index in your error - it only says that it cannot compute value of the _content field for {2E25F9D3-BBBF-4160-BAE1-1EE4E701BD9B} item.
It even tells you the reason - cannot access path on the drive. You should check access rights for the D:\App_Data\data\mediaIndexing directory and make sure it can be access by you application user.
With Azure Web Apps you should have a full access in the file system to the webroot and its descendants. Ensure the MediaIndexingFolder setting is not set to absolute path and does not point to outside of the webroot where the application lives.
By default, if the MediaIndexingFolder setting is not specified, it points to the $(dataFolder)/mediaIndexing path, where the $(dataFolder) must point to the \App_Data under the webroot.
We recently had the same issue. Essentially, make sure that on an Azure WebApp the standard zzDataFolder.config file is used which contains:
<sc.variable name="dataFolder">
<patch:attribute name="value">D:\home\site\wwwroot\App_Data</patch:attribute>
</sc.variable>
Using the other config that is included (DataFolder.config, which sets it to "/data") or your own config file (pointing to anything other than the full drive path) will break the mediaIndexing folder path (even though all other parts of Sitecore which use App_Data like "diagnostics" or "MediaCache" work perfectly well with the "/data" setting).

SharePoint App Deployment error : 'Failed to install app for SharePoint'

When I tried to add a SharePoint mvc app I am getting following error:
Error occurred in deployment step 'Install app for SharePoint':
Failed to install app for SharePoint. Please see the output window for details.
Detailed stack trace:
CorrelationId: 50583239-71cb-4b07-8bcb-4bbc51a22631
ErrorDetail: There was a problem with activating the app web definition.
ErrorType: App
ErrorTypeName: App Related
ExceptionMessage: Microsoft.SharePoint.SPException: Exception from HRESULT: 0x81070964 ---> System.Runtime.InteropServices.COMException: Exception from HRESULT: 0x81070964
at Microsoft.SharePoint.Library.SPRequestInternalClass.EnableModuleFromXml(String bstrSetupDirectory, String bstrFeatureDirectory, String bstrUrl, String bstrXML, Boolean fForceUnghost, ISPEnableModuleCallback pModuleContext)
at Microsoft.SharePoint.Library.SPRequest.EnableModuleFromXml(String bstrSetupDirectory, String bstrFeatureDirectory, String bstrUrl, String bstrXML, Boolean fForceUnghost, ISPEnableModuleCallback pModuleContext)
--- End of inner exception stack trace ---
at Microsoft.SharePoint.Administration.SPElementDefinitionCollection.ProvisionModules(SPFeaturePropertyCollection props, SPSite site, SPWeb web, SPFeatureActivateFlags activateFlags, Boolean fForce)
at Microsoft.SharePoint.Administration.SPElementDefinitionCollection.ProvisionElements(SPFeaturePropertyCollection props, SPWebApplication webapp, SPSite site, SPWeb web, SPFeatureActivateFlags activateFlags, Boolean fForce)
at Microsoft.SharePoint.SPFeature.Activate(SPSite siteParent, SPWeb webParent, SPFeaturePropertyCollection props, SPFeatureActivateFlags activateFlags, Boolean fForce)
at Microsoft.SharePoint.SPFeatureCollection.AddInternal(SPFeatureDefinition featdef, Version version, SPFeaturePropertyCollection properties, SPFeatureActivateFlags activateFlags, Boolean force, Boolean fMarkOnly)
at Microsoft.SharePoint.SPFeatureCollection.AddInternalWithName(Guid featureId, Int32 compatibilityLevel, String featureName, Version version, SPFeaturePropertyCollection properties, SPFeatureActivateFlags activateFlags, Boolean force, Boolean fMarkOnly, SPFeatureDefinitionScope featdefScope)
at Microsoft.SharePoint.SPFeatureCollection.AddInternal(Guid featureId, Version version, SPFeaturePropertyCollection properties, Boolean force, Boolean fMarkOnly, SPFeatureDefinitionScope featdefScope)
at Microsoft.SharePoint.SPFeatureCollection.Add(Guid featureId, Boolean force, SPFeatureDefinitionScope featdefScope)
at Microsoft.SharePoint.SPUserSolutionCollection.EnsureWebFeaturesActivated(SPUserSolution solution)
at Microsoft.SharePoint.Packaging.SPUserCodeSolutionDeploymentGroup.ActivateSolution(SPWeb web, SPUserSolution solution)
at Microsoft.SharePoint.Packaging.SPUserCodeSolutionDeploymentGroup.Deploy()
at Microsoft.SharePoint.Administration.SPAppTask.DeployOperation()
at Microsoft.SharePoint.Lifecycle.MonitoredTaskExecution.DoTask()
Source: AppWeb
SourceName: App Web Deployment
Can somebody have a light on this issue? :)
It is because SharePoint is trying to activate your app as a standard SharePoint feature, when its really an App.
In the features folder of the SharePoint project, there will be a Feature named Feature1.
Open Feature1 and ensure it's contained in the "Items in the solution" list and not in the "Items in the feature" list.
After that you should be able to deploy.
I had the same problem after updateding my NuGet packages. A file called version.json was added and caused this issue. Setting the deployment type to NoDeployment fixed it.
In my sharepoint-hosted add-in, I face this issue when have some *.json files(.bower.json, bower.json) inside my sharepoint project folder, after I delete them and run again my app works!
In my case I got this error when I inadvertently changed the TemplateType value in the instance's Elements.xml file .without making the same change in the Element's Definition (the other Elements.xml directly under the Elements root).
Therefore there was a mismatch in the two elements.xml of the list being deployed.
Something similar happened me. I ran JSLint from Visual Studio and it added a .json file which should not be deployed with the app. Setting the deployment type to NoDeployment fixed it.
I have had the same problem. Problem was that the app.config file of the SharePoint App project has Deployment Type: 'ElementFile' and was going to be deployed to the host web.
This should not happen and generated the error.
Solution:
Change Deployment Type of the app.config to 'NoDeployment' and redeploy.
Have you configured following service applications?
App Management Service Application.
Microsoft SharePoint Foundation Subscription Settings Service Application.
Try configuring following these along with the following
3. Managed Metadata Service Application.
Refer: http://www.sharepoint-journey.com/app-development-in-sharepoint.html#sthash.00z9jnjB.dpuf
I saw this error when I forgot to open Visual Studio with "Run as administrator" privileges.
Solution
Configure Managed Metadata service application correctly.
Check your domain ip in DNS server.(get your ip from ipconfing from CMD )
Also make sure you have the below service applications configured correctly
App Management Service Application.
Microsoft SharePoint Foundation Subscription Settings Service Application.
Then i looked in to Event Viewer. I found below problem
Then I started the Distributed Cache .
Then i deploy the solution the problem solved.
:)
More Details :- http://sharepointstuts.blogspot.com/2015/12/the-content-database-on-server-is.html
I just changed the hosting type in AppManifest.xml from Provider-hosted to SharePoint-hosted and voilá. I don't know if this was modified by itself when I added an Event Receiver in my project, cause before not fails.

How to clear whole Windows Azure Appfabric Cache on WebRole start?

I'm trying to do what might be a simple thing, but i just can't find the answer.
I know how to delete cache on the application level (for a website).
But i need to CLEAR ALL THE CACHE of my azure appfabric cache on webrole start.
EDIT : What if it can be done ? Considering a severe misfunction in Azure Asp.net shared caching or am I dumb ?
This this the scenario i'm stuck into :
I have a a WebRole which have few different websites
Consider all my websites have a default.aspx file on each root with a 60 minutes caching, this is plain regular <%# OutputCache Duration="3600" VaryByParam="*" %>, no fancy code
I browse them, consequently several cached pages are stored in appfabric caches for 60 minutes
Consider uner the hood in this deployment cache depencies are created upon a path like 'E:\sitesroot\xx'
In between, my Webrole reset or I upload a new deployment
Now consider my websites in newly created instances have this path : 'F:\sitesroot\xx'
You get it, heres the result I have :
Directory 'E:\sitesroot\12' does not exist. Failed to start monitoring file changes.
System.Web.HttpException (0x80070003): Directory 'E:\sitesroot\12' does not exist. Failed to start monitoring file changes.
at System.Web.FileChangesMonitor.FindDirectoryMonitor(String dir, Boolean addIfNotFound, Boolean throwOnError)
at System.Web.FileChangesMonitor.StartMonitoringPath(String alias, FileChangeEventHandler callback, FileAttributesData& fad)
at System.Web.Caching.CacheDependency.Init(Boolean isPublic, String[] filenamesArg, String[] cachekeysArg, CacheDependency dependency, DateTime utcStart)
at System.Web.Caching.CacheDependency..ctor(Int32 dummy, String[] filenames)
at System.Web.Caching.OutputCache.HasDependencyChanged(Boolean isFragment, String depKey, String[] fileDeps, String kernelKey, String oceKey, String providerName)
at System.Web.Caching.OutputCache.Get(String key)
at System.Web.Caching.OutputCacheModule.OnEnter(Object source, EventArgs eventArgs)
at System.Web.HttpApplication.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)
It took me some times to understand that this issue MIGHT BE because the current appfacbric cache relied on a cachedepency with a hard path "E:\sitesroot\". What if this path change, has it DOES.
So what can I do ? I'm lost here, I tried to clear appcache on Global.asax Application_Start, but this does not seem to work (and i don't understand why it does not).
Here's my code to clear cache on each websites Global.asax Application_Start
Public Shared Sub cacheClear()
Dim keys As New List(Of String)()
' retrieve application Cache enumerator
Dim enumerator As IDictionaryEnumerator = HttpRuntime.Cache.GetEnumerator()
' copy all keys that currently exist in Cache
While enumerator.MoveNext()
keys.Add(enumerator.Key.ToString())
End While
' delete every key from cache
For i As Integer = 0 To keys.Count - 1
HttpRuntime.Cache.Remove(keys(i))
Next
End Sub
This should do the trick, it does not seems to.
There certainly a ridiculous point i'm missing.
EDIT
I ended dropping completely asp.net outputcache provider for appfabric and writing a custom cache with appfabric. Works great, few line of codes and cachedependancy on azure made easy.
I'm not 100% sure, but I don't think this can be done.

Why does Sitecore throw a NullReferenceException exception when I redirect to one of its pages?

I'm running Sitecore 6.1 on Windows 2008, IIS7, and I'm trying to use the URL Rewrite Module to do a redirect. When I enable the rule and hit the URL that triggers it, I get a YSOD. The same rule works perfectly on a non-sitecore site on the same machine. According to the Failed Request Trace, the rewrite module does its thing just fine, but then Sitecore throws an exception, even if the redirect points to another server. This is probably a result of something I have misconfigured, but I just can't understand why it doesn't work. The details from the YSOD are below.
[NullReferenceException: Object reference not set to an instance of an object.]
Sitecore.Nexus.Web.HttpModule.(Object sender, EventArgs e) +273
System.Web.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +68
System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +75
Sitecore has it's own engine for URL redirection, so some wires are probably getting crossed here. Possibly you need to move your HttpModule so it's executing earlier in the chain.
Sitecore claim to have fixed this in release 6.2 rev.100831 (Update-4) - http://sdn.sitecore.net/Products/Sitecore%20V5/Sitecore%20CMS%206/ReleaseNotes/KnownIssues%20Recommended/Rewriting%20URLs.aspx
Use the pipeline mode "Classic" rather than "Integrated"
http://sdn.sitecore.net/Products/Sitecore%20V5/Sitecore%20CMS%206/ReleaseNotes/KnownIssues%20Recommended/Rewriting%20URLs.aspx
You can get the same error when doing
Response.Redirect("~/SomeUrl.aspx")
within C# code, the way to fix this is to use the overloaded:
Response.Redirect("~/SomeUrl.aspx", true)
which will end the response immediately.
The rewrite module is obviously not ending the request immediately allowing Sitecore to hit this problem. You could get around this problem by creating a module to deal with the redirects or trying to extend the URL Rewrite Module to end the response immediately.
I experienced this in MultiSite instance on Sitecore v6.5, see my answer here: Sitecore NullReferenceException on GetBrowserClassString

SharePoint SiteDefinitions

I have created a simple site definition based on the publishing portal. Every time I want to use the template to create a site-collection I get the following error-message:
The template you have chosen is invalid or cannot be found.
I do not use any custom feature, just the default features with the publishing portal site-def. Any hints?
There is a error log but it just gives me the information above:
Applying template "PalfingerPlatformsOrderRoot#0" to web at URL "http://datsa0004:8080/Platforms/Orders/0000112233".
Failed to get the site template for language 1031, search key 'PalfingerPlatformsOrderRoot'. This warning is expected when provisioning from a custom web template.
Failed to apply template "PalfingerPlatformsOrderRoot#0" to web at URL "http://datsa0004:8080/Platforms/Orders/0000112233".
Failed to apply template "PalfingerPlatformsOrderRoot#0" to web at URL "http://datsa0004:8080/Platforms/Orders/0000112233", error The template you have chosen is invalid or cannot be found. 0x81071e44
The template you have chosen is invalid or cannot be found.
CreatePortal failed creating portal webs. Microsoft.SharePoint.SPException: The template you have chosen is invalid or cannot be found. ---> System.Runtime.InteropServices.COMException (0x81071E44): The template you have chosen is invalid or cannot be found. at Microsoft.SharePoint.Library.SPRequestInternalClass.ApplyWebTemplate(String bstrUrl, String& bstrWebTemplate, Int32& plWebTemplateId) at Microsoft.SharePoint.Library.SPRequest.ApplyWebTemplate(String bstrUrl, String& bstrWebTemplate, Int32& plWebTemplateId) --- End of inner exception stack trace --- at Microsoft.SharePoint.Library.SPRequest.ApplyWebTemplate(String bstrUrl, String& bstrWebTemplate, Int32& plWebTemplateId) at Microsoft.SharePoint.SPWeb.ApplyWebTemplate(String strWebTemplate) at Microsoft.ShareP...
...oint.Publishing.PortalProvisioningProvider.CreatePortal(String xmlFile, SPWeb rootWeb)
Check your custom template's ID,(open it and view the xml) it may be conflicting with an existing template. You can check
Program Files\Common Files\Microsoft
Shared\web server
extensions\12\TEMPLATE\1033\XML
for the other templates and their IDs
I had the same problem and it turned out it was due to a feature which got uninstalled in the server.
Such feature was included in the template file to be activated. I found this out by examining the template file (.STP) and looking at the WebFeatures node. The features there are identified by their GUIDs, so I had to search one by one in the Templates folder until I found out which one was actually uninstalled in the system.
That feature was installed in the system at the point when the template was created, then it got uninstalled. After that it was impossible to create items with the given template (and the Sharepoint error message wasn't very clear about the true reason).
After installing the feature (stsadm -o installfeature...) everything started working.
Check the trace logs/ULS logs in the 12 hive - there's almost certainly more information on your error in there.

Resources