0

I'm on Sitecore 9.0. Sporadically after a build, the Media Library images all display as broken and when I try to browse to an image directly (e.g. mysite.com/-/media/images/logo.png) I see a server error:

[UriFormatException: Invalid URI: The URI is empty.]
System.Uri.CreateThis(String uri, Boolean dontEscape, UriKind uriKind) +261
Sitecore.Xdb.ReferenceData.Client.ReadOnlyReferenceDataHttpClient.get_ServiceAddressFromConnectionString() +110
Sitecore.Xdb.ReferenceData.Client.ReferenceDataHttpClient..ctor(IDefinitionEnvelopeConverter definitionConverter, IEnumerable`1 clientModifiers, IEnumerable`1 webRequestHandlerModifiers, ILogger`1 logger) +25

[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) +217
Sitecore.Reflection.ReflectionUtil.CreateObject(Type type, Object[] parameters) +119
Sitecore.Configuration.DefaultFactory.CreateFromTypeName(XmlNode configNode, String[] parameters, Boolean assert) +108
Sitecore.Configuration.DefaultFactory.CreateObject(XmlNode configNode, String[] parameters, Boolean assert, IFactoryHelper helper) +163
Sitecore.Configuration.DefaultFactory.CreateObject(XmlNode configNode, String[] parameters, Boolean assert) +72
Sitecore.Configuration.DefaultFactory.CreateObject(String configPath, String[] parameters, Boolean assert) +697
Sitecore.Xdb.ReferenceData.Client.Xmgmt.c.b__0_0(IServiceProvider provider) +41
lambda_method(Closure , ServiceProvider ) +19327
Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetService(IServiceProvider provider) +61
Sitecore.Marketing.Definitions.DefinitionManagerFactory.GetDefinitionManager() +84
Sitecore.Analytics.Data.c__DisplayClass7_0.b__4() +69
System.Lazy`1.CreateValue() +708
System.Lazy`1.LazyInitValue() +184
Sitecore.Analytics.Data.MarketingDefinitions.InitializeProfilesWithDefaultValues() +80
System.Lazy`1.CreateValue() +708
System.Lazy`1.LazyInitValue() +184
Sitecore.Analytics.Data.TrackingField.InitializeProfiles() +106
Sitecore.Analytics.Data.TrackingField..ctor(Field innerField) +133
Sitecore.Analytics.Data.TrackingField.GetTrackingField(Item item) +106
Sitecore.Analytics.Data.TrackingField.FindTrackingField(Item item) +37
Sitecore.Analytics.Data.TrackingField.HasTracking(Item item) +9
Sitecore.Analytics.Media.MediaRequestTrackingInformation.IsTrackedRequest() +38
Sitecore.Analytics.RobotDetection.Media.MediaRequestSessionModule.IsSessionRequired() +162
Sitecore.Analytics.Media.MediaRequestSessionModule.ContextPostMapRequestHandler(Object sender, EventArgs e) +17
System.Web.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +223
System.Web.HttpApplication.ExecuteStepImpl(IExecutionStep step) +213
System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +91

Sometimes recycling the app pool resolves this but I want to understand what's causing this issue and the best way to resolve it.

1
  • Do your *.client connection strings contain the protocol (HTTPS)? Commented Feb 7, 2020 at 21:36

1 Answer 1

0

The issue was that xdb was enabled but not configured; Xdb.Enabled and Xdb.Tracking.Enabled were set to true but there was not connectionstring for xdb (which is what was reporting the empty URI). Disabled Xdb and that fixed the issue

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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