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

Not run with Postgresql 16 #3452

Open
hrupin opened this issue Dec 14, 2023 · 6 comments
Open

Not run with Postgresql 16 #3452

hrupin opened this issue Dec 14, 2023 · 6 comments
Labels

Comments

@hrupin
Copy link

hrupin commented Dec 14, 2023

Hello!

First of all, I want to say thank you for such a very cool project!

I had a problem connecting to a Postgresql16 database.

I did everything according to the instructions as written in the documentation

It starts to launch and does not find the driver and stops:

$ java -jar gitbucket.war

SLF4J: No SLF4J providers were found.
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See https://www.slf4j.org/codes.html#noProviders for further details.
22:46:39.142 [main] INFO com.zaxxer.hikari.HikariDataSource - HikariPool-1 - Starting...
22:46:39.180 [main] WARN c.z.hikari.util.DriverDataSource - Registered driver with driverClassName=org.postgresql.Driver2 was not found, trying direct instantiation.
22:46:41.534 [main] INFO com.zaxxer.hikari.HikariDataSource - HikariPool-1 - Start completed.
22:46:41.697 [main] INFO g.core.servlet.InitializeListener - Check version
22:46:41.698 [main] INFO g.core.servlet.InitializeListener - Start schema update

Debian 10

Gitbucket version - 4.40.0

Java version

$ java -version
java version "21.0.1" 2023-10-17 LTS
Java(TM) SE Runtime Environment (build 21.0.1+12-LTS-29)
Java HotSpot(TM) 64-Bit Server VM (build 21.0.1+12-LTS-29, mixed mode, sharing)

Tables in the database are not created

I remotely connect to the database using this account
and tried to set the connection settings in different ways

db {
url = "jdbc:postgresql://localhost:5432/git_db"
user = "bd_user"
password = "123321!"
}

db {
url = "jdbc:postgresql://localhost/git_db"
user = "bd_user"
password = "123321!"
}

db {
url = "jdbc:postgresql://98.45.15.65:5432/git_db"
user = "bd_user"
password = "123321"
}

and created the user as in the documentation

db {
url = "jdbc:postgresql://localhost/gitbucket"
user = "gitbucket_user"
password = "YOUR_PASSWORD!"
}

@takezoe
Copy link
Member

takezoe commented Dec 26, 2023

Is this everything you see?

SLF4J: No SLF4J providers were found.
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See https://www.slf4j.org/codes.html#noProviders for further details.
22:46:39.142 [main] INFO com.zaxxer.hikari.HikariDataSource - HikariPool-1 - Starting...
22:46:39.180 [main] WARN c.z.hikari.util.DriverDataSource - Registered driver with driverClassName=org.postgresql.Driver2 was not found, trying direct instantiation.
22:46:41.534 [main] INFO com.zaxxer.hikari.HikariDataSource - HikariPool-1 - Start completed.
22:46:41.697 [main] INFO g.core.servlet.InitializeListener - Check version
22:46:41.698 [main] INFO g.core.servlet.InitializeListener - Start schema update

@hrupin
Copy link
Author

hrupin commented Jan 13, 2024

yes

version 4.39.0 - started and connection is happening

@takezoe
Copy link
Member

takezoe commented Jan 13, 2024

WARN message is not a problem. HikariCP just couldn't find a JDBC driver in the list of known JDBC drivers as GitBucket uses a custom JDBC driver. If GitBucket cannot actually fail to connect the database, you must see some error messages.

@hrupin
Copy link
Author

hrupin commented Jan 13, 2024

understood thanks

@takezoe
Copy link
Member

takezoe commented Jan 13, 2024

So, could you elaborate your situation if you have still issues, or can we close this issue?

Your meant that your GitBucket stopped working after that message?

@sunnyone
Copy link

sunnyone commented May 4, 2024

The same issue occured on my environment (Ubuntu 24.04, openjdk-21, postgresql-16)

In conclusion, a permission to the public schema is required on postgresql >= 15.
(cf. https://dev.to/dm8ry/postgresql-version-15-error-permission-denied-for-schema-public-2b7 )

$ psql -Upostgres gitbucket
psql (16.2 (Ubuntu 16.2-1ubuntu4))
Type "help" for help.

gitbucket=# GRANT ALL ON SCHEMA public TO gitbucket_user;
GRANT

It might be helpful if gitbucket outputs logs when the migration fails.

Logs

$ sudo -ugitbucket /usr/bin/java -jar /opt/gitbucket/gitbucket.war --gitbucket.home=/srv/gitbucket --port=8083 
SLF4J: No SLF4J providers were found.
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See https://www.slf4j.org/codes.html#noProviders for further details.
13:15:56.481 [main] INFO  com.zaxxer.hikari.HikariDataSource - HikariPool-1 - Starting...
13:15:56.487 [main] WARN  c.z.hikari.util.DriverDataSource - Registered driver with driverClassName=org.postgresql.Driver2 was not found, trying direct instantiation.
13:15:56.851 [main] INFO  com.zaxxer.hikari.HikariDataSource - HikariPool-1 - Start completed.
13:15:56.867 [main] INFO  g.core.servlet.InitializeListener - Check version
13:15:56.867 [main] INFO  g.core.servlet.InitializeListener - Start schema update

The process does not output any logs after above logs, but it's still alive.

postgresql-16-main.log says permission denied.

2024-05-04 13:15:56.887 UTC [57734] gitbucket_user@gitbucket ERROR:  permission denied for schema public at character 14
2024-05-04 13:15:56.887 UTC [57734] gitbucket_user@gitbucket STATEMENT:  CREATE TABLE VERSIONS (MODULE_ID VARCHAR(100) NOT NULL PRIMARY KEY, VERSION VARCHAR(100) NOT NULL)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

No branches or pull requests

3 participants