euca-allocate-address problem

Asked by Laurent Borensky

Hi,

I have an unknown error with the command "euca-allocate-address"
# euca-allocate-address <CR>
UnknowError ...

The command to know the IP addresses floating gives this result:
# nova-manage floating list <CR> or SQL request
mysql> select * from floating_ips; <CR>
created_at updated_at deleted_at deleted id address fixed_ip_id project_id host
2011-05-05 12:26:39 NULL NULL 0 1 10.10.10.224 NULL NULL 10.10.10.2
2011-05-05 12:26:39 NULL NULL 0 2 10.10.10.225 NULL NULL 10.10.10.2
2011-05-05 12:26:39 NULL NULL 0 3 10.10.10.226 NULL NULL 10.10.10.2
2011-05-05 12:26:39 NULL NULL 0 4 10.10.10.227 NULL NULL 10.10.10.2
2011-05-05 12:26:39 NULL NULL 0 5 10.10.10.228 NULL NULL 10.10.10.2
2011-05-05 12:26:39 NULL NULL 0 6 10.10.10.229 NULL NULL 10.10.10.2
2011-05-05 12:26:39 NULL NULL 0 7 10.10.10.230 NULL NULL 10.10.10.2
2011-05-05 12:26:39 NULL NULL 0 8 10.10.10.231 NULL NULL 10.10.10.2
2011-05-05 12:26:39 NULL NULL 0 9 10.10.10.232 NULL NULL 10.10.10.2
2011-05-05 12:26:39 NULL NULL 0 10 10.10.10.233 NULL NULL 10.10.10.2
2011-05-05 12:26:39 NULL NULL 0 11 10.10.10.234 NULL NULL 10.10.10.2
2011-05-05 12:26:39 NULL NULL 0 12 10.10.10.235 NULL NULL 10.10.10.2
2011-05-05 12:26:39 NULL NULL 0 13 10.10.10.236 NULL NULL 10.10.10.2
2011-05-05 12:26:39 NULL NULL 0 14 10.10.10.237 NULL NULL 10.10.10.2
2011-05-05 12:26:39 NULL NULL 0 15 10.10.10.238 NULL NULL 10.10.10.2
2011-05-05 12:26:39 NULL NULL 0 16 10.10.10.239 NULL NULL 10.10.10.2
2011-05-05 12:26:39 NULL NULL 0 17 10.10.10.240 NULL NULL 10.10.10.2
2011-05-05 12:26:39 NULL NULL 0 18 10.10.10.241 NULL NULL 10.10.10.2
2011-05-05 12:26:39 NULL NULL 0 19 10.10.10.242 NULL NULL 10.10.10.2
2011-05-05 12:26:39 NULL NULL 0 20 10.10.10.243 NULL NULL 10.10.10.2
2011-05-05 12:26:39 NULL NULL 0 21 10.10.10.244 NULL NULL 10.10.10.2
2011-05-05 12:26:39 NULL NULL 0 22 10.10.10.245 NULL NULL 10.10.10.2
2011-05-05 12:26:39 NULL NULL 0 23 10.10.10.246 NULL NULL 10.10.10.2
2011-05-05 12:26:39 NULL NULL 0 24 10.10.10.247 NULL NULL 10.10.10.2
2011-05-05 12:26:39 NULL NULL 0 25 10.10.10.248 NULL NULL 10.10.10.2
2011-05-05 12:26:39 NULL NULL 0 26 10.10.10.249 NULL NULL 10.10.10.2
2011-05-05 12:26:39 NULL NULL 0 27 10.10.10.250 NULL NULL 10.10.10.2
2011-05-05 12:26:39 NULL NULL 0 28 10.10.10.251 NULL NULL 10.10.10.2
2011-05-05 12:26:39 NULL NULL 0 29 10.10.10.252 NULL NULL 10.10.10.2
2011-05-05 12:26:39 NULL NULL 0 30 10.10.10.253 NULL NULL 10.10.10.2
2011-05-05 12:26:39 NULL NULL 0 31 10.10.10.254 NULL NULL 10.10.10.2
2011-05-05 12:26:39 NULL NULL 0 32 10.10.10.255 NULL NULL 10.10.10.2

The error message in log file "nova-network" is :

root@server1:/var/log/nova# grep ERROR * <CR>
nova-api.log:2011-05-31 18:10:12,824 ERROR nova.api [VK652XYLDWNK3I-BOMY0 novaadmin projet1] Unexpected error raised: NoMoreAddresses None
nova-api.log:2011-05-31 18:10:12,827 ERROR nova.api [VK652XYLDWNK3I-BOMY0 novaadmin projet1] Environment: {"HTTP_AUTHORIZATION": "AWS 170b5007-29bf-43ae-8d02-ce4a82089dcf:projet1:bfEQn/UpbT6pWFdx8Fq5xrOQLTE=", "CONTENT_TYPE": "text/plain", "SCRIPT_NAME": "/services/Cloud", "HTTP_DATE": "Tue, 31 May 2011 16:10:12 GMT", "REQUEST_METHOD": "GET", "HTTP_HOST": "10.10.10.2:8773", "PATH_INFO": "/", "SERVER_PROTOCOL": "HTTP/1.0", "QUERY_STRING": "AWSAccessKeyId=170b5007-29bf-43ae-8d02-ce4a82089dcf%3Aprojet1&Action=AllocateAddress&SignatureMethod=HmacSHA256&SignatureVersion=2&Timestamp=2011-05-31T16%3A10%3A12&Version=2009-11-30&Signature=udN4DTiG6E5/7p%2BFdU0F/Z8%2BpXJ17hGwNdS1tmiAoTU%3D", "CONTENT_LENGTH": "0", "HTTP_USER_AGENT": "Boto/1.9b (linux2)", "SERVER_NAME": "10.10.10.2", "REMOTE_ADDR": "10.10.10.2", "wsgi.url_scheme": "http", "SERVER_PORT": "8773", "GATEWAY_INTERFACE": "CGI/1.1", "HTTP_ACCEPT_ENCODING": "identity"}
nova-api.log:2011-05-31 18:10:12,827 ERROR nova.api [VK652XYLDWNK3I-BOMY0 novaadmin projet1] UnknownError: An unknown error has occurred. Please try your request again.
nova-network.log:2011-05-31 18:10:12,616 ERROR nova [-] Exception during message handling
nova-network.log:2011-05-31 18:10:12,619 ERROR nova.rpc [-] Returning exception None to caller
nova-network.log:2011-05-31 18:10:12,619 ERROR nova.rpc [-] ['Traceback (most recent call last):\n', ' File "/usr/lib/pymodules/python2.7/nova/rpc.py", line 188, in _receive\n rval = node_func(context=ctxt, **node_args)\n', ' File "/usr/lib/pymodules/python2.7/nova/network/manager.py", line 204, in allocate_floating_ip\n project_id)\n', ' File "/usr/lib/pymodules/python2.7/nova/db/api.py", line 230, in floating_ip_allocate_address\n return IMPL.floating_ip_allocate_address(context, host, project_id)\n', ' File "/usr/lib/pymodules/python2.7/nova/db/sqlalchemy/api.py", line 109, in wrapper\n return f(*args, **kwargs)\n', ' File "/usr/lib/pymodules/python2.7/nova/db/sqlalchemy/api.py", line 444, in floating_ip_allocate_address\n raise db.NoMoreAddresses()\n', 'NoMoreAddresses: None\n']
root@server1:/var/log/nova#

The python code associated (file: api.y)

def floating_ip_allocate_address(context, host, project_id):
    authorize_project_context(context, project_id)
    session = get_session()
    with session.begin():
        floating_ip_ref = session.query(models.FloatingIp).\
                                  filter_by(host=host).\
                                  filter_by(fixed_ip_id=None).\
                                  filter_by(project_id=None).\
                                  filter_by(deleted=False).\
                                  with_lockmode('update').\
                                  first()
        # NOTE(vish): if with_lockmode isn't supported, as in sqlite,
        # then this has concurrency issues
        if not floating_ip_ref:
            raise db.NoMoreAddresses()
        floating_ip_ref['project_id'] = project_id
        session.add(floating_ip_ref)
    return floating_ip_ref['address']

I don't know, why I have a null result (NoMoreAddress)?
Impossible to track the SQL query with the mysql command "show full processlist"
Have you any idea?

Question information

Language:
English Edit question
Status:
Solved
For:
OpenStack Compute (nova) Edit question
Assignee:
No assignee Edit question
Solved by:
Laurent Borensky
Solved:
Last query:
Last reply:
Revision history for this message
Vish Ishaya (vishvananda) said :
#1

You need to use hostname for host instead of an ip address.
update floating_ips set host = '$HOSTNAME';

assuming HOSTNAME =`hostname`

Vish

On May 31, 2011, at 1:25 PM, Laurent Borensky wrote:

