Umbraco 7.15 - Media folders not appearing in the tree
Hi all,
I've upgraded a site through various Umb versions, up to 7.15 and now I've got a strange issue.
Within the back office when I view the media section, I can't see the folders in the tree view on the left hand side, only the media items that aren't in the folders. The right hand pane however shows the media folders and the files(so the right hand pane is acting normally). I've tried republishing, rebuilding the indexes etc, but still no joy.
The media folders also do not display when I use any of the inbuilt editors to add images to a page, but the images that aren't in folders do display. So I'm literally just missing the folders.
The folders exist on both the server and within the database and are correctly pointing the folder content type.
Within the media section I can 'sort' the folders and they show up, but sorting them doesn't make them show up within the tree.
One final bit of odd behaviour is when I create a new folder this does display in the tree, it also uses the correct content type in the db, which is the same as the folders which aren't displaying. I've spent quite a while looking at the db and can't see any real differences between the new folders I add, which display, and the pre-upgrade ones which do not.
I do see an error in the logs, but I'm not sure if it's related to the media issue:
ERROR Umbraco.Core.UmbracoApplicationBase - An unhandled exception occurred
System.IO.PathTooLongException: The specified path, file name, or both are too long. The fully qualified file name must be less than 260 characters, and the directory name must be less than 248 characters.
Does anyone have any other ideas on what I can do to bring these back to life?
*when using the search at the top of the tree it can find the folders BTW, they're just not displayed below.
Ahh new error now showing, does this mean it's Imageprocessor that is my issue? I can't uninstall it, nor change the version as Umb7.15 is dependent on it.
2019-07-10 15:02:58,122 [P8776/D2/T9] ERROR Umbraco.Core.UmbracoApplicationBase - An unhandled exception occurred
System.IO.PathTooLongException: The specified path, file name, or both are too long. The fully qualified file name must be less than 260 characters, and the directory name must be less than 248 characters.
at System.IO.PathHelper.GetFullPathName()
at System.IO.Path.LegacyNormalizePath(String path, Boolean fullCheck, Int32 maxPathLength, Boolean expandShortPaths)
at System.IO.Path.NormalizePath(String path, Boolean fullCheck, Int32 maxPathLength, Boolean expandShortPaths)
at System.IO.Path.GetFullPathInternal(String path)
at System.Security.Util.StringExpressionSet.CanonicalizePath(String path, Boolean needFullPath)
at System.Security.Util.StringExpressionSet.CreateListFromExpressions(String[] str, Boolean needFullPath)
at System.Security.Permissions.FileIOPermission.AddPathList(FileIOPermissionAccess access, AccessControlActions control, String[] pathListOrig, Boolean checkForDuplicates, Boolean needFullPath, Boolean copyPathList)
at System.Security.Permissions.FileIOPermission..ctor(FileIOPermissionAccess access, String path)
at System.Web.InternalSecurityPermissions.PathDiscovery(String path)
at System.Web.Hosting.HostingEnvironment.MapPath(VirtualPath virtualPath)
at System.Web.Hosting.HostingEnvironment.MapPath(String virtualPath)
at ImageProcessor.Web.HttpModules.ImageProcessingModule.<ProcessImageAsync>d__31.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Web.TaskAsyncHelper.EndTask(IAsyncResult ar)
at System.Web.HttpApplication.AsyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
at System.Web.HttpApplication.ExecuteStepImpl(IExecutionStep step)
at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)
Yep I only upgraded because of the security release.
I think it's to do with the UmbracoFileSystemProviders.Azure plugin as I upgraded another 3 sites and they are fine. It's only affected the media folders for the site using that azure media plugin.
I've pinged Jeavon and James on Twitter in case they had seen this, and asked Seb if there was a change in to the alllowed file lengths/names for media items.
Very strange, I can't imagine anything changes that might have caused this.
Can any of you post a full log file (or email it to sj @ umbraco.dk) ? Preferably with Debug level set to <add key="serilog:minimum-level" value="Debug" /> so we have more info.
Ah yes, looks like a server side issue after all, but not with any errors reported. How old are these websites originally? I have tried with a 7.12 site and that worked but I can repro on a really old site that has been upgraded over the years.
No errors in the logs for me either, despite me trying to get it to happen for the purpose of sending a log file over.
I do, occasionally get javascript errors that have pointed to lib/angular 1.1.5, when these happen the console message is generally:
Could not find the tree media, activeTree has not been set
I also get a similar message about tree users and active tree when I tried to set the media start node on a group. When I set a start node to be one of the folders which isn't displaying Umb will save it, but on refresh of the page it's then blank again.
@Seb, the site I upgraded was a 7.14 site when I applied 7.15, but it's migration history is thus:
7.2.8 > 7.7.6 > 7.7.13 > 7.9.6 > 7.11.2 > 7.14 > 7.15
DECLARE @i int
DECLARE @nodeId int
DECLARE @numrows int
DECLARE @versionId varchar(50)
DECLARE @rootNodes TABLE (
idx smallint Primary Key IDENTITY(1,1)
, NodeId int
)
INSERT @rootNodes
SELECT id FROM umbracoNode WHERE nodeObjectType = 'B796F64C-1F99-4FFB-B886-4BF4BC011A9C' AND id NOT IN (SELECT nodeId FROM cmsMedia)
SET @i = 1
SET @numrows = (SELECT COUNT(*) FROM @rootNodes)
IF @numrows > 0
WHILE (@i <= (SELECT MAX(idx) FROM @rootNodes))
BEGIN
SET @nodeId = (SELECT NodeId FROM @rootNodes WHERE idx = @i)
--Do something with Id here
SET @versionId = (SELECT TOP 1 VersionId FROM cmsContentVersion WHERE ContentId = @nodeId ORDER BY VersionDate DESC)
PRINT(@versionId)
PRINT(@nodeId)
INSERT INTO cmsMedia(nodeId, versionId) VALUES(@nodeId, @versionId)
SET @i = @i + 1
END
Do notice that parentId = -1 has been removed from the original post, suggested by Lee (@YodasMyDad) in the Issue.
Does it (still) work for you?
Any complications?
I am concerned since there is no traceability what so ever if we run the TSQL.
Preferred case would of course be if Umbraco made an official patch. Please do :)
Make a dump of whatever is in the cmsMedia table before you run this SQL (a backup of the database is even better) and compare the result afterwards. The only changes that will happen when running that SQL is inserts into cmsMedia.
Umbraco 7.15 - Media folders not appearing in the tree
Hi all,
I've upgraded a site through various Umb versions, up to 7.15 and now I've got a strange issue.
Within the back office when I view the media section, I can't see the folders in the tree view on the left hand side, only the media items that aren't in the folders. The right hand pane however shows the media folders and the files(so the right hand pane is acting normally). I've tried republishing, rebuilding the indexes etc, but still no joy.
The media folders also do not display when I use any of the inbuilt editors to add images to a page, but the images that aren't in folders do display. So I'm literally just missing the folders.
The folders exist on both the server and within the database and are correctly pointing the folder content type.
Within the media section I can 'sort' the folders and they show up, but sorting them doesn't make them show up within the tree.
One final bit of odd behaviour is when I create a new folder this does display in the tree, it also uses the correct content type in the db, which is the same as the folders which aren't displaying. I've spent quite a while looking at the db and can't see any real differences between the new folders I add, which display, and the pre-upgrade ones which do not.
I do see an error in the logs, but I'm not sure if it's related to the media issue:
Does anyone have any other ideas on what I can do to bring these back to life?
*when using the search at the top of the tree it can find the folders BTW, they're just not displayed below.
Ahh new error now showing, does this mean it's Imageprocessor that is my issue? I can't uninstall it, nor change the version as Umb7.15 is dependent on it.
And now in the console we get
Yes I get this issue too. Just upgraded myself to v7.15. Only affects my site using the UmbracoFileSystemProviders.Azure plugin.
Ok so it's a 7.15 problem then. I feel slightly better about that. That'll teach me for upgrading so quickly after a release.
Yep I only upgraded because of the security release.
I think it's to do with the UmbracoFileSystemProviders.Azure plugin as I upgraded another 3 sites and they are fine. It's only affected the media folders for the site using that azure media plugin.
I've pinged Jeavon and James on Twitter in case they had seen this, and asked Seb if there was a change in to the alllowed file lengths/names for media items.
Mine isn't using the Azure plugin and suffers with the issue, although, ironically, the work to upgrade it is to get it ready to sit on Azure.
Very strange, I can't imagine anything changes that might have caused this.
Can any of you post a full log file (or email it to sj @ umbraco.dk) ? Preferably with Debug level set to
<add key="serilog:minimum-level" value="Debug" />
so we have more info.Whoops, it's v7,
<priority value="Debug"/>
in the log4net.config file I mean. ;-)I'm not seeing any errors in my log. Will email you regardless.
Seems to be a javascript error, I'm hearing back from another test.
I'm not seeing any JS errors in my console
I only saw the js errors when navigating the media via the list view
Actually you might be right. The tree isn't showing the items but the main window/listview IS showing the folders.
Although it's reassuring to still see the folders in the main view/list view. No pickers work :(
Replied via email. But I have zero errors in my log which is weird.
Ah yes, looks like a server side issue after all, but not with any errors reported. How old are these websites originally? I have tried with a 7.12 site and that worked but I can repro on a really old site that has been upgraded over the years.
I have a site from 2016, which I just upgraded from 7.5.9 to 7.15 that has the same problem.
I can see 7.15 has some changes in the EntityRepository, that might be the problem (don't know how though). https://github.com/umbraco/Umbraco-CMS/commit/23b8e1cce8107aabd8ba5ebbcb0a3ee33aff212d#diff-f0fb88312c00e357c11d8d36264524d3
Based on the fact that both the treecontroller and the entityService API returns no folders.
No errors in the logs for me either, despite me trying to get it to happen for the purpose of sending a log file over.
I do, occasionally get javascript errors that have pointed to lib/angular 1.1.5, when these happen the console message is generally:
I also get a similar message about tree users and active tree when I tried to set the media start node on a group. When I set a start node to be one of the folders which isn't displaying Umb will save it, but on refresh of the page it's then blank again.
@Seb, the site I upgraded was a 7.14 site when I applied 7.15, but it's migration history is thus: 7.2.8 > 7.7.6 > 7.7.13 > 7.9.6 > 7.11.2 > 7.14 > 7.15
Thanks everyone, I tracked the error down to a problematic query, follow the progress here: https://github.com/umbraco/Umbraco-CMS/issues/5848
Thank you Seb. Confirming this is a problem on our install as well, on the Cloud.
Thanks Seb, I ran the sql mentioned in there and it's sorted it out.
Hi Paul, did you run it on the Umbraco Cloud?
Thanks for tracking it down Seb.
About the SQL-fix uggested in https://github.com/umbraco/Umbraco-CMS/issues/5848.
Do notice that parentId = -1 has been removed from the original post, suggested by Lee (@YodasMyDad) in the Issue.
Does it (still) work for you? Any complications?
I am concerned since there is no traceability what so ever if we run the TSQL.
Preferred case would of course be if Umbraco made an official patch. Please do :)
Yes, removing the
parentId
is just fine.Make a dump of whatever is in the
cmsMedia
table before you run this SQL (a backup of the database is even better) and compare the result afterwards. The only changes that will happen when running that SQL is inserts intocmsMedia
.Of course we're working on a patch release. :)
Good!
"A 7.15.1 release will have to wait a little longer." made me think otherwise about the patch. : )
Thank you for the release! : )
is working on a reply...