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 postgres to newer version to fix fail to start on M2 laptops #44151

Closed
wants to merge 1 commit into from

Conversation

maxandersen
Copy link
Member

fixes #44150

anyone know if reason to stay on older postgres or this should be fine?

@maxandersen maxandersen requested review from yrodiere and gsmet October 29, 2024 08:11
Copy link

quarkus-bot bot commented Oct 29, 2024

Thanks for your pull request!

Your pull request does not follow our editorial rules. Could you have a look?

  • title should preferably start with an uppercase character (if it makes sense!)

This message is automatically generated by a bot.

@quarkus-bot quarkus-bot bot added the area/dependencies Pull requests that update a dependency file label Oct 29, 2024
@gastaldi
Copy link
Contributor

@melloware This also partially fixes #42149

@yrodiere
Copy link
Member

@melloware This also partially fixes #42149

Yeah, pretty sure the upgrade was blocked because Flyway didn't work after the upgrade.

@maxandersen
Copy link
Member Author

And flyway failing was more than need to use flyway-database-postgresql when using Postgres ?

@melloware
Copy link
Contributor

Yes it looks like an issue where Flyway needed to change some code to be PG 16 compliant.

@melloware
Copy link
Contributor

@maxandersen open bug here: flyway/flyway#3743

@maxandersen
Copy link
Member Author

but thats what i'm saying - you need to add a specific postgress flyway dependency to make it work.

@FroMage mentioned he had some fun with flyway on getting it to use right postgres combination. @FroMage can you remember?

@gastaldi
Copy link
Contributor

gastaldi commented Oct 29, 2024

I've run mvn -Dquarkus.datasource.devservices.image-name=postgres quarkus:dev with https://github.com/quarkusio/registry.quarkus.io

And got the following warning, but the app started ok:

2024-10-29 09:26:33,119 WARN  [org.fly.cor.int.dat.bas.Database] (Quarkus Main Thread) Flyway upgrade recommended: PostgreSQL 17.0 is newer than this version of Flyway and support has not been tested. The latest supported version of PostgreSQL is 15.

I'm using RHBQ 3.8.6.redhat-00005 though

@yrodiere
Copy link
Member

but thats what i'm saying - you need to add a specific postgress flyway dependency to make it work.

That additional dependency is already added automatically: #41862

We might need to update it, though, if the compatibility problem with Postgres 16 was fixed upstream.

Anyway, tests are already failing in this PR, maybe let's wait for the report and the exact failure before we discuss solutions?

Copy link

quarkus-bot bot commented Oct 29, 2024

Status for workflow Quarkus CI

This is the status report for running Quarkus CI on commit c6b752b.

Failing Jobs

Status Name Step Failures Logs Raw logs Build scan
JVM Tests - JDK 17 Build Failures Logs Raw logs 🔍
JVM Tests - JDK 21 Build Failures Logs Raw logs 🔍
Native Tests - Data3 Build Failures Logs Raw logs 🔍

Full information is available in the Build summary check run.
You can consult the Develocity build scans.

Failures

⚙️ JVM Tests - JDK 17 #

- Failing: integration-tests/flyway 

📦 integration-tests/flyway

io.quarkus.it.flyway.FlywayFunctionalityTest.testPlaceholders - History - More details - Source on GitHub

java.lang.RuntimeException: java.lang.RuntimeException: Failed to start quarkus
	at io.quarkus.test.junit.QuarkusTestExtension.throwBootFailureException(QuarkusTestExtension.java:632)
	at io.quarkus.test.junit.QuarkusTestExtension.interceptTestClassConstructor(QuarkusTestExtension.java:716)
	at java.base/java.util.Optional.orElseGet(Optional.java:364)
	at java.base/java.util.ArrayList.forEach(ArrayList.java:1511)
	at java.base/java.util.ArrayList.forEach(ArrayList.java:1511)
Caused by: java.lang.RuntimeException: Failed to start quarkus
	at io.quarkus.runner.ApplicationImpl.doStart(Unknown Source)

⚙️ JVM Tests - JDK 21 #

- Failing: integration-tests/flyway 

📦 integration-tests/flyway

io.quarkus.it.flyway.FlywayFunctionalityTest.testPlaceholders - History - More details - Source on GitHub

java.lang.RuntimeException: java.lang.RuntimeException: Failed to start quarkus
	at io.quarkus.test.junit.QuarkusTestExtension.throwBootFailureException(QuarkusTestExtension.java:632)
	at io.quarkus.test.junit.QuarkusTestExtension.interceptTestClassConstructor(QuarkusTestExtension.java:716)
	at java.base/java.util.Optional.orElseGet(Optional.java:364)
	at java.base/java.util.ArrayList.forEach(ArrayList.java:1596)
	at java.base/java.util.ArrayList.forEach(ArrayList.java:1596)
Caused by: java.lang.RuntimeException: Failed to start quarkus
	at io.quarkus.runner.ApplicationImpl.doStart(Unknown Source)

⚙️ Native Tests - Data3 #

- Failing: integration-tests/flyway 

📦 integration-tests/flyway

io.quarkus.it.flyway.FlywayFunctionalityNativeIT.testPlaceholders - History - More details - Source on GitHub

java.lang.RuntimeException: java.lang.RuntimeException: Unable to successfully launch process '5883'. Exit code is: '1'.
	at io.quarkus.test.junit.QuarkusIntegrationTestExtension.throwBootFailureException(QuarkusIntegrationTestExtension.java:375)
	at io.quarkus.test.junit.QuarkusIntegrationTestExtension.beforeEach(QuarkusIntegrationTestExtension.java:118)
	at java.base/java.util.ArrayList.forEach(ArrayList.java:1511)
	at java.base/java.util.ArrayList.forEach(ArrayList.java:1511)
Caused by: java.lang.RuntimeException: Unable to successfully launch process '5883'. Exit code is: '1'.
	at io.quarkus.test.common.LauncherUtil.ensureProcessIsAlive(LauncherUtil.java:124)
	at io.quarkus.test.common.LauncherUtil.waitForCapturedListeningData(LauncherUtil.java:87)

@yrodiere
Copy link
Member

The failure looks related to usage of public schema in tests (see below). Since it's mentioned in #41862, I assume the public schema can no longer be used by default in Postgres 16.

2024-10-29T09:32:39.1749951Z [ERROR] Tests run: 8, Failures: 0, Errors: 1, Skipped: 7, Time elapsed: 10.76 s <<< FAILURE! -- in io.quarkus.it.flyway.FlywayFunctionalityTest
2024-10-29T09:32:39.1754211Z [ERROR] io.quarkus.it.flyway.FlywayFunctionalityTest.testPlaceholders -- Time elapsed: 0.007 s <<< ERROR!
2024-10-29T09:32:39.1756068Z java.lang.RuntimeException: java.lang.RuntimeException: Failed to start quarkus
2024-10-29T09:32:39.1757884Z 	at io.quarkus.test.junit.QuarkusTestExtension.throwBootFailureException(QuarkusTestExtension.java:632)
2024-10-29T09:32:39.1759922Z 	at io.quarkus.test.junit.QuarkusTestExtension.interceptTestClassConstructor(QuarkusTestExtension.java:716)
2024-10-29T09:32:39.1761612Z 	at java.base/java.util.Optional.orElseGet(Optional.java:364)
2024-10-29T09:32:39.1762918Z 	at java.base/java.util.ArrayList.forEach(ArrayList.java:1511)
2024-10-29T09:32:39.1764131Z 	at java.base/java.util.ArrayList.forEach(ArrayList.java:1511)
2024-10-29T09:32:39.1765336Z Caused by: java.lang.RuntimeException: Failed to start quarkus
2024-10-29T09:32:39.1766773Z 	at io.quarkus.runner.ApplicationImpl.doStart(Unknown Source)
2024-10-29T09:32:39.1767936Z 	at io.quarkus.runtime.Application.start(Application.java:101)
2024-10-29T09:32:39.1769104Z 	at java.base/java.lang.reflect.Method.invoke(Method.java:569)
2024-10-29T09:32:39.1770518Z 	at io.quarkus.runner.bootstrap.StartupActionImpl.run(StartupActionImpl.java:305)
2024-10-29T09:32:39.1772149Z 	at io.quarkus.test.junit.QuarkusTestExtension.doJavaStart(QuarkusTestExtension.java:245)
2024-10-29T09:32:39.1773986Z 	at io.quarkus.test.junit.QuarkusTestExtension.ensureStarted(QuarkusTestExtension.java:599)
2024-10-29T09:32:39.1775967Z 	at io.quarkus.test.junit.QuarkusTestExtension.beforeAll(QuarkusTestExtension.java:649)
2024-10-29T09:32:39.1777382Z 	... 1 more
2024-10-29T09:32:39.1778518Z Caused by: org.flywaydb.core.internal.sqlscript.FlywaySqlScriptException: Script  failed
2024-10-29T09:32:39.1779737Z --------------
2024-10-29T09:32:39.1780116Z SQL State  : 42501
2024-10-29T09:32:39.1781268Z Error Code : 0
2024-10-29T09:32:39.1781851Z Message    : ERROR: permission denied for schema public
2024-10-29T09:32:39.1782507Z Location   :  ()
2024-10-29T09:32:39.1782888Z Line       : 1
2024-10-29T09:32:39.1783877Z Statement  : CREATE OR REPLACE FUNCTION f_my_constant() RETURNS integer LANGUAGE plpgsql as $func$ BEGIN return 100; END $func$
2024-10-29T09:32:39.1784815Z 
2024-10-29T09:32:39.1785645Z 	at org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor.handleException(DefaultSqlScriptExecutor.java:256)
2024-10-29T09:32:39.1787638Z 	at org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor.executeStatement(DefaultSqlScriptExecutor.java:217)
2024-10-29T09:32:39.1789401Z 	at org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor.execute(DefaultSqlScriptExecutor.java:137)
2024-10-29T09:32:39.1790768Z 	at org.flywaydb.core.FlywayExecutor.lambda$execute$1(FlywayExecutor.java:159)
2024-10-29T09:32:39.1792114Z 	at org.flywaydb.core.internal.jdbc.JdbcConnectionFactory.openConnection(JdbcConnectionFactory.java:106)
2024-10-29T09:32:39.1793478Z 	at org.flywaydb.core.internal.database.base.Database.<init>(Database.java:89)
2024-10-29T09:32:39.1794691Z 	at org.flywaydb.database.postgresql.PostgreSQLDatabase.<init>(PostgreSQLDatabase.java:38)
2024-10-29T09:32:39.1796173Z 	at org.flywaydb.database.postgresql.PostgreSQLDatabaseType.createDatabase(PostgreSQLDatabaseType.java:96)
2024-10-29T09:32:39.1797478Z 	at org.flywaydb.core.FlywayExecutor.execute(FlywayExecutor.java:164)
2024-10-29T09:32:39.1798337Z 	at org.flywaydb.core.Flyway.migrate(Flyway.java:176)
2024-10-29T09:32:39.1799309Z 	at io.quarkus.flyway.runtime.FlywayRecorder.doStartActions(FlywayRecorder.java:142)
2024-10-29T09:32:39.1800591Z 	at io.quarkus.deployment.steps.FlywayProcessor$startActions2099152139.deploy_0(Unknown Source)
2024-10-29T09:32:39.1802045Z 	at io.quarkus.deployment.steps.FlywayProcessor$startActions2099152139.deploy(Unknown Source)
2024-10-29T09:32:39.1802945Z 	... 8 more
2024-10-29T09:32:39.1803657Z Caused by: org.postgresql.util.PSQLException: ERROR: permission denied for schema public
2024-10-29T09:32:39.1804985Z 	at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2733)
2024-10-29T09:32:39.1806347Z 	at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:2420)
2024-10-29T09:32:39.1807585Z 	at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:372)
2024-10-29T09:32:39.1808705Z 	at org.postgresql.jdbc.PgStatement.executeInternal(PgStatement.java:517)
2024-10-29T09:32:39.1809717Z 	at org.postgresql.jdbc.PgStatement.execute(PgStatement.java:434)
2024-10-29T09:32:39.1810712Z 	at org.postgresql.jdbc.PgStatement.executeWithFlags(PgStatement.java:356)
2024-10-29T09:32:39.1811797Z 	at org.postgresql.jdbc.PgStatement.executeCachedSql(PgStatement.java:341)
2024-10-29T09:32:39.1812870Z 	at org.postgresql.jdbc.PgStatement.executeWithFlags(PgStatement.java:317)
2024-10-29T09:32:39.1813869Z 	at org.postgresql.jdbc.PgStatement.execute(PgStatement.java:312)
2024-10-29T09:32:39.1815141Z 	at org.flywaydb.core.internal.jdbc.JdbcTemplate.executeStatement(JdbcTemplate.java:210)
2024-10-29T09:32:39.1816956Z 	at org.flywaydb.core.internal.sqlscript.ParsedSqlStatement.execute(ParsedSqlStatement.java:88)
2024-10-29T09:32:39.1818801Z 	at org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor.executeStatement(DefaultSqlScriptExecutor.java:212)
2024-10-29T09:32:39.1820020Z 	... 19 more
2024-10-29T09:32:39.1820234Z 

@FroMage
Copy link
Member

FroMage commented Oct 29, 2024

mentioned he had some fun with flyway on getting it to use right postgres combination

It was a red herring. Flyway was reporting something like "Version X of Postgres not supported" when the version was irrelevant: it was the general postgres support module that was missing, but I'm pretty sure some brave colleague fixed that.

@gsmet
Copy link
Member

gsmet commented Oct 30, 2024

I will close this one and create a more comprehensive PR with some Flyway tests adjustments and maybe also some other image updates.

@gsmet gsmet closed this Oct 30, 2024
@quarkus-bot quarkus-bot bot added the triage/invalid This doesn't seem right label Oct 30, 2024
@gsmet
Copy link
Member

gsmet commented Oct 30, 2024

Superseded by #44191 .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/dependencies Pull requests that update a dependency file triage/invalid This doesn't seem right
Projects
None yet
Development

Successfully merging this pull request may close these issues.

postgres:14 as quarkus devservice fails to run on M2 macbook
6 participants