Error Installing GIT-X-Module plugin

Hi there,
we would like to evaulate your bitbucket plugin.

Uploading the jar file gitx-bitbucket-1.0.0-beta3-1487.4488d88.jar was working in the “Mange App” dialog of bitbcuket
But if I click then on the CONFIGURE button, nothing happens

In atlassian-bitbucket.log I can see the following error traces:
{noformat}
2021-04-14 09:12:02,245 ERROR [active-objects-init-compatibility-tenant-0] userID *1JAILSSx551x114313x0 1qrez45 10.142.67.162,10.139.12.50 “POST /rest/plugins/1.0/ HTTP/1.1” net.java.ao.sql Exception executing SQL update <CREATE TABLE “AO_CCAD84_SCOPES” (
“PARENT_SCOPE_ID” NUMBER(20) DEFAULT 0,
“SCOPE_ID” NUMBER(20) DEFAULT 0 CONSTRAINT U_AO_CCAD84_SCOPES_SCOPE_ID UNIQUE NOT NULL,
“STATE” VARCHAR(255),
PRIMARY KEY(“SCOPE_ID”)
)>
java.sql.SQLSyntaxErrorException: ORA-02261: such unique or primary key already exists in the table
{noformat}

What is wrong ?
Robby

Hi Robby,

Thank you for reporting that! We are sorry that the plugin is not installing. It’s not yet clear, why is that.

Could you attach the complete atlassian-bitbucket.log and the content of the /logs/gx folder? We shall investigate the problem thoroughly.

Best,
Dmitry Linov

TMATE.tar (170 KB)

interesting:
log/gx is empty

This is strange indeed. Thank you for the logs, we’re on it!

Hi Dmitry,
I am not an SQL expert, but for me it looks like as if the SQL statement is doubled referring to a primary key.
line
“SCOPE_ID” NUMBER(20) DEFAULT 0 CONSTRAINT U_AO_CCAD84_SCOPES_SCOPE_ID UNIQUE NOT NULL,

is already defining the primary key using the CONSTRAINT keyword.
Then later on, there is again
PRIMARY KEY(“SCOPE_ID”) , where of course, the Primary key has been already defined before

as I said, I am not sure.
Are you testing maybe not with ORACLE but with another database ( e.g. mySQL) and there it works ?
Could be that ORACLE complains about this ?

Robby

Hello Robby,
thanks for the logs and details. I’ve created

https://issues.tmatesoft.com/issue/GXM-57

issue at our tracker. Indeed, the problem seems to happen because of “unique” and “primary key” constraints at the same time.

I’ve removed “unique” constraint and created a new build:

gitx-bitbucket-1.0.0-SNAPSHOT-local.local.jar (5.4 MB, md5: ade80c32cdebf63114fc01438212fac1)

Could you try it instead? If it works, we will include the fix into the next release.

Hello Dmitri
I tried to install your snapshot version.
The error message for creating the table AO_CCAD84_SCOPES does not occur anymore.

But now we are getting the same type of error message for the next table:
2021-04-21 08:13:31,355 ERROR [active-objects-init-compatibility-tenant-0] rbe8fe *1VFXZTHx493x99473x0 14pjgnr 10.142.138.19,10.139.12.50 “POST /rest/plugins/1.0/ HTTP/1.1” net.java.ao.sql Exception executing SQL update <CREATE TABLE “AO_CCAD84_JOBS” (
“CANCELLING” NUMBER(1),
“COMPLETION_TIME” NUMBER(20) DEFAULT 0,
“DETAILED_MESSAGE” CLOB,
“MESSAGE” CLOB,
“NAME” VARCHAR(255) NOT NULL,
“NODE_ID” VARCHAR(255) NOT NULL,
“PARENT_SCOPE_ID” NUMBER(20) DEFAULT 0,
“PROGRESS” NUMBER(11) DEFAULT 0,
“SCHEDULE_TIME” NUMBER(20) DEFAULT 0,
“SCOPE_ID” NUMBER(20) DEFAULT 0,
“START_TIME” NUMBER(20) DEFAULT 0,
“STATUS” VARCHAR(255),
“USER_ID” NUMBER(11) DEFAULT 0,
“UUID” VARCHAR(255) CONSTRAINT U_AO_CCAD84_JOBS_UUID UNIQUE NOT NULL,
PRIMARY KEY(“UUID”)
)>
java.sql.SQLSyntaxErrorException: ORA-02261: such unique or primary key already exists in the table

looks like you have to provide anyother snapshot, buit please have a llok for ALL your table creation statements

Best regards

Robby

Thanks for the information and sorry, it’s my bad that I didn’t check other “unique” constraints. Now there’re no “unique” constraints at all:

gitx-bitbucket-1.0.0-SNAPSHOT-local.local.jar (5.4 MB, md5: 79bdd3616f1d87fb8a41cc08fbc8facc)

thanks Dmitry,
I was able to install the plugin now.
still got the followoing error messages though:
2021-04-21 10:24:07,490 WARN [hz.hazelcast.event-5] com.hazelcast.spi.EventService [10.4.6.239]:5701 [bitbucket] [3.11.1] Error while logging processing event
java.lang.NullPointerException: message
at java.util.Objects.requireNonNull(Objects.java:228)
at com.atlassian.stash.internal.topic.DefaultMessageEvent.(DefaultMessageEvent.java:19)
at com.atlassian.stash.internal.topic.HazelcastTopicService$DefaultTopic.lambda$register$2(HazelcastTopicService.java:388)
at com.hazelcast.topic.impl.TopicService.dispatchEvent(TopicService.java:136)
at com.hazelcast.spi.impl.eventservice.impl.EventProcessor.process(EventProcessor.java:61)
at com.hazelcast.spi.impl.eventservice.impl.RemoteEventProcessor.run(RemoteEventProcessor.java:47)
at com.hazelcast.util.executor.StripedExecutor$Worker.process(StripedExecutor.java:226)
at com.hazelcast.util.executor.StripedExecutor$Worker.run(StripedExecutor.java:209)
2021-04-21 10:24:12,424 WARN [topic-dispatcher:thread-1] c.a.s.i.topic.HazelcastTopicService [org.tmatesoft.gitx.gitx-bitbucket:job-records] error dispatching message to listener class org.tmatesoft.framework.bitbucket.log.GxBitbucketLogService
java.lang.ClassCastException: org.tmatesoft.framework.bitbucket.job.GxBitbucketJobRecord cannot be cast to org.tmatesoft.framework.bitbucket.job.GxBitbucketJobRecord
at org.tmatesoft.framework.bitbucket.log.GxBitbucketLogService.onMessage(GxBitbucketLogService.java:188)
at com.atlassian.stash.internal.topic.HazelcastTopicService$DefaultTopic.dispatchNextMessage(HazelcastTopicService.java:339)
at com.atlassian.stash.internal.topic.HazelcastTopicService$DefaultTopic.access$000(HazelcastTopicService.java:226)
at com.atlassian.stash.internal.topic.HazelcastTopicService.dispatchNextMessage(HazelcastTopicService.java:142)
at com.atlassian.stash.internal.topic.HazelcastTopicService.lambda$scheduleDispatch$3(HazelcastTopicService.java:178)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.lang.Thread.run(Thread.java:748)
… 1 frame trimmed
2021-04-21 10:24:12,425 WARN [topic-dispatcher:thread-1] c.a.s.i.topic.HazelcastTopicService [org.tmatesoft.gitx.gitx-bitbucket:job-records] error dispatching message to listener class org.tmatesoft.framework.bitbucket.log.GxBitbucketLogService
java.lang.ClassCastException: org.tmatesoft.framework.bitbucket.job.GxBitbucketJobRecord cannot be cast to org.tmatesoft.framework.bitbucket.job.GxBitbucketJobRecord
at org.tmatesoft.framework.bitbucket.log.GxBitbucketLogService.onMessage(GxBitbucketLogService.java:188)
at com.atlassian.stash.internal.topic.HazelcastTopicService$DefaultTopic.dispatchNextMessage(HazelcastTopicService.java:339)
at com.atlassian.stash.internal.topic.HazelcastTopicService$DefaultTopic.access$000(HazelcastTopicService.java:226)
at com.atlassian.stash.internal.topic.HazelcastTopicService.dispatchNextMessage(HazelcastTopicService.java:142)
at com.atlassian.stash.internal.topic.HazelcastTopicService.lambda$scheduleDispatch$3(HazelcastTopicService.java:178)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.lang.Thread.run(Thread.java:748)
… 1 frame trimmed
2021-04-21 10:24:12,425 WARN [topic-dispatcher:thread-1] c.a.s.i.topic.HazelcastTopicService [org.tmatesoft.gitx.gitx-bitbucket:job-records] error dispatching message to listener class org.tmatesoft.framework.bitbucket.log.GxBitbucketLogService
java.lang.ClassCastException: org.tmatesoft.framework.bitbucket.job.GxBitbucketJobRecord cannot be cast to org.tmatesoft.framework.bitbucket.job.GxBitbucketJobRecord
at org.tmatesoft.framework.bitbucket.log.GxBitbucketLogService.onMessage(GxBitbucketLogService.java:188)
at com.atlassian.stash.internal.topic.HazelcastTopicService$DefaultTopic.dispatchNextMessage(HazelcastTopicService.java:339)
at com.atlassian.stash.internal.topic.HazelcastTopicService$DefaultTopic.access$000(HazelcastTopicService.java:226)
at com.atlassian.stash.internal.topic.HazelcastTopicService.dispatchNextMessage(HazelcastTopicService.java:142)
at com.atlassian.stash.internal.topic.HazelcastTopicService.lambda$scheduleDispatch$3(HazelcastTopicService.java:178)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.lang.Thread.run(Thread.java:748)
… 1 frame trimmed

