Hi
I’m having trouble starting Powershell Universal on my linux vps. Version 2.5 works fine but anything beyond that has issues. I’ve tried a few versions from 2.6 up to and including the latest 3.0 nightly and all seem to have the same issue.
Seems to be a problem with the secrets but I dont know if this is just a coincidence.
I’m running Ubunto 20.4 LTS.
Mar 12 11:20:34 localhost psuniversal.service[58776]: [11:20:34 ERR] Error registering vault PSUSecretStore
Mar 12 11:20:34 localhost psuniversal.service[58776]: [11:20:34 ERR] Exception:
Mar 12 11:20:34 localhost psuniversal.service[58776]: System.TypeInitializationException: The type initializer for 'Microsoft.PowerShell.SecretManagement.RegisteredVaultCache' threw an exception.
Mar 12 11:20:34 localhost psuniversal.service[58776]: ---> System.ArgumentNullException: Value cannot be null. (Parameter 'path1')
Mar 12 11:20:34 localhost psuniversal.service[58776]: at System.IO.Path.Combine(String path1, String path2)
Mar 12 11:20:34 localhost psuniversal.service[58776]: at Microsoft.PowerShell.SecretManagement.RegisteredVaultCache..cctor()
Mar 12 11:20:34 localhost psuniversal.service[58776]: --- End of inner exception stack trace ---
Mar 12 11:20:34 localhost psuniversal.service[58776]: at Microsoft.PowerShell.SecretManagement.RegisteredVaultCache.GetAll()
Mar 12 11:20:34 localhost psuniversal.service[58776]: at Microsoft.PowerShell.SecretManagement.RegisterSecretVaultCommand.EndProcessing()
Mar 12 11:20:34 localhost psuniversal.service[58776]: at System.Management.Automation.Cmdlet.DoEndProcessing()
Mar 12 11:20:34 localhost psuniversal.service[58776]: at System.Management.Automation.CommandProcessorBase.Complete()
Mar 12 11:20:34 localhost psuniversal.service[58776]: [11:20:34 ERR] Exception:
Mar 12 11:20:34 localhost psuniversal.service[58776]: System.TypeInitializationException: The type initializer for 'Microsoft.PowerShell.SecretStore.SecureStoreFile' threw an exception.
Mar 12 11:20:34 localhost psuniversal.service[58776]: ---> System.ArgumentNullException: Value cannot be null. (Parameter 'path1')
Mar 12 11:20:34 localhost psuniversal.service[58776]: at System.IO.Path.Combine(String path1, String path2)
Mar 12 11:20:34 localhost psuniversal.service[58776]: at Microsoft.PowerShell.SecretStore.SecureStoreFile..cctor()
Mar 12 11:20:34 localhost psuniversal.service[58776]: --- End of inner exception stack trace ---
Mar 12 11:20:34 localhost psuniversal.service[58776]: at Microsoft.PowerShell.SecretStore.SecureStoreFile.get_ConfigRequiresPassword()
Mar 12 11:20:34 localhost psuniversal.service[58776]: at Microsoft.PowerShell.SecretStore.LocalSecretStore.get_PasswordRequired()
Mar 12 11:20:34 localhost psuniversal.service[58776]: at Microsoft.PowerShell.SecretStore.SetSecretStoreConfiguration.EndProcessing()
Mar 12 11:20:34 localhost psuniversal.service[58776]: at System.Management.Automation.Cmdlet.DoEndProcessing()
Mar 12 11:20:34 localhost psuniversal.service[58776]: at System.Management.Automation.CommandProcessorBase.Complete()
Mar 12 11:20:35 localhost powershell[58776]: (7.2.0:45:80) [ScriptBlock_Compile_Detail:ExecuteCommand.Create.Warning] Creating Scriptblock text (1 of 1):#012Set-PSUAuthenticationMethod -Type "Form" -ScriptBlock {⏎param(⏎ [PSCredential]$Credential⏎)⏎⏎#⏎# You can call whatever cmdlets you like to conduct authentication here.⏎# Just make sure to return the $Result with the Success property set to $true⏎#⏎⏎[void][System.Reflection.Assembly]::LoadFrom(“/var/lib/psu/mysql/net5.0/MySql.Data.dll”)⏎$Username = $Credential.UserName⏎$Password = $Credential.getNetworkCredential().Password⏎$stringAsStream = [System.IO.MemoryStream]::new()⏎$writer = [System.IO.StreamWriter]::new($stringAsStream)⏎$writer.write($Password)⏎$writer.flush()⏎$stringAsStream.Position=0⏎$Sptext=(Get-FileHash -InputStream $stringAsStream | Select-Object Hash).hash⏎$Query = "call sp_authenticate_user('$Username','$Sptext')"⏎⏎$myconnection = New-Object MySql.Data.MySqlClient.MySqlConnection⏎$myconnection.ConnectionString = “server=localhost;user id=esuser;password=Raffi8492c!;database=eyespy;pooling=false”⏎$myconnection.open()⏎$mycommand = New-Object MySql.Data.MySqlClient.MySqlCommand⏎$sqlDataAdapter = New-Object MySql.Data.MySqlClient.MySqlDataAdapter⏎$sqlDataSet = New-Object System.Data.DataSet⏎$mycommand.Connection = $myconnection⏎$mycommand.CommandText = $Query⏎$sqlDataAdapter.SelectCommand = $mycommand⏎$rowsFetched=$sqlDataAdapter.Fill($sqlDataSet, "data")⏎$myconnection.Close()⏎⏎if ($rowsFetched -gt 0)⏎{⏎ New-PSUAuthenticationResult -Success -UserName $Username⏎}⏎else ⏎{⏎ New-PSUAuthenticationResult -ErrorMessage 'Bad username or password'⏎}⏎}⏎#012#012ScriptBlock ID: c100ad38-f49e-4bfc-b56e-fb4a374e567c#012Path: /psu/Repository/.universal/authentication.ps1
Mar 12 11:20:35 localhost psuniversal.service[58776]: 2022-03-12 11:20:35 [INFO] (Hangfire.BackgroundJobServer) Starting Hangfire Server using job storage: 'Hangfire.MemoryStorage.MemoryStorage'
Mar 12 11:20:35 localhost psuniversal.service[58776]: 2022-03-12 11:20:35 [INFO] (Hangfire.BackgroundJobServer) Using the following options for Hangfire Server:
Mar 12 11:20:35 localhost psuniversal.service[58776]: Worker count: 20
Mar 12 11:20:35 localhost psuniversal.service[58776]: Listening queues: 'default'
Mar 12 11:20:35 localhost psuniversal.service[58776]: Shutdown timeout: 00:00:15
Mar 12 11:20:35 localhost psuniversal.service[58776]: Schedule polling interval: 00:00:15
Mar 12 11:20:35 localhost psuniversal.service[58776]: 2022-03-12 11:20:35 [INFO] (Hangfire.Server.BackgroundServerProcess) Server 9a612aad-ac41-408e-a691-be069ebab620 successfully announced in 0.061 ms
Mar 12 11:20:35 localhost psuniversal.service[58776]: 2022-03-12 11:20:35 [INFO] (Hangfire.Server.BackgroundServerProcess) Server 9a612aad-ac41-408e-a691-be069ebab620 is starting the registered dispatchers: ServerWatchdog, ServerJobCancellationWatcher, ExpirationManager, CountersAggregator, Worker, DelayedJobScheduler, RecurringJobScheduler...
Mar 12 11:20:35 localhost psuniversal.service[58776]: 2022-03-12 11:20:35 [INFO] (Hangfire.Server.BackgroundServerProcess) Server 9a612aad-ac41-408e-a691-be069ebab620 all the dispatchers started
Mar 12 11:20:36 localhost psuniversal.service[58776]: 2022-03-12 11:20:36 [INFO] (Hangfire.Server.BackgroundServerProcess) Server a6ec5e4d-389f-4ce9-93c3-37c71d32b027 caught stopping signal...
Mar 12 11:20:38 localhost psuniversal.service[58776]: 2022-03-12 11:20:38 [INFO] (Hangfire.Server.BackgroundServerProcess) Server a6ec5e4d-389f-4ce9-93c3-37c71d32b027 caught stopped signal...
Mar 12 11:20:38 localhost psuniversal.service[58776]: 2022-03-12 11:20:38 [INFO] (Hangfire.Server.BackgroundServerProcess) Server a6ec5e4d-389f-4ce9-93c3-37c71d32b027 All dispatchers stopped
Mar 12 11:20:38 localhost psuniversal.service[58776]: 2022-03-12 11:20:38 [INFO] (Hangfire.Server.BackgroundServerProcess) Server a6ec5e4d-389f-4ce9-93c3-37c71d32b027 successfully reported itself as stopped in 0.8425 ms
Mar 12 11:20:38 localhost psuniversal.service[58776]: 2022-03-12 11:20:38 [INFO] (Hangfire.Server.BackgroundServerProcess) Server a6ec5e4d-389f-4ce9-93c3-37c71d32b027 has been stopped in total 2469.0234 ms
Mar 12 11:20:38 localhost psuniversal.service[58776]: Unhandled exception. Interop+Crypto+OpenSslCryptographicException: error:2006D080:BIO routines:BIO_new_file:no such file
Mar 12 11:20:38 localhost psuniversal.service[58776]: at Interop.Crypto.CheckValidOpenSslHandle(SafeHandle handle)
Mar 12 11:20:38 localhost psuniversal.service[58776]: at Internal.Cryptography.Pal.OpenSslX509Encoder.GetCertContentType(String fileName)
Mar 12 11:20:38 localhost psuniversal.service[58776]: at System.Security.Cryptography.X509Certificates.X509Certificate2.GetCertContentType(String fileName)
Mar 12 11:20:38 localhost psuniversal.service[58776]: at Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Certificates.CertificateConfigLoader.GetCertificate(String certificatePath)
Mar 12 11:20:38 localhost psuniversal.service[58776]: at Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Certificates.CertificateConfigLoader.LoadCertificate(CertificateConfig certInfo, String endpointName)
Mar 12 11:20:38 localhost psuniversal.service[58776]: at Microsoft.AspNetCore.Server.Kestrel.KestrelConfigurationLoader.Reload()
Mar 12 11:20:38 localhost psuniversal.service[58776]: at Microsoft.AspNetCore.Server.Kestrel.KestrelConfigurationLoader.Load()
Mar 12 11:20:38 localhost psuniversal.service[58776]: at Microsoft.AspNetCore.Server.Kestrel.Core.KestrelServerImpl.BindAsync(CancellationToken cancellationToken)
Mar 12 11:20:38 localhost psuniversal.service[58776]: at Microsoft.AspNetCore.Server.Kestrel.Core.KestrelServerImpl.StartAsync[TContext](IHttpApplication`1 application, CancellationToken cancellationToken)
Mar 12 11:20:38 localhost psuniversal.service[58776]: at Microsoft.AspNetCore.Hosting.GenericWebHostService.StartAsync(CancellationToken cancellationToken)
Mar 12 11:20:38 localhost psuniversal.service[58776]: at Microsoft.Extensions.Hosting.Internal.Host.StartAsync(CancellationToken cancellationToken)
Mar 12 11:20:38 localhost psuniversal.service[58776]: at Microsoft.Extensions.Hosting.HostingAbstractionsHostExtensions.RunAsync(IHost host, CancellationToken token)
Mar 12 11:20:38 localhost psuniversal.service[58776]: at Microsoft.Extensions.Hosting.HostingAbstractionsHostExtensions.RunAsync(IHost host, CancellationToken token)
Mar 12 11:20:38 localhost psuniversal.service[58776]: at Microsoft.Extensions.Hosting.HostingAbstractionsHostExtensions.Run(IHost host)
Mar 12 11:20:38 localhost psuniversal.service[58776]: at Universal.Server.Program.<>c__DisplayClass3_0.<Main>b__0(Options o) in D:\a\universal\universal\src\Universal.Server\Program.cs:line 67
Mar 12 11:20:38 localhost psuniversal.service[58776]: at CommandLine.ParserResultExtensions.WithParsed[T](ParserResult`1 result, Action`1 action)
Mar 12 11:20:38 localhost psuniversal.service[58776]: at Universal.Server.Program.Main(String[] args) in D:\a\universal\universal\src\Universal.Server\Program.cs:line 49
Mar 12 11:20:38 localhost systemd[1]: psuniversal.service: Main process exited, code=killed, status=6/ABRT
Mar 12 11:20:38 localhost systemd[1]: psuniversal.service: Failed with result 'signal'.