Project

General

Profile

Support #5221

Initialization failure during server runtime

Added by Deividas Varzgalys over 5 years ago. Updated about 4 years ago.

Status:
Closed
Priority:
Normal
Target version:
-
Start date:
Due date:
% Done:

100%

billable:
No
vendor_id:
GCD
case_num:
version_reported:
version_resolved:
reviewer:
production:
No
env_name:
topics:

History

#1 Updated by Greg Shah over 5 years ago

  • Description updated (diff)
  • Assignee set to Constantin Asofiei
  • Start date deleted (03/29/2021)

The following are the problem details from Deividas.

Hello, I am trying to run an application server on a converted application (REST services).
I have made configurations with .paar file:

      <parameter name="rest-cfg"         value="./abl/rest/appNewService.paar" />

Then added configurations under the "/security/accounts/processes/"

<node class="process" name="standard">
   <node-attribute name="enabled" value="TRUE"/>
   <node-attribute name="description" value="P2J server"/>
   <node-attribute name="master" value="TRUE"/>
   <node-attribute name="server" value="TRUE"/>
   <node-attribute name="alias" value="standard"/>
</node>

Under the "/server/default/appservers/":
          <node class="appserver" name="AppServeris">
            <node-attribute name="operating_mode" value="state-reset"/>
            <node-attribute name="request_timeout" value="15"/>
            <node-attribute name="auto_trim_timeout" value="1800"/>
            <node-attribute name="propath" value=".:"/>
            <node-attribute name="initial_agents" value="5"/>
            <node-attribute name="min_agents" value="5"/>
            <node-attribute name="max_agents" value="10"/>
            <node-attribute name="activate" value=""/>
            <node-attribute name="deactivate" value=""/>
            <node-attribute name="connect" value=""/>
            <node-attribute name="disconnect" value=""/>
            <node-attribute name="startup" value=""/>
            <node-attribute name="shutdown" value=""/>
            <node-attribute name="startup_parameter" value=""/>
            <node-attribute name="pasoe" value="TRUE"/>
          </node>
          <node class="container" name="rest">
            <node class="boolean" name="enabled">
              <node-attribute name="value" value="TRUE"/>
            </node>
            <node class="string" name="basepath">
              <node-attribute name="value" value="rest/"/>
            </node>
            <node class="string" name="alias">
              <node-attribute name="value" value="P2J server"/>
            </node>
            <node class="string" name="appserver">
              <node-attribute name="value" value="AppServeris"/>
            </node>
          </node>

Under the "/server/default/"
        <node class="process" name="P2J server">
          <node-attribute name="appserver" value="AppServeris"/>
        </node>
    <node class="container" name="scheduler">
         <node class="job" name="start_appserver">
            <node-attribute name="type" value="process" />
            <node-attribute name="target" value="P2J server" />
            <node-attribute name="enabled" value="TRUE" />
            <node-attribute name="mode" value="now" />
          </node>
      <object-class name="start_appserver" leaf="true" immutable="false">
            <class-attribute name="type"         type="STRING"  mandatory="true"  multiple="false" immutable="false" />
            <class-attribute name="target"       type="STRING"  mandatory="true"  multiple="false" immutable="false" />
            <class-attribute name="enabled"      type="BOOLEAN" mandatory="true"  multiple="false" immutable="false" />
        <class-attribute name="mode"         type="STRING"  mandatory="true"  multiple="false" immutable="false" />
            <class-attribute name="second"       type="STRING"  mandatory="false" multiple="false" immutable="false" />
            <class-attribute name="minute"       type="STRING"  mandatory="false" multiple="false" immutable="false" />
            <class-attribute name="hour"         type="STRING"  mandatory="false" multiple="false" immutable="false" />
        <class-attribute name="day-of-week"  type="STRING"  mandatory="false" multiple="false" immutable="false" />
            <class-attribute name="day-of-month" type="STRING"  mandatory="false" multiple="false" immutable="false" />
            <class-attribute name="month"        type="STRING"  mandatory="false" multiple="false" immutable="false" />
            <class-attribute name="year"         type="STRING"  mandatory="false" multiple="false" immutable="false" />
          </object-class>
        </node>

Under the "/server/default/runtime/<process-id>/clientConfig":
            <node class="container" name="P2J server">
          <node class="container" name="clientConfig">
               <node class="string" name="cfgOverrides">
                  <node-attribute name="value" value="client:driver:background=true"/>
                </node>
              </node>
        </node>

The problem is that when I am trying to start the server I get the error "process 'P2J server' does not exist for job start_appserver!". But I can't find any more information on how to link process and job in configuration.
How can I solve this problem?

Full error:

om.goldencode.p2j.cfg.ConfigurationException:  Initialization failure
    at com.goldencode.p2j.main.StandardServer.hookInitialize(StandardServer.java:2088)
    at com.goldencode.p2j.main.StandardServer.bootstrap(StandardServer.java:1004)
    at com.goldencode.p2j.main.ServerDriver.start(ServerDriver.java:485)
    at com.goldencode.p2j.main.CommonDriver.process(CommonDriver.java:444)
    at com.goldencode.p2j.main.ServerDriver.process(ServerDriver.java:209)
    at com.goldencode.p2j.main.ServerDriver.main(ServerDriver.java:863)
Caused by: com.goldencode.p2j.scheduler.JobValidationException: Scheduler: process 'P2J server' does not exist for job start_appserver!
    at com.goldencode.p2j.scheduler.Scheduler.createJob(Scheduler.java:573)
    at com.goldencode.p2j.scheduler.Scheduler.initialize(Scheduler.java:787)
    at com.goldencode.p2j.scheduler.Scheduler.scheduleJobs(Scheduler.java:730)
    at com.goldencode.p2j.main.StandardServer$4.initialize(StandardServer.java:1165)
    at com.goldencode.p2j.main.StandardServer.hookInitialize(StandardServer.java:2084)
    ... 5 more

#2 Updated by Constantin Asofiei over 5 years ago

There are a few issues here.

1. instead of P2J Server, please use rest_server or something like this (i.e. all lowercase and without spaces).

2. this section is incorrect:

Then added configurations under the "/security/accounts/processes/"

<node class="process" name="standard">
   <node-attribute name="enabled" value="TRUE"/>
   <node-attribute name="description" value="P2J server"/>
   <node-attribute name="master" value="TRUE"/>
   <node-attribute name="server" value="TRUE"/>
   <node-attribute name="alias" value="standard"/>
</node>

If should be:

<node class="process" name="rest_server">
   <node-attribute name="enabled" value="TRUE"/>
   <node-attribute name="description" value="Account for the legacy REST server"/>
   <node-attribute name="master" value="TRUE"/>
   <node-attribute name="server" value="TRUE"/>
   <node-attribute name="alias" value="rest_server"/>
</node>

The FWD account name is set in the parent node class="process" tag, and not in the description attribute. Also, the alias must point to a certificate alias (i.e. rest_server) instead of standard.

3. the rest node must be defined with a certificate alias, and not FWD account name:

          <node class="container" name="rest">
            <node class="boolean" name="enabled">
              <node-attribute name="value" value="TRUE"/>
            </node>
            <node class="string" name="basepath">
              <node-attribute name="value" value="rest/"/>
            </node>
            <node class="string" name="alias">
              <node-attribute name="value" value="rest_server"/>
            </node>
            <node class="string" name="appserver">
              <node-attribute name="value" value="AppServeris"/>
            </node>
          </node>

4. You should define a dedicated process account for the appservers. So instead of:

Under the "/server/default/"

        <node class="process" name="P2J server">
          <node-attribute name="appserver" value="AppServeris"/>
        </node>

