geosolutions-it / geonode-generic

Generic Geonode-project based app, to be used with docker/rancher
https://waffle.io/geosolutions-it/geonode-generic
3 stars 6 forks source link

Incorrect database being written to #42

Open timlinux opened 6 years ago

timlinux commented 6 years ago

Trying to debug #41 it seems like the wrong database is used for storing django tables (and also we should check if geonode_data is actually used).

I opened a shell on the db container, became postgres user:

$ psql geonode
psql (9.6.8)
Type "help" for help.

geonode=# \d
No relations found.

When I look in the postgres db I find all the tables:

$ psql postgres
psql (9.6.8)
Type "help" for help.

postgres=# \d
                                    List of relations
 Schema |                           Name                           |   Type   |  Owner
--------+----------------------------------------------------------+----------+----------
 public | account_emailaddress                                     | table    | postgres
 public | account_emailaddress_id_seq                              | sequence | postgres
 public | account_emailconfirmation                                | table    | postgres
 public | account_emailconfirmation_id_seq                         | sequence | postgres
 public | actstream_action                                         | table    | postgres
 public | actstream_action_id_seq                                  | sequence | postgres
 public | actstream_follow                                         | table    | postgres
 public | actstream_follow_id_seq                                  | sequence | postgres
 public | agon_ratings_overallrating                               | table    | postgres
 public | agon_ratings_overallrating_id_seq                        | sequence | postgres
 public | agon_ratings_rating                                      | table    | postgres
 public | agon_ratings_rating_id_seq                               | sequence | postgres
 public | announcements_announcement                               | table    | postgres
 public | announcements_announcement_id_seq                        | sequence | postgres
 public | announcements_dismissal                                  | table    | postgres
 public | announcements_dismissal_id_seq                           | sequence | postgres
 public | auth_group                                               | table    | postgres
 public | auth_group_id_seq                                        | sequence | postgres
 public | auth_group_permissions                                   | table    | postgres
 public | auth_group_permissions_id_seq                            | sequence | postgres
 public | auth_permission                                          | table    | postgres
 public | auth_permission_id_seq                                   | sequence | postgres
 public | avatar_avatar                                            | table    | postgres
 public | avatar_avatar_id_seq                                     | sequence | postgres
 public | base_backup                                              | table    | postgres
 public | base_backup_id_seq                                       | sequence | postgres
 public | base_contactrole                                         | table    | postgres
 public | base_contactrole_id_seq                                  | sequence | postgres
 public | base_hierarchicalkeyword                                 | table    | postgres
 public | base_hierarchicalkeyword_id_seq                          | sequence | postgres
 public | base_license                                             | table    | postgres
 public | base_license_id_seq                                      | sequence | postgres
 public | base_link                                                | table    | postgres
 public | base_link_id_seq                                         | sequence | postgres
 public | base_region                                              | table    | postgres
 public | base_region_id_seq                                       | sequence | postgres
 public | base_resourcebase                                        | table    | postgres
 public | base_resourcebase_id_seq                                 | sequence | postgres
 public | base_resourcebase_regions                                | table    | postgres
 public | base_resourcebase_regions_id_seq                         | sequence | postgres
 public | base_resourcebase_tkeywords                              | table    | postgres
 public | base_resourcebase_tkeywords_id_seq                       | sequence | postgres
 public | base_restrictioncodetype                                 | table    | postgres
 public | base_restrictioncodetype_id_seq                          | sequence | postgres
 public | base_spatialrepresentationtype                           | table    | postgres
 public | base_spatialrepresentationtype_id_seq                    | sequence | postgres
 public | base_taggedcontentitem                                   | table    | postgres
 public | base_taggedcontentitem_id_seq                            | sequence | postgres
 public | base_thesaurus                                           | table    | postgres
 public | base_thesaurus_id_seq                                    | sequence | postgres
 public | base_thesauruskeyword                                    | table    | postgres
 public | base_thesauruskeyword_id_seq                             | sequence | postgres
 public | base_thesauruskeywordlabel                               | table    | postgres
 public | base_thesauruskeywordlabel_id_seq                        | sequence | postgres
 public | base_topiccategory                                       | table    | postgres
 public | base_topiccategory_id_seq                                | sequence | postgres
 public | dialogos_comment                                         | table    | postgres
 public | dialogos_comment_id_seq                                  | sequence | postgres
 public | django_admin_log                                         | table    | postgres
 public | django_admin_log_id_seq                                  | sequence | postgres
 public | django_content_type                                      | table    | postgres
 public | django_content_type_id_seq                               | sequence | postgres
 public | django_migrations                                        | table    | postgres
 public | django_migrations_id_seq                                 | sequence | postgres
 public | django_session                                           | table    | postgres
 public | django_site                                              | table    | postgres
 public | django_site_id_seq                                       | sequence | postgres
 public | documents_document                                       | table    | postgres
 public | documents_documentresourcelink                           | table    | postgres
 public | documents_documentresourcelink_id_seq                    | sequence | postgres
 public | geography_columns                                        | view     | postgres
 public | geometry_columns                                         | view     | postgres
 public | geonode_client_geonodethemecustomization                 | table    | postgres
 public | geonode_client_geonodethemecustomization_id_seq          | sequence | postgres
 public | geonode_client_geonodethemecustomization_partners        | table    | postgres

Looking at docker-compose.yml, it looks like this line is the culpret:

https://github.com/geosolutions-it/geonode-generic/blob/master/templates/geonode-generic/1/docker-compose.yml#L43

timlinux commented 6 years ago

See also #24