Service Crashing on Start

This forum can be browsed by the general public. Posting is limited to current SAPIEN license holders with active maintenance and does not offer a response time guarantee.
Forum rules
DO NOT POST LICENSE NUMBERS, ACTIVATION KEYS OR ANY OTHER LICENSING INFORMATION IN THIS FORUM.
Only the original author and our tech personnel can reply to a topic that is created in this forum. If you find a topic that relates to an issue you are having, please create a new topic and reference the other in your post.

Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
This topic is 1 year and 7 months old and has exceeded the time allowed for comments. Please begin a new topic or use the search feature to find a similar but newer topic.
User avatar
XxQuaDxX
Posts: 7
Last visit: Thu Aug 18, 2022 6:00 am

Service Crashing on Start

Post by XxQuaDxX »

Product: PowerShell Studio 2022 (64 Bit)
Build: v5.8.209
OS: Windows Server 2016 Standard (64 Bit)
Build: v10.0.14393.0

I'm having an issue where a Service created by PowerShell studio crashes when I try to start the service. This same script used to work on past versions of PowerShell Studio but since upgrading to 5.2 and now 5.8 the created service won't start. I am compiling the exact same script with the same settings and I get error 1064 "An exception occurred in the service when handling the control request". I switch back to an executable created in previous versions of Sapien PSS and the service starts without an issue.

When I change the service to use the local system account the service starts fine, but when I change it to start with my service account it gives this error. Again, switching back to the old executable and starting with the service account it all works as expected.

I created a net-new service script to just echo to a file and that gives me the same results. Is there something that changed in recent versions of Sapien that makes it so service accounts can't be used easily?
Attachments
SapienBit9_3.png
SapienBit9_3.png (7.88 KiB) Viewed 1116 times
SapienBit9_2.png
SapienBit9_2.png (8.04 KiB) Viewed 1116 times
SapienBit9_1.png
SapienBit9_1.png (4.7 KiB) Viewed 1116 times
User avatar
brittneyr
Site Admin
Posts: 1672
Last visit: Wed Apr 17, 2024 1:24 pm
Answers: 39
Been upvoted: 31 times

Re: Service Crashing on Start

Post by brittneyr »

Since you updated from an older build, do you have the service defined functions that are included with the service template in PowerShell Studio? These functions need to be present and cannot be renamed.
An explanation of the functions can be found here:
https://www.sapien.com/blog/2022/06/14/ ... e-project/
Brittney
SAPIEN Technologies, Inc.
User avatar
XxQuaDxX
Posts: 7
Last visit: Thu Aug 18, 2022 6:00 am

Re: Service Crashing on Start

Post by XxQuaDxX »

Thanks @brittneyr

For anyone who gets this in the future ... I got it working by NOT installing the service with an MSI. I copied the complied executable to the directory it should be in and did an 'ExecutableName.exe /i' to install it, modified the "Logon As" manually using Services.msc, and everything works fine now. Service starts no issues.

Not sure why it wouldn't work using the MSI but these are the settings I was using.
Attachments
SapienBit9_5.png
SapienBit9_5.png (13.56 KiB) Viewed 1099 times
User avatar
Alexander Riedel
Posts: 8488
Last visit: Tue Apr 16, 2024 8:42 am
Answers: 20
Been upvoted: 37 times

Re: Service Crashing on Start

Post by Alexander Riedel »

Thanks for the update. I have alerted QA to investigate.
Alexander Riedel
SAPIEN Technologies, Inc.
User avatar
Alexander Riedel
Posts: 8488
Last visit: Tue Apr 16, 2024 8:42 am
Answers: 20
Been upvoted: 37 times

Re: Service Crashing on Start

Post by Alexander Riedel »

To verify from your screenshots. You installed a 64 bit service in the 32 bit Program Files folder? Can you please attach the .psbuild file for further evaluation?
Alexander Riedel
SAPIEN Technologies, Inc.
This topic is 1 year and 7 months old and has exceeded the time allowed for comments. Please begin a new topic or use the search feature to find a similar but newer topic.