CMDBuild Forum

Problems with installation

Hi All,

I have been experiencing issues with a fresh install this week.

 

here are the error messages.

INFO  2018-08-24 16:19:14 [cmdbuild] last available patch is '{Optional.absent()=DefaultPatchManager.DefaultPatch[version=2.5.0-03,description=Create database,category=<null>,file=/var/lib/tomcat/webapps/cmdbuild/WEB-INF/patches/2.5.0-03.sql]}'

WARN  2018-08-24 16:19:14 [org.springframework.web.context.support.XmlWebApplicationContext] Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.apache.cxf.jaxws.EndpointImpl--190796289': Invocation of init method failed; nested exception is javax.xml.ws.WebServiceException: org.springframework.jdbc.BadSqlGrammarException: StatementCallback; bad SQL grammar [SELECT table_id, _cm_cmtable(table_id) AS table_name, _cm_cmschema(table_id) as table_schema, _cm_parent_id(table_id) AS parent_id, _cm_comment_for_table_id(table_id) AS table_comment FROM _cm_class_list() AS table_id WHERE _cm_cmschema(table_id) IN (_cm_cmschema('"Class"'::regclass::oid), 'bim')]; nested exception is org.postgresql.util.PSQLException: ERROR: function _cm_class_list() does not exist

  Hint: No function matches the given name and argument types. You might need to add explicit type casts.

  Position: 190

ERROR 2018-08-24 16:19:14 [org.springframework.web.context.ContextLoader] Context initialization failed

org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.apache.cxf.jaxws.EndpointImpl--190796289': Invocation of init method failed; nested exception is javax.xml.ws.WebServiceException: org.springframework.jdbc.BadSqlGrammarException: StatementCallback; bad SQL grammar [SELECT table_id, _cm_cmtable(table_id) AS table_name, _cm_cmschema(table_id) as table_schema, _cm_parent_id(table_id) AS parent_id, _cm_comment_for_table_id(table_id) AS table_comment FROM _cm_class_list() AS table_id WHERE _cm_cmschema(table_id) IN (_cm_cmschema('"Class"'::regclass::oid), 'bim')]; nested exception is org.postgresql.util.PSQLException: ERROR: function _cm_class_list() does not exist

  Hint: No function matches the given name and argument types. You might need to add explicit type casts.

  Position: 190

The function _cm_class_list() does exist in schema 'information_schema'
 
I also had issues with the demo.sql script where it referenced the public schema explicitly where all the objects are created in information_schema apart from those in quartz.
 
I suspect i'm doing something wrong...
 
Please help...

From
the type of error reported in the log (“ERROR: function _cm_class_list
() does not exist”) there seems to be some problem in the database.

In a properly created CMDBuild database, that function exists.

Could it be that as a database owner a user other than “postgres” was chosen?

CMDBuild Team

Previously Tecnoteca wrote:

From the type of error reported in the log ("ERROR: function _cm_class_list () does not exist") there seems to be some problem in the database.

In a properly created CMDBuild database, that function exists.

Could it be that as a database owner a user other than "postgres" was chosen?

CMDBuild Team
Hi CMDBuild Team,
I think the problem is with the Schemas. There are only the following schemas 
  • Information_schema
  • pg_catalog
  • public
  • quartz
All objects apart from those created in 2.5.0-03 are in Information_schema. I had problems with the database build scripts referring to objects in public that were actually created in Information_Schema. 
 
It seems to me that either there used to be more schemas in use and not all scripts have been modified or that the  install scripts are missing the commands to create the schemas.
 
the db was created using postgres user from the scripts in the base_schema directory. I also tried the demo_schema.sql script but again that wouldn't parse.
It errored on the following:
ErrorMessage: unrecognized configuration parameter "lock_timeout"
on line 2 command SET lock_timeout = 0;
ErrorCode: -2147467259
Severity: ERROR, Code: 42883, Line: 355, Position:
ErrorMessage: function public._cm_string_agg(anyarray) does not exist
This function is in information _schema and there are more occurrences .
  • line 2825 has FINALFUNC = public._cm_string_agg yet this function is in Information_schema
  • line 24 'FROM bim."' || table_record.tablename || '" AS b' yet there is no bim schema
  • line 25 'JOIN public."' ||  table_record.tablename || '" AS p' nothing created in public
 
As for the function _cm_class_list() it does exist and is defined as :
 
CREATE OR REPLACE FUNCTION information_schema._cm_class_list()
 RETURNS SETOF oid
 LANGUAGE sql
 STABLE
AS $function$
SELECT oid FROM pg_class WHERE _cm_is_any_class_comment(_cm_comment_for_cmobject(oid));
$function$
 
I hope you can help...
Cheers
Dave
 

Previously Tecnoteca wrote:

From the type of error reported in the log ("ERROR: function _cm_class_list () does not exist") there seems to be some problem in the database.

In a properly created CMDBuild database, that function exists.

Could it be that as a database owner a user other than "postgres" was chosen?

CMDBuild Team
the function is created as the following definition...
CREATE OR REPLACE FUNCTION information_schema._cm_class_list()
 RETURNS SETOF oid
 LANGUAGE sql
 STABLE
AS $function$
SELECT oid FROM pg_class WHERE _cm_is_any_class_comment(_cm_comment_for_cmobject(oid));
$function$
 
All SQL objects and created in the Information_schema schema, the only other schema used is the quartz schema. There are no other schemas other than the default schemas.
 
cheers
Dave

If you use a pgAdmin client tool you should only see the “public”, “quartz” and possibly “shark” and “gis” schemas.

All CMDBuild objects should be in the "public" schema, excluding the task management tables ("quartz"), the workflow management tables ("shark") and the geo-reference management tables and functions ("gis").
CMDBuild Team
 

 

Previously Tecnoteca wrote:

If you use a pgAdmin client tool you should only see the "public", "quartz" and possibly "shark" and "gis" schemas.
All CMDBuild objects should be in the "public" schema, excluding the task management tables ("quartz"), the workflow management tables ("shark") and the geo-reference management tables and functions ("gis").
CMDBuild Team
 

 

Ahh that will be the problem then :-)
I dont suppose you have lists of the objects that should be in the Quartz, shark and gis schemas?
 
Many thanks
Dave
I do not have a list because the objects are very many, but if you reinstall CMDBuild from scratch paying attention to the scheme should go all right.
CMDBuild Team

Previously Tecnoteca wrote:

If you use a pgAdmin client tool you should only see the "public", "quartz" and possibly "shark" and "gis" schemas.
All CMDBuild objects should be in the "public" schema, excluding the task management tables ("quartz"), the workflow management tables ("shark") and the geo-reference management tables and functions ("gis").
CMDBuild Team
 

 

Shouldn't there be a bim schema as i see this referred to in bim.sql?
I forgot to specify it, there may also be a "bim" scheme that is automatically generated by the system when IFC files are imported from the Administration Module.
CMDBuild Team