error creating a new ec2 volume with ansible - amazon-ec2

I am using ansible 2.1.0. When I try to use ec2_vol to create a new volume, the error I get is 'Volume' object has not attribute 'encrypted'. The trace is:
An exception occurred during task execution. The full traceback is:
Traceback (most recent call last):
File "/tmp/ansible_QgknUu/ansible_module_ec2_vol.py", line 593, in <module>
main()
File "/tmp/ansible_QgknUu/ansible_module_ec2_vol.py", line 583, in main
volume_info = get_volume_info(volume, state)
File "/tmp/ansible_QgknUu/ansible_module_ec2_vol.py", line 454, in get_volume_info
'encrypted': volume.encrypted,
AttributeError: 'Volume' object has no attribute 'encrypted'
Has anyone else seen this?

My issue was related to the fact that my version of python boto was not compatible with the ansible version I was using. Using apt-get in Ubuntu install version 2.20, and I think I need at least 2.30. So I used pip to install boto
pip install boto
An everything is fine now.

Related

Sudden failure on pip install of awsebcli NameError: name 'platform_system' is not defined

I have a Node app that's deployed via Shippable. A few weeks ago my builds started failing without any environmental changes (10/15/19 was last successful build)
I'm deploying to Node v 6.11.5, and it's failing on awsebcli install
The CI/CD pipeline requires AWS Elastic Beanstalk CLI and back when I set this up a while ago I figured we need a specific version below to make everything work with this Node version and all
pip install --force-reinstall awsebcli==3.14.5 is the line that fails, with the error
NameError: name 'platform_system' is not defined
I guess I'm hopeful that I just need to target a different version of awsebcli but I can't seem to figure out what to do
and the full error logs...
Downloading/unpacking docker-compose>=1.21.2,<1.22.0 (from awsebcli==3.14.5)
Downloading/unpacking blessed>=1.9.5 (from awsebcli==3.14.5)
Cleaning up...
Exception:
Traceback (most recent call last):
File "/usr/lib/python2.7/dist-packages/pip/basecommand.py", line 122, in main
status = self.run(options, args)
File "/usr/lib/python2.7/dist-packages/pip/commands/install.py", line 278, in run
requirement_set.prepare_files(finder, force_root_egg_info=self.bundle, bundle=self.bundle)
File "/usr/lib/python2.7/dist-packages/pip/req.py", line 1266, in prepare_files
req_to_install.extras):
File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 2291, in requires
dm = self._dep_map
File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 2484, in _dep_map
self.__dep_map = self._compute_dependencies()
File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 2517, in _compute_dependencies
common = frozenset(reqs_for_extra(None))
File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 2514, in reqs_for_extra
if req.marker_fn(override={'extra':extra}):
File "/usr/share/python-wheels/setuptools-3.3-py2.py3-none-any.whl/_markerlib/markers.py", line 113, in marker_fn
return eval(compiled_marker, environment)
File "<environment marker>", line 1, in <module>
NameError: name 'platform_system' is not defined
setuptools-3.3 was released in 2014! Must be upgraded for sure:
pip install --upgrade setuptools

Why does Storm return 'ImportError: No module named os'?

I ran WordCountTopology example with Storm 0.8.2 but I am thrown an error as below:
'import site' failed; use -v for traceback
Traceback (most recent call last):
File "storm-0.8.2/bin/storm", line 3, in <module>
import os
ImportError: No module named os
Looks like the error is not from the code but Storm environment. Any suggestions where I could look into would be of great help. Thanks.
I just checked the script in your question that is complaining locally, its a python script. You need the python os module for this to work.
I'm not sure why its not included already can you check and see of you have it installed.

TypeError when downloading rapidsms using pip in django-tables2

