(edge case bug) backup fails if no nodes are present
Open
Nobody has claimed this yet.
Type: Bug
- Dominant language
- Ruby
- Stars
- 32
- Forks
- 28
- PR merge metrics
- No merged PRs in 30d
Description
knife.rb
log_level :info
log_location STDOUT
ssl_verify_mode :verify_none
output:
/opt/opscode/embedded/bin/knife ec backup chef_server_backup_knife_ec
Downloading organization object for xxxxxxx from https://localhost/organizations/xxxxxxx
Created /acls
Created /acls/groups
Created /acls/groups/billing-admins.json
Created /groups
Created /groups/billing-admins.json
Created /groups/admins.json
Created /clients
Created /clients/chef-webui.json
Created /clients/chef-validator.json
Created /clients/ooyala-validator.json
Created /containers
Created /containers/groups.json
Created /containers/containers.json
Created /containers/cookbook_artifacts.json
Created /containers/clients.json
Created /containers/nodes.json
Created /containers/data.json
Created /containers/cookbooks.json
Created /containers/environments.json
Created /containers/policies.json
Created /containers/policy_groups.json
Created /containers/sandboxes.json
Created /containers/roles.json
Created /cookbooks
Created /data_bags
Created /environments
Created /environments/_default.json
Created /invitations.json
Created /members.json
Created /nodes
ERROR: knife encountered an unexpected error
This may be a bug in the 'ec backup' knife command or plugin
Please collect the output of this command with the `-VV` option before filing a bug report.
Exception: NoMethodError: undefined method `can_have_child?' for nil:NilClass
debug snippet
DEBUG: Initiating GET to https://localhost/organizations/my_sandwitch/environments/_default
DEBUG: ---- HTTP Request Header Data: ----
DEBUG: Accept: application/json
DEBUG: Accept-Encoding: gzip;q=1.0,deflate;q=0.6,identity;q=0.3
DEBUG: X-OPS-SIGN: algorithm=sha1;version=1.0;
DEBUG: X-OPS-USERID: admin
DEBUG: X-OPS-TIMESTAMP: 2015-09-11T09:48:43Z
DEBUG: X-OPS-CONTENT-HASH: 2jmj7l5rSw0yVb/vlWAYkK/YBwk=
DEBUG: X-OPS-AUTHORIZATION-1: qbZ2JJ2bTzPpTRBro8UfBwErb+7YB09VYApNh5uyL82q6bYiaJZk9l6tQJzz
DEBUG: X-OPS-AUTHORIZATION-2: IM6Ck+HagKLtQXLzkjihsXN8f7TKHlmv1Wi2bNCaQT/8oOVPhCHjqBOS7wre
DEBUG: X-OPS-AUTHORIZATION-3: r5/yIZUWPxuNPLuZQDkej+NnCfwXh1snvp3SLNd/AvF6s6MIbG4EFWMxa9HP
DEBUG: X-OPS-AUTHORIZATION-4: twhaKPX11zrHOt4SA03UhpIAtMUyQka5mcNE5qlSEWFo9aUqR4/NLr8N4H0h
DEBUG: X-OPS-AUTHORIZATION-5: 0+nvBhjzJFeB4V3dulyJXyssE9wBlYA0nLTNmpi7Qv+qjf+lMJhMFRKuSahW
DEBUG: X-OPS-AUTHORIZATION-6: ENn6yevgXthRrQoj5QT/CXvFKpW0EDiQau+m+C3e2w==
DEBUG: HOST: localhost:443
DEBUG: X-Ops-Server-API-Version: 0
DEBUG: X-REMOTE-REQUEST-ID: c1706c06-8258-4934-a3b8-285cd8e3265b
DEBUG: x-ops-request-source: web
DEBUG: ---- End HTTP Request Header Data ----
DEBUG: ---- HTTP Status and Header Data: ----
DEBUG: HTTP 1.1 200 OK
DEBUG: server: openresty/1.7.10.1
DEBUG: date: Fri, 11 Sep 2015 09:48:43 GMT
DEBUG: content-type: application/json
DEBUG: transfer-encoding: chunked
DEBUG: connection: close
DEBUG: x-ops-server-api-version: {"min_version":"0","max_version":"1","request_version":"0","response_version":"0"}
DEBUG: x-ops-api-info: flavor=cs;version=12.0.0;oc_erchef=12.2.0
DEBUG: content-encoding: gzip
DEBUG: ---- End HTTP Status/Header Data ----
DEBUG: Chef::HTTP calling Chef::HTTP::RemoteRequestID#handle_response
DEBUG: Chef::HTTP calling Chef::HTTP::Authenticator#handle_response
DEBUG: Chef::HTTP calling Chef::HTTP::Decompressor#handle_response
DEBUG: decompressing gzip response
DEBUG: Chef::HTTP calling Chef::HTTP::CookieManager#handle_response
DEBUG: Chef::HTTP calling Chef::HTTP::JSONOutput#handle_response
DEBUG: Chef::HTTP calling Chef::HTTP::JSONInput#handle_response
/opt/opscode/embedded/lib/ruby/gems/2.1.0/gems/chef-12.5.0.current.0/lib/chef/chef_fs/file_system/file_system_entry.rb:86:in `exists?': undefined method `can_have_child?' for nil:NilClass (NoMethodError)
from /opt/opscode/embedded/lib/ruby/gems/2.1.0/gems/chef-12.5.0.current.0/lib/chef/chef_fs/file_system.rb:411:in `get_or_create_parent'
from /opt/opscode/embedded/lib/ruby/gems/2.1.0/gems/chef-12.5.0.current.0/lib/chef/chef_fs/file_system.rb:144:in `block in copy_to'
from /opt/opscode/embedded/lib/ruby/gems/2.1.0/gems/chef-12.5.0.current.0/lib/chef/chef_fs/parallelizer/parallel_enumerable.rb:267:in `call'
from /opt/opscode/embedded/lib/ruby/gems/2.1.0/gems/chef-12.5.0.current.0/lib/chef/chef_fs/parallelizer/parallel_enumerable.rb:267:in `process_input'
from /opt/opscode/embedded/lib/ruby/gems/2.1.0/gems/chef-12.5.0.current.0/lib/chef/chef_fs/parallelizer/parallel_enumerable.rb:257:in `process_one'
from /opt/opscode/embedded/lib/ruby/gems/2.1.0/gems/chef-12.5.0.current.0/lib/chef/chef_fs/parallelizer.rb:93:in `call'
from /opt/opscode/embedded/lib/ruby/gems/2.1.0/gems/chef-12.5.0.current.0/lib/chef/chef_fs/parallelizer.rb:93:in `worker_loop'
[root@ip-172-31-42-91 tmp]#
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce knife ec backup with no nodes using the configuration and command shown. Start with file_system_entry.rb:86, then follow file_system.rb at get_or_create_parent and copy_to; done means the backup completes without the can_have_child? error when the nodes collection is empty.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- ruby
- Domain
- cli
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100