question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

UserAPI: Fix error messages in response from userapi

See original GitHub issue

I’m not able to create user via restapi and crd.

restapi:

20:10:08,228 [main] INFO io.enmasse.systemtest.apiclients.UserApiClient - POST-user: path /apis/user.enmasse.io/v1alpha1/namespaces/brokered-shared-0/messagingusers; body {"metadata":{"name":"brokered-shared-0.test","namespace":"brokered-shared-0"},"spec":{"username":"test","authentication":{"type":"password","password":"test"},"authorization":[{"addresses":["*"],"operations":["send","recv","view"]},{"addresses":[],"operations":["manage"]}]}}
20:10:09,845 [vert.x-eventloop-thread-0] ERROR io.enmasse.systemtest.apiclients.ApiClient - expected-code: 201, response-code: 500, body: null
java.lang.RuntimeException: Status 500 body: null
	at io.enmasse.systemtest.apiclients.ApiClient.responseHandler(ApiClient.java:70)
	at io.enmasse.systemtest.apiclients.UserApiClient.lambda$null$0(UserApiClient.java:102)
	at io.vertx.ext.web.client.impl.HttpContext.lambda$null$0(HttpContext.java:125)
	at io.vertx.core.impl.ContextImpl.lambda$wrapTask$2(ContextImpl.java:339)
	at io.netty.util.concurrent.AbstractEventExecutor.safeExecute(AbstractEventExecutor.java:163)
	at io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:404)
	at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:465)
	at io.netty.util.concurrent.SingleThreadEventExecutor$5.run(SingleThreadEventExecutor.java:884)
	at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
	at java.lang.Thread.run(Thread.java:748)

cdr:

1,enmasse $ oc get addressspace
NAME                AGE
brokered-shared-0   5m
0,enmasse $ cat user.yaml
apiVersion: user.enmasse.io/v1alpha1
kind: MessagingUser
metadata:
    name: brokered-shared-0.test
spec:
    authentication:
      type: password
      password: test
    authorization:
    - addresses: [ "topic1", "topic2", "*" ]
      operations: [ "send", "recv", "view" ]
0,enmasse $ oc create -f user.yaml
Error from server (InternalError): error when creating "user.yaml": an error on the server ("") has prevented the request from succeeding (post messagingusers.user.enmasse.io)

api-server log:

2018-08-31 06:19:09 INFO HTTPServer:100 - Request POST /apis/user.enmasse.io/v1alpha1/namespaces/myproject/messagingusers 

2018-08-31 06:19:09 ERROR HttpUserService:40 - Error creating user brokered-shared-0.test 

javax.ws.rs.NotFoundException: HTTP 404 Not Found 

at org.jboss.resteasy.client.jaxrs.internal.ClientInvocation.handleErrorStatus(ClientInvocation.java:218) 

at org.jboss.resteasy.client.jaxrs.internal.ClientInvocation.extractResult(ClientInvocation.java:189) 

at org.jboss.resteasy.client.jaxrs.internal.proxy.extractors.BodyEntityExtractor.extractEntity(BodyEntityExtractor.java:60) 

at org.jboss.resteasy.client.jaxrs.internal.proxy.ClientInvoker.invoke(ClientInvoker.java:107) 

at org.jboss.resteasy.client.jaxrs.internal.proxy.ClientProxy.invoke(ClientProxy.java:76) 

at com.sun.proxy.$Proxy45.search(Unknown Source) 

at io.enmasse.user.keycloak.KeycloakUserApi.lambda$createUser$2(KeycloakUserApi.java:106) 

at io.enmasse.user.keycloak.KeycloakUserApi.withKeycloak(KeycloakUserApi.java:67) 

at io.enmasse.user.keycloak.KeycloakUserApi.createUser(KeycloakUserApi.java:102) 

at io.enmasse.api.v1.http.HttpUserService.lambda$createUser$4(HttpUserService.java:112) 

at io.enmasse.api.v1.http.HttpUserService.doRequest(HttpUserService.java:38) 

at io.enmasse.api.v1.http.HttpUserService.createUser(HttpUserService.java:107) 

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) 

at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) 

at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) 

at java.lang.reflect.Method.invoke(Method.java:498) 

at org.jboss.resteasy.core.MethodInjectorImpl.invoke(MethodInjectorImpl.java:140) 

at org.jboss.resteasy.core.ResourceMethodInvoker.invokeOnTarget(ResourceMethodInvoker.java:294) 

at org.jboss.resteasy.core.ResourceMethodInvoker.invoke(ResourceMethodInvoker.java:248) 

at org.jboss.resteasy.core.ResourceMethodInvoker.invoke(ResourceMethodInvoker.java:235) 

at org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:398) 

at org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:205) 

at org.jboss.resteasy.plugins.server.vertx.RequestDispatcher.service(RequestDispatcher.java:93) 

at org.jboss.resteasy.plugins.server.vertx.VertxRequestHandler.lambda$handle$0(VertxRequestHandler.java:65) 

at io.vertx.core.http.HttpServerRequest.lambda$bodyHandler$0(HttpServerRequest.java:209) 

at io.vertx.core.http.impl.HttpServerRequestImpl.handleEnd(HttpServerRequestImpl.java:417) 

at io.vertx.core.http.impl.Http1xServerConnection.handleEnd(Http1xServerConnection.java:482) 

at io.vertx.core.http.impl.Http1xServerConnection.handleContent(Http1xServerConnection.java:477) 

at io.vertx.core.http.impl.Http1xServerConnection.processMessage(Http1xServerConnection.java:458) 

at io.vertx.core.http.impl.Http1xServerConnection.handleMessage(Http1xServerConnection.java:144) 

at io.vertx.core.http.impl.HttpServerImpl$ServerHandlerWithWebSockets.handleMessage(HttpServerImpl.java:712) 

at io.vertx.core.http.impl.HttpServerImpl$ServerHandlerWithWebSockets.handleMessage(HttpServerImpl.java:619) 

at io.vertx.core.net.impl.VertxHandler.lambda$channelRead$1(VertxHandler.java:146) 

at io.vertx.core.impl.ContextImpl.lambda$wrapTask$2(ContextImpl.java:337) 

at io.vertx.core.impl.TaskQueue.run(TaskQueue.java:76) 

at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) 

at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) 

at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30) 

at java.lang.Thread.run(Thread.java:748) 

2018-08-31 06:19:09 ERROR i18n:72 - RESTEASY019525: Unexpected 

java.lang.IllegalStateException: RESTEASY003765: Response is closed. 

at org.jboss.resteasy.specimpl.BuiltResponse.abortIfClosed(BuiltResponse.java:257) 

at org.jboss.resteasy.client.jaxrs.internal.ClientResponse.abortIfClosed(ClientResponse.java:325) 

at org.jboss.resteasy.client.jaxrs.internal.ClientResponse.getEntity(ClientResponse.java:74) 

at org.jboss.resteasy.core.ExceptionHandler.unwrapException(ExceptionHandler.java:128) 

at org.jboss.resteasy.core.ExceptionHandler.handleApplicationException(ExceptionHandler.java:76) 

at org.jboss.resteasy.core.ExceptionHandler.handleException(ExceptionHandler.java:222) 

at org.jboss.resteasy.core.SynchronousDispatcher.writeException(SynchronousDispatcher.java:171) 

at org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:414) 

at org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:205) 

at org.jboss.resteasy.plugins.server.vertx.RequestDispatcher.service(RequestDispatcher.java:93) 

at org.jboss.resteasy.plugins.server.vertx.VertxRequestHandler.lambda$handle$0(VertxRequestHandler.java:65) 

at io.vertx.core.http.HttpServerRequest.lambda$bodyHandler$0(HttpServerRequest.java:209) 

at io.vertx.core.http.impl.HttpServerRequestImpl.handleEnd(HttpServerRequestImpl.java:417) 

at io.vertx.core.http.impl.Http1xServerConnection.handleEnd(Http1xServerConnection.java:482) 

at io.vertx.core.http.impl.Http1xServerConnection.handleContent(Http1xServerConnection.java:477) 

at io.vertx.core.http.impl.Http1xServerConnection.processMessage(Http1xServerConnection.java:458) 

at io.vertx.core.http.impl.Http1xServerConnection.handleMessage(Http1xServerConnection.java:144) 

at io.vertx.core.http.impl.HttpServerImpl$ServerHandlerWithWebSockets.handleMessage(HttpServerImpl.java:712) 

at io.vertx.core.http.impl.HttpServerImpl$ServerHandlerWithWebSockets.handleMessage(HttpServerImpl.java:619) 

at io.vertx.core.net.impl.VertxHandler.lambda$channelRead$1(VertxHandler.java:146) 

at io.vertx.core.impl.ContextImpl.lambda$wrapTask$2(ContextImpl.java:337) 

at io.vertx.core.impl.TaskQueue.run(TaskQueue.java:76) 

at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) 

at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) 

at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30) 

at java.lang.Thread.run(Thread.java:748)

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:5 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
kornyscommented, Sep 3, 2018

@lulf nope, but keep it open, I will start with writing UserApi specific tests and we will see if all error messages are ok.

0reactions
lulfcommented, Sep 3, 2018

@kornys Any other bad error messages?

Read more comments on GitHub >

github_iconTop Results From Across the Web

userapi not working properly - SAP Community
Hello, I am trying to use the userapi api for get the current user info, but it seems to not work properly, it...
Read more >
How to write API errors that keep your users moving forward
Always have a suggestion field for every error message. While the message field answers “what's wrong”, the suggestion answers “how to fix it”....
Read more >
register user api throws 400 "Email already taken" but it's not
i think the issue here is that something is rejecting the registration, but not throwing the correct error. i would not recommend moving...
Read more >
REST API - User API license is expired - Qualys Discussions
Hello world, When I run a rest api, I get this error: <SIMPLE_RETURN> <RESPONSE> ... <CODE>2012</CODE> <TEXT>User API license is expired.
Read more >
Okta API Error Codes - Okta Developer
Here you can find further information about the errors that the Okta API returns, sorted by error code and HTTP return code.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found