Hi,
I have a local devstack running on an Ubuntu host.
I am trying to query certain data, like volumes, using Apahce Jclouds openstack
libraries. But when I try to get anything from CinderApi, it throws below error
java.util.NoSuchElementException: no endpoints for apiType volume in service
endpoints [ServiceEndpoint{id=null, regionId=RegionOne,
url=http://x.x.x.x/placement, iface=PUBLIC, type=placement, version=null},
ServiceEndpoint{id=null, regionId=RegionOne, url=http://x.x.x.x/image,
iface=PUBLIC, type=image, version=null}, ServiceEndpoint{id=null,
regionId=RegionOne,
url=http://x.x.x.x/compute/v2/97a219626db1447882d6311535d635f5, iface=PUBLIC,
type=compute_legacy, version=null}, ServiceEndpoint{id=null,
regionId=RegionOne, url=http://x.x.x.x:9696/networking, iface=PUBLIC,
type=network, version=null}, ServiceEndpoint{id=null, regionId=RegionOne,
url=http://x.x.x.x/volume/v3, iface=PUBLIC, type=block-storage, version=null},
ServiceEndpoint{id=null, regionId=RegionOne, url=http://x.x.x.x/identity,
iface=PUBLIC, type=identity, version=null}, ServiceEndpoint{id=null,
regionId=RegionOne, url=http://x.x.x.x/compute/v2.1, iface=PUBLIC,
type=compute, version=null}]
at
org.jclouds.openstack.keystone.catalog.suppliers.LocationIdToURIFromServiceEndpointsForTypeAndVersion.get(LocationIdToURIFromServiceEndpointsForTypeAndVersion.java:85)
at
org.jclouds.openstack.keystone.catalog.suppliers.LocationIdToURIFromServiceEndpointsForTypeAndVersion.get(LocationIdToURIFromServiceEndpointsForTypeAndVersion.java:46)
at
org.jclouds.rest.suppliers.MemoizedRetryOnTimeOutButNotOnAuthorizationExceptionSupplier$SetAndThrowAuthorizationExceptionSupplierBackedLoader.load(MemoizedRetryOnTimeOutButNotOnAuthorizationExceptionSupplier.java:75)
at
org.jclouds.rest.suppliers.MemoizedRetryOnTimeOutButNotOnAuthorizationExceptionSupplier$SetAndThrowAuthorizationExceptionSupplierBackedLoader.load(MemoizedRetryOnTimeOutButNotOnAuthorizationExceptionSupplier.java:57)
at
com.google.common.cache.LocalCache$LoadingValueReference.loadFuture(LocalCache.java:3574)
at
com.google.common.cache.LocalCache$Segment.loadSync(LocalCache.java:2316)
at
com.google.common.cache.LocalCache$Segment.lockedGetOrLoad(LocalCache.java:2190)
at com.google.common.cache.LocalCache$Segment.get(LocalCache.java:2080)
at com.google.common.cache.LocalCache.get(LocalCache.java:4017)
at com.google.common.cache.LocalCache.getOrLoad(LocalCache.java:4040)
at
com.google.common.cache.LocalCache$LocalLoadingCache.get(LocalCache.java:4989)
at
org.jclouds.rest.suppliers.MemoizedRetryOnTimeOutButNotOnAuthorizationExceptionSupplier.get(MemoizedRetryOnTimeOutButNotOnAuthorizationExceptionSupplier.java:150)
at
org.jclouds.location.suppliers.derived.RegionIdsFromRegionIdToURIKeySet.get(RegionIdsFromRegionIdToURIKeySet.java:45)
at
org.jclouds.location.suppliers.derived.RegionIdsFromRegionIdToURIKeySet.get(RegionIdsFromRegionIdToURIKeySet.java:33)
at
com.google.common.base.Suppliers$SupplierComposition.get(Suppliers.java:72)
at
org.jclouds.rest.suppliers.MemoizedRetryOnTimeOutButNotOnAuthorizationExceptionSupplier$SetAndThrowAuthorizationExceptionSupplierBackedLoader.load(MemoizedRetryOnTimeOutButNotOnAuthorizationExceptionSupplier.java:75)
atorg.jclouds.rest.suppliers.MemoizedRetryOnTimeOutButNotOnAuthorizationExceptionSupplier$SetAndThrowAuthorizationExceptionSupplierBackedLoader.load(MemoizedRetryOnTimeOutButNotOnAuthorizationExceptionSupplier.java:57)
at
com.google.common.cache.LocalCache$LoadingValueReference.loadFuture(LocalCache.java:3574)
at
com.google.common.cache.LocalCache$Segment.loadSync(LocalCache.java:2316)
at
com.google.common.cache.LocalCache$Segment.lockedGetOrLoad(LocalCache.java:2190)
at com.google.common.cache.LocalCache$Segment.get(LocalCache.java:2080)
at com.google.common.cache.LocalCache.get(LocalCache.java:4017)
at com.google.common.cache.LocalCache.getOrLoad(LocalCache.java:4040)
at
com.google.common.cache.LocalCache$LocalLoadingCache.get(LocalCache.java:4989)
at
org.jclouds.rest.suppliers.MemoizedRetryOnTimeOutButNotOnAuthorizationExceptionSupplier.get(MemoizedRetryOnTimeOutButNotOnAuthorizationExceptionSupplier.java:150)
at
org.jclouds.rest.internal.DelegatesToInvocationFunction.getInstanceOfTypeWithQualifier(DelegatesToInvocationFunction.java:277)
at
org.jclouds.rest.internal.DelegatesToInvocationFunction.lookupValueFromGuice(DelegatesToInvocationFunction.java:234)
at
org.jclouds.rest.internal.DelegatesToInvocationFunction.handle(DelegatesToInvocationFunction.java:152)
at
org.jclouds.rest.internal.DelegatesToInvocationFunction.invoke(DelegatesToInvocationFunction.java:123)
at com.sun.proxy.$Proxy146.getConfiguredRegions(Unknown Source)
Here is my code that queries the volumes
Properties overrides = new Properties();
overrides.setProperty( KeystoneProperties.KEYSTONE_VERSION, "3" );
overrides.setProperty( KeystoneProperties.CREDENTIAL_TYPE,
CredentialTypes.PASSWORD_CREDENTIALS );
overrides.put( KeystoneProperties.SCOPE, "project:demo" );
String endpoint =
http://x.x.x.x/identity/v3<http://10.136.85.165/identity/v3>;
CinderApi cinderApi = ContextBuilder.newBuilder( "openstack-cinder" )
.endpoint( endpoint )
.credentials( "default:admin", "secret" )
.overrides( overrides )
.buildApi( CinderApi.class );
VolumeApi volumeApi = cinderApi.getVolumeApi( "RegionOne" );
System.out.println( volumeApi.list() ); • this line throws
above exception
Nova API works fine. I am able to get regions.
NovaApi novaApi = ContextBuilder.newBuilder( "openstack-nova" )
.endpoint( endpoint )
.overrides( overrides )
.credentials( "default:admin", "secret" ).buildApi(
NovaApi.class );
Set<String> regions = novaApi.getConfiguredRegions(); • this line
fetches regions
Does anyone know why CinderApi is throwing the exception? Any pointers towards
fixing it would be highly appreciated.
Please note, querying volumes via openstack cli and REST API works fine. Please
see output of cli and REST API towards end of this email.
My development environment:
Java:
[test@test-vm ~]$ java -version
openjdk version "11.0.8" 2020-07-14 LTS
OpenJDK Runtime Environment Corretto-11.0.8.10.1 (build 11.0.8+10-LTS)
OpenJDK 64-Bit Server VM Corretto-11.0.8.10.1 (build 11.0.8+10-LTS, mixed mode)
Jcloud libraries:
jclouds-compute-2.7.0.jar
jclouds-core-2.7.0.jar
jclouds-scriptbuilder-2.7.0.jar
openstack-cinder-2.7.0.jar
openstack-common-2.7.0.jar
openstack-keystone-2.7.0.jar
openstack-neutron-2.7.0.jar
openstack-nova-2.7.0.jar
Devstack versions:
test@devstack-vm:~$ openstack versions show
+-------------+----------------+---------+-----------+--------------------------------------------+------------------+------------------+
| Region Name | Service Type | Version | Status | Endpoint
| Min Microversion | Max Microversion |
+-------------+----------------+---------+-----------+--------------------------------------------+------------------+------------------+
| RegionOne | placement | 1.0 | CURRENT |
http://x.x.x.x/placement/<http://10.136.85.165/placement/> | 1.0
| 1.39 |
| RegionOne | image | 2.0 | SUPPORTED |
http://x.x.x.x/image/v2/<http://10.136.85.165/image/v2/> | None
| None |
| RegionOne | image | 2.1 | SUPPORTED |
http://x.x.x.x/image/v2/<http://10.136.85.165/image/v2/> | None
| None |
| RegionOne | image | 2.2 | SUPPORTED |
http://x.x.x.x/image/v2/<http://10.136.85.165/image/v2/> | None
| None |
| RegionOne | image | 2.3 | SUPPORTED |
http://x.x.x.x/image/v2/<http://10.136.85.165/image/v2/> | None
| None |
| RegionOne | image | 2.4 | SUPPORTED |
http://x.x.x.x/image/v2/<http://10.136.85.165/image/v2/> | None
| None |
| RegionOne | image | 2.5 | SUPPORTED |
http://x.x.x.x/image/v2/<http://10.136.85.165/image/v2/> | None
| None |
| RegionOne | image | 2.6 | SUPPORTED |
http://x.x.x.x/image/v2/<http://10.136.85.165/image/v2/> | None
| None |
| RegionOne | image | 2.7 | SUPPORTED |
http://x.x.x.x/image/v2/<http://10.136.85.165/image/v2/> | None
| None |
| RegionOne | image | 2.9 | SUPPORTED |
http://x.x.x.x/image/v2/<http://10.136.85.165/image/v2/> | None
| None |
| RegionOne | image | 2.14 | SUPPORTED |
http://x.x.x.x/image/v2/<http://10.136.85.165/image/v2/> | None
| None |
| RegionOne | image | 2.15 | SUPPORTED |
http://x.x.x.x/image/v2/<http://10.136.85.165/image/v2/> | None
| None |
| RegionOne | image | 2.16 | SUPPORTED |
http://x.x.x.x/image/v2/<http://10.136.85.165/image/v2/> | None
| None |
| RegionOne | image | 2.17 | CURRENT |
http://x.x.x.x/image/v2/<http://10.136.85.165/image/v2/> | None
| None |
| RegionOne | compute_legacy | 2.0 | SUPPORTED |
http://x.x.x.x/compute/v2/<http://10.136.85.165/compute/v2/> | None
| None |
| RegionOne | compute_legacy | 2.1 | CURRENT |
http://x.x.x.x/compute/v2.1/<http://10.136.85.165/compute/v2.1/> | 2.1
| 2.97 |
| RegionOne | network | 2.0 | CURRENT |
http://x.x.x.x:9696/networking/v2.0/<http://10.136.85.165:9696/networking/v2.0/>
| None | None |
| RegionOne | block-storage | 3.0 | CURRENT |
http://x.x.x.x/volume/v3/<http://10.136.85.165/volume/v3/> | 3.0
| 3.71 |
| RegionOne | identity | 3.14 | CURRENT |
http://x.x.x.x/identity/v3/<http://10.136.85.165/identity/v3/> | None
| None |
| RegionOne | compute | 2.0 | SUPPORTED |
http://x.x.x.x/compute/v2/<http://10.136.85.165/compute/v2/> | None
| None |
| RegionOne | compute | 2.1 | CURRENT |
http://x.x.x.x/compute/v2.1/<http://10.136.85.165/compute/v2.1/> | 2.1
| 2.97 |
+-------------+----------------+---------+-----------+--------------------------------------------+------------------+------------------+
Endpoints:
test@devstack-vm:~$ openstack endpoint list
+----------------------------------+-----------+--------------+----------------+---------+-----------+------------------------------------------------+
| ID | Region | Service Name | Service Type
| Enabled | Interface | URL |
+----------------------------------+-----------+--------------+----------------+---------+-----------+------------------------------------------------+
| 0c20b12eaa404d1eb8d824fbc4c63062 | RegionOne | glance | image
| True | public | http://x.x.x.x/image<http://10.136.85.165/image>
|
| 1876bfef46da4e8aaae2bd97f5c8cb0e | RegionOne | placement | placement
| True | public |
http://x.x.x.x/placement<http://10.136.85.165/placement> |
| 2a3ce6fcccc04e6b9ead1ea14e6da3ee | RegionOne | neutron | network
| True | public |
http://x.x.x.x:9696/networking<http://10.136.85.165:9696/networking> |
| 67bef2784e204d119f8eb82282935348 | RegionOne | nova | compute
| True | public |
http://x.x.x.x/compute/v2.1<http://10.136.85.165/compute/v2.1> |
| 8a8f1d8cc4f741069c572b3b12ea2616 | RegionOne | keystone | identity
| True | public | http://x.x.x.x/identity<http://10.136.85.165/identity>
|
| 92e69b296f0147919d958764d2460449 | RegionOne | cinder | block-storage
| True | public |
http://x.x.x.x/volume/v3<http://10.136.85.165/volume/v3> |
| 9539faec5bc54d57b36305a2416326ae | RegionOne | nova_legacy | compute_legacy
| True | public |
http://x.x.x.x/compute/v2/$(project_id)s<http://10.136.85.165/compute/v2/$(project_id)s>
|
+----------------------------------+-----------+--------------+----------------+---------+-----------+------------------------------------------------+
OS:
test@devstack-vm:~$ cat /etc/os-release
PRETTY_NAME="Ubuntu 24.04.1 LTS"
NAME="Ubuntu"
VERSION_ID="24.04"
VERSION="24.04.1 LTS (Noble Numbat)"
VERSION_CODENAME=noble
ID=ubuntu
ID_LIKE=debian
HOME_URL=https://www.ubuntu.com/
SUPPORT_URL=https://help.ubuntu.com/
BUG_REPORT_URL=https://bugs.launchpad.net/ubuntu/
PRIVACY_POLICY_URL=https://www.ubuntu.com/legal/terms-and-policies/privacy-policy
UBUNTU_CODENAME=noble
LOGO=ubuntu-logo
Listing volume using openstack cli and REST API works
Cli:
test@devstack-vm:~$ openstack volume list
+--------------------------------------+-------+-----------+------+-----------------------------------+
| ID | Name | Status | Size | Attached to
|
+--------------------------------------+-------+-----------+------+-----------------------------------+
| a0d1207b-bbb8-46f7-9220-a299a7b6c8d7 | | in-use | 1 | Attached to
test2-vm on /dev/vda |
| adee3606-6e65-405e-b99b-d0fc5e86f74e | test2 | available | 1 |
|
+--------------------------------------+-------+-----------+------+-----------------------------------+
REST API:
[test@test-vm ~]$ curl -s -H 'X-Auth-Token:
gABBBABntf2qEKQsHeEWjvCkuT8wAPHf3NQKRvx19zNkJIqjjHAZWhbpoT20QaqxqbyRRoY9cDc2uCdgb4roZu2PjazgbnhAx_qQ763gLlFp7-8YWm3Nm6kipxPr8fEyYQhxJNb-B1CP6T0WWN25aRXiwAQBc4ijqNfna4SZVh1V6z0TulU786k'
'http://x.x.x.x/volume/v3/volumes' | jq .
{
"volumes": [
{
"id": "a0d1207b-bbb8-46f7-9220-a299a7b6c8d7",
"name": "",
"links": [
{
"rel": "self",
"href":
"http://x.x.x.x/volume/v3/volumes/a0d1207b-bbb8-46f7-9220-a299a7b6c8d7"
},
{
"rel": "bookmark",
"href":
"http://x.x.x.x/volume/volumes/a0d1207b-bbb8-46f7-9220-a299a7b6c8d7"
}
]
},
{
"id": "adee3606-6e65-405e-b99b-d0fc5e86f74e",
"name": "test2",
"links": [
{
"rel": "self",
"href":
"http://x.x.x.x/volume/v3/volumes/adee3606-6e65-405e-b99b-d0fc5e86f74e"
},
{
"rel": "bookmark",
"href":
"http://x.x.x.x/volume/volumes/adee3606-6e65-405e-b99b-d0fc5e86f74e"
}
]
}
]
}
Thanks,
Atul