Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"[LogScrubber] " Task has failed if \App_Data\TEMP\FileUploads doesn't exist #7675

Closed
mistyn8 opened this issue Nov 28, 2019 · 7 comments · Fixed by #8326
Closed

"[LogScrubber] " Task has failed if \App_Data\TEMP\FileUploads doesn't exist #7675

mistyn8 opened this issue Nov 28, 2019 · 7 comments · Fixed by #8326

Comments

@mistyn8
Copy link
Contributor

mistyn8 commented Nov 28, 2019

Umbraco 8.3.0 Forms 8.2.0 Deploy 3.2.0

Message:
"[LogScrubber] " Task has failed

Exception:
System.IO.DirectoryNotFoundException: Could not find a part of the path 'C:\home\site\wwwroot\App_Data\TEMP\FileUploads'.

Seems to be if a new cloud site created and no interaction with media has caused the FileUploads folder to be created?

@dawoe
Copy link
Contributor

dawoe commented Nov 29, 2019

I am seeing thsi well on the same configuration

@nul800sebastiaan
Copy link
Member

The error seems to come from LogScrubber, probably because this line should be
_fileCleanupRunner.TryAdd(task); instead:
https://github.com/umbraco/Umbraco-CMS/blob/v8/contrib/src/Umbraco.Web/Scheduling/SchedulerComponent.cs#L180

I'll move this issue to the CMS tracker instead, so this can get fixed.

@nul800sebastiaan nul800sebastiaan transferred this issue from umbraco/Umbraco.Cloud.Issues Feb 17, 2020
@umbrabot
Copy link

Hi @mistyn8,

We're writing to let you know that we've added the Up For Grabs label to your issue. We feel that this issue is ideal to flag for a community member to work on it. Once flagged here, folk looking for issues to work on will know to look at yours. Of course, please feel free work on this yourself ;-). If there are any changes to this status, we'll be sure to let you know.

For more information about issues and states, have a look at this blog post

Thanks muchly, from your friendly PR team bot :-)

@ronaldbarendse
Copy link
Contributor

ronaldbarendse commented Jun 23, 2020

@nul800sebastiaan The task is indeed added to the wrong runner, so that should get fixed, but the main issue is in:

dir.Refresh(); //in case it's changed during runtime
if (!dir.Exists)
{
_logger.Debug<TempFileCleanup>("The cleanup folder doesn't exist {Folder}", dir.FullName);
}
var files = dir.GetFiles("*.*", SearchOption.AllDirectories);

This still gets all files from a nonexistent directory and throws the exception (see stack trace):

System.IO.DirectoryNotFoundException: Could not find a part of the path 'C:\home\site\wwwroot\App_Data\TEMP\FileUploads'.
   at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
   at System.IO.FileSystemEnumerableIterator`1.CommonInit()
   at System.IO.FileSystemEnumerableIterator`1..ctor(String path, String originalUserPath, String searchPattern, SearchOption searchOption, SearchResultHandler`1 resultHandler, Boolean checkHost)
   at System.IO.DirectoryInfo.InternalGetFiles(String searchPattern, SearchOption searchOption)
   at System.IO.DirectoryInfo.GetFiles(String searchPattern, SearchOption searchOption)
   at Umbraco.Web.Scheduling.TempFileCleanup.CleanupFolder(DirectoryInfo dir)
   at Umbraco.Web.Scheduling.TempFileCleanup.PerformRun()
   at Umbraco.Web.Scheduling.RecurringTaskBase.Run()
   at Umbraco.Web.Scheduling.BackgroundTaskRunner`1.<RunAsync>d__40.MoveNext()

@nul800sebastiaan
Copy link
Member

Haha well that's silly! 🙈 Yep, that should be fixed as well. 👍

@ronaldbarendse
Copy link
Contributor

@nul800sebastiaan I wouldn't have found the issue you mentioned, so this is a real team effort 😉

PR #8326 fixes this and now also allows read-only files to be deleted 🎉

@nul800sebastiaan
Copy link
Member

Fixed in #8326

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants