A strange problem that's started happening recently.
I have an instance of Sitecore 8.0 setup (CD and CM separate servers).
A user uploads an image. (stored as blobs in the db) It shows in experience editor. when published to the web (same server) and viewed as the site it throws a 404 error.
The event viewer shows:
Exception information:
Exception type: HttpParseException
Exception message: "¹" is not valid at the start of a code block. Only identifiers, keywords, comments, "(" and "{" are valid.
that tiny "1" is nowhere to be found in the code. If I publish to web-live it displays fine in that server.
Interestingly enough if I make the filename shorter it will load without error making me think its a max file path issue. Since its using the database this surely wouldn't be a windows issue limiting a file path length would it?
Has anyone dealt with anything like this before?
Thanks
EDIT
full error
3006
A parser error has occurred.
11/8/2018 2:53:55 PM
11/8/2018 2:53:55 PM
185e07226dd44282820f23549c46b33e
214501
134
0
/LM/W3SVC/2/ROOT-1-131842085429794370
Full
/
E:\Hosted\cms.website.org.uk\Website\
HG-CORE-CM
3892
w3wp.exe
NT AUTHORITY\NETWORK SERVICE
HttpParseException
"¹" is not valid at the start of a code block. Only identifiers, keywords, comments, "(" and "{" are valid. at System.Web.WebPages.Razor.RazorBuildProvider.EnsureGeneratedCode() at System.Web.WebPages.Razor.RazorBuildProvider.get_CodeCompilerType() at System.Web.Compilation.BuildProvider.GetCompilerTypeFromBuildProvider(BuildProvider buildProvider) at System.Web.Compilation.BuildProvidersCompiler.ProcessBuildProviders() at System.Web.Compilation.BuildProvidersCompiler.PerformBuild() at System.Web.Compilation.BuildManager.CompileWebFile(VirtualPath virtualPath) at System.Web.Compilation.BuildManager.GetVPathBuildResultInternal(VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean allowBuildInPrecompile, Boolean throwIfNotFound, Boolean ensureIsUpToDate) at System.Web.Compilation.BuildManager.GetVPathBuildResultWithNoAssert(HttpContext context, VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean allowBuildInPrecompile, Boolean throwIfNotFound, Boolean ensureIsUpToDate) at System.Web.Compilation.BuildManager.GetVirtualPathObjectFactory(VirtualPath virtualPath, HttpContext context, Boolean allowCrossApp, Boolean throwIfNotFound) at System.Web.Compilation.BuildManager.CreateInstanceFromVirtualPath(VirtualPath virtualPath, Type requiredBaseType, HttpContext context, Boolean allowCrossApp) at System.Web.WebPages.BuildManagerWrapper.CreateInstanceOfType[T](String virtualPath) at System.Web.WebPages.VirtualPathFactoryManager.CreateInstanceOfType[T](String virtualPath) at System.Web.WebPages.WebPageHttpHandler.CreateFromVirtualPath(String virtualPath, IVirtualPathFactory virtualPathFactory) at System.Web.WebPages.WebPageRoute.DoPostResolveRequestCache(HttpContextBase context) at System.Web.HttpApplication.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)
http://cms.website.org.uk/~/media/Images/Corporate/Enterprise-and-Development/Innovation-Village/General-Images/sitecore_media.ashx/~/media/Images/Corporate/Enterprise-and-Development/Innovation-Village/General-Images/featureintromap.ashx
/~/media/Images/Corporate/Enterprise-and-Development/Innovation-Village/General-Images/sitecore_media.ashx/~/media/Images/Corporate/Enterprise-and-Development/Innovation-Village/General-Images/featureintromap.ashx
148.253.178.66
sitecore\admin
True
NT AUTHORITY\NETWORK SERVICE
229
NT AUTHORITY\NETWORK SERVICE
False
at System.Web.WebPages.Razor.RazorBuildProvider.EnsureGeneratedCode() at System.Web.WebPages.Razor.RazorBuildProvider.get_CodeCompilerType() at System.Web.Compilation.BuildProvider.GetCompilerTypeFromBuildProvider(BuildProvider buildProvider) at System.Web.Compilation.BuildProvidersCompiler.ProcessBuildProviders() at System.Web.Compilation.BuildProvidersCompiler.PerformBuild() at System.Web.Compilation.BuildManager.CompileWebFile(VirtualPath virtualPath) at System.Web.Compilation.BuildManager.GetVPathBuildResultInternal(VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean allowBuildInPrecompile, Boolean throwIfNotFound, Boolean ensureIsUpToDate) at System.Web.Compilation.BuildManager.GetVPathBuildResultWithNoAssert(HttpContext context, VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean allowBuildInPrecompile, Boolean throwIfNotFound, Boolean ensureIsUpToDate) at System.Web.Compilation.BuildManager.GetVirtualPathObjectFactory(VirtualPath virtualPath, HttpContext context, Boolean allowCrossApp, Boolean throwIfNotFound) at System.Web.Compilation.BuildManager.CreateInstanceFromVirtualPath(VirtualPath virtualPath, Type requiredBaseType, HttpContext context, Boolean allowCrossApp) at System.Web.WebPages.BuildManagerWrapper.CreateInstanceOfType[T](String virtualPath) at System.Web.WebPages.VirtualPathFactoryManager.CreateInstanceOfType[T](String virtualPath) at System.Web.WebPages.WebPageHttpHandler.CreateFromVirtualPath(String virtualPath, IVirtualPathFactory virtualPathFactory) at System.Web.WebPages.WebPageRoute.DoPostResolveRequestCache(HttpContextBase context) at System.Web.HttpApplication.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)
below is the error directly from site Sitecore log file:
6148 16:30:51 ERROR Application error.
Exception: System.Web.HttpParseException
Message: "¹" is not valid at the start of a code block. Only identifiers, keywords, comments, "(" and "{" are valid.
Source: System.Web.WebPages.Razor
at System.Web.WebPages.Razor.RazorBuildProvider.EnsureGeneratedCode()
at System.Web.WebPages.Razor.RazorBuildProvider.get_CodeCompilerType()
at System.Web.Compilation.BuildProvider.GetCompilerTypeFromBuildProvider(BuildProvider buildProvider)
at System.Web.Compilation.BuildProvidersCompiler.ProcessBuildProviders()
at System.Web.Compilation.BuildProvidersCompiler.PerformBuild()
at System.Web.Compilation.BuildManager.CompileWebFile(VirtualPath virtualPath)
at System.Web.Compilation.BuildManager.GetVPathBuildResultInternal(VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean allowBuildInPrecompile, Boolean throwIfNotFound, Boolean ensureIsUpToDate)
at System.Web.Compilation.BuildManager.GetVPathBuildResultWithNoAssert(HttpContext context, VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean allowBuildInPrecompile, Boolean throwIfNotFound, Boolean ensureIsUpToDate)
at System.Web.Compilation.BuildManager.GetVirtualPathObjectFactory(VirtualPath virtualPath, HttpContext context, Boolean allowCrossApp, Boolean throwIfNotFound)
at System.Web.Compilation.BuildManager.CreateInstanceFromVirtualPath(VirtualPath virtualPath, Type requiredBaseType, HttpContext context, Boolean allowCrossApp)
at System.Web.WebPages.BuildManagerWrapper.CreateInstanceOfType[T](String virtualPath)
at System.Web.WebPages.VirtualPathFactoryManager.CreateInstanceOfType[T](String virtualPath)
at System.Web.WebPages.WebPageHttpHandler.CreateFromVirtualPath(String virtualPath, IVirtualPathFactory virtualPathFactory)
at System.Web.WebPages.WebPageRoute.DoPostResolveRequestCache(HttpContextBase context)
at System.Web.HttpApplication.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)
1540 16:30:51 ERROR Breadcrumb:Error
ManagedPoolThread #7 16:30:52 INFO Job started: Sitecore.ListManagement.Analytics.UnlockContactListsAgent
ManagedPoolThread #7 16:30:52 INFO Job ended: Sitecore.ListManagement.Analytics.UnlockContactListsAgent (units processed: )
what makes me wonder about the length is that I've put image names scotttest up. when I visit it at
http://cms.website.org.uk/~/media/Images/Corporate/Enterprise-and-Development/Innovation-Village/General-Images/Scotttest.ashx it redirects me to
If I try to access an image that absolutely doesn't exist: I get redirected to: http://cms.website.org.uk/system/404
now if I rename scotttest to scotttes (or anything shorter then that) then the image loads fine.
EDIT
still stuck with this one, made some interesting discoveries though. if the length of the image name is between 9 and 23 characters inclusive I get the 404 redirect error. if the image name is 8 characters or less or is 24 characters or more it loads fine. what on earth would cause something like this and where do I even look at to debug this? short of someone sabotaging the project with some evil if statements I'm at a complete loss!
yourwebsite\App_Data\MediaCache\website
). Since it uses GUIDs as the filenames, maybe it is a file path issue.