Bug 1305056

Summary: Unable to automatically create further branches in Managed Git Repository for BRMS 6.2
Product: [Retired] JBoss BRMS Platform 6 Reporter: Amana <ajuricic>
Component: Business CentralAssignee: manstis
Status: CLOSED EOL QA Contact: Jiri Locker <jlocker>
Severity: high Docs Contact:
Priority: unspecified    
Version: 6.2.0CC: agiertli, ajuricic
Target Milestone: ER1   
Target Release: 6.3.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
: 1305057 (view as bug list) Environment:
Last Closed: 2020-03-27 20:03:22 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1305057    
Attachments:
Description Flags
server_brms.log none

Description Amana 2016-02-05 13:41:44 UTC
Description of problem:

It seems like the "Automatically Configure Branches" option when creating a Managed Git Branch is not working properly in BRMS 6.2.

After checking this option, only the master branch is created. "Dev" and "Release" branches are not created and there is a warn message in server.log:

10:44:46,286 WARN  [org.jbpm.executor.impl.AbstractAvailableJobsExecutor] (EJB default - 8) Error during command org.guvnor.asset.management.backend.command.CreateBranchCommand error message Unknown Command implementation with name 'org.guvnor.asset.management.backend.command.CreateBranchCommand': java.lang.IllegalArgumentException: Unknown Command implementation with name 'org.guvnor.asset.management.backend.command.CreateBranchCommand'
	at org.jbpm.executor.impl.ClassCacheManager.findCommand(ClassCacheManager.java:60) [jbpm-executor-6.3.0.Final-redhat-5.jar:6.3.0.Final-redhat-5]
...

It happens everytime you try to create a managed repo with that option enabled in BRMS 6.2. In BPM Suite 6.2, it happens only at first time in a fresh installation... next managed repos can be created properly.


Version-Release number of selected component (if applicable):

BRMS 6.2

How reproducible:

Always

Steps to Reproduce (BRMS 6.2):
1. Install BRMS 6.2;
2. Create a Managed Repository;
3. Check in "Automatically Configure Branches" option;
4. Click on Next button.

Actual results (BRMS 6.2):
It will throw a warn message in server log and the further repos (dev and release) will not be created. Go to the Authoring -> Project Authoring -> Select the managed repo. The button that should display other branches is not there.

Steps to Reproduce (BPM Suite 6.2):
1. Install BPM Suite 6.2;
2. Create a Managed Repository;
3. Check in "Automatically Configure Branches" option;
4. Click on Next button. You will face the same issue reproduce in BRMS 6.2.
5. Now repeat steps from 2-4. Now you should be able to create the managed repo and see the dev and release branches created properly.

Expected results:
It should be created properly in both Products at first time successfully.

Additional info:

Comment 2 manstis 2016-02-05 13:56:34 UTC
@maciejs, I've assigned to you as the Command Class (org.guvnor.asset.management.backend.command.CreateBranchCommand) is in guvnor and I'm at a loss why org.jbpm.executor.impl.AbstractAvailableJobsExecutor may be failing to find it (I recall we had some issues with different instances of AbstractAvailableJobsExecutor needing different DataSources, but AFAIK we only have one "out of the box"?). Would you mind taking a look?

Comment 4 Maciej Swiderski 2016-02-11 13:47:28 UTC
two questions:
- is there kie server deployed to the same server?
- can we get complete stack trace?

Comment 5 Amana 2016-02-11 16:07:04 UTC
Created attachment 1123215 [details]
server_brms.log

Comment 6 Amana 2016-02-11 16:09:17 UTC
Hi Maciej,

- is there kie server deployed to the same server?

I am checking it with customer. But in my tests it is deployed to the same server. It is easy to reproduce.

- can we get complete stack trace?
I have attached the logs generated from my tests.

Thanks in advance!

Comment 7 Maciej Swiderski 2016-02-11 16:18:32 UTC
the reason why it fails is because you have both brms and kie server configured with same data base and thus kie server might executor pick up jobs submitted by brms. 

In general kie server and business central should not share db due to that exact issue. So there are two options:
- if you don't use kie server undeploy it
- if you use kie server, configure it with different data base (via different data source)

do you mind verifying that since you can easily reproduce it?

Comment 8 Amana 2016-02-11 16:24:17 UTC
Maciej,

After undeploying the kie-server, it worked well.

Is it a bug? Should I keep these BZs opened?

Thanks!

Comment 9 Maciej Swiderski 2016-02-11 16:29:27 UTC
it is not a bug as kie server should not use same db but leave it open I'll enhance asset mgmt processes to include owner id so only executor from workbench will be able to pick these jobs.

Comment 10 Anton Giertli 2016-02-17 08:38:58 UTC
Maciej, this happens with *out of the box* configuration, which imho is a bug. If you are saying that kie-server.war and business-central.war should not use the same database, then let's make sure our product is not configured out-of-the-box with the same database.

For example, we could ship following in a standalone.xml:


                <datasource jndi-name="java:jboss/datasources/KieServer" pool-name="KieServerDS" enabled="true" use-java-context="true">
                    <connection-url>jdbc:h2:mem:kieServer;DB_CLOSE_DELAY=-1;DB_CLOSE_ON_EXIT=FALSE</connection-url>
                    <driver>h2</driver>
                    <security>
                        <user-name>sa</user-name>
                        <password>sa</password>
                    </security>
                </datasource>

And then change this line [1]:

        persistenceProperties.put("javax.persistence.jtaDataSource", config.getConfigItemValue(KieServerConstants.CFG_PERSISTANCE_DS, "java:jboss/datasources/ExampleDS"));

with
persistenceProperties.put("javax.persistence.jtaDataSource", config.getConfigItemValue(KieServerConstants.CFG_PERSISTANCE_DS, "java:jboss/datasources/KieServer"));

And of course, document this behavior in product doc.

Cheers,
Anton


[1] https://github.com/droolsjbpm/droolsjbpm-integration/blob/master/kie-server-parent/kie-server-services/kie-server-services-jbpm/src/main/java/org/kie/server/services/jbpm/JbpmKieServerExtension.java#L460

Comment 11 Maciej Swiderski 2016-02-24 15:16:28 UTC
Anton,

engineering is not providing installer so it's out of my controller. If you like to have this please create BZ for installer.

Comment 12 Maciej Swiderski 2016-02-24 15:18:25 UTC
asset mgmt processes have been altered to make sure only same instance that created it will process them in background so it fixes that kie server will pick up these jobs

guvnor
master:
https://github.com/droolsjbpm/guvnor/commit/44651ca6a7fa8b147212302b4f47e8408b91c7ad

6.4.x:
https://github.com/droolsjbpm/guvnor/commit/dbc8e0969306c02023d6381eec70a8ab1119ebee

Comment 13 jsoltes 2016-03-31 08:55:07 UTC
Verified for BRMS 6.3.0.ER2.