The following error might occur if the site configuration contains a value for virtualFolder settings that does not start with a slash '/' character:
[ArgumentException: The path must start with a '/' followed by one or more characters.
Parameter name: value]
Microsoft.Owin.PathString..ctor(String value) in /_/src/Microsoft.Owin/PathString.cs:33
Sitecore.Owin.Authentication.Extensions.IAppBuilderExtensions.MapEx(IAppBuilder app, String pathMatch, Action`1 configuration) +108
Sitecore.Owin.Authentication.IdentityServer.Pipelines.Initialize.LogoutEndpoint.Process(InitializeArgs args) +434
(Object , Object ) +14
Sitecore.Pipelines.CorePipeline.Run(PipelineArgs args) +1462
Sitecore.Pipelines.DefaultCorePipelineManager.Run(String pipelineName, PipelineArgs args, String pipelineDomain, Boolean failIfNotExists) +236
Sitecore.Pipelines.DefaultCorePipelineManager.Run(String pipelineName, PipelineArgs args, String pipelineDomain) +22
[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.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object[] parameters, Object[] arguments) +132
System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) +146
System.Reflection.MethodBase.Invoke(Object obj, Object[] parameters) +34
Owin.Loader.<>c__DisplayClass9_0.<LoadImplementation>b__0(IAppBuilder builder) in /_/src/Owin.Loader/DefaultLoader.cs:128
Microsoft.Owin.Host.SystemWeb.OwinAppContext.Initialize(Action`1 startup) in /_/src/Microsoft.Owin.Host.SystemWeb/OwinAppContext.cs:82
Microsoft.Owin.Host.SystemWeb.OwinBuilder.Build(Action`1 startup) in /_/src/Microsoft.Owin.Host.SystemWeb/OwinBuilder.cs:64
Microsoft.Owin.Host.SystemWeb.OwinHttpModule.InitializeBlueprint() in /_/src/Microsoft.Owin.Host.SystemWeb/OwinHttpModule.cs:46
System.Threading.LazyInitializer.EnsureInitializedCore(T& target, Boolean& initialized, Object& syncLock, Func`1 valueFactory) +139
Microsoft.Owin.Host.SystemWeb.OwinHttpModule.Init(HttpApplication context) in /_/src/Microsoft.Owin.Host.SystemWeb/OwinHttpModule.cs:24
System.Web.HttpApplication.RegisterEventSubscriptionsWithIIS(IntPtr appContext, HttpContext context, MethodInfo[] handlers) +581
System.Web.HttpApplication.InitSpecial(HttpApplicationState state, MethodInfo[] handlers, IntPtr appContext, HttpContext context) +168
System.Web.HttpApplicationFactory.GetSpecialApplicationInstance(IntPtr appContext, HttpContext context) +259
System.Web.Hosting.PipelineRuntime.InitializeApplication(IntPtr appContext) +317
[HttpException (0x80004005): Exception has been thrown by the target of an invocation.]
System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +518
System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +111
System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest wr, HttpContext context) +753
To resolve the issue, follow the steps below:
<processor type="Sitecore.Owin.Authentication.IdentityServer.Pipelines.Initialize.LogoutEndpoint, Sitecore.Owin.Authentication.IdentityServer" resolve="true" patch:before="processor[@method='Authenticate']" />
In addition, to prevent the issue from occurring for SXA websites, consider adding a regex to validate values starting with a slash (and repeating slash) for the /sitecore/templates/Foundation/Experience Accelerator/Multisite/Base/_Base Site Definition/Basic/VirtualFolder item. For example, the following regex:
^(?!.*\/\/)\/