Skip to content
Snippets Groups Projects
Commit ef6f26b1 authored by Stan Hu's avatar Stan Hu
Browse files

Improve `gitlab-ctl replicate-geo-database` error messages

Users forgetting to run this command as root would not see any
helpful warning messages. Now it will say:

```
* Stopping PostgreSQL and all GitLab services
warning: geo-postgresql: unable to open supervise/ok: access denied
warning: gitaly: unable to open supervise/ok: access denied
warning: gitlab-monitor: unable to open supervise/ok: access denied
warning: gitlab-workhorse: unable to open supervise/ok: access denied
warning: logrotate: unable to open supervise/ok: access denied
warning: nginx: unable to open supervise/ok: access denied
warning: node-exporter: unable to open supervise/ok: access denied
warning: postgres-exporter: unable to open supervise/ok: access denied
warning: postgresql: unable to open supervise/ok: access denied
warning: prometheus: unable to open supervise/ok: access denied
warning: redis: unable to open supervise/ok: access denied
warning: redis-exporter: unable to open supervise/ok: access denied
warning: sidekiq: unable to open supervise/ok: access denied
warning: unicorn: unable to open supervise/ok: access denied

[ERROR] Failed to execute: gitlab-ctl stop -- be sure to run as root
```

Closes gitlab-org/gitlab-ee#2176
parent 9e2433ae
No related branches found
No related tags found
No related merge requests found
Loading
Loading
@@ -162,8 +162,9 @@ class ReplicateGeoHelpers
def run_command(cmd, live: false)
status = GitlabCtl::Util.run_command(cmd, live: live)
if status.error?
puts status.stdout
puts status.stderr
puts "[ERROR] Failed to execute: #{cmd}".color(:red)
puts "[ERROR] Failed to execute: #{cmd} -- be sure to run this command as root".color(:red)
puts
exit 1
end
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment