Salt-Cloud failing to deploy to EC2 -- "There was a profile error: encode() argument 1 must be string, not None"
Description of Issue/Question
When attempting to launch an instance into AWS EC2 via salt-cloud, using a previously working profile, all attempts fail with error:
AWS Response Status Code: 400
Error Creating
Setup
salt-cloud -p base_ec2_private SERVERNAME -l debug
/etc/salt/cloud.profiles.d/profiles.conf:
base_ec2_private:
provider: my-ec2-northeast-private-ips
script: salt_deploy_w_dns
image: ami-XXXXXXXXX
size: t2.large
subnetid: subnet-XXXXXXXXX
ssh_username: ubuntu
securitygroupid: sg-XXXXXXXXX
volumes:
- { size: 55, device: /dev/sdf }
minion:
grains:
setup: False
environment_type: qa
startup_states: highstate`
/etc/salt/cloud.providers.d/providers.conf:
my-ec2-northeast-private-ips:
#Set the location of the Salt Master
minion:
master: XXXXXXXXX
#set grains information
grains:
dom: XXXXXX
#Specify that the private IP is to be used for the script execution
ssh_interface: private_ips
#set the credientials to be used -- these are the master role credentials, which will be appended the next time we create a working Salt master
id: 'XXXXXXXX'
key: 'XXXXXXXXX'
private_key: /etc/salt/XXXX.pem
keyname: XXXXX
#specify the Salt Driver
driver: ec2
Steps to Reproduce Issue
(Include debug logs if possible and relevant.)
salt-cloud -p base_ec2_private 'SERVERNAME' -l debug
[DEBUG ] Reading configuration from /etc/salt/cloud
[DEBUG ] Reading configuration from /etc/salt/master
[DEBUG ] Including configuration from '/etc/salt/master.d/reactor.conf'
[DEBUG ] Reading configuration from /etc/salt/master.d/reactor.conf
[DEBUG ] Using cached minion ID from /etc/salt/minion_id: MASTER
[DEBUG ] Missing configuration file: /etc/salt/cloud.providers
[DEBUG ] Including configuration from '/etc/salt/cloud.providers.d/providers.conf'
[DEBUG ] Reading configuration from /etc/salt/cloud.providers.d/providers.conf
[DEBUG ] Missing configuration file: /etc/salt/cloud.profiles
[DEBUG ] Including configuration from '/etc/salt/cloud.profiles.d/profiles.conf'
[DEBUG ] Reading configuration from /etc/salt/cloud.profiles.d/profiles.conf
[DEBUG ] Including configuration from '/etc/salt/cloud.profiles.d/profiles2.conf'
[DEBUG ] Reading configuration from /etc/salt/cloud.profiles.d/profiles2.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: 'parallels' __virtual__ returned False
[DEBUG ] LazyLoaded parallels.avail_locations
[DEBUG ] LazyLoaded proxmox.avail_sizes
[DEBUG ] Could not LazyLoad saltify.destroy: 'saltify.destroy' is not available.
[DEBUG ] Could not LazyLoad saltify.avail_sizes: 'saltify.avail_sizes' is not available.
[DEBUG ] Could not LazyLoad saltify.avail_images: 'saltify.avail_images' is not available.
[DEBUG ] Could not LazyLoad saltify.avail_locations: 'saltify.avail_locations' is not available.
[DEBUG ] LazyLoaded rackspace.reboot
[DEBUG ] LazyLoaded openstack.list_locations
[DEBUG ] LazyLoaded rackspace.list_locations
[DEBUG ] Could not LazyLoad parallels.avail_sizes: 'parallels' __virtual__ returned False
[DEBUG ] LazyLoaded parallels.avail_locations
[DEBUG ] LazyLoaded proxmox.avail_sizes
[DEBUG ] Could not LazyLoad saltify.destroy: 'saltify.destroy' is not available.
[DEBUG ] Could not LazyLoad saltify.avail_sizes: 'saltify.avail_sizes' is not available.
[DEBUG ] Could not LazyLoad saltify.avail_images: 'saltify.avail_images' is not available.
[DEBUG ] Could not LazyLoad saltify.avail_locations: 'saltify.avail_locations' is not available.
[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
[DEBUG ] AWS Response Status Code: 200
[DEBUG ] LazyLoaded cloud.cache_node_list
[DEBUG ] Generating minion keys for '<SERVERNAME>'
[DEBUG ] LazyLoaded cloud.fire_event
[DEBUG ] MasterEvent PUB socket URI: /var/run/salt/master/master_event_pub.ipc
[DEBUG ] MasterEvent PULL socket URI: /var/run/salt/master/master_event_pull.ipc
[DEBUG ] Initializing new IPCClient for path: /var/run/salt/master/master_event_pull.ipc
[DEBUG ] Sending event: tag = salt/cloud/<SERVERNAME>/creating; data = {'profile': 'base_ec2_private', 'event': 'starting create', '_stamp': '2016-12-15T20:27:43.460003', 'name': '<SERVERNAME>', 'provider': 'my-ec2-northeast-private-ips:ec2'}
[INFO ] Creating Cloud VM <SERVERNAME> in us-east-1
[DEBUG ] MasterEvent PUB socket URI: /var/run/salt/master/master_event_pub.ipc
[DEBUG ] MasterEvent PULL socket URI: /var/run/salt/master/master_event_pull.ipc
[DEBUG ] Initializing new IPCClient for path: /var/run/salt/master/master_event_pull.ipc
[DEBUG ] Sending event: tag = salt/cloud/<SERVERNAME>/requesting; data = {'event': 'requesting instance', '_stamp': '2016-12-15T20:27:43.487663', 'location': 'us-east-1', 'kwargs': {'SecurityGroupId.7': 's', 'SecurityGroupId.6': '0', 'SecurityGroupId.5': '1', 'SecurityGroupId.4': '-', 'SecurityGroupId.3': 'f', 'SecurityGroupId.2': 'g', 'SecurityGroupId.1': 'd', 'SecurityGroupId.0': 'c', 'SecurityGroupId.9': '8', 'ImageId': 'ami-40d28157', 'SubnetId': 'subnet-3dd7b416', 'KeyName': 'Salt_Master_Test', 'MaxCount': 1, 'Action': 'RunInstances', 'MinCount': 1, 'SecurityGroupId.8': '6', 'InstanceType': 't2.large'}}
[DEBUG ] Using AWS endpoint: ec2.us-east-1.amazonaws.com
[DEBUG ] AWS Request: https://ec2.us-east-1.amazonaws.com/?Action=RunInstances&ImageId=ami-40d28157&InstanceType=t2.large&KeyName=MASTER&MaxCount=1&MinCount=1&SecurityGroupId.0=c&SecurityGroupId.1=d&SecurityGroupId.2=g&SecurityGroupId.3=f&SecurityGroupId.4=-&SecurityGroupId.5=1&SecurityGroupId.6=0&SecurityGroupId.7=s&SecurityGroupId.8=6&SecurityGroupId.9=8&SubnetId=subnet-XXXXXX&Version=2014-10-01
[DEBUG ] AWS Response Status Code: 400
[ERROR ] Error creating <SERVERNAME> on EC2 when trying to run the initial deployment:
encode() argument 1 must be string, not None
Traceback (most recent call last):
File "/usr/lib/python2.7/dist-packages/salt/cloud/clouds/ec2.py", line 1921, in request_instance
sigver='4')
File "/usr/lib/python2.7/dist-packages/salt/utils/aws.py", line 463, in query
result.text.encode(result.encoding)
TypeError: encode() argument 1 must be string, not None
[ERROR ] There was a profile error: encode() argument 1 must be string, not None
Traceback (most recent call last):
File "/usr/lib/python2.7/dist-packages/salt/cloud/cli.py", line 284, in run
self.config.get('names')
File "/usr/lib/python2.7/dist-packages/salt/cloud/__init__.py", line 1458, in run_profile
ret[name] = self.create(vm_)
File "/usr/lib/python2.7/dist-packages/salt/cloud/__init__.py", line 1288, in create
output = self.clouds[func](vm_)
File "/usr/lib/python2.7/dist-packages/salt/cloud/clouds/ec2.py", line 2510, in create
data, vm_ = request_instance(vm_, location)
File "/usr/lib/python2.7/dist-packages/salt/cloud/clouds/ec2.py", line 1921, in request_instance
sigver='4')
File "/usr/lib/python2.7/dist-packages/salt/utils/aws.py", line 463, in query
result.text.encode(result.encoding)
TypeError: encode() argument 1 must be string, not None
Versions Report
(Provided by running salt --versions-report. Please also mention any differences in master/minion versions.)
Salt Version:
Salt: 2016.11.1
Dependency Versions:
cffi: Not Installed
cherrypy: 3.5.0
dateutil: 2.4.2
gitdb: 0.6.4
gitpython: 1.0.1
ioflo: Not Installed
Jinja2: 2.8
libgit2: Not Installed
libnacl: Not Installed
M2Crypto: Not Installed
Mako: 1.0.3
msgpack-pure: Not Installed
msgpack-python: 0.4.6
mysql-python: Not Installed
pycparser: Not Installed
pycrypto: 2.6.1
pygit2: Not Installed
Python: 2.7.12 (default, Nov 19 2016, 06:48:10)
python-gnupg: Not Installed
PyYAML: 3.11
PyZMQ: 15.2.0
RAET: Not Installed
smmap: 0.9.0
timelib: Not Installed
Tornado: 4.2.1
ZMQ: 4.1.4
System Versions:
dist: Ubuntu 16.04 xenial
machine: x86_64
release: 4.4.0-34-generic
system: Linux
version: Ubuntu 16.04 xenial
@danbudris i believe this pr: #38183 will fix not being able to connect. can you try that and report back.
I believe this will fix the 400 error but I think we should keep this open so we do not stack trace here if someone is receiving a 400 error.
Hi, thanks for the fast response!
I've updated:
/usr/lib/python2.7/dist-packages/salt/cloud/clouds/ec2.py
With the updated config from 38183. Still experiencing the same encoding error issue as before.
Hmmm I was getting the same error you were getting when i set a securitygroupid in the config on versoin 2016.11.1 but when i removed the securitygroupid from teh config it worked.
And I also found that adding securitygroupid back into the config on the head of 2016.11 branch it also worked so i wonder if there is a different PR that fixes the issue
Just to make sure i'm tracking down the right issue can you try one more thing. If you just remove your securitygroupid does it work?
Yes, if I remove the securitygroupid from /etc/salt/cloud.profiles.d/profiles.conf it successfully deploys.
I'm going to confirm that the update from the PR took and get back to you in a moment.
K perfect! Let me know if it doesn't work and I can dive in and figure out which PR fixes it exactly.
Like I stated above though we still shouldn't be stacktracing on that encoding error when we get a 400 error so regardless we should do a better job on the error reporting there
Ok, yes, so confirmed on my test master that PR 38183 is not a fix for this issue. However, again confirmed that removing the security group allows for provisioning.
After continued testing it is confirmed that this issue persists (fails to deploy, stack trace, encoding error) even after applying pr 38183.
Thanks for re-confirming the PR does not fix the issue. I'm diving into this more right now. will update what I find. Thanks
Okay I dived a little deeper into the issue. It seems its still not working on the head of 2016.11 so my test case must have been mistaken.
But what I realized is the reason I can get it working in 2016.11.0 and not 2016.11.1 is because securitygroupid's are never set and the one i have set in my config is incorrect. And on an earlier verison of salt I am seeing a more useful error: 'Error': {'Message': 'VPC security groups may not be used for a non-VPC launch', 'Code': 'InvalidParameterCombination'}}
In other words I was legitimately receiving a 400 error. Sorry for the incorrect test case.
So if you could edit some code so we can see more information about your 400 error code.
Can you convert: result.text.encode(result.encoding) to result.text on line 463 in /usr/lib/python2.7/dist-packages/salt/utils/aws.py".
That should spit out something more useful in the logs when it states: AWS Response Text
And paste a sanitized version of the output here.
Here's the debug log. I tried it both with a SecurityGroupID and SubnetID and without a SubnetID. Same issue both times.
salt-cloud -p base_ec2_private bugCheck -l debug
[DEBUG ] Reading configuration from /etc/salt/cloud
[DEBUG ] Reading configuration from /etc/salt/master
[DEBUG ] Including configuration from '/etc/salt/master.d/reactor.conf'
[DEBUG ] Reading configuration from /etc/salt/master.d/reactor.conf
[DEBUG ] Using cached minion ID from /etc/salt/minion_id: XTUV-SALTTEST
[DEBUG ] Missing configuration file: /etc/salt/cloud.providers
[DEBUG ] Including configuration from '/etc/salt/cloud.providers.d/providers.conf'
[DEBUG ] Reading configuration from /etc/salt/cloud.providers.d/providers.conf
[DEBUG ] Missing configuration file: /etc/salt/cloud.profiles
[DEBUG ] Including configuration from '/etc/salt/cloud.profiles.d/profiles.conf'
[DEBUG ] Reading configuration from /etc/salt/cloud.profiles.d/profiles.conf
[DEBUG ] Including configuration from '/etc/salt/cloud.profiles.d/profiles2.conf'
[DEBUG ] Reading configuration from /etc/salt/cloud.profiles.d/profiles2.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: 'parallels' __virtual__ returned False
[DEBUG ] LazyLoaded parallels.avail_locations
[DEBUG ] LazyLoaded proxmox.avail_sizes
[DEBUG ] Could not LazyLoad saltify.destroy: 'saltify.destroy' is not available.
[DEBUG ] Could not LazyLoad saltify.avail_sizes: 'saltify.avail_sizes' is not available.
[DEBUG ] Could not LazyLoad saltify.avail_images: 'saltify.avail_images' is not available.
[DEBUG ] Could not LazyLoad saltify.avail_locations: 'saltify.avail_locations' is not available.
[DEBUG ] LazyLoaded rackspace.reboot
[DEBUG ] LazyLoaded openstack.list_locations
[DEBUG ] LazyLoaded rackspace.list_locations
[DEBUG ] Could not LazyLoad parallels.avail_sizes: 'parallels' __virtual__ returned False
[DEBUG ] LazyLoaded parallels.avail_locations
[DEBUG ] LazyLoaded proxmox.avail_sizes
[DEBUG ] Could not LazyLoad saltify.destroy: 'saltify.destroy' is not available.
[DEBUG ] Could not LazyLoad saltify.avail_sizes: 'saltify.avail_sizes' is not available.
[DEBUG ] Could not LazyLoad saltify.avail_images: 'saltify.avail_images' is not available.
[DEBUG ] Could not LazyLoad saltify.avail_locations: 'saltify.avail_locations' is not available.
[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
[DEBUG ] Could not LazyLoad parallels.avail_sizes: 'parallels' __virtual__ returned False
[DEBUG ] LazyLoaded parallels.avail_locations
[DEBUG ] LazyLoaded proxmox.avail_sizes
[DEBUG ] Could not LazyLoad saltify.destroy: 'saltify.destroy' is not available.
[DEBUG ] Could not LazyLoad saltify.avail_sizes: 'saltify.avail_sizes' is not available.
[DEBUG ] Could not LazyLoad saltify.avail_images: 'saltify.avail_images' is not available.
[DEBUG ] Could not LazyLoad saltify.avail_locations: 'saltify.avail_locations' is not available.
[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
[DEBUG ] AWS Response Status Code: 200
[DEBUG ] AWS Response Status Code: 200
[DEBUG ] LazyLoaded cloud.cache_node_list
[DEBUG ] LazyLoaded cloud.cache_node_list
[DEBUG ] Generating minion keys for 'bugCheck'
[DEBUG ] LazyLoaded cloud.fire_event
[DEBUG ] MasterEvent PUB socket URI: /var/run/salt/master/master_event_pub.ipc
[DEBUG ] MasterEvent PULL socket URI: /var/run/salt/master/master_event_pull.ipc
[DEBUG ] Initializing new IPCClient for path: /var/run/salt/master/master_event_pull.ipc
[DEBUG ] Sending event: tag = salt/cloud/bugCheck/creating; data = {'profile': 'base_ec2_private', 'event': 'starting create', '_stamp': '2016-12-16T18:50:46.227134', 'name': 'bugCheck', 'provider': 'my-ec2-northeast-private-ips:ec2'}
[INFO ] Creating Cloud VM bugCheck in us-east-1
[DEBUG ] MasterEvent PUB socket URI: /var/run/salt/master/master_event_pub.ipc
[DEBUG ] MasterEvent PULL socket URI: /var/run/salt/master/master_event_pull.ipc
[DEBUG ] Initializing new IPCClient for path: /var/run/salt/master/master_event_pull.ipc
[DEBUG ] Sending event: tag = salt/cloud/bugCheck/requesting; data = {'event': 'requesting instance', '_stamp': '2016-12-16T18:50:46.254419', 'location': 'us-east-1', 'kwargs': {'SecurityGroupId.7': 's', 'SecurityGroupId.6': '0', 'SecurityGroupId.5': '1', 'SecurityGroupId.4': '-', 'SecurityGroupId.3': 'f', 'SecurityGroupId.2': 'g', 'SecurityGroupId.1': 'd', 'SecurityGroupId.0': 'c', 'SecurityGroupId.9': '8', 'ImageId': 'ami-40d28157', 'SubnetId': 'subnet-XXXXXX', 'KeyName': KEYNAME', 'MaxCount': 1, 'Action': 'RunInstances', 'MinCount': 1, 'SecurityGroupId.8': '6', 'InstanceType': 't2.large'}}
[DEBUG ] Using AWS endpoint: ec2.us-east-1.amazonaws.com
[DEBUG ] AWS Request: https://ec2.us-east-1.amazonaws.com/?Action=RunInstances&ImageId=ami-40d28157&InstanceType=t2.large&KeyName=KEYNAME&MaxCount=1&MinCount=1&SecurityGroupId.0=c&SecurityGroupId.1=d&SecurityGroupId.2=g&SecurityGroupId.3=f&SecurityGroupId.4=-&SecurityGroupId.5=1&SecurityGroupId.6=0&SecurityGroupId.7=s&SecurityGroupId.8=6&SecurityGroupId.9=8&SubnetId=subnet-XXXXXXX&Version=2014-10-01
[DEBUG ] AWS Response Status Code: 400
[ERROR ] AWS Response Status Code and Error: [400 400 Client Error: Bad Request for url: https://ec2.us-east-1.amazonaws.com/?Action=RunInstances&ImageId=ami-40d28157&InstanceType=t2.large&KeyName=Salt_Master_Test&MaxCount=1&MinCount=1&SecurityGroupId.0=c&SecurityGroupId.1=d&SecurityGroupId.2=g&SecurityGroupId.3=f&SecurityGroupId.4=-&SecurityGroupId.5=1&SecurityGroupId.6=0&SecurityGroupId.7=s&SecurityGroupId.8=6&SecurityGroupId.9=8&SubnetId=subnet-XXXXXX&Version=2014-10-01] {'Errors': {'Error': {'Message': 'The parameter groupName cannot be used with the parameter subnet', 'Code': 'InvalidParameterCombination'}}, 'RequestID': 'c55d1ed2-9f2d-420e-9e02-fa57b2a0db6e'}
[ERROR ] Error requesting instance: Errors
Error: There was a profile error: Failed to deploy VM
PR here: #38316
@danbudris perfect thanks for applyig that patch. The error {'Message': 'The parameter groupName cannot be used with the parameter subnet' I believe is what we want to be concerned about.
This is a little out of my realm at this point though and not sure as to why you are getting this conflict. ping @techhat any ideas why one would get that error above refering to the groupname and subnet parameter.
I did find this on stack overflow and maybe that is related but i'm not sure. hopefully techat has some more useful insight.
Also thanks @mlalpho for the fix. That fixes the encoding issue :)
yep, just reread and doesn't like it's the whole issue if he's applied your patch. don't mind me :) just saw "error: encode() argument 1 must be string, not None" which was directly related to PR :)
yep it seems there might be two issues going on here. Oh and i just had him switch it back to the original code so we could just quickly get the real reason behind the 400 error. I didn't mean for my patch to be the solution just a workaround.but yeah looks like your pr will fix that encode error :+1:
Hi! Thanks again for being extremely responsive. I've applied #38316 just to be sure --
When launching using
securitygroupid: sg-XXXXXXXXX
In /etc/salt/cloud.profiles.d/profiles.conf
I still recieve the following 400 response:
salt-cloud -p base_ec2_test BugCheck3 -l debug
[DEBUG ] Reading configuration from /etc/salt/cloud
[DEBUG ] Reading configuration from /etc/salt/master
[DEBUG ] Including configuration from '/etc/salt/master.d/reactor.conf'
[DEBUG ] Reading configuration from /etc/salt/master.d/reactor.conf
[DEBUG ] Using cached minion ID from /etc/salt/minion_id: XTUV-SALTTEST
[DEBUG ] Missing configuration file: /etc/salt/cloud.providers
[DEBUG ] Including configuration from '/etc/salt/cloud.providers.d/providers.conf'
[DEBUG ] Reading configuration from /etc/salt/cloud.providers.d/providers.conf
[DEBUG ] Missing configuration file: /etc/salt/cloud.profiles
[DEBUG ] Including configuration from '/etc/salt/cloud.profiles.d/profiles.conf'
[DEBUG ] Reading configuration from /etc/salt/cloud.profiles.d/profiles.conf
[DEBUG ] Including configuration from '/etc/salt/cloud.profiles.d/profiles2.conf'
[DEBUG ] Reading configuration from /etc/salt/cloud.profiles.d/profiles2.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: 'parallels' __virtual__ returned False
[DEBUG ] LazyLoaded parallels.avail_locations
[DEBUG ] LazyLoaded proxmox.avail_sizes
[DEBUG ] Could not LazyLoad saltify.destroy: 'saltify.destroy' is not available.
[DEBUG ] Could not LazyLoad saltify.avail_sizes: 'saltify.avail_sizes' is not available.
[DEBUG ] Could not LazyLoad saltify.avail_images: 'saltify.avail_images' is not available.
[DEBUG ] Could not LazyLoad saltify.avail_locations: 'saltify.avail_locations' is not available.
[DEBUG ] LazyLoaded rackspace.reboot
[DEBUG ] LazyLoaded openstack.list_locations
[DEBUG ] LazyLoaded rackspace.list_locations
[DEBUG ] Could not LazyLoad parallels.avail_sizes: 'parallels' __virtual__ returned False
[DEBUG ] LazyLoaded parallels.avail_locations
[DEBUG ] LazyLoaded proxmox.avail_sizes
[DEBUG ] Could not LazyLoad saltify.destroy: 'saltify.destroy' is not available.
[DEBUG ] Could not LazyLoad saltify.avail_sizes: 'saltify.avail_sizes' is not available.
[DEBUG ] Could not LazyLoad saltify.avail_images: 'saltify.avail_images' is not available.
[DEBUG ] Could not LazyLoad saltify.avail_locations: 'saltify.avail_locations' is not available.
[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
[DEBUG ] Could not LazyLoad parallels.avail_sizes: 'parallels' __virtual__ returned False
[DEBUG ] LazyLoaded parallels.avail_locations
[DEBUG ] LazyLoaded proxmox.avail_sizes
[DEBUG ] Could not LazyLoad saltify.destroy: 'saltify.destroy' is not available.
[DEBUG ] Could not LazyLoad saltify.avail_sizes: 'saltify.avail_sizes' is not available.
[DEBUG ] Could not LazyLoad saltify.avail_images: 'saltify.avail_images' is not available.
[DEBUG ] Could not LazyLoad saltify.avail_locations: 'saltify.avail_locations' is not available.
[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
[DEBUG ] AWS Response Status Code: 200
[DEBUG ] LazyLoaded cloud.cache_node_list
[DEBUG ] AWS Response Status Code: 200
[DEBUG ] LazyLoaded cloud.cache_node_list
[DEBUG ] Generating minion keys for 'BugCheck3'
[DEBUG ] LazyLoaded cloud.fire_event
[DEBUG ] MasterEvent PUB socket URI: /var/run/salt/master/master_event_pub.ipc
[DEBUG ] MasterEvent PULL socket URI: /var/run/salt/master/master_event_pull.ipc
[DEBUG ] Initializing new IPCClient for path: /var/run/salt/master/master_event_pull.ipc
[DEBUG ] Sending event: tag = salt/cloud/BugCheck3/creating; data = {'profile': 'base_ec2_test', 'event': 'starting create', '_stamp': '2016-12-16T19:26:39.582736', 'name': 'BugCheck3', 'provider': 'my-ec2-northeast-private-ips:ec2'}
[INFO ] Creating Cloud VM BugCheck3 in us-east-1
[DEBUG ] MasterEvent PUB socket URI: /var/run/salt/master/master_event_pub.ipc
[DEBUG ] MasterEvent PULL socket URI: /var/run/salt/master/master_event_pull.ipc
[DEBUG ] Initializing new IPCClient for path: /var/run/salt/master/master_event_pull.ipc
[DEBUG ] Sending event: tag = salt/cloud/BugCheck3/requesting; data = {'event': 'requesting instance', '_stamp': '2016-12-16T19:26:39.609874', 'location': 'us-east-1', 'kwargs': {'SecurityGroupId.7': '7', 'SecurityGroupId.6': '5', 'SecurityGroupId.5': '2', 'SecurityGroupId.4': 's', 'SecurityGroupId.3': '-', 'SecurityGroupId.2': 'g', 'SecurityGroupId.1': 'd', 'SecurityGroupId.0': 'a', 'SecurityGroupId.9': '8', 'ImageId': 'ami-e13739f6', 'SubnetId': 'subnet-XXXXXX', 'KeyName': 'Salt_Master_Test', 'MaxCount': 1, 'Action': 'RunInstances', 'MinCount': 1, 'SecurityGroupId.8': '9', 'InstanceType': 't2.large'}}
[DEBUG ] Using AWS endpoint: ec2.us-east-1.amazonaws.com
[DEBUG ] AWS Request: https://ec2.us-east-1.amazonaws.com/?Action=RunInstances&ImageId=ami-e13739f6&InstanceType=t2.large&KeyName=Salt_Master_Test&MaxCount=1&MinCount=1&SecurityGroupId.0=a&SecurityGroupId.1=d&SecurityGroupId.2=g&SecurityGroupId.3=-&SecurityGroupId.4=s&SecurityGroupId.5=2&SecurityGroupId.6=5&SecurityGroupId.7=7&SecurityGroupId.8=9&SecurityGroupId.9=8&SubnetId=subnet-XXXXXX&Version=2014-10-01
[DEBUG ] AWS Response Status Code: 400
[ERROR ] AWS Response Status Code and Error: [400 400 Client Error: Bad Request for url: https://ec2.us-east-1.amazonaws.com/?Action=RunInstances&ImageId=ami-e13739f6&InstanceType=t2.large&KeyName=Salt_Master_Test&MaxCount=1&MinCount=1&SecurityGroupId.0=a&SecurityGroupId.1=d&SecurityGroupId.2=g&SecurityGroupId.3=-&SecurityGroupId.4=s&SecurityGroupId.5=2&SecurityGroupId.6=5&SecurityGroupId.7=7&SecurityGroupId.8=9&SecurityGroupId.9=8&SubnetId=subnet-XXXXXXX&Version=2014-10-01] {'Errors': {'Error': {'Message': 'The parameter groupName cannot be used with the parameter subnet', 'Code': 'InvalidParameterCombination'}}, 'RequestID': '1f601978-bc56-4b5e-990c-fc6c7c8410f6'}
[ERROR ] Error requesting instance: Errors
Error: There was a profile error: Failed to deploy VM
When deploying using securitygroup: NameOfGroup in /etc/salt/cloud.profiles.d/profiles.conf the machine is created, but without a security group:
salt-cloud -p base_ec2_test BugCheck2 -l debug
[DEBUG ] Reading configuration from /etc/salt/cloud
[DEBUG ] Reading configuration from /etc/salt/master
[DEBUG ] Including configuration from '/etc/salt/master.d/reactor.conf'
[DEBUG ] Reading configuration from /etc/salt/master.d/reactor.conf
[DEBUG ] Using cached minion ID from /etc/salt/minion_id: XTUV-SALTTEST
[DEBUG ] Missing configuration file: /etc/salt/cloud.providers
[DEBUG ] Including configuration from '/etc/salt/cloud.providers.d/providers.conf'
[DEBUG ] Reading configuration from /etc/salt/cloud.providers.d/providers.conf
[DEBUG ] Missing configuration file: /etc/salt/cloud.profiles
[DEBUG ] Including configuration from '/etc/salt/cloud.profiles.d/profiles.conf'
[DEBUG ] Reading configuration from /etc/salt/cloud.profiles.d/profiles.conf
[DEBUG ] Including configuration from '/etc/salt/cloud.profiles.d/profiles2.conf'
[DEBUG ] Reading configuration from /etc/salt/cloud.profiles.d/profiles2.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: 'parallels' __virtual__ returned False
[DEBUG ] LazyLoaded parallels.avail_locations
[DEBUG ] LazyLoaded proxmox.avail_sizes
[DEBUG ] Could not LazyLoad saltify.destroy: 'saltify.destroy' is not available.
[DEBUG ] Could not LazyLoad saltify.avail_sizes: 'saltify.avail_sizes' is not available.
[DEBUG ] Could not LazyLoad saltify.avail_images: 'saltify.avail_images' is not available.
[DEBUG ] Could not LazyLoad saltify.avail_locations: 'saltify.avail_locations' is not available.
[DEBUG ] LazyLoaded rackspace.reboot
[DEBUG ] LazyLoaded openstack.list_locations
[DEBUG ] LazyLoaded rackspace.list_locations
[DEBUG ] Could not LazyLoad parallels.avail_sizes: 'parallels' __virtual__ returned False
[DEBUG ] LazyLoaded parallels.avail_locations
[DEBUG ] LazyLoaded proxmox.avail_sizes
[DEBUG ] Could not LazyLoad saltify.destroy: 'saltify.destroy' is not available.
[DEBUG ] Could not LazyLoad saltify.avail_sizes: 'saltify.avail_sizes' is not available.
[DEBUG ] Could not LazyLoad saltify.avail_images: 'saltify.avail_images' is not available.
[DEBUG ] Could not LazyLoad saltify.avail_locations: 'saltify.avail_locations' is not available.
[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
[DEBUG ] Could not LazyLoad parallels.avail_sizes: 'parallels' __virtual__ returned False
[DEBUG ] LazyLoaded parallels.avail_locations
[DEBUG ] LazyLoaded proxmox.avail_sizes
[DEBUG ] Could not LazyLoad saltify.destroy: 'saltify.destroy' is not available.
[DEBUG ] Could not LazyLoad saltify.avail_sizes: 'saltify.avail_sizes' is not available.
[DEBUG ] Could not LazyLoad saltify.avail_images: 'saltify.avail_images' is not available.
[DEBUG ] Could not LazyLoad saltify.avail_locations: 'saltify.avail_locations' is not available.
[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
[DEBUG ] AWS Response Status Code: 200
[DEBUG ] AWS Response Status Code: 200
[DEBUG ] LazyLoaded cloud.cache_node_list
[DEBUG ] LazyLoaded cloud.cache_node_list
[DEBUG ] Generating minion keys for 'BugCheck2'
[DEBUG ] LazyLoaded cloud.fire_event
[DEBUG ] MasterEvent PUB socket URI: /var/run/salt/master/master_event_pub.ipc
[DEBUG ] MasterEvent PULL socket URI: /var/run/salt/master/master_event_pull.ipc
[DEBUG ] Initializing new IPCClient for path: /var/run/salt/master/master_event_pull.ipc
[DEBUG ] Sending event: tag = salt/cloud/BugCheck2/creating; data = {'profile': 'base_ec2_test', 'event': 'starting create', '_stamp': '2016-12 -16T19:24:04.953104', 'name': 'BugCheck2', 'provider': 'my-ec2-northeast-private-ips:ec2'}
[INFO ] Creating Cloud VM BugCheck2 in us-east-1
[DEBUG ] MasterEvent PUB socket URI: /var/run/salt/master/master_event_pub.ipc
[DEBUG ] MasterEvent PULL socket URI: /var/run/salt/master/master_event_pull.ipc
[DEBUG ] Initializing new IPCClient for path: /var/run/salt/master/master_event_pull.ipc
[DEBUG ] Sending event: tag = salt/cloud/BugCheck2/requesting; data = {'event': 'requesting instance', '_stamp': '2016-12-16T19:24:04.980464', 'location': 'us-east-1', 'kwargs': {'ImageId': 'ami-e13739f6', 'SubnetId': 'subnet-XXXXXXX', 'KeyName': 'Salt_Master_Test', 'MaxCount': 1, 'Acti on': 'RunInstances', 'MinCount': 1, 'InstanceType': 't2.large'}}
[DEBUG ] Using AWS endpoint: ec2.us-east-1.amazonaws.com
[DEBUG ] AWS Request: https://ec2.us-east-1.amazonaws.com/?Action=RunInstances&ImageId=ami-e13739f6&InstanceType=t2.large&KeyName=Salt_Master_T est&MaxCount=1&MinCount=1&SubnetId=subnet-XXXXXXX&Version=2014-10-01
[DEBUG ] AWS Response Status Code: 200
[DEBUG ] MasterEvent PUB socket URI: /var/run/salt/master/master_event_pub.ipc
[DEBUG ] MasterEvent PULL socket URI: /var/run/salt/master/master_event_pull.ipc
[DEBUG ] Initializing new IPCClient for path: /var/run/salt/master/master_event_pull.ipc
[DEBUG ] Sending event: tag = salt/cloud/BugCheck2/querying; data = {'instance_id': 'i-026e04f380ce0dcfa', '_stamp': '2016-12-16T19:24:06.10545 8', 'event': 'querying instance'}
[DEBUG ] The new VM instance_id is i-026e04f380ce0dcfa
[DEBUG ] Using AWS endpoint: ec2.us-east-1.amazonaws.com
[DEBUG ] AWS Request: https://ec2.us-east-1.amazonaws.com/?Action=DescribeInstances&InstanceId.1=i-026e04f380ce0dcfa&Version=2014-10-01
[DEBUG ] AWS Response Status Code: 503
[ERROR ] AWS Response Status Code and Error: [503 503 Server Error: Service Unavailable for url: https://ec2.us-east-1.amazonaws.com/?Action=De scribeInstances&InstanceId.1=i-026e04f380ce0dcfa&Version=2014-10-01] {'Errors': {'Error': {'Message': 'The service is unavailable. Please try aga in shortly.', 'Code': 'Unavailable'}}, 'RequestID': '9f4c0fec-41cf-4e19-92ee-5265381586e8'}; Attempts remaining: 4
[DEBUG ] AWS Request: https://ec2.us-east-1.amazonaws.com/?Action=DescribeInstances&InstanceId.1=i-026e04f380ce0dcfa&Version=2014-10-01
[DEBUG ] AWS Response Status Code: 200
[DEBUG ] The query returned: [{'ownerId': '893642485598', 'groupSet': None, 'reservationId': 'r-07bdd4c9452627953', 'instancesSet': {'item': {' productCodes': None, 'vpcId': 'vpc-6ac5c70f', 'instanceId': 'i-026e04f380ce0dcfa', 'imageId': 'ami-e13739f6', 'keyName': 'Salt_Master_Test', 'cli entToken': None, 'subnetId': 'subnet-XXXXXXX', 'amiLaunchIndex': '0', 'instanceType': 't2.large', 'groupSet': {'item': {'groupName': 'default', 'groupId': 'sg-ff6c8d98'}}, 'monitoring': {'state': 'disabled'}, 'dnsName': None, 'privateIpAddress': '10.162.27.62', 'virtualizationType': 'hvm' , 'privateDnsName': 'ip-10-162-27-62.ec2.internal', 'reason': None, 'sourceDestCheck': 'true', 'blockDeviceMapping': {'item': {'deviceName': '/de v/sda1', 'ebs': {'status': 'attaching', 'deleteOnTermination': 'true', 'volumeId': 'vol-039ff285472fb963a', 'attachTime': '2016-12-16T19:24:06.00 0Z'}}}, 'placement': {'groupName': None, 'tenancy': 'default', 'availabilityZone': 'us-east-1d'}, 'instanceState': {'code': '0', 'name': 'pending '}, 'networkInterfaceSet': {'item': {'status': 'in-use', 'macAddress': '12:84:e9:b0:7e:c0', 'sourceDestCheck': 'true', 'vpcId': 'vpc-6ac5c70f', ' description': None, 'networkInterfaceId': 'eni-8d86527c', 'groupSet': {'item': {'groupName': 'default', 'groupId': 'sg-ff6c8d98'}}, 'attachment': {'status': 'attaching', 'deviceIndex': '0', 'deleteOnTermination': 'true', 'attachmentId': 'eni-attach-3b88cbb8', 'attachTime': '2016-12-16T19:2 4:06.000Z'}, 'subnetId': 'subnet-XXXXXXX', 'ownerId': '893642485598', 'privateIpAddressesSet': {'item': {'primary': 'true', 'privateIpAddress': '10.162.27.62'}}, 'privateIpAddress': '10.162.27.62'}}, 'ebsOptimized': 'false', 'launchTime': '2016-12-16T19:24:06.000Z', 'architecture': 'x86_6 4', 'hypervisor': 'xen', 'rootDeviceType': 'ebs', 'rootDeviceName': '/dev/sda1'}}}]
[DEBUG ] Waiting for VM IP. Giving up in 00:10:00.
[DEBUG ] Using AWS endpoint: ec2.us-east-1.amazonaws.com
[DEBUG ] AWS Request: https://ec2.us-east-1.amazonaws.com/?Action=DescribeInstances&InstanceId.1=i-026e04f380ce0dcfa&Version=2014-10-01
[DEBUG ] AWS Response Status Code: 200
[DEBUG ] Returned query data: [{'ownerId': '893642485598', 'groupSet': None, 'reservationId': 'r-07bdd4c9452627953', 'instancesSet': {'item': { 'productCodes': None, 'vpcId': 'vpc-6ac5c70f', 'instanceId': 'i-026e04f380ce0dcfa', 'imageId': 'ami-e13739f6', 'keyName': 'Salt_Master_Test', 'cl ientToken': None, 'subnetId': 'subnet-XXXXXXX', 'amiLaunchIndex': '0', 'instanceType': 't2.large', 'groupSet': {'item': {'groupName': 'default', 'groupId': 'sg-ff6c8d98'}}, 'monitoring': {'state': 'disabled'}, 'dnsName': None, 'privateIpAddress': '10.162.27.62', 'virtualizationType': 'hvm ', 'privateDnsName': 'ip-10-162-27-62.ec2.internal', 'reason': None, 'sourceDestCheck': 'true', 'blockDeviceMapping': {'item': {'deviceName': '/d ev/sda1', 'ebs': {'status': 'attaching', 'deleteOnTermination': 'true', 'volumeId': 'vol-039ff285472fb963a', 'attachTime': '2016-12-16T19:24:06.0 00Z'}}}, 'placement': {'groupName': None, 'tenancy': 'default', 'availabilityZone': 'us-east-1d'}, 'instanceState': {'code': '0', 'name': 'pendin g'}, 'networkInterfaceSet': {'item': {'status': 'in-use', 'macAddress': '12:84:e9:b0:7e:c0', 'sourceDestCheck': 'true', 'vpcId': 'vpc-6ac5c70f', 'description': None, 'networkInterfaceId': 'eni-8d86527c', 'groupSet': {'item': {'groupName': 'default', 'groupId': 'sg-ff6c8d98'}}, 'attachment' : {'status': 'attaching', 'deviceIndex': '0', 'deleteOnTermination': 'true', 'attachmentId': 'eni-attach-3b88cbb8', 'attachTime': '2016-12-16T19: 24:06.000Z'}, 'subnetId': 'subnet-XXXXXXX', 'ownerId': '893642485598', 'privateIpAddressesSet': {'item': {'primary': 'true', 'privateIpAddress': '10.162.27.62'}}, 'privateIpAddress': '10.162.27.62'}}, 'ebsOptimized': 'false', 'launchTime': '2016-12-16T19:24:06.000Z', 'architecture': 'x86_ 64', 'hypervisor': 'xen', 'rootDeviceType': 'ebs', 'rootDeviceName': '/dev/sda1'}}}]
[DEBUG ] MasterEvent PUB socket URI: /var/run/salt/master/master_event_pub.ipc
[DEBUG ] MasterEvent PULL socket URI: /var/run/salt/master/master_event_pull.ipc
[DEBUG ] Initializing new IPCClient for path: /var/run/salt/master/master_event_pull.ipc
[DEBUG ] Sending event: tag = salt/cloud/BugCheck2/tagging; data = {'_stamp': '2016-12-16T19:24:08.470266', 'event': 'setting tags', 'tags': {' Name': 'BugCheck2'}}
[DEBUG ] Tags to set for BugCheck2: {'Name': 'BugCheck2'}
[DEBUG ] Using AWS endpoint: ec2.us-east-1.amazonaws.com
[DEBUG ] AWS Request: https://ec2.us-east-1.amazonaws.com/?Action=CreateTags&ResourceId.1=i-026e04f380ce0dcfa&Tag.0.Key=Name&Tag.0.Value=BugChe ck2&Version=2014-10-01
[DEBUG ] AWS Response Status Code: 200
[DEBUG ] Using AWS endpoint: ec2.us-east-1.amazonaws.com
[DEBUG ] AWS Request: https://ec2.us-east-1.amazonaws.com/?Action=DescribeTags&Filter.1.Name=resource-id&Filter.1.Value=i-026e04f380ce0dcfa&Ver sion=2014-10-01
[DEBUG ] AWS Response Status Code: 200
[DEBUG ] Setting the tags returned: [{'resourceType': 'instance', 'resourceId': 'i-026e04f380ce0dcfa', 'value': 'BugCheck2', 'key': 'Name'}]
[INFO ] Created node BugCheck2
[INFO ] Salt node data. Private_ip: 10.162.27.62
[INFO ] Salt interface set to: 10.162.27.62
[DEBUG ] MasterEvent PUB socket URI: /var/run/salt/master/master_event_pub.ipc
[DEBUG ] MasterEvent PULL socket URI: /var/run/salt/master/master_event_pull.ipc
[DEBUG ] Initializing new IPCClient for path: /var/run/salt/master/master_event_pull.ipc
[DEBUG ] Sending event: tag = salt/cloud/BugCheck2/waiting_for_ssh; data = {'_stamp': '2016-12-16T19:24:08.736971', 'ip_address': '10.162.27.62 ', 'event': 'waiting for ssh'}
[DEBUG ] Attempting connection to host 10.162.27.62 on port 22
[DEBUG ] Caught exception in wait_for_port: timed out
[DEBUG ] Retrying connection to host 10.162.27.62 on port 22 (try 1)
[DEBUG ] Caught exception in wait_for_port: timed out
[DEBUG ] Retrying connection to host 10.162.27.62 on port 22 (try 2)
[DEBUG ] Caught exception in wait_for_port: timed out
[DEBUG ] Retrying connection to host 10.162.27.62 on port 22 (try 3)
[DEBUG ] Caught exception in wait_for_port: timed out
[DEBUG ] Retrying connection to host 10.162.27.62 on port 22 (try 4)
@danbudris thanks for trying that. do you have the patch from #38183 applied as well?
Yep, 38183 is still applied
K thanks for clarifying. yeah i've hit my limit on this one and hoping @techhat has more insight.
Thanks for all your help @Ch3LL
@Ch3LL hey, any update the issue seems to be with 2016.11.1 and 2016.11.0 and any previous version.