Umbraco 5 - Upload causes "Invalid URI" exception in backoffice
Hi!
I'm setting up a small site that has a number of article and author nodes. Each author has a number of properties, including an optional profile image defined as an Uploader. In early tests, the uploader was tested once, and development carried on in other parts of the system. The system is now near-live and full of content, and we're about to upload author images. In a test yesterday evening, I managed to select an image for upload (3731 bytes PNG), click Save and now the author-node is unavailable (see error and stack trace below). I've been able to reproduce this in both our test and development environment.
From the looks of it, the file gets uploaded and added to the Umbraco database, but backoffice crashes when trying to display the node. I've tried my humble skills in the Immediate Window in VS, but can't seem to find anything that looks like a possible culprit.
Deleting the Uploader property and adding it again makes the node editable in backoffice again.
For a moment, I suspected the PNG format or file itself, but after deleting and adding the Uploader property again, it seemed to work with with the same file and various other test files.
I am of course a bit worried that this may happen again, with the associated data loss :-/
I get this exception in Visual Studio:
"UriFormatException was unhandled by user code Invalid URI: The hostname could not be parser"
Umbraco 5 - Upload causes "Invalid URI" exception in backoffice
Hi!
I'm setting up a small site that has a number of article and author nodes. Each author has a number of properties, including an optional profile image defined as an Uploader. In early tests, the uploader was tested once, and development carried on in other parts of the system. The system is now near-live and full of content, and we're about to upload author images. In a test yesterday evening, I managed to select an image for upload (3731 bytes PNG), click Save and now the author-node is unavailable (see error and stack trace below). I've been able to reproduce this in both our test and development environment.
From the looks of it, the file gets uploaded and added to the Umbraco database, but backoffice crashes when trying to display the node. I've tried my humble skills in the Immediate Window in VS, but can't seem to find anything that looks like a possible culprit.
Deleting the Uploader property and adding it again makes the node editable in backoffice again.
For a moment, I suspected the PNG format or file itself, but after deleting and adding the Uploader property again, it seemed to work with with the same file and various other test files.
I am of course a bit worried that this may happen again, with the associated data loss :-/
I get this exception in Visual Studio:
"UriFormatException was unhandled by user code
Invalid URI: The hostname could not be parser"
.. and this stack trace in backoffice:
at System.Uri.CreateThis(String uri, Boolean dontEscape, UriKind uriKind) at System.Uri..ctor(String uriString) at System.UriBuilder..ctor(String uri) at Umbraco.Hive.Configuration.ProviderMappingGroup.IsMatchForUri(String uri) at Umbraco.Hive.Configuration.ProviderMappingGroup.IsMatchForUri(Uri uri) at Umbraco.Hive.HiveManagerExtensions.<>c__DisplayClass1.<GetGroups>b__0(ProviderMappingGroup x) at System.Linq.Enumerable.WhereSelectEnumerableIterator`2.MoveNext() at System.Linq.Enumerable.WhereEnumerableIterator`1.MoveNext() at System.Linq.Buffer`1..ctor(IEnumerable`1 source) at System.Linq.Enumerable.ToArray[TSource](IEnumerable`1 source) at Umbraco.Hive.HiveManagerExtensions.GetFirstGroupOrThrow(IHiveManager manager, Uri providerGroupRoot) at Umbraco.Hive.HiveManagerExtensions.GetProviderGroup(IHiveManager manager, Uri customMappingRoot) at Umbraco.Hive.HiveManager.GetReader[TFilter](Uri providerMappingRoot) at Umbraco.Hive.HiveManagerExtensions.OpenReader[TFilter](IHiveManager hiveManager, Uri providerMappingRoot) at Umbraco.Cms.Web.UrlHelperExtensions.GetMediaUrl(UrlHelper url, TypedEntity entity, String propertyAlias, Int32 size) at Umbraco.Cms.Web.UrlHelperExtensions.GetMediaUrl(UrlHelper url, HiveId id, String propertyAlias, Int32 size) at Umbraco.Cms.Web.UrlHelperExtensions.GetMediaUrl(UrlHelper url, HiveId id, String propertyAlias) at ASP._Page_EV_axd_EditorTemplates__EV_B7F87D6F58049AADCCA4B78F817E7EF7_UploadEditor__cshtml.Execute() in c:\Users\HC\AppData\Local\Temp\Temporary ASP.NET Files\root\9a468ef2\58f96938\App_Web__ev_b7f87d6f58049aadcca4b78f817e7ef7(uploadeditor).cshtml.542d2575.yp_unrpp.0.cs:line 0 at System.Web.WebPages.WebPageBase.ExecutePageHierarchy() at System.Web.Mvc.WebViewPage.ExecutePageHierarchy() at System.Web.WebPages.WebPageBase.ExecutePageHierarchy(WebPageContext pageContext, TextWriter writer, WebPageRenderingBase startPage) at System.Web.Mvc.RazorView.RenderView(ViewContext viewContext, TextWriter writer, Object instance) at System.Web.Mvc.BuildManagerCompiledView.Render(ViewContext viewContext, TextWriter writer) at System.Web.Mvc.Html.TemplateHelpers.ExecuteTemplate(HtmlHelper html, ViewDataDictionary viewData, String templateName, DataBoundControlMode mode, GetViewNamesDelegate getViewNames, GetDefaultActionsDelegate getDefaultActions) at System.Web.Mvc.Html.TemplateHelpers.TemplateHelper(HtmlHelper html, ModelMetadata metadata, String htmlFieldName, String templateName, DataBoundControlMode mode, Object additionalViewData, ExecuteTemplateDelegate executeTemplate) at System.Web.Mvc.Html.TemplateHelpers.TemplateHelper(HtmlHelper html, ModelMetadata metadata, String htmlFieldName, String templateName, DataBoundControlMode mode, Object additionalViewData) at System.Web.Mvc.Html.TemplateHelpers.TemplateFor[TContainer,TValue](HtmlHelper`1 html, Expression`1 expression, String templateName, String htmlFieldName, DataBoundControlMode mode, Object additionalViewData, TemplateHelperDelegate templateHelper) at System.Web.Mvc.Html.TemplateHelpers.TemplateFor[TContainer,TValue](HtmlHelper`1 html, Expression`1 expression, String templateName, String htmlFieldName, DataBoundControlMode mode, Object additionalViewData) at System.Web.Mvc.Html.EditorExtensions.EditorFor[TModel,TValue](HtmlHelper`1 html, Expression`1 expression, String templateName, String htmlFieldName, Object additionalViewData) at Umbraco.Cms.Web.HtmlHelperEditorExtensions.UmbEditorFor[TModel,TValue](HtmlHelper`1 html, Expression`1 labelFor, Expression`1 validationFor, Expression`1 editorFor, String viewPath, String prefix, String description, String tooltip, Boolean showUmbracoLabel, Object viewData) at ASP._Page_Areas_Umbraco_Views_Shared_EditorTemplates_ContentProperty_cshtml.Execute() in c:\Development\Projects\PrivatSHPL\privatshpl.dk\Areas\Umbraco\Views\Shared\EditorTemplates\ContentProperty.cshtml:line 16 at System.Web.WebPages.WebPageBase.ExecutePageHierarchy() at System.Web.Mvc.WebViewPage.ExecutePageHierarchy() at System.Web.WebPages.WebPageBase.ExecutePageHierarchy(WebPageContext pageContext, TextWriter writer, WebPageRenderingBase startPage) at System.Web.Mvc.RazorView.RenderView(ViewContext viewContext, TextWriter writer, Object instance) at System.Web.Mvc.BuildManagerCompiledView.Render(ViewContext viewContext, TextWriter writer) at System.Web.Mvc.Html.TemplateHelpers.ActionCacheViewItem.Execute(HtmlHelper html, ViewDataDictionary viewData) at System.Web.Mvc.Html.TemplateHelpers.ExecuteTemplate(HtmlHelper html, ViewDataDictionary viewData, String templateName, DataBoundControlMode mode, GetViewNamesDelegate getViewNames, GetDefaultActionsDelegate getDefaultActions) at System.Web.Mvc.Html.TemplateHelpers.TemplateHelper(HtmlHelper html, ModelMetadata metadata, String htmlFieldName, String templateName, DataBoundControlMode mode, Object additionalViewData, ExecuteTemplateDelegate executeTemplate) at System.Web.Mvc.Html.TemplateHelpers.TemplateHelper(HtmlHelper html, ModelMetadata metadata, String htmlFieldName, String templateName, DataBoundControlMode mode, Object additionalViewData) at System.Web.Mvc.Html.TemplateHelpers.TemplateFor[TContainer,TValue](HtmlHelper`1 html, Expression`1 expression, String templateName, String htmlFieldName, DataBoundControlMode mode, Object additionalViewData, TemplateHelperDelegate templateHelper) at System.Web.Mvc.Html.TemplateHelpers.TemplateFor[TContainer,TValue](HtmlHelper`1 html, Expression`1 expression, String templateName, String htmlFieldName, DataBoundControlMode mode, Object additionalViewData) at System.Web.Mvc.Html.EditorExtensions.EditorFor[TModel,TValue](HtmlHelper`1 html, Expression`1 expression, String templateName, String htmlFieldName) at ASP._Page_Areas_Umbraco_Views_Shared__ContentEditorLayout_cshtml.Execute() in c:\Development\Projects\PrivatSHPL\privatshpl.dk\Areas\Umbraco\Views\Shared\_ContentEditorLayout.cshtml:line 52 at System.Web.WebPages.WebPageBase.ExecutePageHierarchy() at System.Web.Mvc.WebViewPage.ExecutePageHierarchy() at System.Web.WebPages.WebPageBase.ExecutePageHierarchy(WebPageContext pageContext, TextWriter writer, WebPageRenderingBase startPage) at System.Web.WebPages.WebPageBase.<>c__DisplayClass7.<RenderPageCore>b__6(TextWriter writer) at System.Web.WebPages.HelperResult.WriteTo(TextWriter writer) at System.Web.WebPages.WebPageBase.Write(HelperResult result) at System.Web.WebPages.WebPageBase.RenderSurrounding(String partialViewName, Action`1 body) at System.Web.WebPages.WebPageBase.PopContext() at System.Web.WebPages.WebPageBase.ExecutePageHierarchy(WebPageContext pageContext, TextWriter writer, WebPageRenderingBase startPage) at System.Web.Mvc.RazorView.RenderView(ViewContext viewContext, TextWriter writer, Object instance) at System.Web.Mvc.BuildManagerCompiledView.Render(ViewContext viewContext, TextWriter writer) at System.Web.Mvc.ViewResultBase.ExecuteResult(ControllerContext context) at System.Web.Mvc.ControllerActionInvoker.InvokeActionResult(ControllerContext controllerContext, ActionResult actionResult) at System.Web.Mvc.ControllerActionInvoker.<>c__DisplayClass1c.<InvokeActionResultWithFilters>b__19() at System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilter(IResultFilter filter, ResultExecutingContext preContext, Func`1 continuation) at System.Web.Mvc.ControllerActionInvoker.<>c__DisplayClass1c.<>c__DisplayClass1e.<InvokeActionResultWithFilters>b__1b() at System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilter(IResultFilter filter, ResultExecutingContext preContext, Func`1 continuation) at System.Web.Mvc.ControllerActionInvoker.<>c__DisplayClass1c.<>c__DisplayClass1e.<InvokeActionResultWithFilters>b__1b() at System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilter(IResultFilter filter, ResultExecutingContext preContext, Func`1 continuation) at System.Web.Mvc.ControllerActionInvoker.<>c__DisplayClass1c.<>c__DisplayClass1e.<InvokeActionResultWithFilters>b__1b() at System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilter(IResultFilter filter, ResultExecutingContext preContext, Func`1 continuation) at System.Web.Mvc.ControllerActionInvoker.<>c__DisplayClass1c.<>c__DisplayClass1e.<InvokeActionResultWithFilters>b__1b() at System.Web.Mvc.ControllerActionInvoker.InvokeActionResultWithFilters(ControllerContext controllerContext, IList`1 filters, ActionResult actionResult) at System.Web.Mvc.ControllerActionInvoker.InvokeAction(ControllerContext controllerContext, String actionName)
- Umbraco 5.0.0 RTM (Assembly version: 5.0.310.16)
Development setup:
Production setup:
.. after removing the uploader property, adding it again and adding all the author profile images.. it happened again. This is terrible :-/
/HC
In a recent interesting development, I've received this new error in backoffice, blocking access to the node completely:
"Cannot parse 'storage://file-uploader/p__file-uploader/v__string/12ecc9c44be34b43b73f686a050fd46a$!Trine_Flørnæss_red.jpg' as a HiveId"
This is the stack trace:
at Umbraco.Framework.HiveId.Parse(String formattedValue) at Umbraco.Framework.Persistence.RelationSerializer.FromXml(String xmlString) at Umbraco.Hive.Providers.IO.EntityRepository.GetRelationsByPattern(String searchPattern) at Umbraco.Hive.Providers.IO.EntityRepository.GetChildRelations(HiveId parentId, FileSystemInfo fileInfo) at Umbraco.Hive.Providers.IO.EntityRepository.PerformGetChildRelations(HiveId parentId, RelationType relationType) at Umbraco.Hive.ProviderSupport.AbstractReadonlyEntityRepository.<>c__DisplayClass16.<GetChildRelations>b__15() at Umbraco.Framework.Caching.CacheProviderExtensions.<>c__DisplayClass1`1.<GetOrCreate>b__0() at Umbraco.Framework.Caching.AbstractCacheProvider.GetOrCreate[T](CacheKey key, Func`1 callback) at Umbraco.Hive.ProviderSupport.AbstractReadonlyEntityRepository.GetChildRelations(HiveId parentId, RelationType relationType) at Umbraco.Hive.ProviderGrouping.RepositoryGroupExtensions.GetChildRelations(IEnumerable`1 session, HiveId parentId, Uri idRoot, RelationType relationType) at Umbraco.Hive.ProviderGrouping.ReadonlyEntityRepositoryGroup`1.GetChildRelations(HiveId parentId, RelationType relationType) at Umbraco.Hive.ProviderGrouping.RepositoryGroupExtensions.GetLazyChildRelations[T](ICoreReadonlyRepository`1 readonlyRepository, HiveId parentId, RelationType relationType) at Umbraco.Cms.Web.UrlHelperExtensions.GetMediaUrl(UrlHelper url, TypedEntity entity, String propertyAlias, Int32 size) at Umbraco.Cms.Web.UrlHelperExtensions.GetMediaUrl(UrlHelper url, HiveId id, String propertyAlias, Int32 size) at ASP._Page_EV_axd_EditorTemplates__EV_B7F87D6F58049AADCCA4B78F817E7EF7_UploadEditor__cshtml.Execute() in c:\Windows\Microsoft.NET\Framework64\v4.0.30319\Temporary ASP.NET Files\root\be569bb9\f211e7c0\App_Web__ev_b7f87d6f58049aadcca4b78f817e7ef7(uploadeditor).cshtml.542d2575.gezrsdy5.0.cs:line 0 at System.Web.WebPages.WebPageBase.ExecutePageHierarchy() at System.Web.Mvc.WebViewPage.ExecutePageHierarchy() at System.Web.WebPages.WebPageBase.ExecutePageHierarchy(WebPageContext pageContext, TextWriter writer, WebPageRenderingBase startPage) at System.Web.Mvc.Html.TemplateHelpers.ExecuteTemplate(HtmlHelper html, ViewDataDictionary viewData, String templateName, DataBoundControlMode mode, GetViewNamesDelegate getViewNames, GetDefaultActionsDelegate getDefaultActions) at System.Web.Mvc.Html.TemplateHelpers.TemplateHelper(HtmlHelper html, ModelMetadata metadata, String htmlFieldName, String templateName, DataBoundControlMode mode, Object additionalViewData, ExecuteTemplateDelegate executeTemplate) at System.Web.Mvc.Html.TemplateHelpers.TemplateHelper(HtmlHelper html, ModelMetadata metadata, String htmlFieldName, String templateName, DataBoundControlMode mode, Object additionalViewData) at System.Web.Mvc.Html.TemplateHelpers.TemplateFor[TContainer,TValue](HtmlHelper`1 html, Expression`1 expression, String templateName, String htmlFieldName, DataBoundControlMode mode, Object additionalViewData) at System.Web.Mvc.Html.EditorExtensions.EditorFor[TModel,TValue](HtmlHelper`1 html, Expression`1 expression, String templateName, String htmlFieldName, Object additionalViewData) at Umbraco.Cms.Web.HtmlHelperEditorExtensions.UmbEditorFor[TModel,TValue](HtmlHelper`1 html, Expression`1 labelFor, Expression`1 validationFor, Expression`1 editorFor, String viewPath, String prefix, String description, String tooltip, Boolean showUmbracoLabel, Object viewData) at ASP._Page_Areas_Umbraco_Views_Shared_EditorTemplates_ContentProperty_cshtml.Execute() in d:\www\privatshpl.dk\prod\Areas\Umbraco\Views\Shared\EditorTemplates\ContentProperty.cshtml:line 16 at System.Web.WebPages.WebPageBase.ExecutePageHierarchy() at System.Web.Mvc.WebViewPage.ExecutePageHierarchy() at System.Web.WebPages.WebPageBase.ExecutePageHierarchy(WebPageContext pageContext, TextWriter writer, WebPageRenderingBase startPage) at System.Web.Mvc.Html.TemplateHelpers.ActionCacheViewItem.Execute(HtmlHelper html, ViewDataDictionary viewData) at System.Web.Mvc.Html.TemplateHelpers.ExecuteTemplate(HtmlHelper html, ViewDataDictionary viewData, String templateName, DataBoundControlMode mode, GetViewNamesDelegate getViewNames, GetDefaultActionsDelegate getDefaultActions) at System.Web.Mvc.Html.TemplateHelpers.TemplateHelper(HtmlHelper html, ModelMetadata metadata, String htmlFieldName, String templateName, DataBoundControlMode mode, Object additionalViewData, ExecuteTemplateDelegate executeTemplate) at System.Web.Mvc.Html.TemplateHelpers.TemplateHelper(HtmlHelper html, ModelMetadata metadata, String htmlFieldName, String templateName, DataBoundControlMode mode, Object additionalViewData) at System.Web.Mvc.Html.TemplateHelpers.TemplateFor[TContainer,TValue](HtmlHelper`1 html, Expression`1 expression, String templateName, String htmlFieldName, DataBoundControlMode mode, Object additionalViewData) at System.Web.Mvc.Html.EditorExtensions.EditorFor[TModel,TValue](HtmlHelper`1 html, Expression`1 expression, String templateName, String htmlFieldName) at ASP._Page_Areas_Umbraco_Views_Shared__ContentEditorLayout_cshtml.Execute() in d:\www\privatshpl.dk\prod\Areas\Umbraco\Views\Shared\_ContentEditorLayout.cshtml:line 52 at System.Web.WebPages.WebPageBase.ExecutePageHierarchy() at System.Web.Mvc.WebViewPage.ExecutePageHierarchy() at System.Web.WebPages.WebPageBase.ExecutePageHierarchy(WebPageContext pageContext, TextWriter writer, WebPageRenderingBase startPage) at System.Web.WebPages.WebPageBase.Write(HelperResult result) at System.Web.WebPages.WebPageBase.RenderSurrounding(String partialViewName, Action`1 body) at System.Web.WebPages.WebPageBase.PopContext() at System.Web.Mvc.ViewResultBase.ExecuteResult(ControllerContext context) at System.Web.Mvc.ControllerActionInvoker.<>c__DisplayClass1c.<InvokeActionResultWithFilters>b__19() at System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilter(IResultFilter filter, ResultExecutingContext preContext, Func`1 continuation) at System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilter(IResultFilter filter, ResultExecutingContext preContext, Func`1 continuation) at System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilter(IResultFilter filter, ResultExecutingContext preContext, Func`1 continuation) at System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilter(IResultFilter filter, ResultExecutingContext preContext, Func`1 continuation) at System.Web.Mvc.ControllerActionInvoker.InvokeActionResultWithFilters(ControllerContext controllerContext, IList`1 filters, ActionResult actionResult) at System.Web.Mvc.ControllerActionInvoker.InvokeAction(ControllerContext controllerContext, String actionName)
no answers? I have the same issue...
is working on a reply...