Coder Social home page Coder Social logo

Comments (8)

nanux avatar nanux commented on August 23, 2024

This seems more like a permission issue. Jira can connect to the database but admin user doesn't have access to the table. I would recommend following Jira MySQL documentation and create a database and a specific jira user ahead of the helm installation. Was myDatabase created explicitly for jira? You can check permissions with:

SHOW GRANTS FOR 'admin'@'localhost';
select user from mysql.db where db='myDatabase';

You should be able to use the MySQL credentials to connect to the database from a normal MySQL client (example).

from data-center-helm-charts.

Forbzy avatar Forbzy commented on August 23, 2024

I think you're right that its a permissions issue.

mysql> SHOW GRANTS FOR 'admin'@'localhost';
ERROR 1141 (42000): There is no such grant defined for user 'admin' on host 'localhost'

mysql> SHOW GRANTS FOR 'admin'@'%';
+--------------------------------------------------------+
| Grants for admin@%                                |
+--------------------------------------------------------+
| GRANT USAGE ON *.* TO `admin`@`%`                 |
| GRANT ALL PRIVILEGES ON `myDatabase`.* TO `admin`@`%` |
+--------------------------------------------------------+
2 rows in set (0.01 sec)

mysql> select user from mysql.db where db='myDatabase';
+------------+
| user       |
+------------+
| admin |
+------------+
1 row in set (0.02 sec)

I'm using the mysql chart provided by bitnami. I've tried changing the permissions for the jira user. No effect so far. By default the mysql chart creates a user with the below.

CREATE USER 'admin'@'%' IDENTIFIED BY 'admin123';
GRANT ALL PRIVILEGES ON myDatabase.* TO 'admin'@'%' WITH GRANT OPTION;

Below are the different commands I've tried. No effect

CREATE USER 'admin'@'10.1.1.%' IDENTIFIED BY 'admin123';
CREATE USER 'admin'@'10.0.0.1/16' IDENTIFIED BY 'admin123';
CREATE USER 'admin'@'jira-0' IDENTIFIED BY 'admin123';
CREATE USER 'admin'@'localhost' IDENTIFIED BY 'admin123';

GRANT ALL PRIVILEGES ON myDatabase.* TO 'admin'@'10.1.1.%' WITH GRANT OPTION;
GRANT ALL PRIVILEGES ON myDatabase.* TO 'admin'@'10.0.0.1/16' WITH GRANT OPTION;
GRANT ALL PRIVILEGES ON myDatabase.* TO 'admin'@'jira-0' WITH GRANT OPTION;
GRANT ALL PRIVILEGES ON myDatabase.* TO 'admin'@'localhost' WITH GRANT OPTION;

I always make sure to run the below as well.
flush privileges;

Below is my mysql configuration.

[mysqld]
default_authentication_plugin=mysql_native_password
skip-name-resolve
explicit_defaults_for_timestamp
basedir=/opt/bitnami/mysql
plugin_dir=/opt/bitnami/mysql/plugin
port=3306
socket=/opt/bitnami/mysql/tmp/mysql.sock
datadir=/bitnami/mysql/data
tmpdir=/opt/bitnami/mysql/tmp
max_allowed_packet=512M
bind-address=0.0.0.0
pid-file=/opt/bitnami/mysql/tmp/mysqld.pid
log-error=/opt/bitnami/mysql/logs/mysqld.log
character-set-server=UTF8MB4
collation-server=utf8mb4_bin
default-storage-engine=INNODB
innodb_default_row_format=DYNAMIC
innodb_log_file_size=2G
interactive_timeout=150000
wait_timeout=150000

from data-center-helm-charts.

bianchi2 avatar bianchi2 commented on August 23, 2024

@Forbzy have you tried creating a dedicated user after MySQL chart gets deployed (as per the following instructions), i.e. not rely on the user that gets created by Bitnami chart?

from data-center-helm-charts.

Forbzy avatar Forbzy commented on August 23, 2024

@bianchi2 I have. The strange thing about this is it was working the other day. I havent changed any configurations. I've even tried the root user.

from data-center-helm-charts.

badgersow avatar badgersow commented on August 23, 2024

I suggest to get Jira out of the equation and try to connect to the DB directly from the Pod. Something like this:

  1. Connect to the pod
kubectl exec -it <POD_NAME> -- bash
  1. Install the mysql client on the pod
apt update; apt install mysql-client
  1. Try to connect to the database from the pod using the client
mysql -h <HOST_WITH_DB> -u admin -Padmin123

If this connection doesn't work as well, then we definitely know that something is wrong with the DB or network Configuration. More likely DB configuration, because the error looks like permission issue.

On the other hand, if the direct connection works, but Jira keeps acting, we will know that the issue is related to the Jira.


I remember during the testing I have provisioned Confluence with the MySQL from bitnami chart, and the product was able to connect to the database. To be honest, I don't recall if I created a separate user from the product, or used the admin.

from data-center-helm-charts.

bianchi2 avatar bianchi2 commented on August 23, 2024

I used Bitnami chart as well. @badgersow good point, let's just use mysql client to connect and see what's going on.

from data-center-helm-charts.

Forbzy avatar Forbzy commented on August 23, 2024

I managed to get it working. It looks like there is a compatibility issue between some mysql drivers and jira docker images. I was using images tagged with ubuntu like 8.18.1-ubuntu-jdk11 with mysql driver mysql-connector-java_8.0.26-1ubuntu20.04_all.deb. They were both 20.04 ubuntu so I thought they would work. In the end I found docker images 8.13.9-jdk11 and 8.18.1-jdk11 worked with mysql driver mysql-connector-java_8.0.26-1debian10_all.deb.

from data-center-helm-charts.

tarka avatar tarka commented on August 23, 2024

Good to hear it's working @Forbzy.

from data-center-helm-charts.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.