chef / chef/chef-server

chef-server-ctl backup fails due to missing rsync

Open
#647 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Aspect: Documentation Component: omnibus packaging Status: To be prioritized Triage: Feature Request
Dominant language
Erlang
Stars
303
Forks
211
Avg merge
1d 8h
Merged PRs (30d)
5

Description

Bug:
running chef-server-ctl on a fresh install of CentOS provided by Azure, the backup command throws an error due to missing rsync

Expectation:
backup should work without external dependencies or it should notify the user of missing dependencies

Details:

Starting Chef Server backup
WARNING:  Offline backup mode must stop your Chef server before continuing.  You can skip this message by passing a "--yes" argument. Do you wish to proceed? (y/N):
y
Bringing down the Chef Server
ok: down: bookshelf: 0s, normally up
ok: down: nginx: 1s, normally up
ok: down: oc_bifrost: 0s, normally up
ok: down: oc_id: 0s, normally up
ok: down: opscode-chef-mover: 517266s, normally up
ok: down: opscode-erchef: 0s, normally up
ok: down: opscode-expander: 0s, normally up
ok: down: opscode-expander-reindexer: 0s, normally up
ok: down: opscode-reporting: 1s, normally up
ok: down: opscode-solr4: 0s, normally up
ok: down: rabbitmq: 0s, normally up
ok: down: redis_lb: 1s, normally up
Dumping Postgresql database to /tmp/chef_backup20151201-5526-1k70r5a/chef_backup-2015-12-01-21-53-38.sql
could not change directory to "/root/temp"
ok: down: postgresql: 0s, normally up
Writing backup manifest
Creating backup tarball
tar: Removing leading `/' from member names
Bringing up the Chef Server
ok: run: bookshelf: (pid 5745) 0s
ok: run: nginx: (pid 5799) 0s
ok: run: oc_bifrost: (pid 5820) 1s
ok: run: oc_id: (pid 5874) 1s
ok: run: opscode-chef-mover: (pid 5890) 0s
ok: run: opscode-erchef: (pid 5939) 0s
ok: run: opscode-expander: (pid 5966) 0s
ok: run: opscode-expander-reindexer: (pid 5998) 1s
ok: run: opscode-reporting: (pid 6040) 0s
ok: run: opscode-solr4: (pid 6124) 0s
ok: run: postgresql: (pid 6172) 1s
ok: run: rabbitmq: (pid 6229) 1s
ok: run: redis_lb: (pid 6501) 0s
Exporting tarball to /var/opt/chef-backup
ERROR: Something wen't terribly wrong, aborting backup
ERROR: No such file or directory - rsync
Cleaning up /tmp/chef_backup20151201-5526-1k70r5a
Bringing up the Chef Server
ok: run: bookshelf: (pid 5745) 62s
ok: run: nginx: (pid 5799) 61s
ok: run: oc_bifrost: (pid 5820) 62s
ok: run: oc_id: (pid 5874) 61s
ok: run: opscode-chef-mover: (pid 5890) 60s
ok: run: opscode-erchef: (pid 5939) 60s
ok: run: opscode-expander: (pid 5966) 59s
ok: run: opscode-expander-reindexer: (pid 5998) 59s
ok: run: opscode-reporting: (pid 6040) 58s
ok: run: opscode-solr4: (pid 6124) 57s
ok: run: postgresql: (pid 6172) 57s
ok: run: rabbitmq: (pid 6229) 57s
ok: run: redis_lb: (pid 6501) 56s
/opt/opscode/embedded/lib/ruby/gems/2.1.0/gems/mixlib-shellout-2.2.0.rc.0/lib/mixlib/shellout/unix.rb:338:in `exec': No such file or directory - rsync (Errno::ENOENT)
        from /opt/opscode/embedded/lib/ruby/gems/2.1.0/gems/mixlib-shellout-2.2.0.rc.0/lib/mixlib/shellout/unix.rb:338:in `block in fork_subprocess'
        from /opt/opscode/embedded/lib/ruby/gems/2.1.0/gems/mixlib-shellout-2.2.0.rc.0/lib/mixlib/shellout/unix.rb:316:in `fork'
        from /opt/opscode/embedded/lib/ruby/gems/2.1.0/gems/mixlib-shellout-2.2.0.rc.0/lib/mixlib/shellout/unix.rb:316:in `fork_subprocess'
        from /opt/opscode/embedded/lib/ruby/gems/2.1.0/gems/mixlib-shellout-2.2.0.rc.0/lib/mixlib/shellout/unix.rb:93:in `run_command'
        from /opt/opscode/embedded/lib/ruby/gems/2.1.0/gems/mixlib-shellout-2.2.0.rc.0/lib/mixlib/shellout.rb:259:in `run_command'
        from /opt/opscode/embedded/lib/ruby/gems/2.1.0/gems/chef_backup-0.0.1.dev.4/lib/chef_backup/helpers.rb:47:in `shell_out'
        from /opt/opscode/embedded/lib/ruby/gems/2.1.0/gems/chef_backup-0.0.1.dev.4/lib/chef_backup/strategy/backup/tar.rb:173:in `export_tarball'
        from /opt/opscode/embedded/lib/ruby/gems/2.1.0/gems/chef_backup-0.0.1.dev.4/lib/chef_backup/strategy/backup/tar.rb:145:in `backup'
        from /opt/opscode/embedded/lib/ruby/gems/2.1.0/gems/chef_backup-0.0.1.dev.4/lib/chef_backup/runner.rb:28:in `backup'
        from (eval):30:in `block in load_file'
        from /opt/opscode/embedded/lib/ruby/gems/2.1.0/gems/omnibus-ctl-0.4.2/lib/omnibus-ctl.rb:190:in `call'
        from /opt/opscode/embedded/lib/ruby/gems/2.1.0/gems/omnibus-ctl-0.4.2/lib/omnibus-ctl.rb:190:in `block in add_command_under_category'
        from /opt/opscode/embedded/lib/ruby/gems/2.1.0/gems/omnibus-ctl-0.4.2/lib/omnibus-ctl.rb:661:in `run'
        from /opt/opscode/embedded/service/omnibus-ctl/chef-server-ctl:192:in `<main>'

workaround:
yum install rsync
chef-server-ctl backup -y

reference: https://github.com/chef/chef/issues/4217

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in chef_backup/strategy/backup/tar.rb at export_tarball and trace the shell_out helper in chef_backup/helpers.rb. Reproduce chef-server-ctl backup on a fresh CentOS installation without rsync, then verify the backup either completes without that external dependency or reports the missing dependency clearly.

Written by the indexing model from the issue text.

Assessment

Tech stack
postgresql, ruby
Domain
backend, cli
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.