losslesspng / SetUpKomgaJava

A Powershell script to get up and running with Komga
22 stars 12 forks source link

Error with running for the first time (previously was manually running the jar) - NSSM cannot start service #1

Open xFaultx opened 2 years ago

xFaultx commented 2 years ago

When running the script, I keep getting the same error when trying to run the script on my windows 10 machine:

`LastWriteTime : 4/2/2022 12:12:46 AM
Length        : 0
Name          : nssm.bat

LastWriteTime : 4/2/2022 12:12:47 AM
Name          : SetSCPerms.ps1

Setting up NSSM...
Starting the service... Give Komga some time to start up and then access your browser at http://localhost:8080/
Start-Service : Service 'Komga Service (komga)' cannot be started due to the following error: Cannot start service
komga on computer '.'.
At C:\Users\USERNAME\OneDrive\Documents\Komga Jar Setup\SetUpKomgaJava.ps1:259 char:1
+ Start-Service -Name "$serviceName"
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : OpenError: (System.ServiceProcess.ServiceController:ServiceController) [Start-Service],
    + FullyQualifiedErrorId : CouldNotStartService,Microsoft.PowerShell.Commands.StartServiceCommand`
This script will automatically launch the web UI in 30 seconds or you can close it and launch it yourself.

Waiting for 26 seconds, press a key to continue ...

Cannot figure out if its an issue with windows getting confused on my credentials? I know Im putting in the right password but this error persists

losslesspng commented 2 years ago

It is a permissions issue, somewhere along the way. The service gets set up using the username running the script, and whatever the first password was that was entered. If you navigate to the install directory and open the nssm folder, you can run nssm edit komga from the command line and check to make sure that your username and password are set correctly. nssm start komga will attempt to start the service as well, it might have something else more specific than the powershell output if there are other errors.

xFaultx commented 2 years ago

Same error from nssm. Ive tried changing the logon credentials both through services.msc and through nssm, no luck

losslesspng commented 2 years ago

In the event that you're still wanting to attempt running this, the error may be related to using a Microsoft Account. I did some digging today and discovered the problem and a workaround. Apologies for the incredibly late response. https://github.com/losslesspng/SetUpKomgaJava/wiki/Running-With-a-Microsoft-Account