Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Duplicate declaration of lag configuration in a recipe is giving NoMethodError: undefined method `properties' for nil:NilClass #27

Closed
Jainpriyal opened this issue Aug 11, 2015 · 1 comment

Comments

@Jainpriyal
Copy link
Contributor

ISSUE:

Here in the recipe, it is using the same configuration twice but the chef run is throwing error: NoMethodError: undefined method `properties' for nil:NilClass which is incorrect

Description

[root@workstation cookbooks]# cat netdev/recipes/simple.rb 
netdev_lag "ae1" do
links %w{ ge-0/0/1 ge-0/0/2}
action :create
end

netdev_lag "ae1" do
links %w{ ge-0/0/1 ge-0/0/2}
action :create
end

root@router% /opt/sdk/chef/bin/ruby /opt/sdk/chef/bin/chef-client -c /config/chef/client.rb
[2015-07-22T10:38:37+05:30] INFO: Forking chef instance to converge...
Starting Chef Client, version 11.10.4
[2015-07-22T10:38:38+05:30] INFO: *** Chef 11.10.4 ***
[2015-07-22T10:38:38+05:30] INFO: Chef-client pid: 24938
[2015-07-22T10:38:43+05:30] INFO: Run List is [recipe[netdev::simple]]
[2015-07-22T10:38:43+05:30] INFO: Run List expands to [netdev::simple]
[2015-07-22T10:38:43+05:30] INFO: Starting Chef Run for tot-mx-k
[2015-07-22T10:38:43+05:30] INFO: Running start handlers
[2015-07-22T10:38:43+05:30] INFO: Start handlers complete.
[2015-07-22T10:38:43+05:30] INFO: HTTP Request Returned 404 Object Not Found:
resolving cookbooks for run list: ["netdev::simple"]
[2015-07-22T10:38:43+05:30] INFO: Loading cookbooks [netdev]
Synchronizing Cookbooks:
netdev
Compiling Cookbooks...
/var/chef/cache/cookbooks/netdev/libraries/_junos_api_client.rb:35: warning: already initialized constant KNOWN_RESOURCES
............
Converging 2 resources
Recipe: netdev::simple

netdev_lag[ae1] action create[2015-07-22T10:38:46+05:30] INFO: Processing netdev_lag[ae1] action create (netdev::simple line 1)
[2015-07-22T10:38:52+05:30] INFO: Netdev::Junos::ApiTransport: Acquired exclusive Junos configuration lock

- create link aggregation group ae1 with values: links: ["ge-0/0/1", "ge-0/0/2"]

netdev_lag[ae1] action create[2015-07-22T10:39:09+05:30] INFO: Processing netdev_lag[ae1] action create (netdev::simple line 6)

Error executing action create on resource 'netdev_lag[ae1]'
NoMethodError
undefined method `properties' for nil:NilClass

Cookbook Trace:
/var/chef/cache/cookbooks/netdev/libraries/_junos_api_client.rb:127:in block in updated_changed_properties' /var/chef/cache/cookbooks/netdev/libraries/_junos_api_client.rb:121:ineach_pair'
/var/chef/cache/cookbooks/netdev/libraries/_junos_api_client.rb:121:in updated_changed_properties' /var/chef/cache/cookbooks/netdev/libraries/provider_lag_junos.rb:73:inaction_create'

Resource Declaration:
In /var/chef/cache/cookbooks/netdev/recipes/simple.rb

6: netdev_lag "ae1" do
7: links %w{ ge-0/0/1 ge-0/0/2}
8: action :create
9: end

Compiled Resource:
Declared in /var/chef/cache/cookbooks/netdev/recipes/simple.rb:6:in `from_file'

netdev_link_aggregation_group("ae1") do
action [:create]
retries 0
retry_delay 2
lag_name "ae1"
lacp "disable"
cookbook_name "netdev"
recipe_name "simple"
links ["ge-0/0/1", "ge-0/0/2"]
end

[2015-07-22T10:39:10+05:30] INFO: Running queued delayed notifications before re-raising exception

Running handlers:
[2015-07-22T10:39:10+05:30] ERROR: Running exception handlers
[2015-07-22T10:39:10+05:30] INFO: Rolled back pending Junos candidate configuration changes

  • JunosCommitTransactionHandler
    Running handlers complete

[2015-07-22T10:39:10+05:30] ERROR: Exception handlers complete
[2015-07-22T10:39:10+05:30] FATAL: Stacktrace dumped to /var/chef/cache/chef-stacktrace.out
Chef Client failed. 1 resources updated in 32.687451191 seconds
[2015-07-22T10:39:10+05:30] ERROR: netdev_lag[ae1](netdev::simple line 6) had an error: NoMethodError: undefined method `properties' for nil:NilClass
[2015-07-22T10:39:10+05:30] FATAL: Chef::Exceptions::ChildConvergeError: Chef run process exited unsuccessfully (exit code 1)

ganeshrn pushed a commit that referenced this issue Aug 20, 2015
solving duplicate declaration, issue #27
@ganeshrn
Copy link
Contributor

@Jainpriyal Thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants