Description
I have just discovered that trying to run 'paket config add-credentials' within a Jenkins pipeline fails due to trying to do a Console.ReadLine(). This returns null in the context of a Jenkins build and throws a System.NullReferenceException.
Repro steps
- Create a Jenkins pipeline that runs the following command:
paket.exe config add-credentials https://nuget-server-with-authentication.com/ --username **** --password ****
- Run the pipeline
Expected behavior
The default authentication type of basic is taken and the command adds the authentication details.
Actual behavior
C:\jenkins\ws\7958e3d43a>..paket\paket.exe config add-credentials https://advancedcsg.jfrog.io/advancedcsg/api/nuget/nuget-snapshot-virtual --username **** --password ****
Paket version 5.120.1
Authentication type (basic|ntlm, default = basic): Performance:
- Runtime: 857 milliseconds
Unhandled Exception: System.NullReferenceException: Object reference not set to an instance of an object.
at Paket.ConfigFile.askAndAddAuth(String source, String username, String password, String authType, Boolean verify)
at <StartupCode$Paket-Core>.$PublicAPI.AddCredentials@177-6.Invoke(Unit unitVar0)
at Paket.Utils.RunInLockedAccessMode[a](String rootFolder, FSharpFunc2 action) at Paket.Program.handleCommand@737-3.Invoke(ParseResults1 results)
at Paket.Program.processWithValidationEx$cont@37[a](Boolean silent, FSharpFunc`2 commandF, a result, Unit unitVar)
at Paket.Program.handleCommand(Boolean silent, Command command)
at Paket.Program.main()
at <StartupCode$paket>.$Paket.Program.main@()
Known workarounds
If you supply --authtype basic the command bypasses the Console.ReadLine() command which is the source of the error.
Description
I have just discovered that trying to run 'paket config add-credentials' within a Jenkins pipeline fails due to trying to do a Console.ReadLine(). This returns null in the context of a Jenkins build and throws a System.NullReferenceException.
Repro steps
Expected behavior
The default authentication type of basic is taken and the command adds the authentication details.
Actual behavior
Known workarounds
If you supply
--authtype basicthe command bypasses the Console.ReadLine() command which is the source of the error.