Cloud Init Fails to Install Packages on CentOS 7 in EC2 - amazon-ec2

I have a cloud config file defined on my EC2 instance in the user data. Many of the parts/actions are run by the server properly, but package installation seems to fail invariably:
#cloud-config
package-update: true
package-upgrade: true
# ...
packages:
- puppet3
- lvm2
- btrfs-progs
# ...
I see the following in the logs:
May 20 20:23:39 cloud-init[1252]: util.py[DEBUG]: Package update failed
Traceback (most recent call last):
File "/usr/lib/python2.6/site-packages/cloudinit/config/cc_package_update_upgrade_install.py", line 74, in handle
cloud.distro.update_package_sources()
File "/usr/lib/python2.6/site-packages/cloudinit/distros/rhel.py", line 278, in update_package_sources
["makecache"], freq=PER_INSTANCE)
File "/usr/lib/python2.6/site-packages/cloudinit/helpers.py", line 197, in run
results = functor(*args)
File "/usr/lib/python2.6/site-packages/cloudinit/distros/rhel.py", line 274, in package_command
util.subp(cmd, capture=False, pipe_cat=True, close_stdin=True)
File "/usr/lib/python2.6/site-packages/cloudinit/util.py", line 1529, in subp
cmd=args)
ProcessExecutionError: Unexpected error while running command.
Command: ['yum', '-t', '-y', 'makecache']
Exit code: 1
Reason: -
Stdout: ''
Stderr: ''
May 20 20:23:39 cloud-init[1252]: amazon.py[DEBUG]: Upgrade level: security
May 20 20:23:39 cloud-init[1252]: util.py[DEBUG]: Running command ['yum', '-t', '-y', '--exclude=kernel', '--exclude=nvidia*', '--exclude=cudatoolkit', '--security', '--sec-severity=critical', '--sec-severity=important', 'upgrade'] with allowed return codes [0] (shell=False, capture=False)
May 20 20:23:52 cloud-init[1252]: util.py[WARNING]: Package upgrade failed
May 20 20:23:52 cloud-init[1252]: util.py[DEBUG]: Package upgrade failed
Traceback (most recent call last):
File "/usr/lib/python2.6/site-packages/cloudinit/config/cc_package_update_upgrade_install.py", line 81, in handle
cloud.distro.upgrade_packages(upgrade_level, upgrade_exclude)
File "/usr/lib/python2.6/site-packages/cloudinit/distros/amazon.py", line 50, in upgrade_packages
return self.package_command('upgrade', args=args)
File "/usr/lib/python2.6/site-packages/cloudinit/distros/rhel.py", line 274, in package_command
util.subp(cmd, capture=False, pipe_cat=True, close_stdin=True)
File "/usr/lib/python2.6/site-packages/cloudinit/util.py", line 1529, in subp
cmd=args)
ProcessExecutionError: Unexpected error while running command.
Command: ['yum', '-t', '-y', '--exclude=kernel', '--exclude=nvidia*', '--exclude=cudatoolkit', '--security', '--sec-severity=critical', '--sec-severity=important', 'upgrade']
Exit code: 1
Reason: -
Stdout: ''
Stderr: ''
May 20 20:23:52 cloud-init[1252]: util.py[DEBUG]: Running command ['yum', '-t', '-y', 'install', 'puppet3', 'lvm2', 'btrfs-progs'] with allowed return codes [0] (shell=False, capture=False)
May 20 20:24:03 cloud-init[1252]: util.py[WARNING]: Failed to install packages: ['puppet3', 'lvm2', 'btrfs-progs']
May 20 20:24:03 cloud-init[1252]: util.py[DEBUG]: Failed to install packages: ['puppet3', 'lvm2', 'btrfs-progs']
Traceback (most recent call last):
File "/usr/lib/python2.6/site-packages/cloudinit/config/cc_package_update_upgrade_install.py", line 88, in handle
cloud.distro.install_packages(pkglist)
File "/usr/lib/python2.6/site-packages/cloudinit/distros/rhel.py", line 70, in install_packages
self.package_command('install', pkgs=pkglist)
File "/usr/lib/python2.6/site-packages/cloudinit/distros/rhel.py", line 274, in package_command
util.subp(cmd, capture=False, pipe_cat=True, close_stdin=True)
File "/usr/lib/python2.6/site-packages/cloudinit/util.py", line 1529, in subp
cmd=args)
ProcessExecutionError: Unexpected error while running command.
Command: ['yum', '-t', '-y', 'install', 'puppet3', 'lvm2', 'btrfs-progs']
Exit code: 1
Reason: -
Stdout: ''
Stderr: ''
May 20 20:24:03 cloud-init[1252]: cc_package_update_upgrade_install.py[WARNING]: 3 failed with exceptions, re-raising the last one
May 20 20:24:03 cloud-init[1252]: util.py[WARNING]: Running package-update-upgrade-install (<module 'cloudinit.config.cc_package_update_upgrade_install' from '/usr/lib/python2.6/site-packages/cloudinit/config/cc_package_update_upgrade_install.pyc'>) failed
May 20 20:24:03 cloud-init[1252]: util.py[DEBUG]: Running package-update-upgrade-install (<module 'cloudinit.config.cc_package_update_upgrade_install' from '/usr/lib/python2.6/site-packages/cloudinit/config/cc_package_update_upgrade_install.pyc'>) failed
Traceback (most recent call last):
File "/usr/lib/python2.6/site-packages/cloudinit/stages.py", line 553, in _run_modules
cc.run(run_name, mod.handle, func_args, freq=freq)
File "/usr/lib/python2.6/site-packages/cloudinit/cloud.py", line 63, in run
return self._runners.run(name, functor, args, freq, clear_on_fail)
File "/usr/lib/python2.6/site-packages/cloudinit/helpers.py", line 197, in run
results = functor(*args)
File "/usr/lib/python2.6/site-packages/cloudinit/config/cc_package_update_upgrade_install.py", line 111, in handle
raise errors[-1]
ProcessExecutionError: Unexpected error while running command.
Command: ['yum', '-t', '-y', 'install', 'puppet3', 'lvm2', 'btrfs-progs']
Exit code: 1
Reason: -
Stdout: ''
Stderr: ''
When I actually run the command yum -t -y install puppet3 lvm2 btrfs-progs as root, it just runs fine, but Cloud Init is failing to run it on its own.
Is there something I'm doing wrong here?

