Skip to content

2015.8.3 salt-call runners.cloud : local variable 'access_ip' referenced before assignment #29758

Closed

Description

Hello,
I'm trying to launch the exemple inside the documentation https://docs.saltstack.com/en/latest/ref/runners/all/salt.runners.cloud.html#salt.runners.cloud.create for runners.cloud.profile:

salt-run cloud.profile prof=my_profile instances=test-instance

And I get this error :

Exception occurred in runner cloud.profile: Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/salt/client/mixins.py", line 337, in low
    data['return'] = self.functions[fun](*args, **kwargs)
  File "/usr/lib/python2.7/dist-packages/salt/runners/cloud.py", line 106, in profile
    info = client.profile(prof, instances, **kwargs)
  File "/usr/lib/python2.7/dist-packages/salt/cloud/__init__.py", line 341, in profile
    mapper.run_profile(profile, names, vm_overrides=vm_overrides)
  File "/usr/lib/python2.7/dist-packages/salt/cloud/__init__.py", line 1403, in run_profile
    ret[name] = self.create(vm_)
  File "/usr/lib/python2.7/dist-packages/salt/cloud/__init__.py", line 1249, in create
    output = self.clouds[func](vm_)
  File "/usr/lib/python2.7/dist-packages/salt/cloud/clouds/nova.py", line 753, in create
    'wait_for_ip_interval', vm_, __opts__, default=10),
  File "/usr/lib/python2.7/dist-packages/salt/utils/cloud.py", line 2240, in wait_for_ip
    data = update_callback(*update_args, **update_kwargs)
  File "/usr/lib/python2.7/dist-packages/salt/cloud/clouds/nova.py", line 732, in __query_node_data
    data.public_ips = access_ip
UnboundLocalError: local variable 'access_ip' referenced before assignment

The VM is created inside my cloud provider, the minion key is accepted inside my salt-master. But after connecting to the VM, salt-minion is not installed.
When I try with salt-cloud, I got the same error and problem.

After downgrading to 2015.8.1 (my previous version), it's working. So this is a regression inside 2015.8.3.

Thanks for your support and your product,
Damien DESMARETS

Activity

  1. added
    bug
    severity-medium
    Regression
    P3
    RIoT
    on Dec 17, 2015
  2. added this to the Approved milestone on Dec 17, 2015
  3. jfindlay commented on Dec 17, 2015

    @jfindlay
    Contributor

    @zaide, thanks for the report.

  4. rallytime commented on Jan 5, 2016

    @rallytime
    Contributor

    @gtmanfred You might have some thoughts on this. There isn't a default set for access_ip in the Nova driver. I'm not familiar enough with this driver to know what that default should be, though maybe that is a simple fix for you?

  5. gtmanfred commented on Jan 5, 2016

    @gtmanfred
    Contributor

    Can you check and see if it works from the 2015.8 branch in git?

    I found a bug in one thing that wasn't setting the access_ip correctly, and fixed it a bit ago.

    I believe this might fix this issue already.

  6. rallytime commented on Jan 5, 2016

    @rallytime
    Contributor

    @zaide Can you test this from the HEAD of the 2015.8 branch?

  7. rallytime commented on Jan 12, 2016

    @rallytime
    Contributor

    Actually, @gtmanfred I was just looking over the code at the HEAD of 2015.8, and access_ip is indeed not set to anything by default. It gets set in a lot of places hidden under various if statements. I'm not sure if that is because there is something missing from @zaide's config files, or if something is getting missed for his setup. We should at the very least clean up that stacktrace and provide a helpful error if we've made it that far without an access_ip.

    @zaide Can you also post your relevant profile/provider configurations (with sensitive data removed)? That will aide in the diagnosis of this bug.

  8. gtmanfred commented on Jan 19, 2016

    @gtmanfred
    Contributor

    We can assign it to a None value, but it should follow one of the branches that assignes access_ip to something everywhere.

    I can take a look at some point this week and see if I can figure out a better way to do it (a lot of this stuff is going to be changed when i finish the rewrite using shade as well.

  9. gtmanfred commented on Feb 12, 2016

    @gtmanfred
    Contributor

    Can you check if this pr fixes your problems #31120 ?

    Thanks
    Daniel

  10. stale commented on Mar 23, 2018

    @stale

    This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

    If this issue is closed prematurely, please leave a comment and we will gladly reopen the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3RIoTRegressionSalt-Cloudbugseverity-mediumstale

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions