Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update postgresql jdbc driver to version 42.6.0 #4

Merged
merged 1 commit into from
Jul 24, 2023

Conversation

kencho51
Copy link
Collaborator

@kencho51 kencho51 commented Jul 17, 2023

This PR is for the following functionalities:

  1. Update postgresql jdbc driver as part of the PR move postUpload logs to user's uploadDir gigadb-website#1318 as described in Problem.

Problem

In production environment, when execute datasetUpload.sh, the java.log would contain the following error:

java.io.FileNotFoundException: time.txt (Permission denied)
org.postgresql.util.PSQLException: The authentication type 10 is not supported. Check that you have configured the pg_hba.conf 
file to include the client's IP address or subnet, and that it is using an authentication scheme supported by the driver.
        at org.postgresql.core.v3.ConnectionFactoryImpl.doAuthentication(ConnectionFactoryImpl.java:403)
        at org.postgresql.core.v3.ConnectionFactoryImpl.openConnectionImpl(ConnectionFactoryImpl.java:108)
        at org.postgresql.core.ConnectionFactory.openConnection(ConnectionFactory.java:66)
        at org.postgresql.jdbc2.AbstractJdbc2Connection.<init>(AbstractJdbc2Connection.java:125)
        at org.postgresql.jdbc3.AbstractJdbc3Connection.<init>(AbstractJdbc3Connection.java:30)
        at org.postgresql.jdbc3g.AbstractJdbc3gConnection.<init>(AbstractJdbc3gConnection.java:22)
        at org.postgresql.jdbc4.AbstractJdbc4Connection.<init>(AbstractJdbc4Connection.java:32)
        at org.postgresql.jdbc4.Jdbc4Connection.<init>(Jdbc4Connection.java:24)
        at org.postgresql.Driver.makeConnection(Driver.java:393)
        at org.postgresql.Driver.connect(Driver.java:267)
        at java.sql.DriverManager.getConnection(DriverManager.java:664)
        at java.sql.DriverManager.getConnection(DriverManager.java:247)
        at Database.<init>(Database.java:32)
        at Validation.<init>(Validation.java:80)
        at Main.processExcel(Main.java:121)
        at Main.main(Main.java:168)
How have functionalities been implemented?

Download the latest postgresql jdbc driver from here: https://jdbc.postgresql.org/download/ and replace the current one lib/lib/postgresql-9.1-901.jdbc4.jar.

How to test in staging
# go to tool's dir
% cd gigadb/app/tools/excel-spreadsheet-uploader
# get the latest change of the tool
./setup.sh
# make sure the postgresql jdbc driver has been updated
# then spin up staging gigadb website
% cd /gigadb-website/ops/infrastructure/envs/staging
% ../../../scripts/tf_init.sh --project gigascience/forks/kencho-gigadb-website --env staging
% terraform apply
% terraform refresh
% ../../../scripts/ansible_init.sh --env staging
% TF_KEY_NAME=private_ip ansible-playbook -i ../../inventories webapp_playbook.yml -v
% ansible-playbook -i ../../inventories bastion_playbook.yml -e "backup=latest" -v
# Complete gitlab pipeline, make sure all staging jobs have been deployed.
# log into bastion server
% ssh -i $pem centos@$bastion-ip
# run the datasetUpload.sh
$ ./datasetUpload.sh
# check the logs, and the postgresql error should be gone
$ less logs/java.log 

@kencho51 kencho51 requested review from pli888 and rija July 17, 2023 10:05
@rija
Copy link
Collaborator

rija commented Jul 17, 2023

Hi @kencho51,

I see this PR is still in draft yet asking us for review. Is it meant to be switched to ready for review?

@kencho51 kencho51 changed the title update postgresql jdbc driver and make the tool does not insert non exist sample attribute update postgresql jdbc driver to version 42.6.0 Jul 18, 2023
@kencho51 kencho51 marked this pull request as ready for review July 18, 2023 04:18
Copy link
Collaborator

@rija rija left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

Copy link
Member

@pli888 pli888 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This the same change I made a month ago where I identified that postgresql-42.6.0.jar was working with PostgreSQL 14 for GigaDB so I approve this PR.

@pli888 pli888 merged commit 8b987de into gigascience:develop Jul 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants