chef-server icon indicating copy to clipboard operation
chef-server copied to clipboard

chef-automate running chef-server error with chef-server-ctl grant-server-admin-permissions

Open PrajaktaPurohit opened this issue 4 years ago • 3 comments

We are using an external AWS Aurora postgres database and that is working fine except for this one command chef-server-ctl grant-server-admin-permissions, which seems to be trying to connect to the database using the local 127.0.0.1 at port 5432. Perhaps there is a bug in this command that is not using a parameter it should to find the external database. This is the command and error message

[root@chef-dev ~]# chef-server-ctl grant-server-admin-permissions test-user /hab/pkgs/chef/chef-server-ctl/14.1.0/20210225010004/vendor/bundle/gems/bundler-1.17.2/lib/bundler/rubygems_integration.rb:200: warning: constant Gem::ConfigMap is deprecated bundler: failed to load command: /hab/pkgs/chef/chef-server-ctl/14.1.0/20210225010004/omnibus-ctl/binstubs/chef-server-ctl (/hab/pkgs/chef/chef-server-ctl/14.1.0/20210225010004/omnibus-ctl/binstubs/chef-server-ctl) PG::ConnectionBad: could not connect to server: Connection refused Is the server running on host "127.0.0.1" and accepting TCP/IP connections on port 5432? /hab/pkgs/chef/chef-server-ctl/14.1.0/20210225010004/omnibus-ctl/plugins/server_admins.rb:147:in initialize' /hab/pkgs/chef/chef-server-ctl/14.1.0/20210225010004/omnibus-ctl/plugins/server_admins.rb:147:in new' /hab/pkgs/chef/chef-server-ctl/14.1.0/20210225010004/omnibus-ctl/plugins/server_admins.rb:147:in setup_erchef_db' /hab/pkgs/chef/chef-server-ctl/14.1.0/20210225010004/omnibus-ctl/plugins/server_admins.rb:34:in block in load_file' /hab/pkgs/chef/chef-server-ctl/14.1.0/20210225010004/vendor/bundle/ruby/2.6.0/bundler/gems/omnibus-ctl-c82dbb47b738/lib/omnibus-ctl.rb:204:in block in add_command_under_category' /hab/pkgs/chef/chef-server-ctl/14.1.0/20210225010004/vendor/bundle/ruby/2.6.0/bundler/gems/omnibus-ctl-c82dbb47b738/lib/omnibus-ctl.rb:747:in run' /hab/pkgs/chef/chef-server-ctl/14.1.0/20210225010004/omnibus-ctl/bin/chef-server-ctl:299:in <top (required)>' /hab/pkgs/chef/chef-server-ctl/14.1.0/20210225010004/omnibus-ctl/binstubs/chef-server-ctl:29:in load' /hab/pkgs/chef/chef-server-ctl/14.1.0/20210225010004/omnibus-ctl/binstubs/chef-server-ctl:29:in `<top (required)>'

To Reproduce

Set up an automate-installed chef infra server with an external AWS Aurora postgres database and run chef-server-ctl grant-server-admin-permissions user

Expected behavior

Command succeeds and user becomes a server admin with data stored in the external database

Actual behavior

Error message indicates attempt to talk to 127.0.0.1:5432 and command faiuls

PrajaktaPurohit avatar May 28 '21 18:05 PrajaktaPurohit

REF: https://github.com/chef/automate/issues/4285

PrajaktaPurohit avatar Jun 02 '21 02:06 PrajaktaPurohit

Any update here?

Kmaralla avatar Jun 30 '21 06:06 Kmaralla

I believe the fix for this is in https://github.com/chef/automate/issues/4285#issuecomment-996212356

btm avatar Jan 20 '22 23:01 btm