Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tables management module #3

Open
ablayelana opened this issue May 9, 2017 · 18 comments
Open

Tables management module #3

ablayelana opened this issue May 9, 2017 · 18 comments

Comments

@ablayelana
Copy link

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

@gfenoy
Copy link
Member

gfenoy commented May 9, 2017

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
Copy link
Author

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


  • name: Download r-cran packages
    get_url: url=https://cran.r-project.org/src/contrib/{{item}} dest={{srcdir}}/{{item}}
    with_items:
    - e1071_1.6-8.tar.gz ---------------------------- e1071_1.6-7.tar.gz
    - classInt_0.1-24.tar.gz ------------------------ classInt_0.1-23.tar.gz

  • name: Install r-cran packages
    shell: cd {{srcdir}}; R CMD INSTALL {{item}}
    with_items:
    - e1071_1.6-8.tar.gz ---------------------------- e1071_1.6-7.tar.gz
    - classInt_0.1-24.tar.gz ------------------------ classInt_0.1-23.tar.gz

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

postgresql-9.5-postgis-2.2

@gfenoy
Copy link
Member

gfenoy commented May 9, 2017

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
Copy link
Member

gfenoy commented May 9, 2017

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

@ablayelana
Copy link
Author

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
Copy link
Member

gfenoy commented May 12, 2017

Can you please let me know when this error occur ?

@ablayelana
Copy link
Author

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
Copy link
Member

gfenoy commented May 17, 2017

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

@ablayelana
Copy link
Author

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

@gfenoy
Copy link
Member

gfenoy commented May 18, 2017

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
Copy link
Author

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
Copy link
Member

gfenoy commented May 23, 2017

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
Copy link
Author

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
Copy link
Author

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
Copy link
Member

gfenoy commented May 30, 2017

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

@omshinde
Copy link

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
Copy link
Author

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
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants