cloudpipe instance fails to get payload.b64

Asked by Hyunsun Moon

Hello,
I'm trying to test VPN. I added some scripts to the cloudpipe image's rc.local for fetching user-data from metadata server.(I found the useful scripts from this board).

Here's the script.

----------------------------------------------------------------------
echo Downloading payload from userdata
wget http://169.254.169.254/latest/user-data -O /tmp/payload.b64
echo Decrypting base64 payload
openssl enc -d -base64 -in /tmp/payload.b64 -out /tmp/payload.zip

mkdir -p /tmp/payload
echo Unzipping payload file
unzip -o /tmp/payload.zip -d /tmp/payload/

# if the autorun.sh script exists, run it
if [ -e /tmp/payload/autorun.sh ]; then
  echo Running autorun.sh
  cd /tmp/payload
  sh /tmp/payload/autorun.sh

else
  echo rc.local : No autorun script to run
fi

exit 0

-----------------------------------------------------------------------

I was able to run vpn instance successfully but during the boot processing, I got the following errors so that the OpenVPN server fails to launch. No more debug messages...

Did I miss something?

----------------------------------------------------------------------

Downloading payload from userdata
--2011-04-11 09:49:43-- http://169.254.169.254/latest/user-data
Connecting to 169.254.169.254:80... connected.
HTTP request sent, awaiting response... 500 Internal Server Error
2011-04-11 09:49:43 ERROR 500: Internal Server Error.

Question information

Language:
English Edit question
Status:
Solved
For:
OpenStack Compute (nova) Edit question
Assignee:
No assignee Edit question
Solved by:
Hyunsun Moon
Solved:
Last query:
Last reply:

This question was reopened

Revision history for this message
Barton Satchwill (barton-satchwill) said :
#1

the autorun.sh script configures the openvpn server, so if there's no autorun script, then we wouldn't expect the vpn server to start. So the root problem is why aren't you getting the autorun.sh script from the payload.zip?

The error message suggests you're connecting to the metadata server, so the network is up.

To get more diagnostic information, you can log into the cloudpipe server, and try executing the rc.local script again, adding some statements to print some diagnostic output.

are you able to 'curl http://169.254.169.254/latest/user-data'?

are you starting the cloudpipe server with 'nova-manage vpn run <project>'?

have you inspected the logfiles in /var/log/nova for the timeperiod of your test?

Revision history for this message
Hyunsun Moon (hyunsun-moon) said :
#2

Hi Barton,
here are the results of curl http://169.254.169.254/latest/meta-data/
local-ipv4
reservation-id
local-hostname
placement/
ami-launch-index
public-hostname
mpi/
hostname
ami-id
public-keys/
instance-action
public-ipv4
block-device-mapping/
ami-manifest-path
security-groups
instance-type
instance-id

It's from the normal instance because I don't know how to log in to the cloudpipe server.
Frequently the same command (curl http://169.254.169.254/latest/meta-data/) occurs the following error!!!

------------------------------------------------------------------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/lib/pymodules/python2.6/eventlet/wsgi.py", line 336, in handle_one_response
    result = self.application(self.environ, start_response)
  File "/usr/lib/pymodules/python2.6/paste/urlmap.py", line 203, in __call__
    return app(environ, start_response)
  File "/usr/lib/pymodules/python2.6/webob/dec.py", line 147, in __call__
    resp = self.call_func(req, *args, **self.kwargs)
  File "/usr/lib/pymodules/python2.6/webob/dec.py", line 208, in call_func
    return self.func(req, *args, **kwargs)
  File "/root/openstack/nova/nova/api/ec2/__init__.py", line 59, in __call__
    rv = req.get_response(self.application)
  File "/usr/lib/pymodules/python2.6/webob/request.py", line 919, in get_response
    application, catch_exc_info=False)
  File "/usr/lib/pymodules/python2.6/webob/request.py", line 887, in call_application
    app_iter = application(self.environ, start_response)
  File "/usr/lib/pymodules/python2.6/webob/dec.py", line 147, in __call__
    resp = self.call_func(req, *args, **self.kwargs)
  File "/usr/lib/pymodules/python2.6/webob/dec.py", line 208, in call_func
    return self.func(req, *args, **kwargs)
  File "/root/openstack/nova/nova/api/ec2/metadatarequesthandler.py", line 74, in __call__
    meta_data = cc.get_metadata(remote_address)
  File "/root/openstack/nova/nova/api/ec2/cloud.py", line 173, in get_metadata
    'instance-type': instance_ref['instance_type'],
  File "/root/openstack/nova/nova/db/sqlalchemy/models.py", line 74, in __getitem__
    return getattr(self, key)
  File "/usr/lib/pymodules/python2.6/sqlalchemy/orm/attributes.py", line 163, in __get__
    instance_dict(instance))
  File "/usr/lib/pymodules/python2.6/sqlalchemy/orm/attributes.py", line 382, in get
    value = callable_(passive=passive)
  File "/usr/lib/pymodules/python2.6/sqlalchemy/orm/strategies.py", line 578, in __call__
    (mapperutil.state_str(state), self.key)
DetachedInstanceError: Parent instance <Instance at 0x45dd810> is not bound to a Session; lazy load operation of attribute 'instance_type' cannot proceed

Revision history for this message
Hyunsun Moon (hyunsun-moon) said :
#3

Hi Barton,
here are the results of curl http://169.254.169.254/latest/meta-data/
local-ipv4
reservation-id
local-hostname
placement/
ami-launch-index
public-hostname
mpi/
hostname
ami-id
public-keys/
instance-action
public-ipv4
block-device-mapping/
ami-manifest-path
security-groups
instance-type
instance-id

It's from the normal instance because I don't know how to log in to the cloudpipe server.
Frequently the same command (curl http://169.254.169.254/latest/meta-data/) occurs the following error!!!

------------------------------------------------------------------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/lib/pymodules/python2.6/eventlet/wsgi.py", line 336, in handle_one_response
    result = self.application(self.environ, start_response)
  File "/usr/lib/pymodules/python2.6/paste/urlmap.py", line 203, in __call__
    return app(environ, start_response)
  File "/usr/lib/pymodules/python2.6/webob/dec.py", line 147, in __call__
    resp = self.call_func(req, *args, **self.kwargs)
  File "/usr/lib/pymodules/python2.6/webob/dec.py", line 208, in call_func
    return self.func(req, *args, **kwargs)
  File "/root/openstack/nova/nova/api/ec2/__init__.py", line 59, in __call__
    rv = req.get_response(self.application)
  File "/usr/lib/pymodules/python2.6/webob/request.py", line 919, in get_response
    application, catch_exc_info=False)
  File "/usr/lib/pymodules/python2.6/webob/request.py", line 887, in call_application
    app_iter = application(self.environ, start_response)
  File "/usr/lib/pymodules/python2.6/webob/dec.py", line 147, in __call__
    resp = self.call_func(req, *args, **self.kwargs)
  File "/usr/lib/pymodules/python2.6/webob/dec.py", line 208, in call_func
    return self.func(req, *args, **kwargs)
  File "/root/openstack/nova/nova/api/ec2/metadatarequesthandler.py", line 74, in __call__
    meta_data = cc.get_metadata(remote_address)
  File "/root/openstack/nova/nova/api/ec2/cloud.py", line 173, in get_metadata
    'instance-type': instance_ref['instance_type'],
  File "/root/openstack/nova/nova/db/sqlalchemy/models.py", line 74, in __getitem__
    return getattr(self, key)
  File "/usr/lib/pymodules/python2.6/sqlalchemy/orm/attributes.py", line 163, in __get__
    instance_dict(instance))
  File "/usr/lib/pymodules/python2.6/sqlalchemy/orm/attributes.py", line 382, in get
    value = callable_(passive=passive)
  File "/usr/lib/pymodules/python2.6/sqlalchemy/orm/strategies.py", line 578, in __call__
    (mapperutil.state_str(state), self.key)
DetachedInstanceError: Parent instance <Instance at 0x45dd810> is not bound to a Session; lazy load operation of attribute 'instance_type' cannot proceed

Revision history for this message
Hyunsun Moon (hyunsun-moon) said :
#4

Hi Barton,
here are the results of curl http://169.254.169.254/latest/meta-data/
local-ipv4
reservation-id
local-hostname
placement/
ami-launch-index
public-hostname
mpi/
hostname
ami-id
public-keys/
instance-action
public-ipv4
block-device-mapping/
ami-manifest-path
security-groups
instance-type
instance-id

It's from the normal instance because I don't know how to log in to the cloudpipe server.
Frequently the same command (curl http://169.254.169.254/latest/meta-data/) occurs the following error!!!

------------------------------------------------------------------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/lib/pymodules/python2.6/eventlet/wsgi.py", line 336, in handle_one_response
    result = self.application(self.environ, start_response)
  File "/usr/lib/pymodules/python2.6/paste/urlmap.py", line 203, in __call__
    return app(environ, start_response)
  File "/usr/lib/pymodules/python2.6/webob/dec.py", line 147, in __call__
    resp = self.call_func(req, *args, **self.kwargs)
  File "/usr/lib/pymodules/python2.6/webob/dec.py", line 208, in call_func
    return self.func(req, *args, **kwargs)
  File "/root/openstack/nova/nova/api/ec2/__init__.py", line 59, in __call__
    rv = req.get_response(self.application)
  File "/usr/lib/pymodules/python2.6/webob/request.py", line 919, in get_response
    application, catch_exc_info=False)
  File "/usr/lib/pymodules/python2.6/webob/request.py", line 887, in call_application
    app_iter = application(self.environ, start_response)
  File "/usr/lib/pymodules/python2.6/webob/dec.py", line 147, in __call__
    resp = self.call_func(req, *args, **self.kwargs)
  File "/usr/lib/pymodules/python2.6/webob/dec.py", line 208, in call_func
    return self.func(req, *args, **kwargs)
  File "/root/openstack/nova/nova/api/ec2/metadatarequesthandler.py", line 74, in __call__
    meta_data = cc.get_metadata(remote_address)
  File "/root/openstack/nova/nova/api/ec2/cloud.py", line 173, in get_metadata
    'instance-type': instance_ref['instance_type'],
  File "/root/openstack/nova/nova/db/sqlalchemy/models.py", line 74, in __getitem__
    return getattr(self, key)
  File "/usr/lib/pymodules/python2.6/sqlalchemy/orm/attributes.py", line 163, in __get__
    instance_dict(instance))
  File "/usr/lib/pymodules/python2.6/sqlalchemy/orm/attributes.py", line 382, in get
    value = callable_(passive=passive)
  File "/usr/lib/pymodules/python2.6/sqlalchemy/orm/strategies.py", line 578, in __call__
    (mapperutil.state_str(state), self.key)
DetachedInstanceError: Parent instance <Instance at 0x45dd810> is not bound to a Session; lazy load operation of attribute 'instance_type' cannot proceed

Revision history for this message
Hyunsun Moon (hyunsun-moon) said :
#5

oh, it was already in bug report, Bug #757293.