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

Make sure EMU fails gracefully when a file is not found #230

Open
2 tasks
atruskie opened this issue Aug 2, 2022 · 0 comments
Open
2 tasks

Make sure EMU fails gracefully when a file is not found #230

atruskie opened this issue Aug 2, 2022 · 0 comments
Labels
enhancement New feature or request

Comments

@atruskie
Copy link
Member

atruskie commented Aug 2, 2022

In the case where a target is specified as an absolute path, and the path for some reason is missing, then we fail with a stack trace.

  • Fail with a coherent error message
  • Ensure exit code is set appropriately

Note: this may be part of a larger error handling epic we have to deal with.

Stack trace we saw in prod:

 Failed running EMU: Unhandled exception: System.IO.FileNotFoundException: Could not find file '/data/harvester_to_do/harvest_1/20220317_61/243/156/20201202_AAO/20201202T100000+1000_REC.flac'. File name: '/data/harvester_to_do/harvest_1/20220317_61/243/156/20201202_AAO/20201202T100000+1000_REC.flac' at Interop.ThrowExceptionForIoErrno(ErrorInfo , String , Boolean , Func`2 ) at Interop.CheckIo(Error , String , Boolean , Func`2 ) at Microsoft.Win32.SafeHandles.SafeFileHandle.Open(String , OpenFlags , Int32 ) at Microsoft.Win32.SafeHandles.SafeFileHandle.Open(String , FileMode , FileAccess , FileShare , FileOptions , Int64 ) at System.IO.Strategies.OSFileStreamStrategy..ctor(String , FileMode , FileAccess , FileShare , FileOptions , Int64 ) at System.IO.Strategies.UnixFileStreamStrategy..ctor(String , FileMode , FileAccess , FileShare , FileOptions , Int64 ) at System.IO.Strategies.FileStreamHelpers.ChooseStrategyCore(String , FileMode , FileAccess , FileShare , FileOptions , Int64 ) at System.IO.Strategies.FileStreamHelpers.ChooseStrategy(FileStream , String , FileMode , FileAccess , FileShare , Int32 , FileOptions , Int64 ) at System.IO.FileStream..ctor(String , FileMode , FileAccess , FileShare , Int32 , FileOptions , Int64 ) at System.IO.FileStream..ctor(String , FileMode , FileAccess , FileShare , Int32 , FileOptions ) at System.IO.FileStream..ctor(String , FileMode , FileAccess , FileShare , Int32 , Boolean ) at System.IO.FileStream..ctor(String , FileMode , FileAccess , FileShare ) at System.IO.File.OpenRead(String ) at System.IO.Abstractions.FileWrapper.OpenRead(String path) at Emu.Fixes.FrontierLabs.MetadataDurationBug.CheckAffectedAsync(String file) in /app/src/Emu/Fixes/FrontierLabs/MetadataDurationBug.cs:line 40 at Emu.Fixes.FrontierLabs.MetadataDurationBug.ProcessFileAsync(String file, DryRun dryRun) in /app/src/Emu/Fixes/FrontierLabs/MetadataDurationBug.cs:line 49 at Emu.FixApply.ApplyFixAsync(String file, DryRun dryRun, IFixOperation operation, CheckResult checkResult) in /app/src/Emu/Commands/Fix/Apply/FixApply.cs:line 284 at Emu.FixApply.ProcessFile(String file, DryRun dryRun, ICheckOperation[] operations) in /app/src/Emu/Commands/Fix/Apply/FixApply.cs:line 187 at Emu.FixApply.InvokeAsync(InvocationContext context) in /app/src/Emu/Commands/Fix/Apply/FixApply.cs:line 90 at Emu.Extensions.System.CommandLine.CommandLineExtensions.<>c__DisplayClass0_0`3.<b__1>d.MoveNext() in /app/src/Emu/Extensions/System/CommandLine/CommandLineExtensions.cs:line 73 --- End of stack trace from previous location --- at System.CommandLine.Invocation.CommandHandler.GetExitCodeAsync(Object value, InvocationContext context) at System.CommandLine.Invocation.ModelBindingCommandHandler.InvokeAsync(InvocationContext context) at System.CommandLine.Invocation.InvocationPipeline.<>c__DisplayClass4_0.<b__0>d.MoveNext() --- End of stack trace from previous location --- at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c__DisplayClass23_0.<b__0>d.MoveNext() --- End of stack trace from previous location --- at System.CommandLine.Hosting.HostingExtensions.<>c__DisplayClass1_0.<b__0>d.MoveNext() --- End of stack trace from previous location --- at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c__DisplayClass16_0.<b__0>d.MoveNext() --- End of stack trace from previous location --- at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c__DisplayClass27_0.<b__1>d.MoveNext() --- End of stack trace from previous location --- at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c__DisplayClass25_0.<b__0>d.MoveNext() --- End of stack trace from previous location --- at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c.<b__24_0>d.MoveNext() --- End of stack trace from previous location --- at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c__DisplayClass22_0.<b__0>d.MoveNext() --- End of stack trace from previous location --- at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c__DisplayClass11_0.<b__0>d.MoveNext() --- End of stack trace from previous location --- at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c.<b__10_0>d.MoveNext() --- End of stack trace from previous location --- at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c__DisplayClass14_0.<b__0>d.MoveNext() 

@atruskie atruskie added the enhancement New feature or request label Aug 2, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant