'Sitecore SXA - "startIndex cannot be larger than length of string."

I am getting this error while I am trying to export site using Creative Exchange. Does anybody have any clue what could cause this error. I am trying to change something on the frontend but I am unable to do it since I just can't export the site

Here is the error:

startIndex cannot be larger than length of string.
Parameter name: startIndex
   at System.String.Substring(Int32 startIndex, Int32 length)
   at Sitecore.XA.Feature.CreativeExchange.Pipelines.Export.PageProcessing.StorePage.BuildItemPath(PageProcessingArgs args)
   at Sitecore.XA.Feature.CreativeExchange.Pipelines.Export.PageProcessing.StorePage.Process(PageProcessingArgs args)
   at (Object , Object )
   at Sitecore.Pipelines.CorePipeline.Run(PipelineArgs args)
   at Sitecore.Pipelines.DefaultCorePipelineManager.Run(String pipelineName, PipelineArgs args, String pipelineDomain, Boolean failIfNotExists)
   at Sitecore.Pipelines.DefaultCorePipelineManager.Run(String pipelineName, PipelineArgs args, String pipelineDomain)
   at Sitecore.XA.Feature.CreativeExchange.Pipelines.Export.Export.PageEnumeration.ProcessPage(ExportedPage exportedPage, ExportArgs args)
   at Sitecore.ContentSearch.Utilities.EnumerableExtensions.ForEach[T](IEnumerable`1 collection, Action`1 action)
   at (Object , Object )
   at Sitecore.Pipelines.CorePipeline.Run(PipelineArgs args)
   at Sitecore.Pipelines.DefaultCorePipelineManager.Run(String pipelineName, PipelineArgs args, String pipelineDomain, Boolean failIfNotExists)
   at Sitecore.Pipelines.DefaultCorePipelineManager.Run(String pipelineName, PipelineArgs args, String pipelineDomain)
   at Sitecore.XA.Feature.CreativeExchange.Jobs.Export.ExportBackgroundJob.Run(GetExportContextArgs args)


Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source