mapmint / ansible-roles

MapMint installer
0 stars 6 forks source link

Tables management module #3

Open ablayelana opened 7 years ago

ablayelana commented 7 years ago

I installed the latest version of Mapmint successfully. However I do not have the tables management module.

gfenoy commented 7 years ago

Thanks for the feedbacks. Very nice to hear that you have correctly installed MapMint on your platform, it will be of big help for writing down the expected documentation and add the new modules to the project.

To activate the Tables and Importer modules you have to first load this inside your mmdb (it is the default name the installer is using, so it should be the name on your platform too): https://github.com/mapmint/mapmint/blob/master/template/sql/tables.sql

Once you have done that, you have to manually edit the main.cfg file and add this new key value pairs to the [mm] section:

importers=true
tables=true

In case you think this should be an option during the installation using this ansible-roles, please let us know by opening another issue on this github repository.

ablayelana commented 7 years ago

To install this version correctly, you must correct the configuration files:

/home/user/mm-install/mapmint-setup/ubuntu/dependencies/vars/main.yml


serverid: myhost.net srcdir: /home/src datadir: /var/data rootdir: /var/www/html pgvers: 9.3---------------------------------------------9.5 indicators: false lo_version: 5.2.6 --------------------------------------5.1.6

/home/user/mm-install/mapmint-setup/ubuntu/dependencies/tasks/r-cran.yml


/home/user/mm-install/mapmint-setup/ubuntu/dependencies/tasks/base-packages.yml

postgresql-9.5-postgis-2.2

gfenoy commented 7 years ago

Thanks, I feel that your last message should be another issue. Still, I will answer it here.

Many thanks for the updates, this modification has to be ported to the files you had modified.

For LibreOffice, even it is unfortunately documented nowhere, you require to run the scripts/loVersion.sh which download the page from LibreOffice official web site and parse the latest stable version available. This script should tell you in case you have to modify a file and which file it is. Please give it a try and report any issue or success using this script.

I think there were another issue that I have discovered when installing MapMint last week on various computer. Once installed, you should go in this directory mapmint-services/vector-tools-src and comment any reference to the service_yaml.o that should not be avilable due to the fact that yaml was not activated when building the ZOO-Kernel through the installer. This is my fault, cause I am use to have a ZOO-Kernel supporting the YAML format meaning that I had added those references to service_yaml.o and it never cause any issue on my side. Still, this have to be fixed. Can you please confirm that this was required.

gfenoy commented 7 years ago

If we refer to issue #1 then we can see the same modifications about the r-cran.xml file it seems.

ablayelana commented 7 years ago

Thank you M Fenoy, the issue has been corrected and I confirm that I have now all the modules. However I encounter other problems for configuring my tables

I often see this error message

× TRACE: list index out of range <type 'exceptions.IndexError'> Unable to run your python process properly. Please check the following messages : [' File "/home/src/mapmint/mapmint-services/np/service.py", line 2101, in details\n tres=pg.getTableDescription(conf,{"dataStore":{"value":conf["main"]["dbuserName"]},"table":{"value": res["name"]}},outputs0[2])\n', ' File "/home/src/mapmint/mapmint-services/datastores/postgis/pgConnection.py", line 118, in getTableDescription\n req=getDesc(db.cur,inputs["table"]["value"])\n', ' File "/home/src/mapmint/mapmint-services/datastores/postgis/pgConnection.py", line 100, in getDesc\n req="SELECT b.relname as t FROM pg_inherits, pg_class a, pg_class b WHERE inhrelid=a.oid AND inhparent=b.oid AND a.relname = \'"+tmp[0]+"\' AND a.relnamespace=(select oid from pg_namespace where nspname=\'"+tmp[1]+"\')"\n']

gfenoy commented 7 years ago

Can you please let me know when this error occur ?

ablayelana commented 7 years ago

Mapmint has been updated but unfortunately this error occur

TRACE: No JSON object could be decoded <type 'exceptions.ValueError'> Unable to run your python process properly. Please check the following messages : [' File "/home/src/mapmint/mapmint-services/np/service.py", line 2069, in details\n ldesc=json.loads(outputs0[2]["Result"]["value"])\n', ' File "/usr/lib/python2.7/json/init.py", line 338, in loads\n return _default_decoder.decode(s)\n', ' File "/usr/lib/python2.7/json/decoder.py", line 366, in decode\n obj, end = self.raw_decode(s, idx=_w(s, 0).end())\n', ' File "/usr/lib/python2.7/json/decoder.py", line 384, in raw_decode\n raise ValueError("No JSON object could be decoded")\n']

gfenoy commented 7 years ago

Please can you provide details on when does this error occurs ?

ablayelana commented 7 years ago

capture du 2017-05-18 11 24 19 capture du 2017-05-18 11 23 58

gfenoy commented 7 years ago

Thanks a lot for your feedbacks and for presenting when the error occurred.

