5

Having a problem on a fresh Habitat setup... followed all steps, publish projects etc, but now I'm getting this error:

Access to the path '$(sourceFolder)\feature\accounts\serialization' is denied.

I've tried setting permissions on that folder, giving Everyone full access, but it doesn't make a difference.

Using latest version as of yesterday. Sitecore was working fine before publishing foundation projects. Have not yet run Unicorn Sync.

Any suggestions?

Here's the full error:

Access to the path '$(sourceFolder)\feature\accounts\serialization' is denied.

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: System.UnauthorizedAccessException: Access to the path '$(sourceFolder)\feature\accounts\serialization' is denied. 

ASP.NET is not authorized to access the requested resource. Consider granting access rights to the resource to the ASP.NET request identity. ASP.NET has a base process identity (typically {MACHINE}\ASPNET on IIS 5 or Network Service on IIS 6 and IIS 7, and the configured application pool identity on IIS 7.5) that is used if the application is not impersonating. If the application is impersonating via <identity impersonate="true"/>, the identity will be the anonymous user (typically IUSR_MACHINENAME) or the authenticated request user. 

To grant ASP.NET access to a file, right-click the file in File Explorer, choose "Properties" and select the Security tab. Click "Add" to add the appropriate user or group. Highlight the ASP.NET account, and check the boxes for the desired access.

Source Error: 


Line 103:    public Job StartRebuildAnalyticsIndexJob()
Line 104:    {
Line 105:      var options = new Sitecore.Jobs.JobOptions("Rebuild analytics index", "Indexing job", "shell", this, "RebuildAnalyticsIndex");
Line 106:      return Sitecore.Jobs.JobManager.Start(options);
Line 107:    }

Source File: C:\DATA\Latrobe.Sc\git\sitecore\src\foundation\Installer\code\MongoRestore\MongoRestoreService.cs    Line: 105 

Stack Trace: 


[UnauthorizedAccessException: Access to the path '$(sourceFolder)\feature\accounts\serialization' is denied.]
   System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath) +419
   System.IO.Directory.InternalCreateDirectory(String fullPath, String path, Object dirSecurityObj, Boolean checkHost) +1438
   System.IO.Directory.InternalCreateDirectoryHelper(String path, Boolean checkHost) +73
   Rainbow.Storage.SerializationFileSystemDataStore.InitializeRootPath(String rootPath) +313
   Rainbow.Storage.SerializationFileSystemDataStore..ctor(String physicalRootPath, Boolean useDataCache, ITreeRootFactory rootFactory, ISerializationFormatter formatter) +233
   lambda_method(Closure , Object[] ) +246
   Unicorn.Configuration.MicroConfiguration.Activate(Type type, KeyValuePair`2[] unmappedConstructorParameters) +826
   Unicorn.Configuration.<>c__DisplayClass7_0`1.<RegisterExpectedConfigType>b__2() +38
   System.Lazy`1.CreateValue() +709
   System.Lazy`1.LazyInitValue() +191
   Unicorn.Data.ConfigurationDataStore.RegisterForChanges(Action`2 actionOnChange) +19
   Unicorn.Data.DataProvider.UnicornDataProvider..ctor(ITargetDataStore targetDataStore, ISourceDataStore sourceDataStore, IPredicate predicate, IFieldFilter fieldFilter, IUnicornDataProviderLogger logger, IUnicornDataProviderConfiguration dataProviderConfiguration, ISyncConfiguration syncConfiguration, PredicateRootPathResolver rootPathResolver) +547
   lambda_method(Closure , Object[] ) +391
   Unicorn.Configuration.MicroConfiguration.Activate(Type type, KeyValuePair`2[] unmappedConstructorParameters) +826
   Unicorn.Configuration.MicroConfiguration.Resolve() +118
   System.Linq.WhereSelectArrayIterator`2.MoveNext() +102
   System.Linq.Buffer`1..ctor(IEnumerable`1 source) +148
   System.Linq.Enumerable.ToArray(IEnumerable`1 source) +106
   Unicorn.Data.DataProvider.UnicornSqlServerDataProvider..ctor(String connectionString) +232

[TargetInvocationException: Exception has been thrown by the target of an invocation.]
   System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor) +0
   System.Reflection.RuntimeConstructorInfo.Invoke(BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) +329
   Sitecore.Reflection.ReflectionUtil.CreateObject(Type type, Object[] parameters) +119
   Sitecore.Configuration.DefaultFactory.CreateFromTypeName(XmlNode configNode, String[] parameters, Boolean assert) +119
   Sitecore.Configuration.DefaultFactory.CreateObject(XmlNode configNode, String[] parameters, Boolean assert, IFactoryHelper helper) +165
   Sitecore.Configuration.DefaultFactory.CreateObject(XmlNode configNode, String[] parameters, Boolean assert) +72
   Sitecore.Configuration.DefaultFactory.CreateObject(String configPath, String[] parameters, Boolean assert) +619
   Sitecore.Configuration.DefaultFactory.CreateFromReference(XmlNode configNode, String[] parameters, Boolean assert) +170
   Sitecore.Configuration.DefaultFactory.CreateObject(XmlNode configNode, String[] parameters, Boolean assert, IFactoryHelper helper) +118
   Sitecore.Configuration.DefaultFactory.CreateObject(XmlNode configNode, String[] parameters, Boolean assert) +72
   Sitecore.Configuration.DefaultFactory.GetInnerObject(XmlNode paramNode, String[] parameters, Boolean assert) +932
   Sitecore.Configuration.DefaultFactory.AssignProperties(XmlNode configNode, String[] parameters, Object obj, Boolean assert, Boolean deferred, IFactoryHelper helper) +560
   Sitecore.Configuration.DefaultFactory.CreateObject(XmlNode configNode, String[] parameters, Boolean assert, IFactoryHelper helper) +322
   Sitecore.Configuration.DefaultFactory.CreateObject(XmlNode configNode, String[] parameters, Boolean assert) +72
   Sitecore.Configuration.DefaultFactory.CreateObject(String configPath, String[] parameters, Boolean assert) +619
   Sitecore.Configuration.DefaultFactory.GetDatabase(String name, Boolean assert) +157
   Sitecore.Configuration.DefaultFactory.GetDatabase(String name) +55
   Sitecore.Configuration.DefaultFactory.GetDatabases() +121
   Sitecore.Data.Managers.LanguageProvider.InitializeEventHandlers() +73
   Sitecore.Data.Managers.LanguageProvider..ctor() +225
   Sitecore.DependencyInjection.DefaultSitecoreServicesConfigurator.<.cctor>b__a(IServiceProvider p) +31
   Microsoft.Extensions.DependencyInjection.ScopedCallSite.Invoke(ServiceProvider provider) +117
   Microsoft.Extensions.DependencyInjection.ServiceLookup.ConstructorCallSite.Invoke(ServiceProvider provider) +117
   Microsoft.Extensions.DependencyInjection.ScopedCallSite.Invoke(ServiceProvider provider) +117
   Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService(IServiceProvider provider, Type serviceType) +100
   Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService(IServiceProvider provider) +59
   System.Lazy`1.CreateValue() +709
   System.Lazy`1.LazyInitValue() +191
   Sitecore.Globalization.Language.TryParse(String name, Language& result) +139
   Sitecore.Globalization.Language.Parse(String name) +63
   Sitecore.Jobs.JobOptions..ctor(String jobName, String category, String siteName, Object obj, String methodName, Object[] parameters) +593
   Sitecore.Jobs.JobOptions..ctor(String jobName, String category, String siteName, Object obj, String methodName) +66
   Sitecore.Foundation.Installer.MongoRestore.MongoRestoreService.StartRebuildAnalyticsIndexJob() in C:\DATA\Latrobe.Sc\git\sitecore\src\foundation\Installer\code\MongoRestore\MongoRestoreService.cs:105
   Sitecore.Foundation.Installer.MongoRestore.MongoRestoreProcessor.Process(PipelineArgs args) in C:\DATA\Latrobe.Sc\git\sitecore\src\foundation\Installer\code\MongoRestore\MongoRestoreProcessor.cs:30
   (Object , Object[] ) +170
   Sitecore.Pipelines.CorePipeline.Run(PipelineArgs args) +484
   Sitecore.Pipelines.DefaultCorePipelineManager.Run(String pipelineName, PipelineArgs args, String pipelineDomain) +22
   Sitecore.Nexus.Web.HttpModule.Application_Start() +259
   Sitecore.Nexus.Web.HttpModule.Init(HttpApplication app) +704
   System.Web.HttpApplication.RegisterEventSubscriptionsWithIIS(IntPtr appContext, HttpContext context, MethodInfo[] handlers) +618
   System.Web.HttpApplication.InitSpecial(HttpApplicationState state, MethodInfo[] handlers, IntPtr appContext, HttpContext context) +172
   System.Web.HttpApplicationFactory.GetSpecialApplicationInstance(IntPtr appContext, HttpContext context) +402
   System.Web.Hosting.PipelineRuntime.InitializeApplication(IntPtr appContext) +343

[HttpException (0x80004005): Exception has been thrown by the target of an invocation.]
   System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +539
   System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +125
   System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest wr, HttpContext context) +731
  • Add the source folder path in z.Habitat.DevSettings.config config. you can find this config under src\Project\Habitat\code\App_Config\Include\Project location. – Yogesh Sharma Jan 16 '17 at 8:24
2

Can you please check whether you have a "z.Habitat.DevSettings.config" in the App_Config/Include/Foundation folder? If not you should have a config file that contains the sourceFolder variable setting.

The sitecore variable should be set like so:

<sc.variable name="sourceFolder" value="C:\projects\Habitat\src" /> 

That variable is used in the serialization path. So you need to change the value to your own src location off course ;)

The "sourceFolder" Sitecore variable should be visible in the http://yoursitename/sitecore/admin/ShowConfig.aspx

| improve this answer | |
  • Yeah it's set. Don't think I can see the showconfig as the Site isn't loading. I'll look deeper tomorrow, thanks – Jeeby Jan 16 '17 at 9:17
0

It seems that Sitecore variable sourceFolder is not set.

Make sure you've copied following config.

https://github.com/Sitecore/Habitat/blob/master/src/Project/Habitat/code/App_Config/Include/Project/z.Habitat.DevSettings.config

with your path to the src folder of Habitat repository.

Example:

<?xml version="1.0"?>
<configuration xmlns:patch="http://www.sitecore.net/xmlconfig/">
<sitecore>
    <sc.variable name="sourceFolder" value="c:\my_repos\Habitat\src" />
</sitecore>
</configuration>
| improve this answer | |
  • That has been set. I will verify tomorrow that the config file has copied to the app config folder successfully. Thanks – Jeeby Jan 16 '17 at 9:16
0

So We've resolved this issue... pretty sure it was caused by a duplicate z.Habitat.DevSettings.config file - this happened as I duplicated the Sitecore.Habitat.Website project, and included it's config file... I'm pretty sure that's what caused this issue. Definitely something to watch out for in future.

Thanks for the tips everyone.

| improve this answer | |

Not the answer you're looking for? Browse other questions tagged or ask your own question.