Skip to content

Using new Sitecore Partner Developer license.xml issued in August 2022 causing XML parsing error at the start-up #162

@peternazarov

Description

@peternazarov

I downloaded the new Sitecore Partner Developer license.xml issued in August 2022 from the Sitecore Partners portal. It looked like it was broken- it came up with an XML parsing error at the start-up.

image

Data at the root level is invalid. Line 1, position 68213.
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.Xml.XmlException: Data at the root level is invalid. Line 1, position 68213.

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:


[XmlException: Data at the root level is invalid. Line 1, position 68213.]
   System.Xml.XmlTextReaderImpl.Throw(Exception e) +91
   System.Xml.XmlTextReaderImpl.ParseRootLevelWhitespace() +408
   System.Xml.XmlTextReaderImpl.ParseDocumentContent() +473
   System.Xml.XmlLoader.LoadDocSequence(XmlDocument parentDoc) +50
   System.Xml.XmlDocument.Load(XmlReader reader) +137
   System.Xml.XmlDocument.LoadXml(String xml) +194
   ‫‍‌​‫‏‏‭‎‮‪‎‪‫‫‏‫‌‎‭‎​‪‫‭‌‏‮‮‮.‎​‪‎‭‪‫‭‭‬‎‪‏‪‮‌‮‫‭‮(‭‪‌‏‪‌‬‎‎‌‍‮‍‫​‏‫‏​‮‏‍‏‮‬‎‮ , String ) +261
   ‭‪‌‏‪‌‬‎‎‌‍‮‍‫​‏‫‏​‮‏‍‏‮‬‎‮..ctor(String ) +462
   ‬‮‍‎‍​‭‎‮‮‪‏‮‏‌‪‎‭‌‍‭‪‬‮..ctor(String ) +79
   Sitecore.Nexus.Licensing.NexusLicenseApi.get_Api() +329
   Sitecore.Nexus.Licensing.NexusLicenseApi.GetSnapShot(Guid instance) +16
   Sitecore.SecurityModel.License.LicenseManager.GetSnapshotData(Guid instance) +57
   Sitecore.SecurityModel.License.LicenseManager.UpdateSnapshot() +74
   Sitecore.SecurityModel.License.LicenseManager..cctor() +151

[TypeInitializationException: The type initializer for 'Sitecore.SecurityModel.License.LicenseManager' threw an exception.]
   Sitecore.Data.Managers.DefaultItemManager.DemandRuntime() +24
   Sitecore.Data.Managers.DefaultItemManager.Initialize() +45
   (Object , Object ) +60
   Sitecore.Pipelines.CorePipeline.Run(PipelineArgs args) +490
   (Object , Object ) +9
   Sitecore.Pipelines.CorePipeline.Run(PipelineArgs args) +490
   Sitecore.Pipelines.DefaultCorePipelineManager.Run(String pipelineName, PipelineArgs args, String pipelineDomain, Boolean failIfNotExists) +236
   Sitecore.Pipelines.DefaultCorePipelineManager.Run(String pipelineName, PipelineArgs args, String pipelineDomain) +22
   Sitecore.Nexus.Web.HttpModule.Application_Start() +146
   Sitecore.Nexus.Web.HttpModule.Init(HttpApplication app) +918
   System.Web.HttpApplication.RegisterEventSubscriptionsWithIIS(IntPtr appContext, HttpContext context, MethodInfo[] handlers) +584
   System.Web.HttpApplication.InitSpecial(HttpApplicationState state, MethodInfo[] handlers, IntPtr appContext, HttpContext context) +168
   System.Web.HttpApplicationFactory.GetSpecialApplicationInstance(IntPtr appContext, HttpContext context) +277
   System.Web.Hosting.PipelineRuntime.InitializeApplication(IntPtr appContext) +369

[HttpException (0x80004005): The type initializer for 'Sitecore.SecurityModel.License.LicenseManager' threw an exception.]
   System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +532
   System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +111
   System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest wr, HttpContext context) +724

I opened the lisense.xml in Notepad++ and realized that the file is being frequently rewritten. The rewrites were coming from one of the running Sitecore containers.

I checked the code of this repository and realised that you pass the empty SITECORE_LICENSE environment variable to Sitecore containers in the docker-compose.yml, which somehow forces Sitecore containers to write back to the linese.xml when the new 2022 license.xml is used. When the 2021 issued license is used then it works ok...```

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions