running trellis with docker compose

110 views
Skip to first unread message

Fred Hauschel

unread,
Jul 20, 2020, 9:39:10 AM7/20/20
to Trellis LDP
Hi there, found trellis a few hours ago ;-)
Now i try to run it on my ubuntu notebook using the attached docker-compose.yml.
But it fails while setting up the connection pool. See attached log.txt

do you have an idea, whats wrong ?

Thanks
docker-compose.yml
log.txt

Gregory Neil Jansen

unread,
Jul 20, 2020, 11:51:42 AM7/20/20
to trell...@googlegroups.com
It looks to me that you are using a trellis docker image that does not come with the PostgreSQL driver. You probably want to edit docker-compose.yml to
That is, replace trellisldp/trellis:latest with trellisldp/trellis-postgresql:latest

Greg

--
You received this message because you are subscribed to the Google Groups "Trellis LDP" group.
To unsubscribe from this group and stop receiving emails from it, send an email to trellis-ldp...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/trellis-ldp/376d2a50-2f5c-45b2-a52b-11f6ff40b8c7n%40googlegroups.com.


--
Gregory N. Jansen
Research Software Architect
Advanced Information Collaboratory
School of Information Studies
University of Maryland in College Park

Aaron Coburn

unread,
Jul 20, 2020, 1:36:55 PM7/20/20
to trell...@googlegroups.com
Hi,
the problem with the docker-compose configuration is that it doesn't include a driver class. You will see in the logs that the Trellis application is trying to connect to an H2 database, but you have a postgresql JDBC URL.

If you add this to the environment block of the trellis service, you should be all set:

TRELLIS_DB_DRIVER: org.postgresql.Driver

Alternatively, you can do what Greg recommends and use the trellis-posgresql container, which is optimized for PostgreSQL persistence layers. You can find various examples of working docker compose scripts here: https://github.com/trellis-ldp/trellis-docker-tests

Cheers,
Aaron



Aaron Coburn

unread,
Jul 20, 2020, 1:40:06 PM7/20/20
to trell...@googlegroups.com
And as a follow-on, I see that the wiki documentation had omitted that environment value. I've updated that page so that the example is now correct. https://github.com/trellis-ldp/trellis/wiki/Dockerized-Trellis

-Aaron

SoftwareEngineering Hauschel

unread,
Jul 20, 2020, 2:20:27 PM7/20/20
to trell...@googlegroups.com
Hi,
yes i got the sample from the wiki documentation.
Cool, that you already fixed it ! Thanks!
Now it starts without errors.

So i can try so store/read data.

Best Regards
Fredy

You received this message because you are subscribed to a topic in the Google Groups "Trellis LDP" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/trellis-ldp/QYMJ0lquE5A/unsubscribe.
To unsubscribe from this group and all its topics, send an email to trellis-ldp...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/trellis-ldp/CAD4uyLctVzkkecUsVPdz7LOc35h1BOgFms2VJwWXa76iT%2BmpAg%40mail.gmail.com.


--
Mit freundlichen Grüßen
Fred Robert Hauschel
+49 179 6917092

Mein Strom kommt von http://www.naturstrom.de. Für eine saubere Zukunft!
Der Umstieg ist jederzeit völlig problemlos möglich: http://www.atomausstieg-selber-machen.de.

Fred Hauschel

unread,
Jul 26, 2020, 9:04:25 AM7/26/20
to Trellis LDP
Hi there,
now was trying to start the server with the attached docker-compose.yml, but startup fails:

Caused by: org.flywaydb.core.api.FlywayException: Found non-empty schema(s) "public" but no schema history table. Use baseline() or set baselineOnMigrate to true to initialize the schema history table.


BR Fredy
docker-compose.yml

Aaron Coburn

unread,
Jul 26, 2020, 8:57:14 PM7/26/20
to trell...@googlegroups.com
Hi,
There are two simple ways to fix this:

1) if you don't care about the data stored in PostgreSQL, completely remove the image: `docker rm <image-name>` (alternatively, drop all the tables) -- the goal is to start from a completely clean slate
2) if you want to keep any data currently in the database, add this environment variable to the Trellis service: 
QUARKUS_FLYWAY_BASELINE_ON_MIGRATE = "true"

The issue has to do with the fact that the dropwizard-based Trellis image (trellisldp/trellis) uses Liquibase to manage database schema migrations while the Quarkus-based image (trellisldp/trellis-postgresql) uses Flyway. The data schemas themselves are identical, but Flyway complains if you start using it with a database that has existing tables. The environment variable only needs to be used once; then you can remove it from the docker compose configuration.

Hope that helps,
Aaron


Fred Hauschel

unread,
Jul 27, 2020, 12:58:49 PM7/27/20
to Trellis LDP
Hi there, stopping all containers, removing them and removing all the images was not a solution. i already tried that.
Using the variable QUARKUS_FLYWAY_BASELINE_ON_MIGRATE = "true" once helped!
Thanks
Reply all
Reply to author
Forward
0 new messages