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

2018.3.1 Creating Windows machine in Amazon using salt-cloud fails. #47955

Closed
frogunder opened this Issue Jun 4, 2018 · 2 comments

Comments

@frogunder
Contributor

frogunder commented Jun 4, 2018

Description of Issue/Question

In 2018.3.1 when trying to create a windows machine in amazon from a linux master with salt-cloud it fails with this error:

[ERROR   ] There was a profile error: data must be bytes or None, not unicode
Traceback (most recent call last):
  File "/usr/lib/python2.7/site-packages/salt/cloud/cli.py", line 281, in run
    self.config.get('names')
  File "/usr/lib/python2.7/site-packages/salt/cloud/__init__.py", line 1454, in run_profile
    ret[name] = self.create(vm_)
  File "/usr/lib/python2.7/site-packages/salt/cloud/__init__.py", line 1284, in create
    output = self.clouds[func](vm_)
  File "/usr/lib/python2.7/site-packages/salt/cloud/clouds/ec2.py", line 2705, in create
    vm_, data, ip_address, display_ssh_output
  File "/usr/lib/python2.7/site-packages/salt/cloud/clouds/ec2.py", line 2333, in wait_for_instance
    call='action',
  File "/usr/lib/python2.7/site-packages/salt/cloud/clouds/ec2.py", line 4765, in get_password_data
    key = RSA.load_key_string(rsa_key)
  File "/usr/lib64/python2.7/site-packages/M2Crypto/RSA.py", line 412, in load_key_string
    bio = BIO.MemoryBuffer(string)
  File "/usr/lib64/python2.7/site-packages/M2Crypto/BIO.py", line 187, in __init__
    "data must be bytes or None, not %s" % (type(data).__name__, ))
TypeError: data must be bytes or None, not unicode

Setup

providers.d

amazon:
  driver: ec2
  id: xxxxx
  key: xxxxx
  securitygroup: xxxxx
  private_key: xxxxx
  keyname: xxxxx
  ssh_interface: public_ips
  ssh_username: ec2-user

profiles.d

windows:
  provider: amazon
  image: ami-50e87938
  size: m3.medium
  userdata_file: /etc/salt/windows-firewall.ps1
  win_installer: /root/Salt-Minion-2018.3.1-Py2-AMD64-Setup.exe
  win_username: Administrator
  win_password: auto

Versions Report

Salt Version:
           Salt: 2018.3.1
 
Dependency Versions:
           cffi: Not Installed
       cherrypy: Not Installed
       dateutil: Not Installed
      docker-py: Not Installed
          gitdb: Not Installed
      gitpython: Not Installed
          ioflo: Not Installed
         Jinja2: 2.7.2
        libgit2: Not Installed
        libnacl: Not Installed
       M2Crypto: 0.28.2
           Mako: Not Installed
   msgpack-pure: Not Installed
 msgpack-python: 0.5.1
   mysql-python: Not Installed
      pycparser: Not Installed
       pycrypto: 2.6.1
   pycryptodome: Not Installed
         pygit2: Not Installed
         Python: 2.7.5 (default, Apr 11 2018, 07:36:10)
   python-gnupg: Not Installed
         PyYAML: 3.11
          PyZMQ: 15.3.0
           RAET: Not Installed
          smmap: Not Installed
        timelib: Not Installed
        Tornado: 4.2.1
            ZMQ: 4.1.4
 
System Versions:
           dist: centos 7.5.1804 Core
         locale: UTF-8
        machine: x86_64
        release: 4.15.13-x86_64-linode106
         system: Linux
        version: CentOS Linux 7.5.1804 Core

@dwoz dwoz self-assigned this Jun 4, 2018

@Ch3LL Ch3LL added this to the Approved milestone Jun 5, 2018

dwoz added a commit to dwoz/salt that referenced this issue Jun 6, 2018

dwoz added a commit to dwoz/salt that referenced this issue Jun 6, 2018

dwoz added a commit to dwoz/salt that referenced this issue Jun 6, 2018

rallytime added a commit to rallytime/salt that referenced this issue Jun 6, 2018

@rallytime

This comment has been minimized.

Contributor

rallytime commented Jun 6, 2018

@frogunder This should be fixed with #47989. Can you apply that fix to your 2018.3.1 test branch (or pull down #47998) and test this again?

@frogunder

This comment has been minimized.

Contributor

frogunder commented Jun 6, 2018

It's working fine with that fix.

@rallytime rallytime closed this Jun 6, 2018

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