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

Exception when running aaru from within mintty (MSYS shell) #562

Open
5 of 9 tasks
darkstar opened this issue Mar 5, 2021 · 1 comment
Open
5 of 9 tasks

Exception when running aaru from within mintty (MSYS shell) #562

darkstar opened this issue Mar 5, 2021 · 1 comment

Comments

@darkstar
Copy link
Collaborator

darkstar commented Mar 5, 2021

Prerequisites

  • Are you running the latest version?
  • Can you reproduce the problem in the debug version?

Check and fill as appropriate:

  • I was running Aaru under Windows 10...
  • I was running Aaru under Linux [version here]...
  • I was running Aaru under macOS [version here]...
  • ...in 32-bit
  • ...in 64-bit
  • ...using an Intel / AMD processor
  • ...using an ARM or Apple Silicon processor

Description

When running aaru from within a mintty shell (like from "Git for Windows" or MinGW/MSYS2), during initial configuration, the following exception occurs:

...
Do you want to enable the decryption of copy protected media (also known as DRM),
like for example DVD Video CSS encryption.
Consult your local laws before enabling it, as this is illegal in some countries, or
only legal under some circumstances.
Do you want to decryption of copy protected media? (Y/N): Unhandled exception: System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation.
 ---> System.InvalidOperationException: Cannot read keys when either application does not have a console or when console input has been redirected. Try Console.Read.
   at System.ConsolePal.ReadKey(Boolean intercept)
   at System.Console.ReadKey()
   at Aaru.Commands.ConfigureCommand.Invoke(Boolean debug, Boolean verbose) in D:\Devel\Aaru\Aaru\Commands\Configure.cs:line 105
   --- End of inner exception stack trace ---
   at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor, Boolean wrapExceptions)
   at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
   at System.Delegate.DynamicInvokeImpl(Object[] args)
   at System.Delegate.DynamicInvoke(Object[] args)
   at System.CommandLine.Invocation.ModelBindingCommandHandler.InvokeAsync(InvocationContext context)
   at System.CommandLine.Invocation.InvocationPipeline.<>c__DisplayClass4_0.<<BuildInvocationChain>b__0>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c.<<UseParseErrorReporting>b__19_0>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c__DisplayClass14_0.<<UseHelp>b__0>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c__DisplayClass22_0.<<UseVersionOption>b__0>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c__DisplayClass21_0.<<UseTypoCorrections>b__0>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c.<<UseSuggestDirective>b__20_0>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c.<<UseParseDirective>b__18_0>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c.<<UseDebugDirective>b__10_0>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c.<<RegisterWithDotnetSuggest>b__9_0>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c__DisplayClass12_0.<<UseExceptionHandler>b__0>d.MoveNext()
...

Presumably, because mintty does funny things with the console

Exact command line used:

user@laptop MINGW64 /d/Devel/Aaru (master)
$ Aaru/bin/Debug/netcoreapp3.1/aaru

Expected behavior:

Either a working console input, or a user-readable error that initial interactive configuration is not possible through alternative shells. In that case, providing command-line parameters like --accept-gdpr-foo=yes for each question would be useful.

Actual behavior:

exception is thrown as seen above

Note

It looks like this also results in Aaru uploading statistics, even though the user did not actually consent to that.

$ Aaru/bin/Debug/netcoreapp3.1/aaru
In compliance with the European Union General Data Protection Regulation 2016/679 (GDPR),
we must give you the following information about Aaru and ask if you want to opt-in
in some information sharing.

Disclaimer: Because Aaru is an open source software this information, and therefore,
compliance with GDPR only holds true if you obtained a certificated copy from its original
authors. In case of doubt, close Aaru now and ask in our IRC support channel.

For any information sharing your IP address may be stored in our server, in a way that is not
possible for any person, manual, or automated process, to link with your identity, unless
specified otherwise.

Do you want to enable the decryption of copy protected media (also known as DRM),
like for example DVD Video CSS encryption.
Consult your local laws before enabling it, as this is illegal in some countries, or
only legal under some circumstances.
Do you want to decryption of copy protected media? (Y/N): Unhandled exception: System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation.
 ---> System.InvalidOperationException: Cannot read keys when either application does not have a console or when console input has been redirected. Try Console.Read.
   at System.ConsolePal.ReadKey(Boolean intercept)
   at System.Console.ReadKey()
   at Aaru.Commands.ConfigureCommand.Invoke(Boolean debug, Boolean verbose) in D:\Devel\Aaru\Aaru\Commands\Configure.cs:line 105
   --- End of inner exception stack trace ---
   at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor, Boolean wrapExceptions)
   at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
   at System.Delegate.DynamicInvokeImpl(Object[] args)
   at System.Delegate.DynamicInvoke(Object[] args)
   at System.CommandLine.Invocation.ModelBindingCommandHandler.InvokeAsync(InvocationContext context)
   at System.CommandLine.Invocation.InvocationPipeline.<>c__DisplayClass4_0.<<BuildInvocationChain>b__0>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c.<<UseParseErrorReporting>b__19_0>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c__DisplayClass14_0.<<UseHelp>b__0>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c__DisplayClass22_0.<<UseVersionOption>b__0>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c__DisplayClass21_0.<<UseTypoCorrections>b__0>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c.<<UseSuggestDirective>b__20_0>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c.<<UseParseDirective>b__18_0>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c.<<UseDebugDirective>b__10_0>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c.<<RegisterWithDotnetSuggest>b__9_0>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c__DisplayClass12_0.<<UseExceptionHandler>b__0>d.MoveNext()
Required command was not provided.

aaru:
  aaru 5.2.99.3380-alpha+4dbc04a9 built by LTAU336 in Debug, modified Copyright © 2011-2021 Natalia Portillo

Usage:
  aaru [options] [command]

Options:
  -v, --verbose     Shows verbose output.
  -d, --debug       Shows debug output from plugins.
  --version         Show version information
  -?, -h, --help    Show help and usage information

Commands:
  database, db          Commands to manage the device and statistics database
  dev, device           Commands that talks to devices
  fi, filesystem, fs    Commands to manage filesystems
  i, image              Commands to manage images
  m, media              Commands to manage media inserted in devices
  arc, archive          Commands to manage archive files
  configure             Configures user settings and statistics.
  formats               Lists all supported disc images, partition schemes and file systems.
  list-encodings        Lists all supported text encodings and code pages.
  list-namespaces       Lists all namespaces supported by read-only filesystems.
  remote <host>         Tests connection to a Aaru Remote Server.

Uploading statistics
@darkstar darkstar added the bug label Mar 5, 2021
@claunia
Copy link
Collaborator

claunia commented Mar 5, 2021

Considering it works in other alternative shells like Powershell and Windows Terminal it looks like it is a bug in mintty and/or dotnet, we cannot fix it here.

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

No branches or pull requests

2 participants