openbaton / openstack4j-plugin

Apache License 2.0
3 stars 12 forks source link

org.openbaton.exceptions.VimDriverException: Unauthorized #28

Closed ghost closed 7 years ago

ghost commented 7 years ago

When registering an OpenStack VIM Instance, I get the message:

org.openbaton.exceptions.VimDriverException: Unauthorized

In /var/log/openbaton/openbaton.log, I have:

2017-07-14 10:44:00.916 ERROR 13009 --- [http-nio-8080-exec-5] org.openbaton.vim_impl.vim.GenericVIM    : Not listed Images successfully of VimInstance openstack-demo. Caused by: org.openbaton.exceptions.VimDriverException: Unauthorized
2017-07-14 10:44:00.943 ERROR 13009 --- [http-nio-8080-exec-5] o.o.n.a.e.GlobalExceptionHandler         : Exception was thrown -> Return message: Not listed Images successfully of VimInstance openstack-demo. Caused by: org.openbaton.exceptions.VimDriverException: Unauthorized

And in /var/log/openbaton/plugin-logs/plugin-openstack_2017-07-14_10-30-45.log, I see:

[pool-1-thread-6] DEBUG org.openbaton.drivers.openstack4j.OpenStack4JDriver - Reply queue is: amq.gen-Yh3xV7CQJIB6MrtEQm2L9w
[pool-1-thread-8] INFO org.openbaton.drivers.openstack4j.OpenStack4JDriver - 
Waiting for RPC requests
[pool-1-thread-8] DEBUG org.openbaton.drivers.openstack4j.OpenStack4JDriver - Received message
[pool-1-thread-8] DEBUG org.openbaton.drivers.openstack4j.OpenStack4JDriver - There are 1 parameters
[pool-1-thread-8] DEBUG org.openbaton.drivers.openstack4j.OpenStack4JDriver - Looking for method: listImages
[pool-1-thread-8] ERROR org.openbaton.drivers.openstack4j.OpenStack4JDriver - Unauthorized
org.openbaton.exceptions.VimDriverException: Unauthorized
    at org.openbaton.drivers.openstack4j.OpenStack4JDriver.authenticate(OpenStack4JDriver.java:154)
    at org.openbaton.drivers.openstack4j.OpenStack4JDriver.listImages(OpenStack4JDriver.java:379)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:606)
    at org.openbaton.plugin.PluginListener.executeMethod(PluginListener.java:208)
    at org.openbaton.plugin.PluginListener.run(PluginListener.java:124)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
    at java.lang.Thread.run(Thread.java:745)
Caused by: AuthenticationException{message=Unauthorized, status=401}
    at org.openstack4j.core.transport.HttpExceptionHandler.mapException(HttpExceptionHandler.java:36)
    at org.openstack4j.core.transport.HttpExceptionHandler.mapException(HttpExceptionHandler.java:23)
    at org.openstack4j.openstack.internal.OSAuthenticator.authenticateV3(OSAuthenticator.java:158)
    at org.openstack4j.openstack.internal.OSAuthenticator.invoke(OSAuthenticator.java:70)
    at org.openstack4j.openstack.client.OSClientBuilder$ClientV3.authenticate(OSClientBuilder.java:165)
    at org.openstack4j.openstack.client.OSClientBuilder$ClientV3.authenticate(OSClientBuilder.java:128)
    at org.openbaton.drivers.openstack4j.OpenStack4JDriver.authenticate(OpenStack4JDriver.java:104)
    ... 10 more
[pool-1-thread-8] DEBUG org.openbaton.drivers.openstack4j.OpenStack4JDriver - Answer is: {
  "exception": {
    "detailMessage": "Unauthorized",
    "stackTrace": [],
    "suppressedExceptions": []
  }
}

I checked twice the url, tenant, username and password. Can you help?

ghost commented 7 years ago

Used tenant name instead of tenant ID

lorenzotomasini commented 7 years ago

If you use v3 --> tenant id if you use v2 --> tenant name