SQL - Fresh Install

Product: PowerShell Universal
Version: 3.6.4

Good afternoon,

I am trying to setup a new instance of PSU and leverage sql backend. So far i have installed sql express and created a new db called psu

image

Following your training here I keep getting the following error during installation.

Any help would be greatly appreciated.

Thanks,
michael

That error from the installer is super misleading :confounded:. It usually means the service failed to start.

Can you check for a log in C:\ProgramData\PowerShellUniversal?

Im not seeing any log files from this installer.

That other log file in the pervious picture was from and old install that day using the other db method and sql.

Can you try installing but leave the Start Service check box unchecked and see if it will install?

The install wizard doesnt get that far.

It fails after you click next / install

Ah. That’s because the appsettings.json file exists in C:\ProgramData\PowerShellUniversal. Can you remove or rename that file and try again?

Yeah it still doesnt install… No log file either.

This is what is in event logs

Very weird. I guess the next step is to get an MSI log: logging - Create an MSI log file - Stack Overflow

as you request.

Here is the log: https://drive.google.com/file/d/1ze3zTCBfLNdroOUchVruNn6qnIBm2mcH/view?usp=sharing

Could it be due to my connection string?

It certainly could be. I would suggest a different database (like PSU) since master is a system database.

If you install without configuring SQL, does it work?

ahh shoot I forgot to change the database name. I have a “psu” db setup and when I use the following connection string I get the same result.

Maybe sql is configured wrong? Im not really not sure.
image

installing without sql and using litedb does not work either…

Does PSU have other decencies that im missing on this VM?

Based on the MSI log it does actually look like it’s a permission issue. It never gets to the Start Service step and is failing on the actually install of the service via the SCM.

I am 100% a local admin on this box. lol

You could try to run PSU outside of the MSI (from the ZIP) to see if it starts properly. That said, there shouldn’t be any special pre-reqs necessary to install the MSI.

The PowerShell module also installs PSU as a service but uses New-Service rather than MSI: Installation - PowerShell Universal

That might provide some more info.

So it turns out that installer might have been corrupt. Downloaded it again and it installed. However setting up the sql connection I didnt realize you needed to escape the “slash” after localhost.

Now im getting the following.

You need to add ;TrustServerCertificate=True to the connection string if your SQL Server certificate is self-signed

Thanks! :slight_smile:

Now im just tackling some permission issues.

Can you tell its my first time? lol

Got it!!! :slight_smile:

For reference I am running psu as local system.

In SSMS under security / logins I changed the system account to be a db_owner

1 Like

So im getting some weird errors now… @adam