I'm a total python newbie. I installed python 3.3.1 on a 32 bit windows 7 professional. I'm trying to install RapidSMS, and it should be as easy as "pip install rapidsms" and it does start the process, but it doesn't complete and I'm left with the below error message.
I've been trying to google it, but I haven't been able to find this specific problem, for the error I find fixes for people who have written the code themselves, and I haven't seen anyone mention this problem about rapidsms themselves. Since it stops in Django-tables, I wonder if I messed up that installation somehow or if there's a problem with the python version compatibility. I've used pip when installing some other software, so I don't think that's the problem.
So if anyone's encountered this error when installing pyhton packages or really have any idea what the cause might be I'd really appreciate it! (I also plan to post this in the RapidSMS mailing list when I get approved, but wanted to see if this was a more general problem that might have a fix.)
Downloading/unpacking django-tables2==0.13.0 (from rapidsms)
Running setup.py egg_info for package django-tables2
Traceback (most recent call last):
File "<string>", line 16, in <module>
File "c:\users\mhealth1\appdata\local\temp\pip-build-mhealth1\django-tables2\setup.py", line 7, in <module>
version = re.search('__version__ = "(.+?)"', f.read()).group(1)
File "C:\Python33\lib\re.py", line 161, in search
return _compile(pattern, flags).search(string)
TypeError: can't use a string pattern on a bytes-like object
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "<string>", line 16, in <module>
File "c:\users\mhealth1\appdata\local\temp\pip-build-mhealth1\django-tables2\setup.py", line 7, in <module>
version = re.search('__version__ = "(.+?)"', f.read()).group(1)
File "C:\Python33\lib\re.py", line 161, in search
return _compile(pattern, flags).search(string)
TypeError: can't use a string pattern on a bytes-like object
----------------------------------------
Command python setup.py egg_info failed with error code 1 in c:\users\mhealth1\a
ppdata\local\temp\pip-build-mhealth1\django-tables2
Storing complete log in C:\Users\mhealth1\pip\pip.log
Django-tables2 fails to install in Python3 because of the following code from line 7 of setup.py in the traceback:
version = re.search('__version__ = "(.+?)"', f.read()).group(1)
This should work if the search pattern was a bytes object. A byte literal can be created by simply pre-pending the string literal with a b like the following:
version = re.search(b'__version__ = "(.+?)"', f.read()).group(1)
This is why Python is throwing a TypeError with the message "Can't use a string pattern on a bytes-like object". The file contents are being read in as bytes.
I don't think RapidSMS currently supports Python3 yet based on its list of environments that are tested. This can be seen in the tox environments list of the project seen here, in which only Python 2.6 and 2.7 are listed: https://github.com/rapidsms/rapidsms/blob/develop/tox.ini#L2
To solve the immediate problem, you'll want to install RapidSMS in a virtual environment with Python 2.6 or 2.7. The documentation for RapidSMS describes virtual environment setup briefly here: http://www.rapidsms.org/en/develop/topics/virtualenv.html
You'll want to install Python 2.6 or 2.7 on your system and specify which Python for the virtualenv to use, using the -p or --python argument. The following is taken from the RapidSMS docs linked above, but ammended to specify using Python 2.7:
mkvirtualenv --distribute --no-site-packages rapidsms --python=python2.7

MySQL-Python with PyPy

MySQL-Python (MySQLdb) is known to work with PyPy. How do you make it work?
I tried downloading it and installing:
C:\dev\Installs\MySQL-python\MySQL-python-1.2.3>pypy setup.py install
Traceback (most recent call last):
File "app_main.py", line 51, in run_toplevel
File "setup.py", line 15, in <module>
metadata, options = get_config()
File "C:\dev\Installs\MySQL-python\MySQL-python-1.2.3\setup_windows.py", line 7, in get_config
serverKey = _winreg.OpenKey(_winreg.HKEY_LOCAL_MACHINE, options['registry_key'])
WindowsError: [Error 2] The system cannot find the file specified.
Then I tried to download the ctypes implementation which seemed to have installed ok, however trying to use it gave:
...
File "C:\pypy-1.7\site-packages\django\db\backends\mysql\base.py", line 14, in <module>
raise ImproperlyConfigured("Error loading MySQLdb module: %s" % e)
ImproperlyConfigured: Error loading MySQLdb module: Can't find a libmysqlclient
I'm at a loss at this point. How do I make it work
Regarding your second error with mysql-ctypes, the answer is that the line
ctypes.util.find_library('mysqlclient')
can't find the library on windows. Changing it to:
ctypes.util.find_library('mysqlclient.lib')
works on my system - but that only gets you to the next error (windows error 193) on my system.
you're right, the original MySQLdb is known to not work on PyPy.
I never tried to install mysql-ctypes on a windows maschine as I do not have one, but do you have libmysqlclient installed in your PATH?
If so, you may try my (sadly not yet merged) fork on https://github.com/EnTeQuAk/mysql-ctypes which has support for a bit more versions of libmysqlclient.
I had no issues with the MySQLdb package in pypy after installing it using pip.
You can find instructions for installing pip for pypy in the second section of the following link: http://doc.pypy.org/en/latest/getting-started.html#installing-pypy
Once you have pip installed, it's just a matter of running
pip install MySQL-python

Error for syncdb while installing openstack

I've seen other people say they have this error from openstack also, but I have not been able to find any kind of answer.
I followed the website http://uksysadmin.wordpress.com/2011/02/17/ for the base installation of openstack, and this seems to work correctly.
Now I'm following the website http://wiki.openstack.org/OpenStackDashboard to install openstack Dashboard and when I get to the command "tools/with_venv.sh dashboard/manage.py syncdb" I get this error:
ERROR:root:No module named local.local_settings
Traceback (most recent call last):
File "/home/harlan/horizon/openstack-dashboard/dashboard/settings.py", line 126, in <module>
from local.local_settings import *
ImportError: No module named local.local_settings
ERROR:root:No module named local.local_settings
Traceback (most recent call last):
File "/home/harlan/horizon/openstack-dashboard/dashboard/../dashboard/settings.py", line 126, in <module>
from local.local_settings import *
ImportError: No module named local.local_settings
Error: No module named horizon.dashboards.settings
I'm doing the installation on Ubuntu 11.10 Server.
It looks like it's not finding your local_settings.py file, make sure you did this step (documented on the wiki):
$ cd horizon/openstack-dashboard
$ cp local/local_settings.py.example local/local_settings.py
As an aside, the simplest way to get up and running with OpenStack is to use DevStack.

Resources