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

salt-cloud rename fails in 2015.8.5 #31059

Closed
mf-collinhayden opened this issue Feb 9, 2016 · 5 comments
Closed

salt-cloud rename fails in 2015.8.5 #31059

mf-collinhayden opened this issue Feb 9, 2016 · 5 comments
Assignees
Labels
Bug broken, incorrect, or confusing behavior fixed-pls-verify fix is linked, bug author to confirm fix P3 Priority 3 Regression The issue is a bug that breaks functionality known to work in previous releases. RIoT Relates to integration with cloud providers, hypervisors, API-based services, etc. Salt-Cloud severity-medium 3rd level, incorrect or bad functionality, confusing and lacks a work around
Milestone

Comments

@mf-collinhayden
Copy link

Hi guys,

I have a script that does a rename for the instance before creating a new one and it is failing. When I ran debug, this is what I get:

build@p-uswest-ca-saltmaster01:~$ sudo salt-cloud --loglevel=debug -a rename d-uswest-ca-db01.momentfeed.com newname=d-uswest-ca-db01.momentfeed.com-previous
Usage: salt-cloud

salt-cloud: error: no such option: --loglevel
build@p-uswest-ca-saltmaster01:~$ sudo salt-cloud --log-level=debug -a rename d-uswest-ca-db01.momentfeed.com newname=d-uswest-ca-db01.momentfeed.com-previous
[DEBUG   ] Reading configuration from /etc/salt/cloud
[DEBUG   ] Reading configuration from /etc/salt/master
[DEBUG   ] Including configuration from '/etc/salt/master.d/momentfeed_customizations_master.conf'
[DEBUG   ] Reading configuration from /etc/salt/master.d/momentfeed_customizations_master.conf
[DEBUG   ] Using cached minion ID from /etc/salt/minion_id: p-uswest-ca-saltmaster01.momentfeed.com
[DEBUG   ] Missing configuration file: /etc/salt/cloud.providers
[DEBUG   ] Including configuration from '/etc/salt/cloud.providers.d/ec2-useast-ca-public-ips.conf'
[DEBUG   ] Reading configuration from /etc/salt/cloud.providers.d/ec2-useast-ca-public-ips.conf
[DEBUG   ] Including configuration from '/etc/salt/cloud.providers.d/ec2-uswest-ca-private-ips.conf'
[DEBUG   ] Reading configuration from /etc/salt/cloud.providers.d/ec2-uswest-ca-private-ips.conf
[DEBUG   ] Missing configuration file: /etc/salt/cloud.profiles
[DEBUG   ] Including configuration from '/etc/salt/cloud.profiles.d/ec2-useast-ca-profile.conf'
[DEBUG   ] Reading configuration from /etc/salt/cloud.profiles.d/ec2-useast-ca-profile.conf
[DEBUG   ] Including configuration from '/etc/salt/cloud.profiles.d/ec2-uswest-ca-profile.conf'
[DEBUG   ] Reading configuration from /etc/salt/cloud.profiles.d/ec2-uswest-ca-profile.conf
[DEBUG   ] Configuration file path: /etc/salt/cloud
[WARNING ] Insecure logging configuration detected! Sensitive data may be logged.
[INFO    ] salt-cloud starting
[DEBUG   ] Could not LazyLoad parallels.avail_sizes
[DEBUG   ] LazyLoaded parallels.avail_locations
[DEBUG   ] LazyLoaded proxmox.avail_sizes
[DEBUG   ] Could not LazyLoad saltify.destroy
[DEBUG   ] Could not LazyLoad saltify.avail_sizes
[DEBUG   ] Could not LazyLoad saltify.avail_images
[DEBUG   ] Could not LazyLoad saltify.avail_locations
[DEBUG   ] LazyLoaded rackspace.reboot
[DEBUG   ] LazyLoaded openstack.list_locations
[DEBUG   ] LazyLoaded rackspace.list_locations
The following virtual machines are set to be actioned with "rename":
  d-uswest-ca-db01.momentfeed.com

Proceed? [N/y] y
... proceeding
[DEBUG   ] Could not LazyLoad parallels.avail_sizes
[DEBUG   ] LazyLoaded parallels.avail_locations
[DEBUG   ] LazyLoaded proxmox.avail_sizes
[DEBUG   ] Could not LazyLoad saltify.destroy
[DEBUG   ] Could not LazyLoad saltify.avail_sizes
[DEBUG   ] Could not LazyLoad saltify.avail_images
[DEBUG   ] Could not LazyLoad saltify.avail_locations
[DEBUG   ] LazyLoaded rackspace.reboot
[DEBUG   ] LazyLoaded openstack.list_locations
[DEBUG   ] LazyLoaded rackspace.list_locations
[DEBUG   ] Using AWS endpoint: ec2.us-west-1.amazonaws.com
[DEBUG   ] AWS Request: https://ec2.us-west-1.amazonaws.com/?Action=DescribeInstances&Version=2014-10-01
[DEBUG   ] Could not LazyLoad parallels.avail_sizes
[DEBUG   ] LazyLoaded parallels.avail_locations
[DEBUG   ] LazyLoaded proxmox.avail_sizes
[DEBUG   ] Could not LazyLoad saltify.destroy
[DEBUG   ] Could not LazyLoad saltify.avail_sizes
[DEBUG   ] Could not LazyLoad saltify.avail_images
[DEBUG   ] Could not LazyLoad saltify.avail_locations
[DEBUG   ] LazyLoaded rackspace.reboot
[DEBUG   ] LazyLoaded openstack.list_locations
[DEBUG   ] LazyLoaded rackspace.list_locations
[DEBUG   ] Using AWS endpoint: ec2.us-east-1.amazonaws.com
[DEBUG   ] AWS Request: https://ec2.us-east-1.amazonaws.com/?Action=DescribeInstances&Version=2014-10-01
[INFO    ] Starting new HTTPS connection (1): ec2.us-east-1.amazonaws.com
[INFO    ] Starting new HTTPS connection (1): ec2.us-west-1.amazonaws.com
[DEBUG   ] Setting read timeout to None
[DEBUG   ] Setting read timeout to None
[DEBUG   ] "GET /?Action=DescribeInstances&Version=2014-10-01 HTTP/1.1" 200 None
[DEBUG   ] AWS Response Status Code: 200
[DEBUG   ] "GET /?Action=DescribeInstances&Version=2014-10-01 HTTP/1.1" 200 None
[DEBUG   ] AWS Response Status Code: 200
[DEBUG   ] vm:p2-uswest-ca-content-arb-db01.momentfeed.com in provider:ec2 is not in name list:set(['d-uswest-ca-db01.momentfeed.com'])
[DEBUG   ] vm:p2-uswest-ca-events-db01.momentfeed.com in provider:ec2 is not in name list:set(['d-uswest-ca-db01.momentfeed.com'])
[DEBUG   ] vm:q-uswest-ca-wapp02.momentfeed.com in provider:ec2 is not in name list:set(['d-uswest-ca-db01.momentfeed.com'])
[DEBUG   ] vm:p2-uswest-ca-beanstalk03.momentfeed.com in provider:ec2 is not in name list:set(['d-uswest-ca-db01.momentfeed.com'])
[DEBUG   ] vm:q-uswest-ca-runner01.momentfeed.com in provider:ec2 is not in name list:set(['d-uswest-ca-db01.momentfeed.com'])
[DEBUG   ] vm:s-uswest-ca-wapp01.momentfeed.com in provider:ec2 is not in name list:set(['d-uswest-ca-db01.momentfeed.com'])
[DEBUG   ] vm:p2-uswest-ca-analytics-db02.momentfeed.com in provider:ec2 is not in name list:set(['d-uswest-ca-db01.momentfeed.com'])
[DEBUG   ] vm:p-uswest-ca-mobile01.momentfeed.com in provider:ec2 is not in name list:set(['d-uswest-ca-db01.momentfeed.com'])
[DEBUG   ] vm:p2-uswest-ca-runner07.momentfeed.com in provider:ec2 is not in name list:set(['d-uswest-ca-db01.momentfeed.com'])
[DEBUG   ] vm:p2-uswest-ca-web04.momentfeed.com in provider:ec2 is not in name list:set(['d-uswest-ca-db01.momentfeed.com'])
[DEBUG   ] vm:p2-uswest-ca-web01.momentfeed.com in provider:ec2 is not in name list:set(['d-uswest-ca-db01.momentfeed.com'])
[DEBUG   ] vm:q-uswest-ca-rt01.momentfeed.com in provider:ec2 is not in name list:set(['d-uswest-ca-db01.momentfeed.com'])
[ERROR   ] There was an error actioning machines: 'NoneType' object has no attribute '__getitem__'
Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/salt/cloud/cli.py", line 245, in run
    ret = mapper.do_action(names, kwargs)
  File "/usr/lib/python2.7/dist-packages/salt/cloud/__init__.py", line 1493, in do_action
    vm_name, **kws
  File "/usr/lib/python2.7/dist-packages/salt/cloud/clouds/ec2.py", line 2902, in rename
    log.info('Renaming {0} to {1}'.format(name, kwargs['newname']))