there should be something like, under /security/accounts/processes/:

          <node class="process" name="appserveris_process">
            <node-attribute name="appserver" value="AppServeris"/>
            <node-attribute name="enabled" value="TRUE"/>
            <node-attribute name="description" value="Process for appserver."/>
            <node-attribute name="alias" value="appserveris_alias"/>
            <node-attribute name="master" value="FALSE"/>
            <node-attribute name="server" value="FALSE"/>
          </node>

5. The scheduler configuration must reference the process account name for the appserver, like this:

    <node class="container" name="scheduler">
         <node class="job" name="start_appserver">
            <node-attribute name="type" value="process" />
            <node-attribute name="target" value="appserveris_process" />
            <node-attribute name="enabled" value="TRUE" />
            <node-attribute name="mode" value="now" />
          </node>

6. The <object-class name="start_appserver" leaf="true" immutable="false"> node and its children must be removed, these are schema nodes and not something which should appear in directory.xml

7. for the appserver, this configuration should appear under /server/default/runtime:

          <node class="container" name="appserveris_process">
            <node class="container" name="clientConfig">
              <node class="string" name="outputToFile">
                <node-attribute name="value" value="client_%appserver%_%pid%_%timestamp%_%userid%.log"/>
              </node>
              <node class="string" name="cfgOverrides">
                <node-attribute name="value" value="client:driver:background=true"/>
              </node>
              <node class="string" name="systemUser">
                <node-attribute name="value" value="[replace with an OS user]"/>
              </node>
            </node>
          </node>

Note that for the appserveris_alias and rest_server process accounts the certificate/private-keys need to be generated. The builtin certificate generation tool can be used for this.

#3 Updated by Deividas Varzgalys over 5 years ago

I made all your suggested changes, but now getting error:

com.goldencode.p2j.cfg.ConfigurationException: server ID <standard> has no account
    at com.goldencode.p2j.security.SecurityCache.verifyServerId(SecurityCache.java:2881)
    at com.goldencode.p2j.security.SecurityCache.<init>(SecurityCache.java:455)
    at com.goldencode.p2j.security.SecurityCache.<init>(SecurityCache.java:353)
    at com.goldencode.p2j.security.SecurityManager.<init>(SecurityManager.java:697)
    at com.goldencode.p2j.security.SecurityManager.createInstance(SecurityManager.java:787)
    at com.goldencode.p2j.main.StandardServer.bootstrap(StandardServer.java:873)
    at com.goldencode.p2j.main.ServerDriver.start(ServerDriver.java:485)
    at com.goldencode.p2j.main.CommonDriver.process(CommonDriver.java:444)
    at com.goldencode.p2j.main.ServerDriver.process(ServerDriver.java:209)
    at com.goldencode.p2j.main.ServerDriver.main(ServerDriver.java:863)

I tried to reconvert project and change all places in directory.xml file where I can find "standard" and still this error appears.
Where it can be the clue to fix this error?

#4 Updated by Deividas Varzgalys over 5 years ago

I found the solution. It was not changed server-id on server.xml file.

#5 Updated by Deividas Varzgalys over 5 years ago

I cant understand, what kind of certificates should be "trusted" getting this error:

Mar 31, 2021 9:14:15 AM com.goldencode.p2j.net.SSL onFailure
WARNING: handshake failure
javax.net.ssl.SSLHandshakeException: No trusted certificate found
    at sun.security.ssl.Alert.createSSLException(Alert.java:131)
    at sun.security.ssl.TransportContext.fatal(TransportContext.java:324)
    at sun.security.ssl.TransportContext.fatal(TransportContext.java:267)
    at sun.security.ssl.TransportContext.fatal(TransportContext.java:262)
    at sun.security.ssl.CertificateMessage$T12CertificateConsumer.checkServerCerts(CertificateMessage.java:654)
    at sun.security.ssl.CertificateMessage$T12CertificateConsumer.onCertificate(CertificateMessage.java:473)
    at sun.security.ssl.CertificateMessage$T12CertificateConsumer.consume(CertificateMessage.java:369)
    at sun.security.ssl.SSLHandshake.consume(SSLHandshake.java:377)
    at sun.security.ssl.HandshakeContext.dispatch(HandshakeContext.java:444)
    at sun.security.ssl.SSLEngineImpl$DelegatedTask$DelegatedAction.run(SSLEngineImpl.java:968)
    at sun.security.ssl.SSLEngineImpl$DelegatedTask$DelegatedAction.run(SSLEngineImpl.java:955)
    at java.security.AccessController.doPrivileged(Native Method)
    at sun.security.ssl.SSLEngineImpl$DelegatedTask.run(SSLEngineImpl.java:902)
    at com.goldencode.p2j.net.SSL.lambda$handshake$0(SSL.java:375)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
    at java.lang.Thread.run(Thread.java:748)
