Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

new DB creation even if the database exists (jira-core container vs MySQL host)

Francesco R
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Champions.
April 28, 2020

I'm new to containers and maybe I lack some impostant knowledges.
My goal was to create a jira-core container with my customizations (my plugins, some configuration files etc.) and to use it connected to a MySQL server running on the host, with already stored issues (i.e. already used with a normal jira-core instance).
I succeeded in connecting the customized container (FROM atlassian/jira-core:7.13.2-jdk8) to the server (after some failed attemps) sharing the dbconfig.xml file (through a VOLUME [${JIRA_HOME}]) and modifing the url string in it.

When the jira container started the 1st time in the log there were traces like these:

[...]
JIRA-Bootstrap WARN [o.o.c.entity.jdbc.DatabaseUtil] Entity "Action" has no table in the database
JIRA-Bootstrap ERROR [o.o.c.entity.jdbc.DatabaseUtil] Could not create table "jira_docker01.jiraaction"
JIRA-Bootstrap ERROR [o.o.c.entity.jdbc.DatabaseUtil] SQL Exception while executing the following:
CREATE TABLE jira_docker01.jiraaction (ID DECIMAL(18,0) NOT NULL, issueid DECIMAL(18,0), AUTHOR VARCHAR(255), actiontype VARCHAR(255), actionlevel VARCHAR(255), rolelevel DECIMAL(18,0), actionbody LONGTEXT, CREATED DATETIME, UPDATEAUTHOR VARCHAR(255), UPDATED DATETIME, actionnum DECIMAL(18,0), CONSTRAINT PK_jiraaction PRIMARY KEY (ID))
Error was: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Table 'jiraaction' already exists
JIRA-Bootstrap WARN [o.o.c.entity.jdbc.DatabaseUtil] Entity "Application" has no table in the database
JIRA-Bootstrap ERROR [o.o.c.entity.jdbc.DatabaseUtil] Could not create table "jira_docker01.cwd_application"
JIRA-Bootstrap ERROR [o.o.c.entity.jdbc.DatabaseUtil] SQL Exception while executing the following:
CREATE TABLE jira_docker01.cwd_application (ID DECIMAL(18,0) NOT NULL, application_name VARCHAR(255), lower_application_name VARCHAR(255), created_date DATETIME, updated_date DATETIME, active DECIMAL(9,0), description VARCHAR(255), application_type VARCHAR(255), credential VARCHAR(255), CONSTRAINT PK_cwd_application PRIMARY KEY (ID))
Error was: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Table 'cwd_application' already exists
[...]

However the connection was ok and the running container had my all old issues.
My question is: why the installation process tries to create the tables in the DB if in dbconfig.xml I configured an existing one ?

I hope I've been clear enough in writing the question.
Thanks.

5 answers

1 accepted

1 vote
Answer accepted
justindowning
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Champions.
July 6, 2011

Edit this file: atlassian-jira/WEB-INF/classes/templates/jira/issue/summary/issuesummaryblock.vm

Around line 16, you can comment or remove this block:

            <li class="item item-right">
                <div class="wrap">
                    <strong class="name">$i18n.getText("issue.field.status"):</strong>
                    <span id="status-val" class="property-list-value">
                        #set ($status = $issue.getStatusObject())
                        #displayConstantIcon($status) $textutils.htmlEncode($status.nameTranslation, false)
                    </span>
                </div>
            </li>

You will need to restart JIRA, unless you have modified your velocity.properties file as directed here.

Ben Geng
July 6, 2011

Justin,

thanks for the tips, I did not know this file before.

Tthe problem though is that it removes Status from all screen. I am looking for a way to hide the Status on my custom screen only.

justindowning
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Champions.
July 6, 2011

No problem. You'll want to wrap the status div with some velocity that checks what Screen is being used to display the issue details.

Ben Geng
July 7, 2011

Totally no idea how to do that. can you point to a place that i can find some documentation/samples?

thanks.

Dave Yu [YP]
July 7, 2011

Along the lines of what Justin suggests, you could wrap that <li /> element in a conditional statement like this:

#if ($issue.getIssueTypeObject().getName() != "My Issue Type" )
    <li class="item item-right">
    ...
    </li>
#end
Ben Geng
July 8, 2011

Dave,

thanks a lot, that worked fine for me.

0 votes
Nic Brough -Adaptavist-
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Champions.
July 7, 2011

Ah, that's not going to work - Status isn't even a field - it's an integral part of the workflow. You can't use another field for it and you can't remove it. You can rename it, play with the colours and icons, and use whatever values you need, but you can't get rid of it. If you use the velocity given in the other answers to supress it on issue-view, you'll still find it in all sorts of other places, and you'll find you miss it almost immediately.

0 votes
Ben Geng
July 6, 2011

good question! I wanted to setup a workflow based on my custom field, not Status.

0 votes
Nic Brough -Adaptavist-
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Champions.
July 6, 2011

I assume that your issue type doesn't have a workflow?

0 votes
João Junior
July 6, 2011

The status field, as well as some date fields, can not fail to be displayed on the default screen display issues.

One option would be to create a plugin that displays the information as you need or customize the file .vm.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events