CMDBuild Forum

Error during Installation Openmaint 3.1.1

Believe me Openmaint, even at 3.1.1 version, the installation is still a pain. Can you please make two seperate snapshots based installation guide for Windows and Linux? And please mention it with steps to install from posgres DB, Post GIS, the some random database queries to be fired to enable Post GIS extensions and blah blah and then how to import the dump that actually gets imported without any error.

This will not take more than 2 hours for any of your technical experts. Can you please do that to save hundreds of hours of your potential product users ???

Now here is my issue:
I am trying to install openmaint 3.1.1 on my windows 7 based workstation

I have followed the document “technical-manual-in-english.pdf”. And followed the steps to run Database queries as mentioned on page 8 and 9.

Here is what I did:

  1. From zip file “openmaint-2.0-3.1.zip”, extract the war file “openmaint-2.0-3.1.1.war”

  2. Copy file “openmaint-2.0-3.1.1.war” into the Tomcat “webapps” directory, renaming it to “openmaint.war”

  3. Start tomcat and after the war file is decompressed, stop tomcat

  4. Delete the “openmaint-2.0-3.1.1.war” file from “webapps” directory.

  5. How to configure openmaint
    5.1 create cmdbuild conf directory in ${catalina.base}/conf/<openmaint_webapp_context>. I created a folder named “openmaint” inside “.\tomcat\conf”
    5.2 copy default config file “tomcat\webapps\openmaint\WEB-INF\conf\database.conf_example”, to location " .\tomcat\conf\openmaint"
    5.3 Rename the file to “database.conf”

  6. Update the file “WEB-INF\conf\database.conf” to add the database connectivity and name details.

db.url=db.url=jdbc:postgresql://localhost:5432/openmaint db.username=postgres
db.password=password
db.admin.username=postgres
db.admin.password=password

  1. Create a new database “openmaint” in your PostgreSQL using pgAdmin
  2. Run following commands through Query Tool of pgAdmin on database openmaint

    CREATE SCHEMA gis;
    SET SEARCH_PATH TO gis, public;
    Import and run script …\PostgreSQL\10\share\contrib\postgis-2.4\postgis.sql
    Import and run script …\PostgreSQL\10\share\contrib\postgis-2.4\spatial_ref_sys.sql
    ALTER DATABASE openmaint SET search_path="$user", public, gis;

  3. Now import the demo dump “openmaint_demo.dump”
    I get following error message
    ================================================================
    pg_restore: connecting to database for restore
    pg_restore: creating SCHEMA “gis”
    pg_restore: [archiver (db)] Error while PROCESSING TOC:
    pg_restore: [archiver (db)] Error from TOC entry 7; 2615 14972889 SCHEMA gis postgres
    pg_restore: [archiver (db)] could not execute query: ERROR: schema “gis” already exists
    Command was: CREATE SCHEMA gis;

pg_restore: creating SCHEMA “public”
pg_restore: creating COMMENT “SCHEMA public”
pg_restore: creating SCHEMA “quartz”
pg_restore: creating EXTENSION “plpgsql”
pg_restore: creating COMMENT “EXTENSION plpgsql”
pg_restore: creating SHELL TYPE “gis.box2d”
pg_restore: creating FUNCTION “gis.box2d_in(cstring)”
pg_restore: [archiver (db)] Error from TOC entry 726; 1255 14972927 FUNCTION box2d_in(cstring) postgres
pg_restore: [archiver (db)] could not execute query: ERROR: could not access file “$libdir/postgis-2.2”: No such file or directory
Command was: CREATE FUNCTION gis.box2d_in(cstring) RETURNS gis.box2d
LANGUAGE c IMMUTABLE STRICT
AS ‘$libdir/postgis-2.2’, ‘BOX2D_in’;

pg_restore: [archiver (db)] could not execute query: ERROR: function gis.box2d_in(cstring) does not exist
Command was: ALTER FUNCTION gis.box2d_in(cstring) OWNER TO postgres;