Caused by: sun.security.validator.ValidatorException: No trusted certificate found
    at sun.security.validator.SimpleValidator.buildTrustedChain(SimpleValidator.java:398)
    at sun.security.validator.SimpleValidator.engineValidate(SimpleValidator.java:135)
    at sun.security.validator.Validator.validate(Validator.java:271)
    at sun.security.ssl.X509TrustManagerImpl.validate(X509TrustManagerImpl.java:315)
    at sun.security.ssl.X509TrustManagerImpl.checkTrusted(X509TrustManagerImpl.java:278)
    at sun.security.ssl.X509TrustManagerImpl.checkServerTrusted(X509TrustManagerImpl.java:141)
    at sun.security.ssl.CertificateMessage$T12CertificateConsumer.checkServerCerts(CertificateMessage.java:632)
    ... 12 more

Can you give me some tips where I can check to fix this problem?

#6 Updated by Constantin Asofiei over 5 years ago

Is the error when trying to start an appserver?

If so, it may be because the alias for the appserver certificate, configured as 'appserveris_alias' in:

        <node class="process" name="appserveris_process">
            <node-attribute name="appserver" value="AppServeris"/>
            <node-attribute name="enabled" value="TRUE"/>
            <node-attribute name="description" value="Process for appserver."/>
            <node-attribute name="alias" value="appserveris_alias"/>
            <node-attribute name="master" value="FALSE"/>
            <node-attribute name="server" value="FALSE"/>
          </node>

does not have a certificate generated for it.

What aliases do you have under the /security/certificates/peers node?

#7 Updated by Deividas Varzgalys over 5 years ago

I have three aliases "shared", "appserveris_alias", "rest_server".

#8 Updated by Constantin Asofiei over 5 years ago

You've mentioned that you had to change the server-id on server.xml.

Why did you need to do this? The 'standard' process account and its certificate (in the directory.xml you can find for the Hotel app), is for the FWD server. This should not be changed, or if it is changed, then there are lots of additional places which need to be updated. And there is no need to change this 'standard' name at this phase.

At this time, I would advise you this: please do a diff of your directory.xml with the one from the Hotel app, and revert all the 'standard'-related changes. And update back the server.xml to use 'standard'.

For the appserver and legacy REST support to work, all required changes do not involve modifying anything related to the 'standard' server account.

#9 Updated by Deividas Varzgalys over 5 years ago

I changed server-id on server.xml because I got error mentioned above "server ID <standard> has no account".

Maybe it is possible to turn of security (something like develop mode, where I don't need certificates?)

#10 Updated by Constantin Asofiei over 5 years ago

For the appservers agents to start, the FWD server must have SSL enabled.

By changing the server account name (which defaults to 'standard'), does not affect just the certificates - there are ACL subjects and maybe more which need to be renamed.

Please put back the 'standard' changes (including its process account) and try again.

#11 Updated by Greg Shah about 5 years ago

Deividas: Is everything working? I'd like to close this task if it is resolved.

#12 Updated by Greg Shah about 4 years ago

  • % Done changed from 0 to 100
  • Status changed from New to Closed

As far as I know, this is complete. We can reopen it if needed in the future.

Also available in: Atom PDF