Hazelcastservice stands for the bitbucket cluster functionality. so I guess something does not fully work yet under cluster conditions.
But at least I can open now the configure dialog and also inside a repository I may open
the gitx-x repository settings. This will allow our developers to start testing your plugins.

Best regards

Robby

Thanks for the information! While we are trying to reproduce the problem, may I ask you whether this problem happens only once or does it happen all the time?

The problem happens because of the following: somewhere inside Bitbucket or hazelcast, theres’s in-memory cache of objects; and when a new version of the app is uploaded, another Java class loader is used and thus type casting fails. The easiest work-around is to restart Bitbucket, then in-memory cache will be cleared and all the objects will be with the same class loader, so no type casting error will happen.

Meanwhile we will be working on preventing the app from conflicting with its previously installed version without restarting.

May I also ask, whether you’re using Bitbucket Data Center 3.11.1? If no which Bitbucket version are you using? I was just surprised to see 3.11.1 in the log…

Hello Dmitry
I will try to restart the services today to see, if we really get rid of the error messages.

currently I get multiple ERROR log entries every 10 minutes.

Don’t get confused about the number 3.11.1 I think it is the version number of a submodule only.
We are running bitbucket data center version 6.10.7 and plan to upgrade to 7.6. soon.

Best regards Robby

Hello Dmitry
after restarting the servers we do not see any error traces anymore

So I will wait for your announcment of a new official version in Atlassian market place and then try to install it again.

best regards
Robby

Hello Robby,

We have released the new version of Git X-Modules for Bitbucket Data Center today. It includes the fix that you’ve discussed with my colleague in April, and many new features - check it out!

Thanks for the info.

Will download the new version asap

Mit freundlichen Grüßen / Best regards

Robby Berner

Software Lifecycle and Source Code Management (CI/PLS2)
Robert Bosch GmbH | Postfach 30 02 20 | 70442 Stuttgart | GERMANY | www.bosch.com
Tel. +49 711 811-22942 | Mobil +49 172 6708685 | Telefax +49 711 811-5180461 | Robby.Berner@de.bosch.com

Sitz: Stuttgart, Registergericht: Amtsgericht Stuttgart, HRB 14000;
Aufsichtsratsvorsitzender: Franz Fehrenbach; Geschäftsführung: Dr. Volkmar Denner,
Prof. Dr. Stefan Asenkerschbaumer, Filiz Albrecht, Dr. Michael Bolle, Dr. Christian Fischer,
Dr. Stefan Hartung, Dr. Markus Heyn, Harald Kröger, Rolf Najork, Uwe Raschke

Hello Robby,

How’s your experience with Git X-Modules so far?

I would like to let you know, that it’s now out of beta - we have uploaded the full-fledged release version of Git X-Modules. Please take a look!