pg_restore: creating FUNCTION “gis.box2d_out(gis.box2d)”
pg_restore: [archiver (db)] Error from TOC entry 727; 1255 14972928 FUNCTION box2d_out(gis.box2d) postgres
pg_restore: [archiver (db)] could not execute query: ERROR: could not access file “$libdir/postgis-2.2”: No such file or directory
Command was: CREATE FUNCTION gis.box2d_out(gis.box2d) RETURNS cstring
LANGUAGE c IMMUTABLE STRICT
AS ‘$libdir/postgis-2.2’, ‘BOX2D_out’;
…
…
…

Can your technical team point me, what did I miss.

1 Like

Anyone for help here ?

the message "could not access file “$libdir/postgis-2.2” comes from the following sql command displayed in the error :

# Command was: CREATE FUNCTION gis.box2d_out(gis.box2d) RETURNS cstring 
LANGUAGE c IMMUTABLE STRICT
AS ‘$libdir/postgis-2.2’, ‘BOX2D_out’;

It seems that you pre-installed postgis v2.4 instead of 2.2

However I think (Not sure) that error such (“unable to create”, or “already created”) should be ignored (as you installed a postgis version before db restoring the openmaint backup … or else (better) … you should not pre-install postgis before importing openmaint db.

@jmkemphasized text
Thanks for reply. If you say so, let me redo complete installation by completely removing all prerequisite software postgres,postgis and anything else that I may have installed for it and test it. I will update on this tomorrow.

Sorry jmk. I tried as you mentioned but it doesn’t work not to pre-install postgis before importing dump. I have read in two of the replies of CMDBuild team in previous versions of software installation issues, (forum. cmdbuild. org/t/during-enable-gis/1723/5) and (forum. cmdbuild. org /t/errors-when-updating-certain-cards-or-creating-relations/2394/5), they say to " create a new database, create the gis schema, create the gis functions and then perform the restore of the backup.". And this is not possible unless PostGIS is pre-installed. If I do that, then while importing dump, it gives error.

I really doubt, if Technoteca technical team actually ever tested their software on Postgres 10.9 and PostGIS 2.4 as advertised in Openmaint web page openmaint. org/en/download/download, they mention PostgreSQL v 10.9 under “Best” column of section Software and Hardware requirements. They subsequently mention PostGIS v 2.4 under it as “Best” version of PotGIS to be used with PostgreSQL v 10.9. Why ? Because, when we try to import the dump carrying demo data for Openmaint, it gives same error “ERROR: could not access file “$libdir/postgis-2.2”: No such file or directory”. I opened their dump file “openmaint_demo.dump” in edit plus and found a lot of mention for phrase “$libdir/postgis-2.2” starting from line 32. That means they have hard coded it in the system. If that is so, then nothing will work.

@ Technoteca team, can you have some courtesy to clarify on this point? If you don’t want to help your users on this forum, please say you don’t want to help. At least I will stop wasting my time in installing your new version for which I have been attending your webinars, following all posts for long and have been waiting for this version. And at the end, here I am at same age old issue of installation stuck up. Can you please clarify on which prerequisite software version of Postgres, Postgis, will Openmaint 3.1.1 work in windows environment and what exact steps shall I follow? Please do mention the links from where I should download the prerequisite software. Don’t just mention the website name or page numbers of the technical manual. I have wasted my one week in installation troubleshooting and you guys just don’t bother to reply and guide your users.

And to my surprise, your new forum also does not allows to post page urls!!! Guys!! Come on ! at which age of open discussion you are at??? Open Up to the world! If you guys keep yourself restricted like this, you are bottleneck of your own growth.

Hi,

performing a manual setup with postgres and postgis is tricky, this because you have to adapt to the different versions of postgres, postgis etc and the configuration on your platform.

Most of our deployments are on linux, so we’ve developed automated procedures for this target platform (in which case setup is quite straightforward). We cannot offer at the moment fully-automated setup for windows, so you have to rely on manual setup if you need to deploy on windows (or other platforms).

Just to clarify any doubt: we have no hardcoded 2.2 postgis version; our dumps are built with a older version than the recommended one in order to support our minimum system requirements. During the setup procedure database is usually upgraded to work with postgres/postgis version installed on your actual system.

As I said before, postgis setup/upgrade may be tricky. This is the generic import procedure, which you may have to adapt to your platform and configuration:

  • install postgres, postgis;
  • create database, create gis schema;
  • import all non-gis schemas (usually those are public, quartz, sometimes also bim and shark, depending on your source dump);
  • load postgis extension in your schema; this may be done with sql scripts, or executing the CREATE EXTENSION postgis SCHEMA gis sql command;
  • import gis schema from dump: you have to import the provided dump on the existing postgis-enabled schema; this way postgis-specific function and types within dump will be discarded, and only those already present on your schema will be used; this operation will throw many warning messages, which can usually be ignored.

More about this procedure can be found in the official postgis docs; I recommend these:

regards,
CMDBuild Team

Thank you very much for the reply and clarifications. Fair enough if you say that your software installation is smoother on Linux. I will set up a new VM on my PC with Linux Ubuntu or CentOS.

If I am successful, I will share a snapshot based installation manual right from installation of Linux in VM and all pre-requsite software.

Please can you confirm me the best possible combination of versions of Postgres DB Server and PostGIS that will work and successfully run Openmaint 3.1.1 on Linux Ubuntu or CentOS.

Regards,
Devanshu

For new installation we recommend postgres 10.x and postgis 2.4.x.

You can find detailed system requirements and minimum/recommended component versions here:

http://www.openmaint.org/en/download/download

One last note: this is a free support forum. We’re happy to help out users, and we try to do so in a timely fashion, but it may take us some day to answer a question. If you’re working a time-critical business and need an immediate feedback or custom-tailored support, you should ask for commercial support https://www.tecnoteca.com/en/services/cmdbuild/cmdbuild .

regards,
CMDBuild Team

Thanks for the information. I am working to build a working demo out of the Openmaint application to show case it to a government departments here on whose projects we work. Right now it is all our efforts and investment in building the working demo.

If things goes well, there can be whole lot of commercial opportunities on way.

Regards,
Devanshu

I was able to setup Openmaint 3.1.1 on Windows 7 Pro Workstation by following your latest CMD build technical manual. There are some updates to latest manual like adding topic “3.5. CMDBuild database configuration for Windows”. It was helpful in setting up installation.

Note that, I setup three different instances with different context names of Openmaint for three different kinds of data dump files. Namely “openmaint_demo.dump”, “openmaint_empty_gis.dump” and “openmaint_empty.dump”.

For “openmaint_demo.dump”, following is the result of the import
I get following result code
Process returned exit code 0.
It seems everything gets imported without any error! I am surprised!

For “openmaint_empty_gis.dump”, following is the result of the import
I get following result code
WARNING: errors ignored on restore: 1063
Process returned exit code 1.
It seems there were some errors, but as said in new updated technical manual on page 15 in second last para from bottom, these can be ignored.

For “openmaint_empty.dump”, following is the result of the import
I get following result code
Process returned exit code 0.
It seems all went well in this import.

Here is my base software configuration:
Base OS: Windows 7 Pro 64Bit
Openmaint Files: openmaint-2.0-3.1.zip -> (Get openmaint-2.0-3.1.1.war from it)

Postgres v 9.5.19 (postgresql-9.5.19-2-windows-x64.exe)
Post GIS v 2.5.1 (postgis_2_5_pg95.exe (Downloaded from Stack Builder)
Tomcat v 8.5.47 (apache-tomcat-8.5.47-windows-x64.zip)

@devanshu.chakraborty can you please share how you install it ?
I have followed this tutorial : that i found on pine.it because this is the only one that mention detailled information on each step with postgres sql and postgis.

I try it on windows and Linux but always failled on SQL import dump ! so openmaint cannot be started in tomcat due to this error.

Regards.

@mouedarbi Sorry for delayed response.

Here is what I did to install and run it successfully on my Windows 7 Pro based workstation.
Please refer to the attached document which I have prepared while installing it on my workstation. Note that, I have used all the three database dumps; empty, empty with gis and the one with full demo data. It is all mentioned in the attached document.

I think it would be helpful to you and anyone else who is trying to use this great product for very first time. The pdf font may appear small as I exported it to pdf format from my excel file. You can zoom in to make it appear readable.

Openmaint-3.1.1-Install.pdf (875.2 KB)

Hi @devanshu.chakraborty, Thank you very much for sharing !
I have followed your instruction and was able to make it run on Windows 10.
Now i will try to make it work with SHARK and BIM server.

Regards.

1 Like