mapcomm / mapping.community-carto_install_doc

Detailed instructions for install process of CartoDB on CentOS7
http://mapping.community
7 stars 3 forks source link

Cannot create groups #11

Open kidwellj opened 7 years ago

kidwellj commented 7 years ago

When I try to create a new group, Carto returns the following error:

PG::Error: ERROR: spiexceptions.InternalError: plpy.Error: Fatal Group API error: [Errno -2] Name or service not known

Following the docs (and a tip in the carto google group discussion), there is an instruction towards "Group support for organizations" under the News for 3.11.1 which suggests that the following steps should be taken:

Group support for organizations. Usage instructions:

  1. Update CartoDB PostgreSQL extension to the latest version (instructions).
  2. Configure metadata api credentials and timeout. You can copy org_metadata_api config from config/app_config.yml.sample into your config/app_config.yml.
  3. Trigger existing orgs configuration: RAILS_ENV=development bundle exec rake cartodb:db:configure_extension_org_metadata_api_endpoint.
  4. Trigger existing org owner role assignment: RAILS_ENV=development bundle exec rake cartodb:db:assign_org_owner_role.
  5. Increase your database pool size to 50 (10 x # threads, see next line) at config/database.yml. Sample development configuration: config/database.yml.sample
  6. From now on you must run the server in multithread mode: bundle exec thin start --threaded -p 3000 --threadpool-size 5.

These are clearly directed at a development configuration (which this is not, quite), so it's a matter of parsing out what steps haven't been integrated above!

I've tried a modified form of steps 2-4 above:

nano app_config.yml RAILS_ENV=production bundle exec rake cartodb:db:configure_extension_org_metadata_api_endpoint RAILS_ENV=production bundle exec rake cartodb:db:assign_org_owner_role

The last of these returns an error:

Updating 2 organizations
71060f22-f4dd-4005-8b0b-c62b2b8ba8eb Owner: 02d450cc-da2f-477b-8bf9-ffcc8dc0764e kidwellj       Name: birmingham-uni
92ad31e3-4f9a-498b-96f0-cd68f6f85dbf Owner: 6beff2e5-ca45-48c3-8e7e-9499a99eea96 mapcomm-admin      Name: mapping-community
[carto@CAL-P-MAP-01 cartodb]$ RAILS_ENV=production bundle exec rake cartodb:db:assign_org_owner_role
Updating 2 organizations
71060f22-f4dd-4005-8b0b-c62b2b8ba8eb Owner: 02d450cc-da2f-477b-8bf9-ffcc8dc0764e kidwellj       Name: birmingham-uni
ERROR for birmingham-uni: undefined method `setup_owner_permissions' for #<CartoDB::UserModule::DBService:0x007f085e726538>
92ad31e3-4f9a-498b-96f0-cd68f6f85dbf Owner: 6beff2e5-ca45-48c3-8e7e-9499a99eea96 mapcomm-admin      Name: mapping-community
ERROR for mapping-community: undefined method `setup_owner_permissions' for #<CartoDB::UserModule::DBService:0x007f085e702688>

...and then when I retry group creation I get a new error in the browser:

spiexceptions.ExternalRoutineException: plpy.Error: Fatal Group API error:

The production log file gives me:

Started POST "/user/mapcomm-admin/api/v1/organization/92ad31e3-4f9a-498b-96f0-cd68f6f85dbf/groups" for 147.188.129.99 at 2017-05-10 21:14:40 +0100
Processing by Carto::Api::GroupsController#create as JSON
  Parameters: {"display_name"=>"Church of England", "user_domain"=>"mapcomm-admin", "organization_id"=>"92ad31e3-4f9a-498b-96f0-cd68f6f85dbf"}
Completed 422 Unprocessable Entity in 13.9ms (Views: 0.1ms | Models: 0.0ms)

Now I'm stuck.

oskardolch commented 6 years ago

I spent about 3 days on this problem. After all, I am not sure whether executing assign_org_owner_role is needed at all. It looks like the most important was to run the service as threaded with thin start. But if it is not sufficient, then edit cartodb/lib/tasks/db_maintenance.rake, find the function assign_org_owner_role and replace the setup_owner_permissions with grant_admin_permissions. Then it should start working.