Evidently there was a bug fixed with later versions of the image. If this is happening to you, it may be a legitimate bug in Cloud-Init or your servers implementation of it. A package upgrade may fix the problem, also an update to the image will fix it globally.

Related

Why is pipenv failing to install dependencies in production environment but not locally?

So I attempting to debug a deployment on AWS EB -> Elastic BeanStalk Django Error in Pipfile
And it seems like the issue is being caused by pipenv
error Command /bin/sh -c /usr/bin/python3.8 -m pipenv install --skip-lock
However, when I run that command locally it works fine, so I dont know what to do to fix this or investigate further on the cause of the issue.
My pipfile is:
[[source]]
name = "pypi"
url = "https://pypi.org/simple"
verify_ssl = true
[dev-packages]
[packages]
appdirs = "==1.4.4"
asgiref = "==3.3.1"
"backports.entry-points-selectable" = "==1.1.0"
certifi = "==2020.11.8"
chardet = "==3.0.4"
distlib = "==0.3.1"
django-cors-headers = "==3.6.0"
djangorestframework = "==3.12.2"
filelock = "==3.0.12"
idna = "==2.10"
pipenv = "==2020.8.13"
platformdirs = "==2.2.0"
pytz = "==2020.4"
requests = "==2.25.0"
six = "==1.15.0"
sqlparse = "==0.4.1"
stripe = "==2.55.1"
urllib3 = "==1.26.2"
virtualenv = "==20.7.2"
virtualenv-clone = "==0.5.6"
Django = "==3.0.8"
Pillow = "==8.0.1"
[requires]
python_version = "3.8"
And the full error log is:
----------------------------------------
/var/log/eb-engine.log
----------------------------------------
Downloading Pillow-8.0.1-cp38-cp38-manylinux1_x86_64.whl (2.2 MB)
Collecting pipenv==2020.11.15
Downloading pipenv-2020.11.15-py2.py3-none-any.whl (3.9 MB)
Collecting pytz==2020.4
Downloading pytz-2020.4-py2.py3-none-any.whl (509 kB)
Collecting requests==2.25.0
Downloading requests-2.25.0-py2.py3-none-any.whl (61 kB)
Collecting six==1.15.0
Downloading six-1.15.0-py2.py3-none-any.whl (10 kB)
Collecting sqlparse==0.4.1
Downloading sqlparse-0.4.1-py3-none-any.whl (42 kB)
Collecting stripe==2.55.1
Downloading stripe-2.55.1-py2.py3-none-any.whl (204 kB)
Collecting urllib3==1.26.2
Downloading urllib3-1.26.2-py2.py3-none-any.whl (136 kB)
Collecting virtualenv==20.2.1
Downloading virtualenv-20.2.1-py2.py3-none-any.whl (4.9 MB)
Collecting virtualenv-clone==0.5.4
Downloading virtualenv_clone-0.5.4-py2.py3-none-any.whl (6.6 kB)
Requirement already satisfied: pip>=18.0 in /var/app/venv/staging-LQM1lest/lib/python3.8/site-packages (from pipenv==2020.11.15->-r requirements.txt (line 12)) (21.1.3)
Requirement already satisfied: setuptools>=36.2.1 in /var/app/venv/staging-LQM1lest/lib/python3.8/site-packages (from pipenv==2020.11.15->-r requirements.txt (line 12)) (57.1.0)
Installing collected packages: urllib3, sqlparse, six, pytz, idna, filelock, distlib, chardet, certifi, asgiref, appdirs, virtualenv-clone, virtualenv, requests, Django, stripe, pipenv, Pillow, djangorestframework, django-cors-headers
Successfully installed Django-3.0.8 Pillow-8.0.1 appdirs-1.4.4 asgiref-3.3.1 certifi-2020.11.8 chardet-3.0.4 distlib-0.3.1 django-cors-headers-3.6.0 djangorestframework-3.12.2 filelock-3.0.12 idna-2.10 pipenv-2020.11.15 pytz-2020.4 requests-2.25.0 six-1.15.0 sqlparse-0.4.1 stripe-2.55.1 urllib3-1.26.2 virtualenv-20.2.1 virtualenv-clone-0.5.4
2021/08/13 12:49:39.051999 [INFO] Installing dependencies with Pipfile.lock
2021/08/13 12:49:39.052013 [INFO] Running command /bin/sh -c /usr/bin/python3.8 -m pipenv install --ignore-pipfile
2021/08/13 12:49:40.248089 [INFO] Installing dependencies with Pipfile
2021/08/13 12:49:40.248118 [INFO] Running command /bin/sh -c /usr/bin/python3.8 -m pipenv install --skip-lock
2021/08/13 12:49:40.976863 [INFO] Installing dependencies from Pipfile…
2021/08/13 12:49:40.976902 [ERROR] An error occurred during execution of command [app-deploy] - [InstallDependency]. Stop running the command. Error: fail to install dependencies with Pipfile file with error Command /bin/sh -c /usr/bin/python3.8 -m pipenv install --skip-lock failed with error exit status 1. Stderr:Traceback (most recent call last):
File "/usr/lib64/python3.8/runpy.py", line 194, in _run_module_as_main
return _run_code(code, main_globals, None,
File "/usr/lib64/python3.8/runpy.py", line 87, in _run_code
exec(code, run_globals)
File "/usr/local/lib/python3.8/site-packages/pipenv/__main__.py", line 5, in <module>
cli()
File "/usr/local/lib/python3.8/site-packages/pipenv/vendor/click/core.py", line 829, in __call__
return self.main(*args, **kwargs)
File "/usr/local/lib/python3.8/site-packages/pipenv/vendor/click/core.py", line 782, in main
rv = self.invoke(ctx)
File "/usr/local/lib/python3.8/site-packages/pipenv/vendor/click/core.py", line 1259, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "/usr/local/lib/python3.8/site-packages/pipenv/vendor/click/core.py", line 1066, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/usr/local/lib/python3.8/site-packages/pipenv/vendor/click/core.py", line 610, in invoke
return callback(*args, **kwargs)
File "/usr/local/lib/python3.8/site-packages/pipenv/vendor/click/decorators.py", line 73, in new_func
return ctx.invoke(f, obj, *args, **kwargs)
File "/usr/local/lib/python3.8/site-packages/pipenv/vendor/click/core.py", line 610, in invoke
return callback(*args, **kwargs)
File "/usr/local/lib/python3.8/site-packages/pipenv/vendor/click/decorators.py", line 21, in new_func
return f(get_current_context(), *args, **kwargs)
File "/usr/local/lib/python3.8/site-packages/pipenv/cli/command.py", line 232, in install
retcode = do_install(
File "/usr/local/lib/python3.8/site-packages/pipenv/core.py", line 2052, in do_install
do_init(
File "/usr/local/lib/python3.8/site-packages/pipenv/core.py", line 1305, in do_init
do_install_dependencies(
File "/usr/local/lib/python3.8/site-packages/pipenv/core.py", line 827, in do_install_dependencies
lockfile = project.get_or_create_lockfile(from_pipfile=True)
File "/usr/local/lib/python3.8/site-packages/pipenv/project.py", line 783, in get_or_create_lockfile
lockfile_dict.update({"_meta": self.get_lockfile_meta()})
File "/usr/local/lib/python3.8/site-packages/pipenv/project.py", line 817, in get_lockfile_meta
sources = self.lockfile_content.get("_meta", {}).get("sources", [])
File "/usr/local/lib/python3.8/site-packages/pipenv/project.py", line 662, in lockfile_content
return self.load_lockfile()
File "/usr/local/lib/python3.8/site-packages/pipenv/project.py", line 1044, in load_lockfile
j = json.load(lock)
File "/usr/lib64/python3.8/json/__init__.py", line 293, in load
return loads(fp.read(),
File "/usr/lib64/python3.8/json/__init__.py", line 357, in loads
return _default_decoder.decode(s)
File "/usr/lib64/python3.8/json/decoder.py", line 337, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File "/usr/lib64/python3.8/json/decoder.py", line 353, in raw_decode
obj, end = self.scan_once(s, idx)
json.decoder.JSONDecodeError: Expecting property name enclosed in double quotes: line 4 column 1 (char 35)
2021/08/13 12:49:40.976920 [INFO] Executing cleanup logic
2021/08/13 12:49:40.977012 [INFO] CommandService Response: {"status":"FAILURE","api_version":"1.0","results":[{"status":"FAILURE","msg":"Engine execution has encountered an error.","returncode":1,"events":[{"msg":"Instance deployment failed to install application dependencies. The deployment failed.","timestamp":1628858980,"severity":"ERROR"},{"msg":"Instance deployment failed. For details, see 'eb-engine.log'.","timestamp":1628858980,"severity":"ERROR"}]}]}
Additionally, I am operating inside a virtualenv and the command I mentioned gives me the following warning
Courtesy Notice: Pipenv found itself running within a virtual environment, so it will automatically use that environment, instead of creating its own for any project. You can set PIPENV_IGNORE_VIRTUALENVS=1 to force pipenv to ignore that environment and create its own instead. You can set PIPENV_VERBOSITY=-1 to suppress this warning.
I have tried to run it outside the virtualenv but can't seem to get the correct version of pipenv I have version 2021.5.29 and I need 2020.8.13 as specified by AWS in their documentation.
There is also a small difference between the python version as I use python3.8.11 and they use 3.8.5 does that make a difference?
Not a python export but the error message explicitly notes.
“Instance deployment failed to install application dependencies”
And reading the stack trace it notes.
“ json.decoder.JSONDecodeError: Expecting property name enclosed in double quotes: line 4 column 1 (char 35)”
Looks like you have malformed JSON in your lock file.

Forbidden: You are not authorized to perform the requested action

I am installing openstack devstack deploying identity ldap
I followed these steps:
i followed the step of the quick start installation of devstack too i created a local.conf file with the following contents:
[[Local|localrc]]
ADMIN_PASSWORD=sesame
DATABASE_PASSWORD=$ADMIN_PASSWORD
RABBIT_PASSWORD=$ADMIN_PASSWORD
SERVICE_PASSWORD=$ADMIN_PASSWORD
ENABLED_SERVICES=key,n-api,n-crt,n-obj,n-cpu,n-net,n-cond,cinder,c-sch,c-api,c-vol,n-sch,n-novnc,n-xvnc,n-cauth,horizon,mysql,rabbit,ldap
KEYSTONE_IDENTITY_BACKEND=ldap
KEYSTONE_CLEAR_LDAP=yes
LDAP_PASSWORD=sesame
then I started the installation ./stack.sh
I had the same problem after every installation attempt. please help me.
CRITICAL keystone [None req-eac86609-c531-420b-8f0c-c05dbb1ea404 None None] Unhandled error: Forbidden: You are not authorized to perform the requested action.
ERROR keystone Traceback (most recent call last):
ERROR keystone File "/usr/bin/keystone-manage", line 10, in <module>
ERROR keystone sys.exit(main())
ERROR keystone File "/opt/stack/keystone/keystone/cmd/manage.py", line 45, in main
ERROR keystone cli.main(argv=sys.argv, config_files=config_files)
ERROR keystone File "/opt/stack/keystone/keystone/cmd/cli.py", line 1191, in main
ERROR keystone CONF.command.cmd_class.main()
ERROR keystone File "/opt/stack/keystone/keystone/cmd/cli.py", line 178, in main
ERROR keystone klass.do_bootstrap()
ERROR keystone File "/opt/stack/keystone/keystone/cmd/cli.py", line 169, in do_bootstrap
ERROR keystone self.bootstrapper.bootstrap()
ERROR keystone File "/opt/stack/keystone/keystone/cmd/bootstrap.py", line 63, in bootstrap
ERROR keystone self._bootstrap_admin_user()
ERROR keystone File "/opt/stack/keystone/keystone/cmd/bootstrap.py", line 207, in _bootstrap_admin_user
ERROR keystone 'password': self.admin_password
ERROR keystone File "/opt/stack/keystone/keystone/common/manager.py", line 116, in wrapped
ERROR keystone __ret_val = __f(*args, **kwargs)
ERROR keystone File "/opt/stack/keystone/keystone/identity/core.py", line 416, in wrapper
ERROR keystone return f(self, *args, **kwargs)
ERROR keystone File "/opt/stack/keystone/keystone/identity/core.py", line 426, in wrapper
ERROR keystone return f(self, *args, **kwargs)
ERROR keystone File "/opt/stack/keystone/keystone/identity/core.py", line 967, in create_user
ERROR keystone ref = driver.create_user(user['id'], user)
ERROR keystone File "/opt/stack/keystone/keystone/identity/backends/ldap/core.py", line 160, in create_user
ERROR keystone self._disallow_write()
ERROR keystone File "/opt/stack/keystone/keystone/identity/backends/ldap/core.py", line 157, in _disallow_write
ERROR keystone raise exception.Forbidden(READ_ONLY_LDAP_ERROR_MESSAGE)
ERROR keystone Forbidden: You are not authorized to perform the requested action.
ERROR keystone
+lib/keystone:bootstrap_keystone:1 exit_trap
+./stack.sh:exit_trap:515 local r=1
++./stack.sh:exit_trap:516 jobs -p
+./stack.sh:exit_trap:516 jobs=
+./stack.sh:exit_trap:519 [[ -n '' ]]
+./stack.sh:exit_trap:525 '[' -f /tmp/tmp.sbrPqeUJur ']'
+./stack.sh:exit_trap:526 rm /tmp/tmp.sbrPqeUJur
+./stack.sh:exit_trap:530 kill_spinner
+./stack.sh:kill_spinner:425 '[' '!' -z '' ']'
+./stack.sh:exit_trap:532 [[ 1 -ne 0 ]]
+./stack.sh:exit_trap:533 echo 'Error on exit'
Error on exit
+./stack.sh:exit_trap:535 type -p generate-subunit
+./stack.sh:exit_trap:536 generate-subunit 1530240644 2563 fail
+./stack.sh:exit_trap:538 [[ -z /opt/stack/logs ]]
+./stack.sh:exit_trap:541 /home/stack/devstack/tools/worlddump.py -d /opt/stack/logs
World dumping... see /opt/stack/logs/worlddump-2018-06-29-033327.txt for details
+./stack.sh:exit_trap:550 exit 1

QIIME2 dada2 rlang.so error

I was running the QIIME2 moving picture tutorial, at the dada2 step,
I was running:
qiime dada2 denoise-single \
--i-demultiplexed-seqs demux.qza \
--p-trim-left 0 \
--p-trunc-len 120 \
--o-representative-sequences rep-seqs-dada2.qza \
--o-table table-dada2.qza
and ran into this error:
Plugin error from dada2:
An error was encountered while running DADA2 in R (return code 1),
please inspect stdout and stderr to learn more.
Debug info has been saved to /tmp/qiime2-q2cli-err-52fzrvlu.log.
I then open the file: /tmp/qiime2-q2cli-err-52fzrvlu.log. this is what I found:
Running external command line application(s). This may print messages
to stdout and/or stderr. The command(s) being run are below. These
commands cannot be manually re-run as they will depend on temporary
files that no longer exist.
Command: run_dada_single.R
/tmp/qiime2-archive-pco6y5vm/fe614b44-775f-41b1-9ee3-04319005e830/data
/tmp/tmpda8dnyve/output.tsv.biom /tmp/tmpda8dnyve 120 0 2.0 2
consensus 1.0 1 1000000
R version 3.3.1 (2016-06-21) Loading required package: Rcpp Error in
dyn.load(file, DLLpath = DLLpath, ...) : unable to load shared
object '/home/cao/lib/R/library/rlang/libs/rlang.so':
/home/cao/lib/R/library/rlang/libs/rlang.so: undefined symbol:
R_ExternalPtrAddrFn In addition: Warning message: package ‘Rcpp’ was
built under R version 3.4.1 Error: package or namespace load failed
for ‘dada2’ Execution halted Traceback (most recent call last): File
"/home/cao/miniconda3/envs/qiime2-2017.7/lib/python3.5/site-packages/q2_dada2/_denoise.py",
line 126, in denoise_single
run_commands([cmd]) File "/home/cao/miniconda3/envs/qiime2-2017.7/lib/python3.5/site-packages/q2_dada2/_denoise.py",
line 35, in run_commands
subprocess.run(cmd, check=True) File "/home/cao/miniconda3/envs/qiime2-2017.7/lib/python3.5/subprocess.py",
line 398, in run
output=stdout, stderr=stderr) subprocess.CalledProcessError: Command '['run_dada_single.R',
'/tmp/qiime2-archive-pco6y5vm/fe614b44-775f-41b1-9ee3-04319005e830/data',
'/tmp/tmpda8dnyve/output.tsv.biom', '/tmp/tmpda8dnyve', '120', '0',
'2.0', '2', 'consensus', '1.0', '1', '1000000']' returned non-zero
exit status 1
During handling of the above exception, another exception occurred:
Traceback (most recent call last): File
"/home/cao/miniconda3/envs/qiime2-2017.7/lib/python3.5/site-packages/q2cli/commands.py",
line 222, in __call__
results = action(**arguments) File "<decorator-gen-252>", line 2, in denoise_single File
"/home/cao/miniconda3/envs/qiime2-2017.7/lib/python3.5/site-packages/qiime2/sdk/action.py",
line 201, in callable_wrapper
output_types, provenance) File "/home/cao/miniconda3/envs/qiime2-2017.7/lib/python3.5/site-packages/qiime2/sdk/action.py",
line 334, in _callable_executor_
output_views = callable(**view_args) File "/home/cao/miniconda3/envs/qiime2-2017.7/lib/python3.5/site-packages/q2_dada2/_denoise.py",
line 137, in denoise_single
" and stderr to learn more." % e.returncode) Exception: An error was encountered while running DADA2 in R (return code 1), please
inspect stdout and stderr to learn more.
I then 'sudo R' and installed the Rcpp and rlang packages, but still got the the same error when I run the same code as I first did:
qiime dada2 denoise-single \
--i-demultiplexed-seqs demux.qza \
--p-trim-left 0 \
--p-trunc-len 120 \
--o-representative-sequences rep-seqs-dada2.qza \
--o-table table-dada2.qza
I figured it out:
it was the R version: i uninstalled R3.4 and install R 3.3 and everythign works

How to publicly view website that I am hosting on amazon-ec2?

I have started an amazon-ec2 instance with public a DNS of ec2-12-34-567-89.us-west-2.compute.amazonaws.com. There I have set up a security group, where type=HTTP, protocol=TCP, port range=80, source=0.0.0.0/. I log in to the EC2 instance and launch my app:
$ python3 run.py
* Running on http://0.0.0.0:0/
Then with browser I try to open: http://ec2-12-34-567-89.us-west-2.compute.amazonaws.com and get an "Unable to connect" message.
What am I missing here?
Edit
With port 80, it ends up like this:
$ python3 run.py
* Running on http://0.0.0.0:80/
Traceback (most recent call last):
File "run.py", line 5, in <module>
app.run(host="0.0.0.0", port=80)
File "/opt/python/3.4.1/lib/python3.4/site-packages/flask/app.py", line 772, in run
run_simple(host, port, self, **options)
File "/opt/python/3.4.1/lib/python3.4/site-packages/werkzeug/serving.py", line 710, in run_simple
inner()
File "/opt/python/3.4.1/lib/python3.4/site-packages/werkzeug/serving.py", line 692, in inner
passthrough_errors, ssl_context).serve_forever()
File "/opt/python/3.4.1/lib/python3.4/site-packages/werkzeug/serving.py", line 486, in make_server
passthrough_errors, ssl_context)
File "/opt/python/3.4.1/lib/python3.4/site-packages/werkzeug/serving.py", line 410, in __init__
HTTPServer.__init__(self, (host, int(port)), handler)
File "/opt/python/3.4.1/lib/python3.4/socketserver.py", line 429, in __init__
self.server_bind()
File "/opt/python/3.4.1/lib/python3.4/http/server.py", line 133, in server_bind
socketserver.TCPServer.server_bind(self)
File "/opt/python/3.4.1/lib/python3.4/socketserver.py", line 440, in server_bind
self.socket.bind(self.server_address)
PermissionError: [Errno 13] Permission denied
Appearently I needed to run my code as superuser.
$ **sudo** python3 run.py
* Running on http://0.0.0.0:80/

Error with DataStax Commuity on Amazon EC2

I got this Error if i want to Setup the Datastax Cassandra Cluster (Community Edition), i have used this:
http://www.datastax.com/docs/1.2/install/install_ami
[EXEC] 06/05/13-10:52:05 sudo rm -rf /etc/motd
[EXEC] 06/05/13-10:52:05 sudo touch /etc/motd
[INFO] Started with user data set to:
[INFO] --clustername myDSCcluster --totalnodes 3 --version community
[INFO] Using instance type: m1.large
[ERROR] Exception seen in ds1_launcher.py:
Traceback (most recent call last):
File "/home/ubuntu/datastax_ami/ds1_launcher.py", line 31, in initial_configurations
ds2_configure.run()
File "/home/ubuntu/datastax_ami/ds2_configure.py", line 932, in run
File "/home/ubuntu/datastax_ami/ds2_configure.py", line 125, in get_ec2_data
File "/usr/lib/python2.7/urllib2.py", line 126, in urlopen
return _opener.open(url, data, timeout)
File "/usr/lib/python2.7/urllib2.py", line 406, in open
response = meth(req, response)
File "/usr/lib/python2.7/urllib2.py", line 519, in http_response
'http', request, response, code, msg, hdrs)
File "/usr/lib/python2.7/urllib2.py", line 444, in error
return self._call_chain(*args)
File "/usr/lib/python2.7/urllib2.py", line 378, in _call_chain
result = func(*args)
File "/usr/lib/python2.7/urllib2.py", line 527, in http_error_default
raise HTTPError(req.get_full_url(), code, msg, hdrs, fp)
HTTPError: HTTP Error 404: Not Found
It seems as though you may have attempted to launch the cluster within a VPC, which isn't supported.
I did, however, notice that we don't specifically mention that VPC's aren't supported. I'll make sure we get that fixed.

Resources