open stack Essex: nova 401 unathorize

333 views
Skip to first unread message

Kenneth Nagin

unread,
May 6, 2012, 5:51:07 AM5/6/12
to jclouds
I installed openstack's newest version Essex.
However, I am getting a 401 unauthorize when trying to access the the
server.
I am using the "nova" provider:

NOVARC=$(readlink -f "${BASH_SOURCE:-${0}}" 2>/dev/null) ||
NOVARC=$(python -c 'import os,sys; print
os.path.abspath(os.path.realpath(sys.argv[1]))' "${BASH_SOURCE:-
${0}}")
NOVA_KEY_DIR=${NOVARC%/*}
export EC2_ACCESS_KEY="myadmin:myproject1"
export EC2_SECRET_KEY="0ec14078-147b-485b-a192-ae95fb61e384"
export EC2_URL="http://9.148.27.67:8773/services/Cloud"
export S3_URL="http://9.148.27.67:3333"
export EC2_USER_ID=42 # nova does not use user id, but bundling
requires it
export EC2_PRIVATE_KEY=${NOVA_KEY_DIR}/pk.pem
export EC2_CERT=${NOVA_KEY_DIR}/cert.pem
export NOVA_CERT=${NOVA_KEY_DIR}/cacert.pem
export EUCALYPTUS_CERT=${NOVA_CERT} # euca-bundle-image seems to
require this set
alias ec2-bundle-image="ec2-bundle-image --cert ${EC2_CERT} --
privatekey ${EC2_PRIVATE_KEY} --user 42 --ec2cert ${NOVA_CERT}"
alias ec2-upload-bundle="ec2-upload-bundle -a ${EC2_ACCESS_KEY} -s $
{EC2_SECRET_KEY} --url ${S3_URL} --ec2cert ${NOVA_CERT}"
export NOVA_API_KEY="myadmin"
export NOVA_USERNAME="myadmin"
export NOVA_PROJECT_ID="myproject1"
export NOVA_URL="http://9.148.27.67:8774/v1.1/"
export NOVA_VERSION="1.1"
root@lnx-ensure2:~#

My endpoint is set to http://9.148.27.67:8774/
Context identity is myadmin
Context certification is myadmin.
Also set overrides to:
iProperties.setProperty(Constants.PROPERTY_TRUST_ALL_CERTS,
"true");
iProperties.setProperty(Constants.PROPERTY_RELAX_HOSTNAME,
"true");
iProperties.setProperty(Constants.PROPERTY_API_VERSION,
"1.1");

This the exception:
org.jclouds.rest.AuthorizationException: command: GET http://9.148.27.67:8774/v1.1
HTTP/1.1 failed with response: HTTP/1.1 401 Unauthorized; content:
[<html>
<head>
<title>401 Unauthorized</title>
</head>
<body>
<h1>401 Unauthorized</h1>
This server could not verify that you are authorized to access the
document you requested. Either you supplied the wrong credentials
(e.g., bad password), or your browser does not understand how to
supply the credentials required.<br /><br />
Authentication required


</body>
</html>]
at
org.jclouds.openstack.nova.handlers.ParseNovaErrorFromHttpResponse.handleError(ParseNovaErrorFromHttpResponse.java:
57)
at
org.jclouds.http.handlers.DelegatingErrorHandler.handleError(DelegatingErrorHandler.java:
69)
at org.jclouds.http.internal.BaseHttpCommandExecutorService
$HttpResponseCallable.shouldContinue(BaseHttpCommandExecutorService.java:
192)
at org.jclouds.http.internal.BaseHttpCommandExecutorService
$HttpResponseCallable.call(BaseHttpCommandExecutorService.java:162)
at org.jclouds.http.internal.BaseHttpCommandExecutorService
$HttpResponseCallable.call(BaseHttpCommandExecutorService.java:130)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:314)
at java.util.concurrent.FutureTask.run(FutureTask.java:149)
at java.util.concurrent.ThreadPoolExecutor
$Worker.runTask(ThreadPoolExecutor.java:897)
at java.util.concurrent.ThreadPoolExecutor
$Worker.run(ThreadPoolExecutor.java:919)
at java.lang.Thread.run(Thread.java:736)
at
org.jclouds.concurrent.config.ExecutorServiceModule.getStackTraceHere(ExecutorServiceModule.java:
377)
at org.jclouds.concurrent.config.ExecutorServiceModule
$DescribingExecutorService.submit(ExecutorServiceModule.java:184)
at
org.jclouds.http.internal.BaseHttpCommandExecutorService.submit(BaseHttpCommandExecutorService.java:
127)
at
org.jclouds.http.TransformingHttpCommandExecutorServiceImpl.submit(TransformingHttpCommandExecutorServiceImpl.java:
54)
at
org.jclouds.http.TransformingHttpCommandImpl.execute(TransformingHttpCommandImpl.java:
73)
at
org.jclouds.rest.internal.AsyncRestClientProxy.createListenableFutureForHttpRequestMappedToMethodAndArgs(AsyncRestClientProxy.java:
248)
at
org.jclouds.rest.internal.AsyncRestClientProxy.invoke(AsyncRestClientProxy.java:
148)
at $Proxy60.authenticate(Unknown Source)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:
60)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:
37)
at java.lang.reflect.Method.invoke(Method.java:611)
at org.jclouds.concurrent.internal.SyncProxy.invoke(SyncProxy.java:
159)
at $Proxy61.authenticate(Unknown Source)
at org.jclouds.openstack.config.OpenStackAuthenticationModule
$GetAuthenticationResponse$1.apply(OpenStackAuthenticationModule.java:
100)
at org.jclouds.openstack.config.OpenStackAuthenticationModule
$GetAuthenticationResponse$1.apply(OpenStackAuthenticationModule.java:
96)
at
org.jclouds.concurrent.RetryOnTimeOutExceptionFunction.apply(RetryOnTimeOutExceptionFunction.java:
49)
at com.google.common.cache.CacheLoader
$FunctionToCacheLoader.load(CacheLoader.java:119)
at com.google.common.cache.LocalCache
$LoadingValueReference.loadFuture(LocalCache.java:3568)
at com.google.common.cache.LocalCache
$Segment.loadSync(LocalCache.java:2350)
at com.google.common.cache.LocalCache
$Segment.lockedGetOrLoad(LocalCache.java:2313)
at com.google.common.cache.LocalCache$Segment.get(LocalCache.java:
2228)
at com.google.common.cache.LocalCache.get(LocalCache.java:3965)
at com.google.common.cache.LocalCache.getOrLoad(LocalCache.java:3969)
at com.google.common.cache.LocalCache
$LocalManualCache.get(LocalCache.java:4829)
at com.google.common.cache.LocalCache
$LocalManualCache.getUnchecked(LocalCache.java:4834)
at org.jclouds.openstack.config.OpenStackAuthenticationModule
$3.get(OpenStackAuthenticationModule.java:127)
at org.jclouds.openstack.config.OpenStackAuthenticationModule
$3.get(OpenStackAuthenticationModule.java:124)
at
org.jclouds.openstack.functions.URIFromAuthenticationResponseForService.get(URIFromAuthenticationResponseForService.java:
48)
at
org.jclouds.openstack.functions.URIFromAuthenticationResponseForService.get(URIFromAuthenticationResponseForService.java:
31)
at
org.jclouds.rest.internal.RestAnnotationProcessor.getEndpointFor(RestAnnotationProcessor.java:
778)
at
org.jclouds.rest.internal.RestAnnotationProcessor.createRequest(RestAnnotationProcessor.java:
425)
at
org.jclouds.rest.internal.AsyncRestClientProxy.createListenableFutureForHttpRequestMappedToMethodAndArgs(AsyncRestClientProxy.java:
237)
at
org.jclouds.rest.internal.AsyncRestClientProxy.invoke(AsyncRestClientProxy.java:
148)
at $Proxy73.listServers(Unknown Source)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:
60)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:
37)
at java.lang.reflect.Method.invoke(Method.java:611)
at org.jclouds.concurrent.internal.SyncProxy.invoke(SyncProxy.java:
159)
at $Proxy74.listServers(Unknown Source)
at
org.jclouds.openstack.nova.compute.strategy.NovaComputeServiceAdapter.listNodes(NovaComputeServiceAdapter.java:
80)
at
org.jclouds.compute.strategy.impl.AdaptingComputeServiceStrategies.listDetailsOnNodesMatching(AdaptingComputeServiceStrategies.java:
108)
at
org.jclouds.compute.internal.BaseComputeService.listNodesDetailsMatching(BaseComputeService.java:
333)
at com.ibm.pds.va.VA.listVMInstances(VA.java:383)
at
com.ibm.pds.test.vahandler.VACmdTester.listAllVMInstances(VACmdTester.java:
337)
at com.ibm.pds.test.vahandler.VACmdTester.cmdLoop(VACmdTester.java:
156)
at com.ibm.pds.test.vahandler.VACmdTester.main(VACmdTester.java:61)
at
org.jclouds.concurrent.config.ExecutorServiceModule.getStackTraceHere(ExecutorServiceModule.java:
377)
at org.jclouds.concurrent.config.ExecutorServiceModule
$DescribingExecutorService.submit(ExecutorServiceModule.java:184)
at
org.jclouds.http.internal.BaseHttpCommandExecutorService.submit(BaseHttpCommandExecutorService.java:
127)
at
org.jclouds.http.TransformingHttpCommandExecutorServiceImpl.submit(TransformingHttpCommandExecutorServiceImpl.java:
54)
at
org.jclouds.http.TransformingHttpCommandImpl.execute(TransformingHttpCommandImpl.java:
73)
at
org.jclouds.rest.internal.AsyncRestClientProxy.createListenableFutureForHttpRequestMappedToMethodAndArgs(AsyncRestClientProxy.java:
248)
at
org.jclouds.rest.internal.AsyncRestClientProxy.invoke(AsyncRestClientProxy.java:
148)
at $Proxy60.authenticate(Unknown Source)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:
60)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:
37)
at java.lang.reflect.Method.invoke(Method.java:611)
at org.jclouds.concurrent.internal.SyncProxy.invoke(SyncProxy.java:
159)
at $Proxy61.authenticate(Unknown Source)
at org.jclouds.openstack.config.OpenStackAuthenticationModule
$GetAuthenticationResponse$1.apply(OpenStackAuthenticationModule.java:
100)
at org.jclouds.openstack.config.OpenStackAuthenticationModule
$GetAuthenticationResponse$1.apply(OpenStackAuthenticationModule.java:
96)
at
org.jclouds.concurrent.RetryOnTimeOutExceptionFunction.apply(RetryOnTimeOutExceptionFunction.java:
49)
at com.google.common.cache.CacheLoader
$FunctionToCacheLoader.load(CacheLoader.java:119)
at com.google.common.cache.LocalCache
$LoadingValueReference.loadFuture(LocalCache.java:3568)
at com.google.common.cache.LocalCache
$Segment.loadSync(LocalCache.java:2350)
at com.google.common.cache.LocalCache
$Segment.lockedGetOrLoad(LocalCache.java:2313)
at com.google.common.cache.LocalCache$Segment.get(LocalCache.java:
2228)
at com.google.common.cache.LocalCache.get(LocalCache.java:3965)
at com.google.common.cache.LocalCache.getOrLoad(LocalCache.java:3969)
at com.google.common.cache.LocalCache
$LocalManualCache.get(LocalCache.java:4829)
at com.google.common.cache.LocalCache
$LocalManualCache.getUnchecked(LocalCache.java:4834)
at org.jclouds.openstack.config.OpenStackAuthenticationModule
$3.get(OpenStackAuthenticationModule.java:127)
at org.jclouds.openstack.config.OpenStackAuthenticationModule
$3.get(OpenStackAuthenticationModule.java:124)
at
org.jclouds.openstack.functions.URIFromAuthenticationResponseForService.get(URIFromAuthenticationResponseForService.java:
48)
at
org.jclouds.openstack.functions.URIFromAuthenticationResponseForService.get(URIFromAuthenticationResponseForService.java:
31)
at
org.jclouds.rest.internal.RestAnnotationProcessor.getEndpointFor(RestAnnotationProcessor.java:
778)
at
org.jclouds.rest.internal.RestAnnotationProcessor.createRequest(RestAnnotationProcessor.java:
425)
at
org.jclouds.rest.internal.AsyncRestClientProxy.createListenableFutureForHttpRequestMappedToMethodAndArgs(AsyncRestClientProxy.java:
237)
at
org.jclouds.rest.internal.AsyncRestClientProxy.invoke(AsyncRestClientProxy.java:
148)
at $Proxy73.listServers(Unknown Source)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:
60)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:
37)
at java.lang.reflect.Method.invoke(Method.java:611)
at org.jclouds.concurrent.internal.SyncProxy.invoke(SyncProxy.java:
159)
at $Proxy74.listServers(Unknown Source)
at
org.jclouds.openstack.nova.compute.strategy.NovaComputeServiceAdapter.listNodes(NovaComputeServiceAdapter.java:
80)
at
org.jclouds.compute.strategy.impl.AdaptingComputeServiceStrategies.listDetailsOnNodesMatching(AdaptingComputeServiceStrategies.java:
108)
at
org.jclouds.compute.internal.BaseComputeService.listNodesDetailsMatching(BaseComputeService.java:
333)
at com.ibm.pds.va.VA.listVMInstances(VA.java:383)
at
com.ibm.pds.test.vahandler.VACmdTester.listAllVMInstances(VACmdTester.java:
337)
at com.ibm.pds.test.vahandler.VACmdTester.cmdLoop(VACmdTester.java:
156)
at com.ibm.pds.test.vahandler.VACmdTester.main(VACmdTester.java:61)
Caused by: org.jclouds.http.HttpResponseException: command: GET
http://9.148.27.67:8774/v1.1 HTTP/1.1 failed with response: HTTP/1.1
401 Unauthorized; content: [<html>
<head>
<title>401 Unauthorized</title>
</head>
<body>
<h1>401 Unauthorized</h1>
This server could not verify that you are authorized to access the
document you requested. Either you supplied the wrong credentials
(e.g., bad password), or your browser does not understand how to
supply the credentials required.<br /><br />
Authentication required


</body>
</html>]
at
org.jclouds.openstack.nova.handlers.ParseNovaErrorFromHttpResponse.handleError(ParseNovaErrorFromHttpResponse.java:
54)
at
org.jclouds.http.handlers.DelegatingErrorHandler.handleError(DelegatingErrorHandler.java:
69)
at org.jclouds.http.internal.BaseHttpCommandExecutorService
$HttpResponseCallable.shouldContinue(BaseHttpCommandExecutorService.java:
192)
at org.jclouds.http.internal.BaseHttpCommandExecutorService
$HttpResponseCallable.call(BaseHttpCommandExecutorService.java:162)
at org.jclouds.http.internal.BaseHttpCommandExecutorService
$HttpResponseCallable.call(BaseHttpCommandExecutorService.java:130)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:314)
at java.util.concurrent.FutureTask.run(FutureTask.java:149)
at java.util.concurrent.ThreadPoolExecutor
$Worker.runTask(ThreadPoolExecutor.java:897)
at java.util.concurrent.ThreadPoolExecutor
$Worker.run(ThreadPoolExecutor.java:919)
at java.lang.Thread.run(Thread.java:736)

Adrian Cole

unread,
May 6, 2012, 11:33:58 AM5/6/12
to jcl...@googlegroups.com

Hi, Kenneth.

In github jclouds-examples compute-basics, there's example syntax for openstack-nova.  I believe you are missing the tenantId.

-A

--
You received this message because you are subscribed to the Google Groups "jclouds" group.
To post to this group, send email to jcl...@googlegroups.com.
To unsubscribe from this group, send email to jclouds+u...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/jclouds?hl=en.

Kenneth Nagin

unread,
May 6, 2012, 12:12:29 PM5/6/12
to jclouds
How do you get the tenantId for a particular user?
> > My endpoint is set tohttp://9.148.27.67:8774/
> ...
>
> read more »

Adrian Cole

unread,
May 6, 2012, 2:18:27 PM5/6/12
to jcl...@googlegroups.com

I believe this is the project id in your output.

-A

Kenneth Nagin

unread,
May 7, 2012, 9:02:31 AM5/7/12
to jclouds
I tried your suggestion but it did not work.
I was using "nova" as the provider id. Since that failed I switched
to
"openstack-nova" to see if I would have better luck, but I'm still
getting 401.

I tried many different combinations including:
username:username password
tenantId:username password
userId:username passord
I also tried using ports 5000 and 35357.

This is the output from the nova API:
nova --os_username admin --os_password passw0rd --os_tenant_name
admin --os_auth_url http://lnx-ensure2:35357/v2.0/ credentials
+------------------
+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+
| User Credentials
|
Value
|
+------------------
+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+
| id |
5105619edbd6488c9dda821e70b2bb78
|
| name |
admin
|
| roles | [{u'id': u'0c6076019ea2401592b7cc526d482a4e',
u'name': u'admin'}, {u'id': u'a9a228c28766490197ed844be0599bf3',
u'name': u'KeystoneAdmin'}, {u'id':
u'8186b2b194114fb7ada7c28f05e57e9a', u'name':
u'KeystoneServiceAdmin'}] |
| roles_links |
[]
|
| username |
admin
|
+------------------
+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+
+---------
+---------------------------------------------------------------------------------------------------------
+
| Token |
Value |
+---------
+---------------------------------------------------------------------------------------------------------
+
| expires |
2012-05-08T11:15:44Z
|
| id |
7d7cc8f7ca8546c5b7a9f3699ef019db
|
| tenant | {u'id': u'6dd04c1d6ccb4ae1a9acc355c3c98886', u'enabled':
True, u'description': None, u'name': u'admin'} |
+---------
+---------------------------------------------------------------------------------------------------------
+

Which values do you think I should use?

I'm setting the following override properties
Constants.PROPERTY_ENDPOINT,
Constants.PROPERTY_TRUST_ALL_CERTS, "true");
Constants.PROPERTY_CREDENTIAL,"passwordCredentials");
"jclouds.keystone.credential-type","passwordCredentials")

Are these the correct properties?
> ...
>
> read more »

Adrian Cole

unread,
May 7, 2012, 9:55:04 AM5/7/12
to jcl...@googlegroups.com

Hi, Kenneth.

Sorry you are having trouble. While it is possible that there's a code issue, the fact that others are able to use Essex makes me think there's use in us digging deeper.

Let's recap:

So you've tried the compute-basics example with the instructions in the readme against an Essex keystone endpoint built with devstack and it threw an authorization error?  Can you send the actual command and output?  What you sent doesn't look like code from the example.

The next step from here is always to enable log debug.  Can you uncomment out the lines in arc/main/resources/logback.xml and mvn install, run again?

You should see the auth error that fails.

Good luck!
-A

Kenneth Nagin

unread,
May 7, 2012, 11:33:58 AM5/7/12
to jclouds
I also am assuming that it is a user error.
The trace helped a lot. It uncovered the first user error which was
me setting
Constants.PROPERTY_CREDENTIAL to the literal "passwordCredentials" (I
thought I was indicating the type credential testing.) Anyway the
overrides are now:
overrides.setProperty("openstack-nova.endpoint", endpointurl;
overrides.setProperty(Constants.PROPERTY_TRUST_ALL_CERTS, "true");
overrides.setProperty("jclouds.keystone.credential-
type","passwordCredentials");

The problem is not solved yet.
The first part of the trace I ran using tenant id. I see from the
trace that
that it seems to want the tenantName instead. So I replaced it with
the user name "admin".
Now it returns a 404 not found.

What do you suggest?


This is the trace:
[0] 6:13:02 PM main VACmdTester.main: entering
initComputeService: openstack-nova,
5105619edbd6488c9dda821e70b2bb78:admin,passw0rd
[0] 6:13:02 PM connecting VA.initComputeService: to openstack-nova
identity=5105619edbd6488c9dda821e70b2bb78:admin credetials=passw0rd
properties={openstack-nova.endpoint=http://lnx-ensure2:35357,
jclouds.endpoint=http://lnx-ensure2:35357, jclouds.trust-all-
certs=true, jclouds.keystone.credential-type=passwordCredentials}
enter command :

listAllVMInstances
[0] 6:13:16 PM ENTRY VA.listVMInstances:
- >> listing node details matching(ALWAYS_TRUE)
- >> "{"auth":{"passwordCredentials":
{"username":"admin","password":"passw0rd"},"tenantName":"5105619edbd6488c9dda821e70b2bb78"}}"
- >> POST http://lnx-ensure2:35357/v2.0/tokens HTTP/1.1
- >> Accept: application/json
- >> Content-Type: application/json
- >> Content-Length: 123
- << HTTP/1.1 200 OK
- << Vary: X-Auth-Token
- << Transfer-Encoding: chunked
- << Date: Mon, 07 May 2012 15:13:16 GMT
- << Connection: keep-alive
- << Content-Type: application/json
- << "{"access": {"token": {"expires": "2012-05-08T15:13:16Z", "id":
"d176ae7c8d4e4a81801e4a4a7617fdd1"}, "serviceCatalog": {}, "user":
{"username": "admin", "roles_links": [], "id":
"5105619edbd6488c9dda821e70b2bb78", "roles": [], "name": "admin"}}}"
com.google.common.util.concurrent.UncheckedExecutionException:
java.lang.IllegalStateException: Expected BEGIN_ARRAY but was
BEGIN_OBJECT at line 1 column 120
at com.google.common.cache.LocalCache$Segment.get(LocalCache.java:
2256)
at com.google.common.cache.LocalCache.get(LocalCache.java:3980)
at com.google.common.cache.LocalCache.getOrLoad(LocalCache.java:3984)
at com.google.common.cache.LocalCache
$LocalLoadingCache.get(LocalCache.java:4868)
at
org.jclouds.openstack.keystone.v2_0.config.KeystoneAuthenticationModule
$2.get(KeystoneAuthenticationModule.java:223)
at
org.jclouds.openstack.keystone.v2_0.config.KeystoneAuthenticationModule
$2.get(KeystoneAuthenticationModule.java:219)
at
org.jclouds.openstack.keystone.v2_0.suppliers.LocationIdToURIFromAccessForTypeAndVersionSupplier.get(LocationIdToURIFromAccessForTypeAndVersionSupplier.java:
61)
at
org.jclouds.openstack.keystone.v2_0.suppliers.LocationIdToURIFromAccessForTypeAndVersionSupplier.get(LocationIdToURIFromAccessForTypeAndVersionSupplier.java:
40)
at
org.jclouds.rest.suppliers.SetAndThrowAuthorizationExceptionSupplier.get(SetAndThrowAuthorizationExceptionSupplier.java:
49)
at
org.jclouds.concurrent.RetryOnTimeOutExceptionSupplier.get(RetryOnTimeOutExceptionSupplier.java:
47)
at
org.jclouds.util.Suppliers2$ExpiringMemoizingSupplier.get(Suppliers2.java:
130)
at
org.jclouds.rest.suppliers.MemoizedRetryOnTimeOutButNotOnAuthorizationExceptionSupplier.get(MemoizedRetryOnTimeOutButNotOnAuthorizationExceptionSupplier.java:
64)
at
org.jclouds.location.suppliers.derived.ZoneIdsFromZoneIdToURIKeySet.get(ZoneIdsFromZoneIdToURIKeySet.java:
48)
at
org.jclouds.location.suppliers.derived.ZoneIdsFromZoneIdToURIKeySet.get(ZoneIdsFromZoneIdToURIKeySet.java:
36)
at
org.jclouds.rest.suppliers.SetAndThrowAuthorizationExceptionSupplier.get(SetAndThrowAuthorizationExceptionSupplier.java:
49)
at
org.jclouds.concurrent.RetryOnTimeOutExceptionSupplier.get(RetryOnTimeOutExceptionSupplier.java:
47)
at
org.jclouds.util.Suppliers2$ExpiringMemoizingSupplier.get(Suppliers2.java:
130)
at
org.jclouds.rest.suppliers.MemoizedRetryOnTimeOutButNotOnAuthorizationExceptionSupplier.get(MemoizedRetryOnTimeOutButNotOnAuthorizationExceptionSupplier.java:
64)
at
org.jclouds.openstack.nova.v1_1.compute.NovaComputeServiceAdapter.listNodes(NovaComputeServiceAdapter.java:
174)
at
org.jclouds.compute.strategy.impl.AdaptingComputeServiceStrategies.listDetailsOnNodesMatching(AdaptingComputeServiceStrategies.java:
108)
at
org.jclouds.compute.internal.BaseComputeService.listNodesDetailsMatching(BaseComputeService.java:
346)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:
60)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:
37)
at java.lang.reflect.Method.invoke(Method.java:611)
at
com.google.inject.internal.DelegatingInvocationHandler.invoke(DelegatingInvocationHandler.java:
37)
at $Proxy69.listNodesDetailsMatching(Unknown Source)
at com.ibm.pds.va.VA.listVMInstances(VA.java:427)
at
com.ibm.pds.test.vahandler.VACmdTester.listAllVMInstances(VACmdTester.java:
346)
at com.ibm.pds.test.vahandler.VACmdTester.cmdLoop(VACmdTester.java:
156)
at com.ibm.pds.test.vahandler.VACmdTester.main(VACmdTester.java:61)
Caused by: java.lang.IllegalStateException: Expected BEGIN_ARRAY but
was BEGIN_OBJECT at line 1 column 120
at com.google.gson.stream.JsonReader.expect(JsonReader.java:339)
at com.google.gson.stream.JsonReader.beginArray(JsonReader.java:306)
at com.google.gson.internal.bind.CollectionTypeAdapterFactory
$Adapter.read(CollectionTypeAdapterFactory.java:79)
at com.google.gson.internal.bind.CollectionTypeAdapterFactory
$Adapter.read(CollectionTypeAdapterFactory.java:60)
at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory
$1.read(ReflectiveTypeAdapterFactory.java:93)
at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory
$Adapter.read(ReflectiveTypeAdapterFactory.java:176)
at com.google.gson.Gson.fromJson(Gson.java:755)
at
org.jclouds.http.functions.ParseFirstJsonValueNamed.apply(ParseFirstJsonValueNamed.java:
81)
at
org.jclouds.http.functions.ParseFirstJsonValueNamed.apply(ParseFirstJsonValueNamed.java:
48)
at com.google.common.util.concurrent.Futures$3.apply(Futures.java:
380)
at com.google.common.util.concurrent.Futures
$ChainingListenableFuture.run(Futures.java:522)
at java.util.concurrent.ThreadPoolExecutor
$Worker.runTask(ThreadPoolExecutor.java:897)
at java.util.concurrent.ThreadPoolExecutor
$Worker.run(ThreadPoolExecutor.java:919)
at java.lang.Thread.run(Thread.java:736)
enter command :

connect lnx-ensure2.admin2
initComputeService: nova,admin:admin,passw0rd
[0] 6:15:12 PM connecting VA.initComputeService: to nova
identity=admin:admin credetials=passw0rd properties={jclouds.relax-
hostname=true, jclouds.endpoint=http://lnx-ensure2, jclouds.api-
version=1.1, jclouds.trust-all-certs=true}
enter command :

listAllVMInstances
[0] 6:15:40 PM ENTRY VA.listVMInstances:
- >> listing node details matching(ALWAYS_TRUE)
- >> GET http://lnx-ensure2/v1.1 HTTP/1.1
- >> X-Auth-User: admin:admin
- >> X-Auth-Key: passw0rd
- >> Accept: */*
- << HTTP/1.1 404 NOT FOUND
- << Vary: Accept-Language,Cookie,Accept-Encoding
- << Server: Apache/2.2.22 (Ubuntu)
- << Keep-Alive: timeout=5, max=100
- << Transfer-Encoding: chunked
- << Date: Mon, 07 May 2012 15:15:40 GMT
- << Connection: Keep-Alive
- << Content-Type: text/html
- << Content-Language: en
- << "[\n]"
- << "<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">[\n]"
- << "<html lang="en">[\n]"
- << "<head>[\n]"
- << " <meta http-equiv="content-type" content="text/html;
charset=utf-8">[\n]"
- << " <title>Page not found at /v1.1</title>[\n]"
- << " <meta name="robots" content="NONE,NOARCHIVE">[\n]"
- << " <style type="text/css">[\n]"
- << " html * { padding:0; margin:0; }[\n]"
- << " body * { padding:10px 20px; }[\n]"
- << " body * * { padding:0; }[\n]"
- << " body { font:small sans-serif; background:#eee; }[\n]"
- << " body>div { border-bottom:1px solid #ddd; }[\n]"
- << " h1 { font-weight:normal; margin-bottom:.4em; }[\n]"
- << " h1 span { font-size:60%; color:#666; font-weight:normal; }
[\n]"
- << " table { border:none; border-collapse: collapse; width:100%; }
[\n]"
- << " td, th { vertical-align:top; padding:2px 3px; }[\n]"
- << " th { width:12em; text-align:right; color:#666; padding-
right:.5em; }[\n]"
- << " #info { background:#f6f6f6; }[\n]"
- << " #info ol { margin: 0.5em 4em; }[\n]"
- << " #info ol li { font-family: monospace; }[\n]"
- << " #summary { background: #ffc; }[\n]"
- << " #explanation { background:#eee; border-bottom: 0px none; }
[\n]"
- << " </style>[\n]"
- << "</head>[\n]"
- << "<body>[\n]"
- << " <div id="summary">[\n]"
- << " <h1>Page not found <span>(404)</span></h1>[\n]"
- << " <table class="meta">[\n]"
- << " <tr>[\n]"
- << " <th>Request Method:</th>[\n]"
- << " <td>GET</td>[\n]"
- << " </tr>[\n]"
- << " <tr>[\n]"
- << " <th>Request URL:</th>[\n]"
- << " <td>http://lnx-ensure2/v1.1</td>[\n]"
- << " </tr>[\n]"
- << " </table>[\n]"
- << " </div>[\n]"
- << " <div id="info">[\n]"
- << " [\n]"
- << " <p>[\n]"
- << " Using the URLconf defined in
<code>openstack_dashboard.urls</code>,[\n]"
- << " Django tried these URL patterns, in this order:[\n]"
- << " </p>[\n]"
- << " <ol>[\n]"
- << " [\n]"
- << " <li>[\n]"
- << " [\n]"
- << " ^$[\n]"
- << " [name='splash'][\n]"
- << " [\n]"
- << " </li>[\n]"
- << " [\n]"
- << " <li>[\n]"
- << " [\n]"
- << " ^qunit/$[\n]"
- << " [name='qunit_tests'][\n]"
- << " [\n]"
- << " </li>[\n]"
- << " [\n]"
- << " <li>[\n]"
- << " [\n]"
- << " [\n]"
- << " [\n]"
- << " [\n]"
- << " home/$[\n]"
- << " [name='user_home'][\n]"
- << " [\n]"
- << " </li>[\n]"
- << " [\n]"
- << " <li>[\n]"
- << " [\n]"
- << " [\n]"
- << " [\n]"
- << " [\n]"
- << " auth/login/$[\n]"
- << " [name='auth_login'][\n]"
- << " [\n]"
- << " </li>[\n]"
- << " [\n]"
- << " <li>[\n]"
- << " [\n]"
- << " [\n]"
- << " [\n]"
- << " [\n]"
- << " auth/logout/$[\n]"
- << " [name='auth_logout'][\n]"
- << " [\n]"
- << " </li>[\n]"
- << " [\n]"
- << " <li>[\n]"
- << " [\n]"
- << " [\n]"
- << " [\n]"
- << " [\n]"
- << " auth/switch/(?P&lt;tenant_id&gt;[^/]+)/$[\n]"
- << " [name='auth_switch'][\n]"
- << " [\n]"
- << " </li>[\n]"
- << " [\n]"
- << " <li>[\n]"
- << " [\n]"
- << " [\n]"
- << " [\n]"
- << " [\n]"
- << " ^i18n/setlang/$[\n]"
- << " [name='set_language'][\n]"
- << " [\n]"
- << " </li>[\n]"
- << " [\n]"
- << " <li>[\n]"
- << " [\n]"
- << " [\n]"
- << " [\n]"
- << " [\n]"
- << " ^i18n/[\n]"
- << " [\n]"
- << " [\n]"
- << " </li>[\n]"
- << " [\n]"
- << " <li>[\n]"
- << " [\n]"
- << " [\n]"
- << " [\n]"
- << " [\n]"
- << " ^settings/[\n]"
- << " [\n]"
- << " [\n]"
- << " </li>[\n]"
- << " [\n]"
- << " <li>[\n]"
- << " [\n]"
- << " [\n]"
- << " [\n]"
- << " [\n]"
- << " ^nova/[\n]"
- << " [\n]"
- << " [\n]"
- << " </li>[\n]"
- << " [\n]"
- << " <li>[\n]"
- << " [\n]"
- << " [\n]"
- << " [\n]"
- << " [\n]"
- << " ^syspanel/[\n]"
- << " [\n]"
- << " [\n]"
- << " </li>[\n]"
- << " [\n]"
- << " <li>[\n]"
- << " [\n]"
- << " ^static\/(?P&lt;path&gt;.*)$[\n]"
- << " [\n]"
- << " [\n]"
- << " </li>[\n]"
- << " [\n]"
- << " <li>[\n]"
- << " [\n]"
- << " ^media\/(?P&lt;path&gt;.*)$[\n]"
- << " [\n]"
- << " [\n]"
- << " </li>[\n]"
- << " [\n]"
- << " </ol>[\n]"
- << " <p>The current URL, <code>v1.1</code>, didn't match any of
these.</p>[\n]"
- << " [\n]"
- << " </div>[\n]"
- << "[\n]"
- << " <div id="explanation">[\n]"
- << " <p>[\n]"
- << " You're seeing this error because you have <code>DEBUG =
True</code> in[\n]"
- << " your Django settings file. Change that to <code>False</
code>, and Django[\n]"
- << " will display a standard 404 page.[\n]"
- << " </p>[\n]"
- << " </div>[\n]"
- << "</body>[\n]"
- << "</html>[\n]"
- << list(0)
[0] 6:15:40 PM RETURN VA.listVMInstances:
enter command :



