Standard deployment of contentbox war

Hi people,

well, it seems that first steps of deploying a contentbox war file is quite frustrating. I’d have expected that if I get a web archive I just drop it to any container, let it unpack and run any kind of installer. Ouh, but what happens here is that after it’s unpacked and the app is requested I just get a

lucee.runtime.exp.DatabaseException: datasource [contentbox] doesn't exist

Even if I read readme.md I’m left alone as there a no hints for this kind of installation or configuration. There are no explanations how to continue. I think I need some idiot proofed tutorials what to do if I start with a simple bash. I did quite a lot a coldfusion development 25 years ago and thought I give it a chance. But documentation seems to be a big pain. 7 years old YT content can’t convice. Am I at the end immediately?

We have dropped support for war deployment since version 4.x. Due to trying to support the many underlying issues of a servelet container plus the many versions of lucee with their supported and unsported features, it just became a pain.

Especially dealing with datasources in a WAR environment and seeding the engine with the datasource, building the initial database, etc.

Therefore, that was dropped from us directly since version 4.

Now, with that said, you can build your own WAR archive YOUR way. ContentBox is now intsallable via a our contentbox-cli. Which then you can use to prep your database of choice. Once that’s build, you can then package it and send it to your serlvet of choice.

Well, thanks for hints. So I installed (on my Linux box) the debian package of contentbox and called

contentbox install-wizard

In the summary I configure:

╔══════════════════╤════════════╗
║ Configuration    │ Value      ║
╠══════════════════╪════════════╣
║ DATABASEPASSWORD │ ***        ║
╟──────────────────┼────────────╢
║ DATABASEPORT     │ [default]  ║
╟──────────────────┼────────────╢
║ DATABASENAME     │ contentbox ║
╟──────────────────┼────────────╢
║ DATABASEUSERNAME │ rusreich   ║
╟──────────────────┼────────────╢
║ DATABASETYPE     │ PostgreSQL ║
╟──────────────────┼────────────╢
║ CFMLPASSWORD     │ ***        ║
╟──────────────────┼────────────╢
║ DEPLOYSERVER     │ true       ║
╟──────────────────┼────────────╢
║ COLDBOXPASSWORD  │ ***        ║
╟──────────────────┼────────────╢
║ DATABASEHOST     │ localhost  ║
╟──────────────────┼────────────╢
║ NAME             │ tik3       ║
╟──────────────────┼────────────╢
║ CFMLENGINE       │ lucee@5    ║
╟──────────────────┼────────────╢
║ PRODUCTION       │ false      ║
╚══════════════════╧════════════╝

and I’m pretty sure my Postgres is running and I entered the right credentials, but it CLI complains about

Make sure your database (contentbox) has been created!
If this process fails, then your database credentials are not correct.  Verify them and make sure they match the ones in the (.env) file we created.
You don't have to run the installer again if it fails. You can run the following commands to finish your installation:
- migrate install
- run-script contentbox:migrate

Please wait while we install your migrations table...
Storing cfmigrations information in box.json has been deprecated in v4 and will be removed in v5.
Please refer to the migration guide at https://github.com/commandbox-modules/commandbox-migrations to upgrade.

The format of the migrations configuration has changed in v4.
We will convert your configuration to the new format. This auto-conversion will be dropped in v5.
Please refer to the migration guide at https://github.com/commandbox-modules/commandbox-migrations to upgrade.




ERROR (6.0.0+00787)

No manager found named [contentbox]. Available managers are: default

and the “webinstaller” says: lucee.runtime.exp.CustomTypeException: Error building: AuthorService@contentbox -> ORM is not enabled .
I created a database “contentbox” by hand, which still feels strange as I define credentials and someone could image that an installer could do this job?!

Few observations.

I don’t think you have the latest migrations installed. Please do a uninstall commandbox-migrations --system and reinstall it install commandbox-migrations.

If you can’t get the CLI to install the database, then we can’t move to the web portions. You should have a .cfmigrations.json in the root.

Mmh, not sure why I should be out of date if I had a fresh installation and started with an update --system command?

But I did what you suggested. Still the result of my contentbox install-wizard is:

Make sure your database (contentbox) has been created!
If this process fails, then your database credentials are not correct.  Verify them and make sure they match the ones in the (.env) file we created.
You don't have to run the installer again if it fails. You can run the following commands to finish your installation:
- migrate install
- run-script contentbox:migrate
...
ERROR (6.0.0+00787)

No manager found named [contentbox]. Available managers are: default


I double check the .env and find valid credentials (third check is to use psql manually):

