1. Sebastian Sebastian
  2. scm-manager
  3. Issues

Issues

Issue #74 resolved

Windows Service

Bernhard Millauer
created an issue

Hi, if i start the installed service ("scm-manager.bat install"), an error occurrs.

{{{

!xml

  • <Event xmlns="http://schemas.microsoft.com/win/2004/08/events/event">
  • <System> <Provider Name="Service Control Manager" Guid="{555908d1-a6d7-4695-8e1e-26931d2012f4}" EventSourceName="Service Control Manager" /> <EventID Qualifiers="49152">7024</EventID> <Version>0</Version> <Level>2</Level> <Task>0</Task> <Opcode>0</Opcode> <Keywords>0x8080000000000000</Keywords> <TimeCreated SystemTime="2011-11-04T15:58:14.131375000Z" /> <EventRecordID>1657</EventRecordID> <Correlation /> <Execution ProcessID="480" ThreadID="340" /> <Channel>System</Channel> <Computer>SERVERNAME</Computer> <Security /> </System>
  • <EventData> <Data Name="param1">scm-server</Data> <Data Name="param2">%%0</Data> </EventData> </Event> }}}

and in the logs is the following:

{{{

!text

[2011-11-04 17:03:29] [info] Commons Daemon procrun (1.0.5.0 64-bit) started [2011-11-04 17:03:29] [info] Running 'scm-server' Service... [2011-11-04 17:03:29] [info] Run service finished. [2011-11-04 17:03:29] [error] Commons Daemon procrun failed with exit value: 4 (Failed to run service) [2011-11-04 17:03:29] [error] The service process could not connect to the service controller. }}}

i've also tried to start everything as administrator, but that does not help.

ive running a windows 2008 r2 server x64.

Comments (30)

  1. chuckrolek

    Its been a little bit, but if I remember correctly I might have actually got the same error.

    I know this does not resolved that error, but it might help you as a work-around. Our solution was to use Tomcat to host SCM as a service. Then we used Apache Server to handle the little bit of redirecting we needed.

  2. Bernhard Millauer reporter

    hey, sorry for the delay...

    .) Have you started the "Command Prompt" with "Run as administrator"? yes, as i wrote

    .) Could you start the service over the "Service-Center"? no, the same error occur :(.

    so you cant help me, right?

  3. Sebastian Sebastian repo owner

    Please uninstall the scm-server service and edit the scm-server.bat, search the line:

    "%BASEDIR%\libexec\%PRUNSRV%" //IS//scm-server --Classpath=%CLASSPATH_PREFIX%;%CLASSPATH% --JvmOptions=-Dapp.name="scm-server";-Dapp.repo="%REPO%";-Dbasedir="%BASEDIR%" ++JvmOptions=-Dlogback.configurationFile=logging.xml --DisplayName="scm-server" --Jvm=auto --StartMode=jvm --StartMethod=start --StopMode=jvm --StopMethod=stop --StartClass=sonia.scm.server.ScmServerDaemon --StopClass=sonia.scm.server.ScmServerDaemon --LogPath="%BASEDIR%\var\log" --PidFile="%BASEDIR%\var\scm-server.pid"
    

    and replace the line with:

    "%BASEDIR%\libexec\%PRUNSRV%" //IS//scm-server --LogLevel=Debug --LogJniMessages=1 --Classpath=%CLASSPATH_PREFIX%;%CLASSPATH% --JvmOptions=-Dapp.name="scm-server";-Dapp.repo="%REPO%";-Dbasedir="%BASEDIR%" ++JvmOptions=-Dlogback.configurationFile=logging.xml --DisplayName="scm-server" --Jvm=auto --StartMode=jvm --StartMethod=start --StopMode=jvm --StopMethod=stop --StartClass=sonia.scm.server.ScmServerDaemon --StopClass=sonia.scm.server.ScmServerDaemon --LogPath="%BASEDIR%\var\log" --PidFile="%BASEDIR%\var\scm-server.pid"
    

    After that install the service again with "scm-server.bat install", than start the service with:

    libexec\prunsrv.exe --LogLevel=Debug --LogJniMessages=1
    

    Please post the var\log\commons-daemon.xxx.log and the output of prunsrv.exe command.

  4. Anonymous

    Hi, thank you for your new configuration. Here is the output: (again, sorry for delay x.X)

    commons-daemon.log

    [2011-11-24 15:51:41] [debug] ( prunsrv.c:1494) Commons Daemon procrun log initialized
    [2011-11-24 15:51:41] [info]  (          :0   ) Commons Daemon procrun (1.0.5.0 32-bit) started
    [2011-11-24 15:51:41] [info]  (          :0   ) Running 'scm-server' Service...
    [2011-11-24 15:51:41] [info]  (          :0   ) Run service finished.
    [2011-11-24 15:51:41] [error] ( prunsrv.c:1563) Commons Daemon procrun failed with exit value: 4 (Failed to run service)
    [2011-11-24 15:51:41] [error] ( prunsrv.c:1563) The service process could not connect to the service controller.
    

    prunsrv.exe

    2011-11-24 15:51:41 Commons Daemon procrun stdout initialized
    2011-11-24 15:51:41 Commons Daemon procrun stderr initialized
    

    Additional, i have to start with an service name, otherwise he complains about a missing service name :)

    libexec\prunsrv.exe //RS//scm-server --LogLevel=Debug --LogJniMessages=1
    

    ive started it with following conditions: logged in as administrator cmd started explicit as administrator 32 and 64 bit version

    all the same output

    does this helps you?

  5. Bernhard Millauer reporter

    hmm.. wasnt logged in and have a format problem:

    ive started it with following conditions:

    .) logged in as administrator

    .) cmd started explicit as administrator

    .) 32 and 64 bit version

  6. Bernhard Millauer reporter

    Hi Sebastian,

    unfortunately the change has no effect. here the error out of the EventLog:

      <Event xmlns="http://schemas.microsoft.com/win/2004/08/events/event">
      <System>
      <Provider Name="Service Control Manager" Guid="{555908d1-a6d7-4695-8e1e-26931d2012f4}" EventSourceName="Service Control Manager" /> 
      <EventID Qualifiers="49152">7024</EventID> 
      <Version>0</Version> 
      <Level>2</Level> 
      <Task>0</Task> 
      <Opcode>0</Opcode> 
      <Keywords>0x8080000000000000</Keywords> 
      <TimeCreated SystemTime="2011-11-25T15:52:48.828250000Z" /> 
      <EventRecordID>4736</EventRecordID> 
      <Correlation /> 
      <Execution ProcessID="492" ThreadID="2116" /> 
      <Channel>System</Channel> 
      <Computer>upinnov04</Computer> 
      <Security /> 
      </System>
      <EventData>
      <Data Name="param1">scm-server</Data> 
      <Data Name="param2">%%0</Data> 
      </EventData>
      </Event>
    

    the error code in this case is "%%0" :(

    the key "HKEY_LOCAL_MACHINE\SOFTWARE\Apache Software Foundation\ProcRun 2.0\scm-server\Parameters" does not exists because of x64 system, but the other two:

    HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\scm-server

    Windows Registry Editor Version 5.00
    
    [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\scm-server]
    "Type"=dword:00000010
    "Start"=dword:00000003
    "ErrorControl"=dword:00000001
    "ImagePath"=hex(2):43,00,3a,00,5c,00,53,00,43,00,4d,00,2d,00,4d,00,61,00,6e,00,\
      61,00,67,00,65,00,72,00,5c,00,6c,00,69,00,62,00,65,00,78,00,65,00,63,00,5c,\
      00,70,00,72,00,75,00,6e,00,73,00,72,00,76,00,2d,00,61,00,6d,00,64,00,36,00,\
      34,00,2e,00,65,00,78,00,65,00,20,00,2f,00,2f,00,52,00,53,00,2f,00,2f,00,73,\
      00,63,00,6d,00,2d,00,73,00,65,00,72,00,76,00,65,00,72,00,00,00
    "DisplayName"="scm-server"
    "DependOnService"=hex(7):54,00,63,00,70,00,69,00,70,00,00,00,41,00,66,00,64,00,\
      00,00,00,00
    "ObjectName"="LocalSystem"
    
    [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\scm-server\Parameters]
    

    HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Apache Software Foundation\ProcRun 2.0\scm-server

    Windows Registry Editor Version 5.00
    
    [HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Apache Software Foundation\Procrun 2.0\scm-server]
    
    [HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Apache Software Foundation\Procrun 2.0\scm-server\Parameters]
    
    [HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Apache Software Foundation\Procrun 2.0\scm-server\Parameters\Java]
    "Jvm"="auto"
    "Options"=hex(7):2d,00,44,00,61,00,70,00,70,00,2e,00,6e,00,61,00,6d,00,65,00,\
      3d,00,73,00,63,00,6d,00,2d,00,73,00,65,00,72,00,76,00,65,00,72,00,00,00,2d,\
      00,44,00,61,00,70,00,70,00,2e,00,72,00,65,00,70,00,6f,00,3d,00,43,00,3a,00,\
      5c,00,53,00,43,00,4d,00,2d,00,4d,00,61,00,6e,00,61,00,67,00,65,00,72,00,5c,\
      00,62,00,69,00,6e,00,5c,00,5c,00,2e,00,2e,00,5c,00,6c,00,69,00,62,00,00,00,\
      2d,00,44,00,62,00,61,00,73,00,65,00,64,00,69,00,72,00,3d,00,43,00,3a,00,5c,\
      00,53,00,43,00,4d,00,2d,00,4d,00,61,00,6e,00,61,00,67,00,65,00,72,00,5c,00,\
      62,00,69,00,6e,00,5c,00,5c,00,2e,00,2e,00,00,00,2d,00,44,00,6c,00,6f,00,67,\
      00,62,00,61,00,63,00,6b,00,2e,00,63,00,6f,00,6e,00,66,00,69,00,67,00,75,00,\
      72,00,61,00,74,00,69,00,6f,00,6e,00,46,00,69,00,6c,00,65,00,3d,00,6c,00,6f,\
      00,67,00,67,00,69,00,6e,00,67,00,2e,00,78,00,6d,00,6c,00,00,00,00,00
    "Classpath"=";C:\\SCM-Manager\\bin\\\\..\\conf;C:\\SCM-Manager\\bin\\\\..\\lib\\scm-server-1.9-SNAPSHOT.jar;C:\\SCM-Manager\\bin\\\\..\\lib\\commons-daemon-1.0.8.jar;C:\\SCM-Manager\\bin\\\\..\\lib\\jetty-server-7.5.1.v20110908.jar;C:\\SCM-Manager\\bin\\\\..\\lib\\servlet-api-2.5.jar;C:\\SCM-Manager\\bin\\\\..\\lib\\jetty-continuation-7.5.1.v20110908.jar;C:\\SCM-Manager\\bin\\\\..\\lib\\jetty-http-7.5.1.v20110908.jar;C:\\SCM-Manager\\bin\\\\..\\lib\\jetty-io-7.5.1.v20110908.jar;C:\\SCM-Manager\\bin\\\\..\\lib\\jetty-webapp-7.5.1.v20110908.jar;C:\\SCM-Manager\\bin\\\\..\\lib\\jetty-xml-7.5.1.v20110908.jar;C:\\SCM-Manager\\bin\\\\..\\lib\\jetty-servlet-7.5.1.v20110908.jar;C:\\SCM-Manager\\bin\\\\..\\lib\\jetty-security-7.5.1.v20110908.jar;C:\\SCM-Manager\\bin\\\\..\\lib\\jetty-jmx-7.5.1.v20110908.jar;C:\\SCM-Manager\\bin\\\\..\\lib\\jetty-util-7.5.1.v20110908.jar;C:\\SCM-Manager\\bin\\\\..\\lib\\jetty-ajp-7.5.1.v20110908.jar"
    
    [HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Apache Software Foundation\Procrun 2.0\scm-server\Parameters\Log]
    "Path"="C:\\SCM-Manager\\bin\\\\..\\var\\log"
    "PidFile"="C:\\SCM-Manager\\bin\\\\..\\var\\scm-server.pid"
    
    [HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Apache Software Foundation\Procrun 2.0\scm-server\Parameters\Start]
    "Class"="sonia.scm.server.ScmServerDaemon"
    "Method"="start"
    "Mode"="jvm"
    
    [HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Apache Software Foundation\Procrun 2.0\scm-server\Parameters\Stop]
    "Class"="sonia.scm.server.ScmServerDaemon"
    "Method"="stop"
    "Mode"="jvm"
    
  7. Anonymous

    Hi, I am currently experiencing the same problem with procrun. By using the process monitor, i found out, that I get a bufferoverflow when reading the classpath from the registry...

  8. Sebastian Sebastian repo owner

    There was another user today with an error simular to this one: https://groups.google.com/forum/?fromgroups#!topic/scmmanager/rOL1nJ9DnfI

    Could you please edit the path to your jvm?

    You could insert the direct path, with the following steps:

    • Open a shell as administrator
    • If the service not installed call scm-server\bin\scm-server.bat install
    • execute the command below:
    scm-server\libexec\prunmgr.exe //ES/scm-server/
    
    • Switch to the Java tab
    • Uncheck to "use default" checkbox
    • Insert the path to your jvm.dll (e.g. C:\Program Files\Java\jre6\bin\server\jvm.dll)
    • Try it again
  9. Bernhard Millauer reporter

    Hi, thanks for the information but i have some issues with that:

    if i try to use scm-manager\libexec\prunmgr.exe //ES/scm-server/ it says that

    The filename, directory name, or volume label syntax is incorrect. Unable to open the service 'scm-server/'
    

    can i change these values myself without the prunmgr?

    thanks!

  10. Bernhard Millauer reporter

    Hi, i found the solution in the link you provided: Just install JAVA x64 (without changing the path). It works like a charm. I just had to move the .scm folder content from the user account to the system root folder/.scm

    thank you for your help!!!

  11. Torsten Martinsen

    I am experiencing similar problems.

    First I tried on a Windows Server 2003 VM - did not do any debugging. Now I have tried on Windows 7 Enterprise (x64). I enabled debugging as per above, and tried several versions of the jvm.dll (both x86 and x64). In all cases, I get the error

    [2012-09-12 14:44:19] [debug] ( prunsrv.c:1644) Commons Daemon procrun log initialized
    [2012-09-12 14:44:19] [info]  ( prunsrv.c:1648) Commons Daemon procrun (1.0.10.0 32-bit) started
    [2012-09-12 14:44:19] [info]  ( prunsrv.c:1561) Running 'scm-server' Service...
    [2012-09-12 14:44:19] [error] ( prunsrv.c:1567) StartServiceCtrlDispatcher for 'scm-server' failed
    [2012-09-12 14:44:19] [error] ( prunsrv.c:1567) The service process could not connect to the service controller.
    [2012-09-12 14:44:19] [error] ( prunsrv.c:1720) Commons Daemon procrun failed with exit value: 4 (Failed to run service)
    [2012-09-12 14:44:19] [error] ( prunsrv.c:1720) The service process could not connect to the service controller.
    

    (This is with 1.20, BTW).

  12. Torsten Martinsen

    If I just use prunsrv.exe, I get

    [2012-09-17 10:26:38] [debug] ( prunsrv.c:1644) Commons Daemon procrun log initialized [2012-09-17 10:26:38] [info] ( prunsrv.c:1648) Commons Daemon procrun (1.0.10.0 32-bit) started [2012-09-17 10:26:38] [info] ( prunsrv.c:1561) Running 'scm-server' Service... [2012-09-17 10:26:38] [error] ( prunsrv.c:1567) StartServiceCtrlDispatcher for 'scm-server' failed [2012-09-17 10:26:38] [error] ( prunsrv.c:1567) The service process could not connect to the service controller. [2012-09-17 10:26:38] [error] ( prunsrv.c:1720) Commons Daemon procrun failed with exit value: 4 (Failed to run service) [2012-09-17 10:26:38] [error] ( prunsrv.c:1720) The service process could not connect to the service controller.

    If I use prunsrv-amd64.exe, I get

    [2012-09-17 10:29:58] [info] ( prunsrv.c:1648) Commons Daemon procrun (1.0.10.0 64-bit) started [2012-09-17 10:29:58] [info] ( prunsrv.c:1561) Running 'scm-server' Service... [2012-09-17 10:29:58] [error] ( prunsrv.c:1567) StartServiceCtrlDispatcher for 'scm-server' failed [2012-09-17 10:29:58] [error] ( prunsrv.c:1567) The service process could not connect to the service controller. [2012-09-17 10:29:58] [error] ( prunsrv.c:1720) Commons Daemon procrun failed with exit value: 4 (Failed to run service) [2012-09-17 10:29:58] [error] ( prunsrv.c:1720) The service process could not connect to the service controller.

  13. Torsten Martinsen

    Update: I tried again today, and for some reason the service started with no problems.

    However, when I try to do e.g. a 'git pull', git fails with

    fatal: Authentication failed
    

    Even with the log setup suggested in the comment dated 2011-11-19, I only get this in the log:

    [2012-10-09 15:42:58] [debug] ( prunsrv.c:1644) Commons Daemon procrun log initialized
    [2012-10-09 15:42:58] [info]  ( prunsrv.c:1648) Commons Daemon procrun (1.0.10.0 64-bit) started
    [2012-10-09 15:42:58] [debug] ( prunsrv.c:559 ) Installing service...
    [2012-10-09 15:42:58] [info]  ( prunsrv.c:595 ) Service scm-server name scm-server
    [2012-10-09 15:42:58] [info]  ( prunsrv.c:629 ) Service 'scm-server' installed
    [2012-10-09 15:42:58] [info]  ( prunsrv.c:1729) Commons Daemon procrun finished
    [2012-10-09 15:43:03] [debug] ( prunsrv.c:1644) Commons Daemon procrun log initialized
    [2012-10-09 15:43:03] [info]  ( prunsrv.c:1648) Commons Daemon procrun (1.0.10.0 64-bit) started
    [2012-10-09 15:43:03] [info]  ( prunsrv.c:1561) Running 'scm-server' Service...
    [2012-10-09 15:43:03] [debug] ( prunsrv.c:1345) Inside ServiceMain...
    [2012-10-09 15:43:03] [info]  ( prunsrv.c:1089) Starting service...
    [2012-10-09 15:43:03] [debug] ( javajni.c:195 ) Invalid RuntimeLib 'C:\Program Files\Java\jre7\bin\client\jvm.dll'
    [2012-10-09 15:43:03] [debug] ( javajni.c:197 ) Using Jre JavaHome 'C:\Program Files\Java\jre7'
    [2012-10-09 15:43:03] [debug] ( javajni.c:206 ) loading jvm 'C:\Program Files\Java\jre7\bin\server\jvm.dll'
    [2012-10-09 15:43:03] [debug] ( javajni.c:251 ) Setting DLL search path to 'C:\Program Files\Java\jre7\bin\server'
    [2012-10-09 15:43:03] [debug] ( javajni.c:251 ) Setting DLL search path to 'C:\Program Files\Java\jre7\bin'
    [2012-10-09 15:43:03] [debug] ( javajni.c:660 ) Jvm Option[0] -Dapp.name=scm-server
    [2012-10-09 15:43:03] [debug] ( javajni.c:660 ) Jvm Option[1] -Dapp.repo=C:\scm-server\bin\\..\lib
    [2012-10-09 15:43:03] [debug] ( javajni.c:660 ) Jvm Option[2] -Dbasedir=C:\scm-server\bin\\..
    [2012-10-09 15:43:03] [debug] ( javajni.c:660 ) Jvm Option[3] -Dlogback.configurationFile=logging.xml
    [2012-10-09 15:43:03] [debug] ( javajni.c:660 ) Jvm Option[4] -Djava.class.path=;C:\scm-server\bin\\..\conf;C:\scm-server\bin\\..\lib\scm-server-1.20.jar;C:\scm-server\bin\\..\lib\commons-daemon-1.0.10.jar;C:\scm-server\bin\\..\lib\jetty-server-7.6.5.v20120716.jar;C:\scm-server\bin\\..\lib\javax.servlet-2.5.0.v201103041518.jar;C:\scm-server\bin\\..\lib\jetty-continuation-7.6.5.v20120716.jar;C:\scm-server\bin\\..\lib\jetty-http-7.6.5.v20120716.jar;C:\scm-server\bin\\..\lib\jetty-io-7.6.5.v20120716.jar;C:\scm-server\bin\\..\lib\jetty-webapp-7.6.5.v20120716.jar;C:\scm-server\bin\\..\lib\jetty-xml-7.6.5.v20120716.jar;C:\scm-server\bin\\..\lib\jetty-servlet-7.6.5.v20120716.jar;C:\scm-server\bin\\..\lib\jetty-security-7.6.5.v20120716.jar;C:\scm-server\bin\\..\lib\jetty-jmx-7.6.5.v20120716.jar;C:\scm-server\bin\\..\lib\jetty-util-7.6.5.v20120716.jar;C:\scm-server\bin\\..\lib\jetty-ajp-7.6.5.v20120716.jar
    [2012-10-09 15:43:03] [debug] ( javajni.c:660 ) Jvm Option[5] vfprintf
    [2012-10-09 15:43:03] [debug] ( javajni.c:897 ) Java Worker thread started sonia/scm/server/ScmServerDaemon:start
    [2012-10-09 15:43:03] [debug] ( javajni.c:914 ) Java Worker thread finished sonia/scm/server/ScmServerDaemon:start with status=0
    [2012-10-09 15:43:04] [debug] ( prunsrv.c:1148) Java started sonia/scm/server/ScmServerDaemon
    [2012-10-09 15:43:04] [info]  ( prunsrv.c:1244) Service started in 1640 ms.
    [2012-10-09 15:43:04] [debug] ( prunsrv.c:1496) Waiting for worker to finish...
    [2012-10-09 15:43:04] [debug] ( prunsrv.c:1501) Worker finished.
    [2012-10-09 15:43:04] [debug] ( prunsrv.c:1524) Waiting for all threads to exit
    [2012-10-09 15:45:02] [info]  ( prunsrv.c:906 ) Stopping service...
    [2012-10-09 15:45:02] [debug] ( javajni.c:897 ) Java Worker thread started sonia/scm/server/ScmServerDaemon:stop
    [2012-10-09 15:45:03] [debug] ( prunsrv.c:952 ) Waiting for java jni stop worker to finish...
    [2012-10-09 15:45:04] [debug] ( javajni.c:914 ) Java Worker thread finished sonia/scm/server/ScmServerDaemon:stop with status=0
    [2012-10-09 15:45:04] [debug] ( prunsrv.c:954 ) Java jni stop worker finished.
    [2012-10-09 15:45:04] [debug] ( prunsrv.c:1055) Waiting for worker to die naturally...
    [2012-10-09 15:45:04] [debug] ( prunsrv.c:1066) Worker finished gracefully in 0 ms.
    

    When I run scm-manager from the command line, it outputs a lot of diagnostic information such as

    15:45:18.017 [main] INFO  sonia.scm.activedirectory.auth.ActiveDirectoryAuthenti
    cationHandler - Active Directory default domain is DC=gatehouse,DC=local
    

    How do I get this into the log file when running as a service?

  14. Log in to comment