SDP-363

pgancarczyk
Open
The customer explains it best: (00373607)

----------------------

When setting up a new server using the SDP, eventually I arrived at this state when first starting the new service:

-       The service stops immediately with a useless error message from windows.

-       There are no log files whatsoever.

-       The Windows event log says:


  <Event xmlns="http://schemas.microsoft.com/win/2004/08/events/event">

  <System>

  <Provider Name="Perforce server" />

  <EventID Qualifiers="0">0</EventID>

  <Level>2</Level>

  <Task>0</Task>

  <Keywords>0x80000000000000</Keywords>

  <TimeCreated SystemTime="2018-12-12T14:13:12.458353500Z" />

  <EventRecordID>4078</EventRecordID>

  <Channel>Application</Channel>

  <Computer>desvcode01.brainlab.net</Computer>

  <Security />

  </System>

 <EventData>

  <Data>Database open error on db.server! open: db.server: Access is denied.</Data>

  </EventData>

  </Event>



Eventually, what I found out is this:


-       SDP uses instsrv to create the service.

-       We want to run the service not with the local system account, but with a dedicated domain account with limited permissions.

-       Note that instsrv actually helpfully suggests this!

-       Registry entries associated with the process (e.g. HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\p4_1\Parameters) have permissions like files.

-       These keys belonged to the local system account, and the account running the service didn’t have permissions to read these.

-       These keys include the `p4 set -S <service> …` setting for P4ROOT and P4LOG. Without permission to read these values, the service was unable to create either the db files or the log files.

----------------------

Their suggestions on the matter:

----------------------

Suggestions:



1.     In the SDP Guide, explicitly address the issue of running the service as a different user, and mention that permissions need to be fixed using regedit.

2.     Even better, add an option for this in the SDP configuration and use it as `-a` parameter to instsrv. (I haven’t tried this, but it looks as if this is feature in instsrv.)

3.     When failing to read the service’s parameters, produce an error message about this and fail immediately, instead of assuming an arbitrary P4ROOT and P4LOG and then failing because these are not writable.
Not sure if this is possible: Are these variables set in the environment before Windows starts p4s.exe? Then this would still be helpful:

4.     If the P4ROOT or P4LOG directories are not writable, show absolute paths in the error message instead of just filenames. That would help a lot in understanding what’s wrong.
Status
Open
Project
perforce-software-sdp
Severity
A
Reported By
pgancarczyk
Reported Date
Modified By
pgancarczyk
Modified Date
Owned By
pgancarczyk
Type
Bug