On May 7, 4:55 pm, Adrian Cole <adrian.f.c...@gmail.com> wrote:
> Hi, Kenneth.
>
> ...
>
> read more »

Kenneth Nagin

unread,
May 8, 2012, 5:19:35 AM5/8/12
to jclouds
I discovered by adding a forward slash to the port (either 5000 or
35357 ) the request to list servers intially responds with at 200
when jclouds the necessary tokens and creditials.
However the follow-up requests by jclouds finds fails authentication
because it is trying to access the localhost and not openstack
server.

If my interpretation of the trace is correct the json response from
the initial request is the source of the probem since it
is specifying the localhost.

Does someone know how I should configure the system so it reponse with
the proper urls?

This is the trace:
[0] 11:19:41 AM ENTRY VA.listVMInstances:
- >> listing node details matching(ALWAYS_TRUE)
- >> "{"auth":{"passwordCredentials":
{"username":"admin","password":"passw0rd"},"tenantName":"admin"}}"
- >> POST http://lnx-ensure2:5000/v2.0/tokens HTTP/1.1
- >> Accept: application/json
- >> Content-Type: application/json
- >> Content-Length: 96
- << HTTP/1.1 200 OK
- << Vary: X-Auth-Token
- << Transfer-Encoding: chunked
- << Date: Tue, 08 May 2012 08:19:41 GMT
- << Connection: keep-alive
- << Content-Type: application/json
- << "{"access": {"token": {"expires": "2012-05-09T08:19:41Z", "id":
"18100387f9ff4c80ba4ed56e2e153367", "tenant": {"description": null,
"enabled": true, "id": "6dd04c1d6ccb4ae1a9acc355c3c98886", "name":
"admin"}}, "serviceCatalog": [{"endpoints": [{"adminURL": "http://
localhost:8776/v1/6dd04c1d6ccb4ae1a9acc355c3c98886", "region":
"RegionOne", "publicURL": "http://localhost:8776/
v1/6dd04c1d6ccb4ae1a9acc355c3c98886", "internalURL": "http://localhost:
8776/v1/6dd04c1d6ccb4ae1a9acc355c3c98886"}], "endpoints_links": [],
"type": "volume", "name": "Volume Service"}, {"endpoints":
[{"adminURL": "http://localhost:9292/v1", "region": "RegionOne",
"publicURL": "http://localhost:9292/v1", "internalURL": "http://
localhost:9292/v1"}], "endpoints_links": [], "type": "image", "name":
"Image Service"}, {"endpoints": [{"adminURL": "http://localhost:8774/
v1.1/6dd04c1d6ccb4ae1a9acc355c3c98886", "region": "RegionOne",
"publicURL": "http://localhost:8774/
v1.1/6dd04c1d6ccb4ae1a9acc355c3c98886", "internalURL": "http://
localhost:8774/v1.1/6dd04c1d6ccb4ae1a9acc355c3c98886"}],
"endpoints_links": [], "type": "compute", "name": "Compute Service"},
{"endpoints": [{"adminURL": "http://localhost:8773/services/Admin",
"region": "RegionOne", "publicURL": "http://localhost:8773/services/
Cloud", "internalURL": "http://localhost:8773/services/Cloud"}],
"endpoints_links": [], "type": "ec2", "name": "EC2 Service"},
{"endpoints": [{"adminURL": "http://localhost:35357/v2.0", "region":
"RegionOne", "publicURL": "http://localhost:5000/v2.0", "internalURL":
"http://localhost:5000/v2.0"}], "endpoints_links": [], "type":
"identity", "name": "Identity Service"}], "user": {"username":
"admin", "roles_links": [], "id": "5105619edbd6488c9dda821e70b2bb78",
"roles": [{"id": "0c6076019ea2401592b7cc526d482a4e", "name": "admin"},
{"id": "a9a228c28766490197ed844be0599bf3", "name": "KeystoneAdmin"},
{"id": "8186b2b194114fb7ada7c28f05e57e9a", "name":
"KeystoneServiceAdmin"}], "name": "admin"}}}"
- >> GET http://localhost:8774/v1.1/6dd04c1d6ccb4ae1a9acc355c3c98886/servers/detail
HTTP/1.1
- >> Accept: application/json
- >> X-Auth-Token: 18100387f9ff4c80ba4ed56e2e153367
- >> GET http://localhost:8774/v1.1/6dd04c1d6ccb4ae1a9acc355c3c98886/servers/detail
HTTP/1.1
- >> Accept: application/json
- >> X-Auth-Token: 18100387f9ff4c80ba4ed56e2e153367
- >> GET http://localhost:8774/v1.1/6dd04c1d6ccb4ae1a9acc355c3c98886/servers/detail
HTTP/1.1
- >> Accept: application/json
- >> X-Auth-Token: 18100387f9ff4c80ba4ed56e2e153367
- >> GET http://localhost:8774/v1.1/6dd04c1d6ccb4ae1a9acc355c3c98886/servers/detail
HTTP/1.1
- >> Accept: application/json
- >> X-Auth-Token: 18100387f9ff4c80ba4ed56e2e153367
- >> GET http://localhost:8774/v1.1/6dd04c1d6ccb4ae1a9acc355c3c98886/servers/detail
HTTP/1.1
- >> Accept: application/json
- >> X-Auth-Token: 18100387f9ff4c80ba4ed56e2e153367
- >> GET http://localhost:8774/v1.1/6dd04c1d6ccb4ae1a9acc355c3c98886/servers/detail
HTTP/1.1
- >> Accept: application/json
- >> X-Auth-Token: 18100387f9ff4c80ba4ed56e2e153367
- Cannot retry after server error, command has exceeded retry limit 5:
[method=ServerAsyncClient.listServersInDetail, request=GET
http://localhost:8774/v1.1/6dd04c1d6ccb4ae1a9acc355c3c98886/servers/detail
HTTP/1.1]
org.jclouds.http.HttpResponseException: Connection refused: connect
connecting to GET http://localhost:8774/v1.1/6dd04c1d6ccb4ae1a9acc355c3c98886/servers/detail
HTTP/1.1
at org.jclouds.http.internal.BaseHttpCommandExecutorService
$HttpResponseCallable.call(BaseHttpCommandExecutorService.java:176)
at org.jclouds.http.internal.BaseHttpCommandExecutorService
$HttpResponseCallable.call(BaseHttpCommandExecutorService.java:132)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:314)
at java.util.concurrent.FutureTask.run(FutureTask.java:149)
at java.util.concurrent.ThreadPoolExecutor
$Worker.runTask(ThreadPoolExecutor.java:897)
at java.util.concurrent.ThreadPoolExecutor
$Worker.run(ThreadPoolExecutor.java:919)
at java.lang.Thread.run(Thread.java:736)
at
org.jclouds.concurrent.config.ExecutorServiceModule.getStackTraceHere(ExecutorServiceModule.java:
369)
at org.jclouds.concurrent.config.ExecutorServiceModule
$DescribingExecutorService.submit(ExecutorServiceModule.java:182)
at
org.jclouds.http.internal.BaseHttpCommandExecutorService.submit(BaseHttpCommandExecutorService.java:
129)
at
org.jclouds.http.TransformingHttpCommandExecutorServiceImpl.submit(TransformingHttpCommandExecutorServiceImpl.java:
54)
at
org.jclouds.http.TransformingHttpCommandImpl.execute(TransformingHttpCommandImpl.java:
73)
at
org.jclouds.rest.internal.AsyncRestClientProxy.createListenableFutureForHttpRequestMappedToMethodAndArgs(AsyncRestClientProxy.java:
248)
at
org.jclouds.rest.internal.AsyncRestClientProxy.invoke(AsyncRestClientProxy.java:
148)
at $Proxy77.listServersInDetail(Unknown Source)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:
60)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:
37)
at java.lang.reflect.Method.invoke(Method.java:611)
at org.jclouds.concurrent.internal.SyncProxy.invoke(SyncProxy.java:
159)
at $Proxy78.listServersInDetail(Unknown Source)
at
org.jclouds.openstack.nova.v1_1.compute.NovaComputeServiceAdapter.listNodes(NovaComputeServiceAdapter.java:
175)
at
org.jclouds.compute.strategy.impl.AdaptingComputeServiceStrategies.listDetailsOnNodesMatching(AdaptingComputeServiceStrategies.java:
108)
at
org.jclouds.compute.internal.BaseComputeService.listNodesDetailsMatching(BaseComputeService.java:
346)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:
60)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:
37)
at java.lang.reflect.Method.invoke(Method.java:611)
at
com.google.inject.internal.DelegatingInvocationHandler.invoke(DelegatingInvocationHandler.java:
37)
at $Proxy69.listNodesDetailsMatching(Unknown Source)
at com.ibm.pds.va.VA.listVMInstances(VA.java:428)
at
com.ibm.pds.test.vahandler.VACmdTester.listAllVMInstances(VACmdTester.java:
346)
at com.ibm.pds.test.vahandler.VACmdTester.cmdLoop(VACmdTester.java:
156)
at com.ibm.pds.test.vahandler.VACmdTester.main(VACmdTester.java:61)
at
org.jclouds.concurrent.config.ExecutorServiceModule.getStackTraceHere(ExecutorServiceModule.java:
369)
at org.jclouds.concurrent.config.ExecutorServiceModule
$DescribingExecutorService.submit(ExecutorServiceModule.java:182)
at
org.jclouds.http.internal.BaseHttpCommandExecutorService.submit(BaseHttpCommandExecutorService.java:
129)
at
org.jclouds.http.TransformingHttpCommandExecutorServiceImpl.submit(TransformingHttpCommandExecutorServiceImpl.java:
54)
at
org.jclouds.http.TransformingHttpCommandImpl.execute(TransformingHttpCommandImpl.java:
73)
at
org.jclouds.rest.internal.AsyncRestClientProxy.createListenableFutureForHttpRequestMappedToMethodAndArgs(AsyncRestClientProxy.java:
248)
at
org.jclouds.rest.internal.AsyncRestClientProxy.invoke(AsyncRestClientProxy.java:
148)
at $Proxy77.listServersInDetail(Unknown Source)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:
60)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:
37)
at java.lang.reflect.Method.invoke(Method.java:611)
at org.jclouds.concurrent.internal.SyncProxy.invoke(SyncProxy.java:
159)
at $Proxy78.listServersInDetail(Unknown Source)
at
org.jclouds.openstack.nova.v1_1.compute.NovaComputeServiceAdapter.listNodes(NovaComputeServiceAdapter.java:
175)
at
org.jclouds.compute.strategy.impl.AdaptingComputeServiceStrategies.listDetailsOnNodesMatching(AdaptingComputeServiceStrategies.java:
108)
at
org.jclouds.compute.internal.BaseComputeService.listNodesDetailsMatching(BaseComputeService.java:
346)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:
60)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:
37)
at java.lang.reflect.Method.invoke(Method.java:611)
at
com.google.inject.internal.DelegatingInvocationHandler.invoke(DelegatingInvocationHandler.java:
37)
at $Proxy69.listNodesDetailsMatching(Unknown Source)
at com.ibm.pds.va.VA.listVMInstances(VA.java:428)
at
com.ibm.pds.test.vahandler.VACmdTester.listAllVMInstances(VACmdTester.java:
346)
at com.ibm.pds.test.vahandler.VACmdTester.cmdLoop(VACmdTester.java:
156)
at com.ibm.pds.test.vahandler.VACmdTester.main(VACmdTester.java:61)
Caused by: java.net.ConnectException: Connection refused: connect
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native
Method)
at
sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:
56)
at
sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:
39)
at java.lang.reflect.Constructor.newInstance(Constructor.java:527)
at sun.net.www.protocol.http.HttpURLConnection
$6.run(HttpURLConnection.java:1501)
at java.security.AccessController.doPrivileged(AccessController.java:
251)
at
sun.net.www.protocol.http.HttpURLConnection.getChainedException(HttpURLConnection.java:
1495)
at
sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:
1149)
at java.net.HttpURLConnection.getResponseCode(HttpURLConnection.java:
390)
at
org.jclouds.http.internal.JavaUrlHttpCommandExecutorService.invoke(JavaUrlHttpCommandExecutorService.java:
122)
at
org.jclouds.http.internal.JavaUrlHttpCommandExecutorService.invoke(JavaUrlHttpCommandExecutorService.java:
80)
at org.jclouds.http.internal.BaseHttpCommandExecutorService
$HttpResponseCallable.call(BaseHttpCommandExecutorService.java:155)
at org.jclouds.http.internal.BaseHttpCommandExecutorService
$HttpResponseCallable.call(BaseHttpCommandExecutorService.java:132)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:314)
at java.util.concurrent.FutureTask.run(FutureTask.java:149)
at java.util.concurrent.ThreadPoolExecutor
$Worker.runTask(ThreadPoolExecutor.java:897)
at java.util.concurrent.ThreadPoolExecutor
$Worker.run(ThreadPoolExecutor.java:919)
at java.lang.Thread.run(Thread.java:736)
Caused by: java.net.ConnectException: Connection refused: connect
at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:383)
at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:
245)
at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:232)
at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:377)
at java.net.Socket.connect(Socket.java:539)
at sun.net.NetworkClient.doConnect(NetworkClient.java:170)
at sun.net.www.http.HttpClient.openServer(HttpClient.java:407)
at sun.net.www.http.HttpClient.openServer(HttpClient.java:542)
at sun.net.www.http.HttpClient.<init>(HttpClient.java:246)
at sun.net.www.http.HttpClient.New(HttpClient.java:319)
at sun.net.www.http.HttpClient.New(HttpClient.java:336)
at
sun.net.www.protocol.http.HttpURLConnection.getNewHttpClient(HttpURLConnection.java:
980)
at
sun.net.www.protocol.http.HttpURLConnection.plainConnect(HttpURLConnection.java:
921)
at
sun.net.www.protocol.http.HttpURLConnection.connect(HttpURLConnection.java:
846)
at
sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:
1182)
at
org.jclouds.http.internal.JavaUrlHttpCommandExecutorService.invoke(JavaUrlHttpCommandExecutorService.java:
113)
... 8 more
> - << "              ...
>
> read more »

Mathieu Guillaume

unread,
May 8, 2012, 11:18:02 AM5/8/12
to jcl...@googlegroups.com

In your keystone.conf, you have a "catalog" section that probably looks like this:
[catalog]
driver = keystone.catalog.backends.templated.TemplatedCatalog
template_file = /etc/keystone/default_catalog.templates

Edit the "/etc/keystone/default_catalog.templates" file (or the one matching your configuration), then endpoints are defined in there.
Just replace "localhost" with your management node's public IP/name and restart keystone and you should be good to go.

Kenneth Nagin

unread,
May 9, 2012, 9:43:43 AM5/9/12
to jclouds
Thanks. That fixed the problem and I can now access nova using
jcloud's openstack-nova client!

I think it is worth summarizing what I learned so that others can
benefit from my experience.

In order to create an openstack-nova context use:
"openstack-nova", projectname:username, user's password.
Note: There is some confusion around the second parameter, i.e. the
identity parameter.
The open stack dashboard displays the projectname and username.
For some reason the dashboard's projectname is the same as the
tenantname used in the rest protocol.

You also have to set the property overrides
Constants.PROPERTY_ENDPOINT with your endpoint (see below).
For some back jclouds versions you might have to set "openstack-
nova.endpoint" property and the "jclouds.keystone.credential-type"
property to "passwordCredentials". But in the latest 1.5.0-alpha.6 it
is not necessary, but does not hurt.

The endpoint takes the form:
http://<public ip or dns name>:<public port | admin port>/ e.g.
http://myMngNode:5000/ or http://myMngNode:35357/
Beware: the forward slash, "/", at the end is important!
(note: I've found no difference between the keystone public port or
admin port, but maybe I'm missing something.)

As of 1.5.0-alpha.4
The sequence:
ComputeServiceContext context = new
ComputeServiceContextFactory().createContext(pProvider, pIdentity,
pCredential, modules, iProperties);
ComputeService computeservice = context.getComputeService();
Is replace by:
ContextBuilder builder =
ContextBuilder.newBuilder(pProvider).credentials(pIdentity,
pCredential).modules(modules).overrides(iProperties);
ComputeService computeservice =
builder.buildView(ComputeServiceContext.class).getComputeService();

-Kenneth

Adrian Cole

unread,
May 9, 2012, 9:59:18 AM5/9/12
to jcl...@googlegroups.com

Glad you are in business!

Note that you can discover info about what to place where by:

Apis.withId("openstack-nova#).identityName()

ApiMetada and ProviderMetadata are meant in part to help users figure out how to fill in blanks on unknown services.

Take care!
-A

Swetha Somula

unread,
May 17, 2012, 5:12:04 AM5/17/12
to jclouds
I am using Daiblo and provider as Nova. but when i try to list images
or servers it giving me null.
when i try to create a server or image it throwing me
ResourceNotFoundException?
Can anyone help me?
I am trying this from long time but no luck. I have followed the steps
as specified in Installation.
> >http://myMngNode:5000/ orhttp://myMngNode:35357/

Adrian Cole

unread,
May 17, 2012, 12:07:46 PM5/17/12
to jcl...@googlegroups.com
Hi, Swetha.

Please refrain from posting the same issue on two mail threads.

https://en.wikipedia.org/wiki/Crossposting

Thanks,
-A
Reply all
Reply to author
Forward
0 new messages