> New question #159804 on OpenStack Compute (nova):
> https://answers.launchpad.net/nova/+question/159804
>
> Hi,
>
> I have an unknown error with the command "euca-allocate-address"
> # euca-allocate-address <CR>
> UnknowError ...
>
> The command to know the IP addresses floating gives this result:
> # nova-manage floating list <CR> or SQL request
> mysql> select * from floating_ips; <CR>
> created_at updated_at deleted_at deleted id address fixed_ip_id project_id host
> 2011-05-05 12:26:39 NULL NULL 0 1 10.10.10.224 NULL NULL 10.10.10.2
> 2011-05-05 12:26:39 NULL NULL 0 2 10.10.10.225 NULL NULL 10.10.10.2
> 2011-05-05 12:26:39 NULL NULL 0 3 10.10.10.226 NULL NULL 10.10.10.2
> 2011-05-05 12:26:39 NULL NULL 0 4 10.10.10.227 NULL NULL 10.10.10.2
> 2011-05-05 12:26:39 NULL NULL 0 5 10.10.10.228 NULL NULL 10.10.10.2
> 2011-05-05 12:26:39 NULL NULL 0 6 10.10.10.229 NULL NULL 10.10.10.2
> 2011-05-05 12:26:39 NULL NULL 0 7 10.10.10.230 NULL NULL 10.10.10.2
> 2011-05-05 12:26:39 NULL NULL 0 8 10.10.10.231 NULL NULL 10.10.10.2
> 2011-05-05 12:26:39 NULL NULL 0 9 10.10.10.232 NULL NULL 10.10.10.2
> 2011-05-05 12:26:39 NULL NULL 0 10 10.10.10.233 NULL NULL 10.10.10.2
> 2011-05-05 12:26:39 NULL NULL 0 11 10.10.10.234 NULL NULL 10.10.10.2
> 2011-05-05 12:26:39 NULL NULL 0 12 10.10.10.235 NULL NULL 10.10.10.2
> 2011-05-05 12:26:39 NULL NULL 0 13 10.10.10.236 NULL NULL 10.10.10.2
> 2011-05-05 12:26:39 NULL NULL 0 14 10.10.10.237 NULL NULL 10.10.10.2
> 2011-05-05 12:26:39 NULL NULL 0 15 10.10.10.238 NULL NULL 10.10.10.2
> 2011-05-05 12:26:39 NULL NULL 0 16 10.10.10.239 NULL NULL 10.10.10.2
> 2011-05-05 12:26:39 NULL NULL 0 17 10.10.10.240 NULL NULL 10.10.10.2
> 2011-05-05 12:26:39 NULL NULL 0 18 10.10.10.241 NULL NULL 10.10.10.2
> 2011-05-05 12:26:39 NULL NULL 0 19 10.10.10.242 NULL NULL 10.10.10.2
> 2011-05-05 12:26:39 NULL NULL 0 20 10.10.10.243 NULL NULL 10.10.10.2
> 2011-05-05 12:26:39 NULL NULL 0 21 10.10.10.244 NULL NULL 10.10.10.2
> 2011-05-05 12:26:39 NULL NULL 0 22 10.10.10.245 NULL NULL 10.10.10.2
> 2011-05-05 12:26:39 NULL NULL 0 23 10.10.10.246 NULL NULL 10.10.10.2
> 2011-05-05 12:26:39 NULL NULL 0 24 10.10.10.247 NULL NULL 10.10.10.2
> 2011-05-05 12:26:39 NULL NULL 0 25 10.10.10.248 NULL NULL 10.10.10.2
> 2011-05-05 12:26:39 NULL NULL 0 26 10.10.10.249 NULL NULL 10.10.10.2
> 2011-05-05 12:26:39 NULL NULL 0 27 10.10.10.250 NULL NULL 10.10.10.2
> 2011-05-05 12:26:39 NULL NULL 0 28 10.10.10.251 NULL NULL 10.10.10.2
> 2011-05-05 12:26:39 NULL NULL 0 29 10.10.10.252 NULL NULL 10.10.10.2
> 2011-05-05 12:26:39 NULL NULL 0 30 10.10.10.253 NULL NULL 10.10.10.2
> 2011-05-05 12:26:39 NULL NULL 0 31 10.10.10.254 NULL NULL 10.10.10.2
> 2011-05-05 12:26:39 NULL NULL 0 32 10.10.10.255 NULL NULL 10.10.10.2
>
> The error message in log file "nova-network" is :
>
> root@server1:/var/log/nova# grep ERROR * <CR>
> nova-api.log:2011-05-31 18:10:12,824 ERROR nova.api [VK652XYLDWNK3I-BOMY0 novaadmin projet1] Unexpected error raised: NoMoreAddresses None
> nova-api.log:2011-05-31 18:10:12,827 ERROR nova.api [VK652XYLDWNK3I-BOMY0 novaadmin projet1] Environment: {"HTTP_AUTHORIZATION": "AWS 170b5007-29bf-43ae-8d02-ce4a82089dcf:projet1:bfEQn/UpbT6pWFdx8Fq5xrOQLTE=", "CONTENT_TYPE": "text/plain", "SCRIPT_NAME": "/services/Cloud", "HTTP_DATE": "Tue, 31 May 2011 16:10:12 GMT", "REQUEST_METHOD": "GET", "HTTP_HOST": "10.10.10.2:8773", "PATH_INFO": "/", "SERVER_PROTOCOL": "HTTP/1.0", "QUERY_STRING": "AWSAccessKeyId=170b5007-29bf-43ae-8d02-ce4a82089dcf%3Aprojet1&Action=AllocateAddress&SignatureMethod=HmacSHA256&SignatureVersion=2&Timestamp=2011-05-31T16%3A10%3A12&Version=2009-11-30&Signature=udN4DTiG6E5/7p%2BFdU0F/Z8%2BpXJ17hGwNdS1tmiAoTU%3D", "CONTENT_LENGTH": "0", "HTTP_USER_AGENT": "Boto/1.9b (linux2)", "SERVER_NAME": "10.10.10.2", "REMOTE_ADDR": "10.10.10.2", "wsgi.url_scheme": "http", "SERVER_PORT": "8773", "GATEWAY_INTERFACE": "CGI/1.1", "HTTP_ACCEPT_ENCODING": "identity"}
> nova-api.log:2011-05-31 18:10:12,827 ERROR nova.api [VK652XYLDWNK3I-BOMY0 novaadmin projet1] UnknownError: An unknown error has occurred. Please try your request again.
> nova-network.log:2011-05-31 18:10:12,616 ERROR nova [-] Exception during message handling
> nova-network.log:2011-05-31 18:10:12,619 ERROR nova.rpc [-] Returning exception None to caller
> nova-network.log:2011-05-31 18:10:12,619 ERROR nova.rpc [-] ['Traceback (most recent call last):\n', ' File "/usr/lib/pymodules/python2.7/nova/rpc.py", line 188, in _receive\n rval = node_func(context=ctxt, **node_args)\n', ' File "/usr/lib/pymodules/python2.7/nova/network/manager.py", line 204, in allocate_floating_ip\n project_id)\n', ' File "/usr/lib/pymodules/python2.7/nova/db/api.py", line 230, in floating_ip_allocate_address\n return IMPL.floating_ip_allocate_address(context, host, project_id)\n', ' File "/usr/lib/pymodules/python2.7/nova/db/sqlalchemy/api.py", line 109, in wrapper\n return f(*args, **kwargs)\n', ' File "/usr/lib/pymodules/python2.7/nova/db/sqlalchemy/api.py", line 444, in floating_ip_allocate_address\n raise db.NoMoreAddresses()\n', 'NoMoreAddresses: None\n']
> root@server1:/var/log/nova#
>
> The python code associated (file: api.y)
>
> def floating_ip_allocate_address(context, host, project_id):
> authorize_project_context(context, project_id)
> session = get_session()
> with session.begin():
> floating_ip_ref = session.query(models.FloatingIp).\
> filter_by(host=host).\
> filter_by(fixed_ip_id=None).\
> filter_by(project_id=None).\
> filter_by(deleted=False).\
> with_lockmode('update').\
> first()
> # NOTE(vish): if with_lockmode isn't supported, as in sqlite,
> # then this has concurrency issues
> if not floating_ip_ref:
> raise db.NoMoreAddresses()
> floating_ip_ref['project_id'] = project_id
> session.add(floating_ip_ref)
> return floating_ip_ref['address']
>
> I don't know, why I have a null result (NoMoreAddress)?
> Impossible to track the SQL query with the mysql command "show full processlist"
> Have you any idea?
>
> --
> You received this question notification because you are a member of Nova
> Core, which is an answer contact for OpenStack Compute (nova).

Revision history for this message
Laurent Borensky (laurent-borensky) said :
#2

Vish,

Thank you for your response. In Administration Manual page 45 (release Cactus Apr 20, 2011), the CLI command "euca deallocate-address" is mentioned. But it is an error. The command is "euca-release-address".

Bye