I'm trying to install Cmdbuild in our test environment to have a look. The product seems very
promising, but we run into a few installation issues.
We are installing on tomcat6 and postgres 9.1.4 under RHEL. The tomcat part
seems to
work fine. Also, a test installation on my ubuntu laptop with database name 'postgres' and database user
'postgres' worked as a charm.
We are using a database with a name different from 'postgres' and a user different from 'postgres',
but the user has full rights to create objects in the database.
- In the first installation screen, how do I specify ssl=true in the database parameters. It
seems the app tries to contact the database without SSL.
- It seems the app tries to contact the database 'postgres' even though I use another name in the installation
screen. We want to use a specified database name and user name.
- I've tried to use WEB-INF/conf/database.conf to change these parameters, and it seems to work, but then I'm presented with a list of patches to install, and the majority of them fail.
In the first installation screen, how do I specify ssl=true in the database parameters. It seems the app tries to contact the database without SSL.
It is not possible to specify the SSL parameter at the moment, so you cannot create the database if the server accepts SSL connections only. You can use an unencrypted connection to create the database, and then alter the database connection string in the database.conf file. The system also uses the user and password from the same file.
I've tried to use WEB-INF/conf/database.conf to change these parameters, and it seems to work, but then I'm presented with a list of patches to install, and the majority of them fail.
When the database connection is configured but not correctly, CMDBuild will try to apply every patch to the database, but of course failing. When you see all the patches since version 1.0.3 and you are not upgrading from that release (as you are not), that means that the connection string is not correct. A few common reasons are:
- wrong database name
- wrong username or password
- pg_hba.conf rejecting the connection
- lack of privileges in the database table for the user connecting
Hope it helps.
Paolo
Tecnoteca ha scritto:
It is not possible to specify the SSL parameter at the moment, so you cannot create the database if the server accepts SSL connections only. You can use an unencrypted connection to create the database, and then alter the database connection string in the database.conf file. The system also uses the user and password from the same file.
I tried this, but it seems the app is trying to use the database 'postgres', even though I've used the name some_other_name in the GUI. Do you accept database names with underscore '_' in them?
When the database connection is configured but not correctly, CMDBuild will try to apply every patch to the database, but of course failing. When you see all the patches since version 1.0.3 and you are not upgrading from that release (as you are not), that means that the connection string is not correct. A few common reasons are:
- wrong database name
- wrong username or password
- pg_hba.conf rejecting the connection
- lack of privileges in the database table for the user connecting
Which privileges are needed? I tried to run the database sql-scripts in sequence, but it still wants the patches. The connection is fine using psql from the command line.
Hope it helps.
Paolo
Thanks, Ståle.
Ståle Askerød wrote:
it seems the app is trying to use the database 'postgres', even though I've used the name some_other_name in the GUI. Do you accept database names with underscore '_' in them?
Yes, we do accept underscores. The string in the file WEB-INF/conf/database.conf is used directly to connect to the database. You might want to check in there if everything looks all right. An example:
db.url=jdbc\:postgresql\://dbserver/cmdbuild_with_underscores
db.username=myunprivilegeduser
db.password=myunprivilegedpassword
Where "dbserver" is the name of the postgres server (localhost is allowed of course), "cmdbuild_with_underscores" is the name of the database, and the user is "myunprivilegeduser" with password "myunprivilegedpassword"
Which privileges are needed? I tried to run the database sql-scripts in sequence, but it still wants the patches. The connection is fine using psql from the command line.
The user should be the owner of the database, of the public schema and of every table in that schema.
I have tried with a fresh CMDBuild installation and a demo database. The configuration wizard was able to create a new user, granting it the ownership and fill the database.
If you are still experiencing problems, try to take a look at the log file in ${TOMCAT_HOME}/logs/cmdbuild.log.
One more thing, was Tomcat downloaded from the official from the Apache website? Sometimes the one in the distribution packages (notably the one in Ubuntu) don't contain all the libraries (e.g. tomcat-dbcp.jar).
Paolo
db.url=jdbc\:postgresql\://dbserver/cmdbuild_with_underscores
db.username=myunprivilegeduser
db.password=myunprivilegedpassword
Where "dbserver" is the name of the postgres server (localhost is allowed of course), "cmdbuild_with_underscores" is the name of the database, and the user is "myunprivilegeduser" with password "myunprivilegedpassword"
This seems to be OK.
The user should be the owner of the database, of the public schema and of every table in that schema.
Does this mean that it has to be the 'postgres' user? At our university our DBA group runs a postgres-hotel and give databases to people who need them. The setup is like this:
server: some.test.server.uio.no
port: 5432
database: my_test_database
super user: my_test_database_user
password: my_test_database_password
Does Cmdbuild expect the user to be able to create databases? The user my_test_database_user
can do everything else, but not create users or databases, as I understand.
Amart from that, my DBA people tell me that if I try to do this from the webpage and the initial setup (as opposed to database.conf), the application will try to use the user 'postgres', and this is confirmed in cmdbuild.log:
INFO 2012-07-10 15:46:08 [cmdbuild] Test connection failed: FATAL: no pg_hba.conf entry for host "129.240.118.44", user "bsd_drift_test_user", database "postgres", SSL off
This is with the database my_test_database in the GUI.
I have tried with a fresh CMDBuild installation and a demo database. The configuration wizard was able to create a new user, granting it the ownership and fill the database.
If you are still experiencing problems, try to take a look at the log file in ${TOMCAT_HOME}/logs/cmdbuild.log.
One more thing, was Tomcat downloaded from the official from the Apache website? Sometimes the one in the distribution packages (notably the one in Ubuntu) don't contain all the libraries (e.g. tomcat-dbcp.jar).
The libraries are OK, I think. I put them in the tomcat /lib.
INFO 2012-07-10 15:46:08 [cmdbuild] Test connection failed: FATAL: no pg_hba.conf entry for host "129.240.118.44", user "bsd_drift_test_user", database "postgres", SSL off
I mean, of course, that the application apparently tries to use the database "postgres". From what I see, it appears that Cmdbuild tries to create the database even though it is already created.
Ståle
I think I get what happened. The item “Existing database” in the configuration refers to an existing CMDBuild database, not just an empty PostgreSQL one. I guess you chose that option, and I admit that it is misleading.
In your environment you cannot use the guided configuration to create the database. This is what I would do:
- Create the database (empty, demo, etc.) in a test environment (you said you did it successfully on a laptop)
- Dump the database you created
- Restore it to the assigned database in the postgres-hotel, using any user (it must be the owner of that database, but it doesn't need to be a privileged user)
- Start CMDBuild from scratch (you can just comment with # every line in database.conf if you prefer)
- Choose the "Existing database" option and specify your user credentials (you would need only the ownership of the database)
Please note that Shark needs another user configured to use the "shark" schema by default. You can postpone the creation of its schema and user till you need it.
Paolo
Tecnoteca ha scritto:
I think I get what happened. The item "Existing database" in the configuration refers to an existing CMDBuild database, not just an empty PostgreSQL one. I guess you chose that option, and I admit that it is misleading.
Actually, it seems that Cmdbuild tries to use the "postgres" database on all the three choices "Empty", "Demo" and "Existing". Could it be a bug?
In your environment you cannot use the guided configuration to create the database. This is what I would do:
- Create the database (empty, demo, etc.) in a test environment (you said you did it successfully on a laptop)
- Dump the database you created
- Restore it to the assigned database in the postgres-hotel, using any user (it must be the owner of that database, but it doesn't need to be a privileged user)
- Start CMDBuild from scratch (you can just comment with # every line in database.conf if you prefer)
- Choose the "Existing database" option and specify your user credentials (you would need only the ownership of the database)
I'll try this, thanks. But shouldn't this really work as I expected?
Ståle