Before being able to validate the form from the view panel you will need to provide a name (the title of your view) a clause (which can be set to true if not required) and you should also set value for both group and themes. So, your themes table should contains some element if you need to give access to the table you are currently configuring the view.

ablayelana commented 7 years ago

Hi Mr Fenoy Thanks a lot. The table mansagement runs correctly now However I encounter the same problem with the importer module When you create the importer, you receive this error occur:

×Unable to load C Library (null)

×TRACE: No JSON object could be decoded <type 'exceptions.ValueError'> Unable to run your python process properly. Please check the following messages : [' File "/home/src/mapmint/mapmint-services/np/service.py", line 2069, in details\n ldesc=json.loads(outputs0[2]["Result"]["value"])\n', ' File "/usr/lib/python2.7/json/init.py", line 338, in loads\n return _default_decoder.decode(s)\n', ' File "/usr/lib/python2.7/json/decoder.py", line 366, in decode\n obj, end = self.raw_decode(s, idx=_w(s, 0).end())\n', ' File "/usr/lib/python2.7/json/decoder.py", line 384, in raw_decode\n raise ValueError("No JSON object could be decoded")\n']

gfenoy commented 7 years ago

Hi, can you please tell me what happen when you try to run the following command from a terminal?

cd /home/src/mapmint/mapmint-services/vector-tools-src/
make

In case the make command complains about service_yaml.o, then please remove any reference to this file from the Makefile in this directory and run make commande.

ablayelana commented 7 years ago

Thank you Mr Fenoy I removed any reference service_yaml.o to this file from the Makefile and executed the make command but the error persists:

TRACE: No JSON object could be decoded <type 'exceptions.ValueError'> Unable to run your python process properly. Please check the following messages : [' File "/home/src/mapmint/mapmint-services/np/service.py", line 2069, in details\n ldesc=json.loads(outputs0[2]["Result"]["value"])\n', ' File "/usr/lib/python2.7/json/init.py", line 338, in loads\n return _default_decoder.decode(s)\n', ' File "/usr/lib/python2.7/json/decoder.py", line 366, in decode\n obj, end = self.raw_decode(s, idx=_w(s, 0).end())\n', ' File "/usr/lib/python2.7/json/decoder.py", line 384, in raw_decode\n raise ValueError("No JSON object could be decoded")\n']

ablayelana commented 7 years ago

Hello everybody !

I come to give you a solution for those who have had to encounter these kinds of error when using the tables and importers modules

Unable to run the Service. The message returned back by the Service was the following: An error occured when processing your request: column "tablename" of relation "pages" does not exist LINE 1: INSERT INTO mm_tables.pages (name,tablename,type,ofield,otyp... ^ Traceback (most recent call last): File "/home/src/mapmint/mapmint-services/np/service.py", line 3085, in insert cur.execute(req) ProgrammingError: column "tablename" of relation "pages" does not exist LINE 1: INSERT INTO mm_tables.pages (name,tablename,type,ofield,otyp... ^

Unable to run the Service. The message returned back by the Service was the following: An error occured when processing your request: column "isreference" of relation "pages" does not exist LINE 1: ...ages (name,tablename,type,ofield,otype,length,iid,isreferenc... ^ Traceback (most recent call last): File "/home/src/mapmint/mapmint-services/np/service.py", line 3085, in insert cur.execute(req) ProgrammingError: column "isreference" of relation "pages" does not exist LINE 1: ...ages (name,tablename,type,ofield,otype,length,iid,isreferenc... ^

Correct the mm_tables.pages table structure ( https://github.com/mapmint/mapmint/blob/master/template/sql/tables.sql)

CREATE TABLE mm_tables.pages(
id serial NOT NULL, name text, tablename text, type integer, ofield text, otype text, iid integer, length integer, isreference boolean, CONSTRAINT pages_pkey PRIMARY KEY (id), CONSTRAINT pages_iid_fkey FOREIGN KEY (iid) REFERENCES mm_tables.importers (id) MATCH SIMPLE ON UPDATE NO ACTION ON DELETE CASCADE, CONSTRAINT pages_type_fkey FOREIGN KEY (type) REFERENCES mm_tables.page_types (id) MATCH SIMPLE ON UPDATE NO ACTION ON DELETE CASCADE);

gfenoy commented 7 years ago

Hello, many thanks for your update, this modification has been included.

omshinde commented 7 years ago

Hello @ablayelana, @gfenoy! I got a lot of help from your previous issues while setting up the Tables module. Thank you.

I had successfully setup the Tables module but when I am trying to publish the Tables, I am not getting any output. As you mentioned in this thread, that you were able to publish the modules. Please help me with where I am getting it incorrect. The image showing View settings are according to following image.

tables_issue_1

How can I see the published tables? Regards.

ablayelana commented 7 years ago

Hi @omshinde Thank you for your feedbacks The Publish button does not work. You can see your created views through this link http://localhost/ui/public/tables

omshinde commented 7 years ago

Hi @ablayelana, Thank you for replying. Yes, I understood about the Publish button by the help of Mr. Fenoy. Thank you so much.