TypeError: 'NoneType' object has no attribute '__getitem__'

This was working in the prior version 2015.8.3.

Here is my OS info, I am using the official ubuntu saltstack repo:

build@p-uswest-ca-saltmaster01:~$ sudo salt --versions-report
Salt Version:
           Salt: 2015.8.5

Dependency Versions:
         Jinja2: 2.7.2
       M2Crypto: Not Installed
           Mako: 0.9.1
         PyYAML: 3.10
          PyZMQ: 14.4.0
         Python: 2.7.6 (default, Jun 22 2015, 17:58:13)
           RAET: Not Installed
        Tornado: 4.2.1
            ZMQ: 4.0.4
           cffi: Not Installed
       cherrypy: Not Installed
       dateutil: 2.4.2
          gitdb: 0.5.4
      gitpython: 0.3.2 RC1
          ioflo: Not Installed
        libgit2: Not Installed
        libnacl: Not Installed
   msgpack-pure: Not Installed
 msgpack-python: 0.3.0
   mysql-python: 1.2.3
      pycparser: Not Installed
       pycrypto: 2.6.1
         pygit2: Not Installed
   python-gnupg: Not Installed
          smmap: 0.8.2
        timelib: Not Installed

System Versions:
           dist: Ubuntu 14.04 trusty
        machine: x86_64
        release: 3.13.0-40-generic
         system: Ubuntu 14.04 trusty

build@p-uswest-ca-saltmaster01:~$ sudo salt-cloud --version
salt-cloud 2015.8.5 (Beryllium)
@jfindlay jfindlay added Bug broken, incorrect, or confusing behavior severity-medium 3rd level, incorrect or bad functionality, confusing and lacks a work around Salt-Cloud P3 Priority 3 RIoT Relates to integration with cloud providers, hypervisors, API-based services, etc. Regression The issue is a bug that breaks functionality known to work in previous releases. labels Feb 9, 2016
@jfindlay jfindlay added this to the Approved milestone Feb 9, 2016
@jfindlay
Copy link
Contributor

jfindlay commented Feb 9, 2016

@mf-collinhayden, thanks for reporting.

@rallytime
Copy link
Contributor

@mf-collinhayden This was caused by the change in #30217, which I have reverted in #31061. This will be fixed in the next release of salt, 2015.8.7.

Here's the output of making sure this was fixed. First, the reproduction of the bug:

# salt-cloud -a rename rallytime-test-1 newname=rallytime-test-1-rename
[INFO    ] salt-cloud starting
The following virtual machines are set to be actioned with "rename":
  rallytime-test-1

Proceed? [N/y] y
... proceeding
[ERROR   ] There was an error actioning machines: 'NoneType' object has no attribute '__getitem__'

And then successful run, after applying the branch with the reverted change:

# salt-cloud -a rename rallytime-test-1 newname=rallytime-test-1-rename
[INFO    ] salt-cloud starting
The following virtual machines are set to be actioned with "rename":
  rallytime-test-1

Proceed? [N/y] y
... proceeding
ec2-config:
    ----------
    ec2:
        ----------
        rallytime-test-1:
            None
# salt-cloud -f list_nodes ec2 | grep rally
[INFO    ] salt-cloud starting
        rallytime-test-1-rename:
                rallytime-test-1-rename

@rallytime rallytime added the fixed-pls-verify fix is linked, bug author to confirm fix label Feb 9, 2016
@rallytime rallytime modified the milestones: B 3, Approved Feb 9, 2016
@rallytime rallytime self-assigned this Feb 9, 2016
@mf-collinhayden
Copy link
Author

@rallytime Thanks much. I made the changes manually to the 2 files for now until the release, and it's working :)

@rallytime
Copy link
Contributor

@mf-collinhayden Excellent! Glad to hear that.

@rallytime
Copy link
Contributor

Since 2015.8.7 has been released officially and this is confirmed fixed, I am going to close this. Thanks again @mf-collinhayden!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug broken, incorrect, or confusing behavior fixed-pls-verify fix is linked, bug author to confirm fix P3 Priority 3 Regression The issue is a bug that breaks functionality known to work in previous releases. RIoT Relates to integration with cloud providers, hypervisors, API-based services, etc. Salt-Cloud severity-medium 3rd level, incorrect or bad functionality, confusing and lacks a work around
Projects
None yet
Development

No branches or pull requests

3 participants