######################################################
# Database Datasource Connection
######################################################
DB_DRIVER=PostgreSQL
DB_CLASS=org.postgresql.Driver
DB_BUNDLEVERSION=9.4.1212
DB_BUNDLENAME=org.postgresql.jdbc42
# DB Location
DB_HOST=localhost
DB_PORT=5432
DB_CONNECTIONSTRING=jdbc:postgresql://localhost:5432/contentbox
# DB Credentials
DB_DATABASE=contentbox
DB_USER=rusreich
DB_PASSWORD=xxxxxxxx

Do I need any valid database schemas? I just created an empty database (my expectation would be that any kind of installer would care about that).

Can you post your migrations file. there should be a .cfmigrations.json in the root

There isn’t one. What I got in my folder is:

-rwxrw-r-- 1 rusreich rusreich   330 Aug  9  2022 robots.txt
-rwxrw-r-- 1 rusreich rusreich  5115 Aug  9  2022 readme.md
-rwxrw-r-- 1 rusreich rusreich 10162 Aug  9  2022 license.txt
-rwxrw-r-- 1 rusreich rusreich  1021 Aug  9  2022 index.cfm
-rwxrw-r-- 1 rusreich rusreich  1406 Aug  9  2022 favicon.ico
-rwxrw-r-- 1 rusreich rusreich  6328 Aug  9  2022 CONTRIBUTING.md
-rwxrw-r-- 1 rusreich rusreich    41 Aug  9  2022 contentbox-5.3.0+246-202208092312
-rwxrw-r-- 1 rusreich rusreich  6200 Aug  9  2022 changelog.md
-rwxrw-r-- 1 rusreich rusreich  8066 Aug  9  2022 Application.cfc
drwxrwxr-x 2 rusreich rusreich  4096 Mär 12 13:47 models
drwxrwxr-x 2 rusreich rusreich  4096 Mär 12 13:47 layouts
drwxrwxr-x 3 rusreich rusreich  4096 Mär 12 13:47 views
drwxrwxr-x 2 rusreich rusreich  4096 Mär 12 13:47 bin
drwxrwxr-x 3 rusreich rusreich  4096 Mär 12 13:47 modules_app
drwxrwxr-x 2 rusreich rusreich  4096 Mär 12 13:47 handlers
drwxrwxr-x 2 rusreich rusreich  4096 Mär 12 13:47 config
drwxrwxr-x 3 rusreich rusreich  4096 Mär 12 13:47 coldbox
drwxrwxr-x 4 rusreich rusreich  4096 Mär 12 13:47 modules
-rwxrw-r-- 1 rusreich rusreich   786 Mär 12 13:47 server.json
-rwxrw-r-- 1 rusreich rusreich  2140 Mär 13 11:19 box.json


“Migrations” means something like DDL?
How do I get more verbose outputs, are there any logs or arguments for the commandbox?

Thanks for your support, I still believe it’s possible :slight_smile:

Anyone with an idea?
To check my assumption I monitor with tcpdump any connections to my postgres at port 5432.
But nothing arrives :frowning:

A restart of the box command and the start of the “contentbox install-wizard” gave me this time (at the end):

Do you wish to continue? [y/n] : y
Starting to install ContentBox...

 × | Installing package [forgebox:contentbox-installer@y]
   |-------------------------------------------------------------------
   | Verifying package 'contentbox-installer@y' in forgebox, please wait...
   | Error getting ForgeBox entry [contentbox-installer@y]  The entry slug sent is invalid or does not e
   | xis
   |-------------------------------------------------------------------


ERROR (6.0.0+00787)

Error getting ForgeBox entry [contentbox-installer@y]

The entry slug sent is invalid or does not exist

To apply again the previos mentionend uninstall/install of suspicious components I did an:

uninstall contentbox-installer
install contentbox-installer

but I’m still caught with the last error.

Hi @Rainer another issue reported some issues with the ContentBox CLI. So I would suggest that you update it as we just applied tons of fixes for the cli.

box update contentbox-cli --force

Remove all databases, files and do another install

box contentbox install-wizard

Hi @lmajano, after your suggestions the error message changed to:

Make sure your database (contentbox) has been created!
If this process fails, then your database credentials are not correct.  Verify them and make sure they match the ones in the (.env) file we created.
You don't have to run the installer again if it fails. You can run the following commands to finish your installation:
- migrate install
- run-script contentbox:migrate

Please wait while we install your migrations table...



ERROR (6.0.0+00787)

Authentication type 10 is not supported. Ensure that the 'pg_hba.conf' file contains the IP address or subnet of the client and that the client uses an authentication scheme that is supported by the driver.

would recommand to change to MD5 hashes. My try didn’t succeed. Finally it seems to be a JDBC → PostgreSQL 14 problem. This explains why all cli tests with psql (and my used credentials) run without any issues where on the other hand JDBC fails.