Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Next challenges

Recent achievements

  • Global
  • Personal

Recognition

  • Give kudos
  • Received
  • Given

Leaderboard

  • Global

Trophy case

Kudos (beta program)

Kudos logo

You've been invited into the Kudos (beta program) private group. Chat with others in the program, or give feedback to Atlassian.

View group

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

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

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.

1 answer

0 votes

The setup in your home directory does not match the data that is in the existing database.  Your new Jira is still in a state where it expects to be given an empty database so that it can go through the setup routine.

If you are trying to create a new Jira install and connect it to a pre-existing database, what you need to do several steps (apologies if you did do this, but I couldn't see all the steps called out in your question)

Download a Jira install of exactly the same version as the existing database was from

  • Create a new empty database
  • Install Jira, pointed at the empty database, running through to the point where you can log in as the admin and be asked to start creating projects and users etc
  • Stop it
  • Change the dbconfig file so it points at the old database
  • Restart it
  • Log in using an admin user from the old Jira
  • Run a full re-index

I'll try a new docker build following your steps and I'll let you know, but I don't understand why I should start/stop and then change dbconfig.xml and restart.

My steps were:

  • Create a new database (let's call it mydbcpy) where I copied my actual development database (let's call it mydborig)
  • Build a docker image with VOLUME command to share /var/atlassian/application-data/jira where I store my plugins (in plugins/installed-plugins) and my dbconfig.xml file pointed to the newly copied database
  • Start the docker
  • Run the full re-index

At this point the behaviour I was expecting that Jira starts and, according the dbconfig.xml, it begins to use the mydbcpy database. Jira detects it but it tries to create the tables and just after doing this, it uses it and all datas in it.

You need to do this because your installation does not match your database.

Your steps are wrong because you have created a new Jira that is missing all the config it needs and then pointed it at a load of data it is not expecting to see. 

A plain Jira install that has not yet run through the initial set up is missing a whole load of stuff it needs before it can be used.  You've not done any of that, you've just expected it work without any setup. 

It's a bit like putting me in front of a partly done oil painting and expecting me to finish it without teaching me how to paint first, not least the bit about going to get the paint and brushes I'll need.

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase
Published in Jira

Announcing the waitlist for Jira Work Management

Hey there Cloud Community members! We’re excited to give you the first glimpse of the new home for business teams on Jira — Jira Work Management. Jira Work Management is the next generation of J...

132 views 3 7
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you