2023-01-06 15:15:07.834 -06:00 [ERR] Error discovering modules
System.Management.Automation.CmdletInvocationException: Could not load type 'System.Management.Automation.PSSnapIn' from assembly 'System.Management.Automation, Version=7.2.7.500, Culture=neutral, PublicKeyToken=31bf3856ad364e35'.
 ---> System.TypeLoadException: Could not load type 'System.Management.Automation.PSSnapIn' from assembly 'System.Management.Automation, Version=7.2.7.500, Culture=neutral, PublicKeyToken=31bf3856ad364e35'.
   at System.Reflection.RuntimeAssembly.GetExportedTypes(QCallAssembly assembly, ObjectHandleOnStack retTypes)
   at System.Reflection.RuntimeAssembly.GetExportedTypes()
   at System.Management.Automation.Runspaces.PSSnapInHelpers.GetAssemblyTypes(Assembly assembly, String name)
   at System.Management.Automation.Runspaces.PSSnapInHelpers.AnalyzeModuleAssemblyWithReflection(Assembly assembly, String name, PSSnapInInfo psSnapInInfo, PSModuleInfo moduleInfo, String helpFile, Dictionary`2& cmdlets, Dictionary`2& aliases, Dictionary`2& providers)
   at System.Management.Automation.Runspaces.PSSnapInHelpers.AnalyzePSSnapInAssembly(Assembly assembly, String name, PSSnapInInfo psSnapInInfo, PSModuleInfo moduleInfo, Dictionary`2& cmdlets, Dictionary`2& aliases, Dictionary`2& providers, String& helpFile)
   at System.Management.Automation.Runspaces.InitialSessionState.ImportCmdletsFromAssembly(Assembly assembly, PSModuleInfo module)
   at Microsoft.PowerShell.Commands.ModuleCmdletBase.LoadBinaryModule(PSModuleInfo parentModule, String moduleName, String fileName, Assembly assemblyToLoad, String moduleBase, SessionState ss, ImportModuleOptions options, ManifestProcessingFlags manifestProcessingFlags, String prefix, Boolean loadTypes, Boolean loadFormats, Boolean& found, String shortModuleName, Boolean disableFormatUpdates)
   at Microsoft.PowerShell.Commands.ModuleCmdletBase.LoadModule(PSModuleInfo parentModule, String fileName, String moduleBase, String prefix, SessionState ss, Object privateData, ImportModuleOptions& options, ManifestProcessingFlags manifestProcessingFlags, Boolean& found, Boolean& moduleFileFound)
   at Microsoft.PowerShell.Commands.ModuleCmdletBase.LoadModuleNamedInManifest(PSModuleInfo parentModule, ModuleSpecification moduleSpecification, String moduleBase, Boolean searchModulePath, String prefix, SessionState ss, ImportModuleOptions options, ManifestProcessingFlags manifestProcessingFlags, Boolean loadTypes, Boolean loadFormats, Object privateData, Boolean& found, String shortModuleName, Nullable`1 manifestLanguageMode)
   at Microsoft.PowerShell.Commands.ModuleCmdletBase.LoadModuleManifest(String moduleManifestPath, ExternalScriptInfo manifestScriptInfo, Hashtable data, Hashtable localizedData, ManifestProcessingFlags manifestProcessingFlags, Version minimumVersion, Version maximumVersion, Version requiredVersion, Nullable`1 requiredModuleGuid, ImportModuleOptions& options, Boolean& containedErrors)
   at Microsoft.PowerShell.Commands.ModuleCmdletBase.LoadModule(PSModuleInfo parentModule, String fileName, String moduleBase, String prefix, SessionState ss, Object privateData, ImportModuleOptions& options, ManifestProcessingFlags manifestProcessingFlags, Boolean& found, Boolean& moduleFileFound)
   at Microsoft.PowerShell.Commands.ModuleCmdletBase.LoadUsingExtensions(PSModuleInfo parentModule, String moduleName, String fileBaseName, String extension, String moduleBase, String prefix, SessionState ss, ImportModuleOptions options, ManifestProcessingFlags manifestProcessingFlags, Boolean& found, Boolean& moduleFileFound)
   at Microsoft.PowerShell.Commands.ModuleCmdletBase.LoadUsingModulePath(PSModuleInfo parentModule, Boolean found, IEnumerable`1 modulePath, String name, SessionState ss, ImportModuleOptions options, ManifestProcessingFlags manifestProcessingFlags, PSModuleInfo& module)
   at Microsoft.PowerShell.Commands.ModuleCmdletBase.LoadUsingModulePath(Boolean found, IEnumerable`1 modulePath, String name, SessionState ss, ImportModuleOptions options, ManifestProcessingFlags manifestProcessingFlags, PSModuleInfo& module)
   at Microsoft.PowerShell.Commands.ImportModuleCommand.ImportModule_LocallyViaName(ImportModuleOptions importModuleOptions, String name)
   at Microsoft.PowerShell.Commands.ImportModuleCommand.ProcessRecord()
   at System.Management.Automation.CommandProcessor.ProcessRecord()
   --- End of inner exception stack trace ---
   at System.Management.Automation.Runspaces.PipelineBase.Invoke(IEnumerable input)
   at System.Management.Automation.Runspaces.Pipeline.Invoke()
   at System.Management.Automation.PowerShell.Worker.ConstructPipelineAndDoWork(Runspace rs, Boolean performSyncInvoke)
   at System.Management.Automation.PowerShell.Worker.CreateRunspaceIfNeededAndDoWork(Runspace rsToUse, Boolean isSync)
   at System.Management.Automation.PowerShell.CoreInvokeHelper[TInput,TOutput](PSDataCollection`1 input, PSDataCollection`1 output, PSInvocationSettings settings)
   at System.Management.Automation.PowerShell.CoreInvoke[TInput,TOutput](PSDataCollection`1 input, PSDataCollection`1 output, PSInvocationSettings settings)
   at System.Management.Automation.Runspaces.InitialSessionState.ProcessOneModule(Runspace initializedRunspace, String name, PSModuleInfo moduleInfoToLoad, String path, HashSet`1 publicCommands)
   at System.Management.Automation.Runspaces.InitialSessionState.ProcessModulesToImport(Runspace initializedRunspace, IEnumerable moduleList, String path, HashSet`1 publicCommands, HashSet`1 unresolvedCmdsToExpose)
   at System.Management.Automation.Runspaces.InitialSessionState.BindRunspace(Runspace initializedRunspace, PSTraceSource runspaceInitTracer)
   at System.Management.Automation.Runspaces.LocalRunspace.DoOpenHelper()
   at System.Management.Automation.Runspaces.LocalRunspace.OpenHelper(Boolean syncCall)
   at System.Management.Automation.Runspaces.RunspaceBase.CoreOpen(Boolean syncCall)
   at System.Management.Automation.Runspaces.RunspaceBase.Open()
   at UniversalAutomation.Host.ModuleService.LoadModules(ExecutionEnvironment environment) in C:\actions-runner\_work\universal\universal\src\Host\ModuleService.cs:line 24
   at Universal.Server.Services.ModuleDiscoveryService.<>c__DisplayClass8_0.<DiscoverModules>b__0() in C:\actions-runner\_work\universal\universal\src\Universal.Server\Services\ModuleDiscoveryService.cs:line 130

Service is still running but ui is returning a 404 at localhost:5000/login

That is weird. It seems like the install is still corrupt…

Do you want to schedule some time to iron this out? Feel free to email support@ironmansoftware.com