studio icon indicating copy to clipboard operation
studio copied to clipboard

Error 500 when calling API

Open apic-jeremy opened this issue 1 year ago • 1 comments

Describe the bug Good morning, I just discovered your version of STUdio (STUdio v0.5.2) and it is much faster than the original :)

On the other hand, I developed a small FRONT tool in Angular to allow me to manage my packs more quickly (mass sending and deletion) and I encountered a problem with your version.

Indeed, when I call certain endpoints, they return me a 500 error.

Note that the embedded front with STUdio works very well. On the other hand, the API call does not crash in version 0.3.1 of STUdio (of Marian).

To Reproduce Here, the code I use to perform actions :

public pushStory(_uuid: string, _path: string) {
        return this.http.post<any>("http://localhost:8080/api/device/addFromLibrary", 
            JSON.stringify({uuid: _uuid, path: _path})
        );
    }

Expected behavior Correct response of API

Logs Logs form debug console of Firefox :

{"error":{"code":500,"message":"Cannot invoke "io.vertx.core.json.JsonObject.getString(String)" because the return value of "io.vertx.ext.web.RoutingContext.getBodyAsJson()" is null"},"stack":["studio.webui.api.DeviceController.lambda$apiRouter$8(DeviceController.java:54)","io.vertx.ext.web.impl.BlockingHandlerDecorator.lambda$handle$0(BlockingHandlerDecorator.java:48)","io.vertx.core.impl.ContextImpl.lambda$null$0(ContextImpl.java:159)","io.vertx.core.impl.AbstractContext.dispatch(AbstractContext.java:100)","io.vertx.core.impl.ContextImpl.lambda$executeBlocking$1(ContextImpl.java:157)","io.vertx.core.impl.TaskQueue.run(TaskQueue.java:76)","java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)","java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)","io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)","java.base/java.lang.Thread.run(Thread.java:842)"]}

Desktop and environment (please complete the following information):

  • OS: Windows
  • Browser: Firefox
  • Java version: "17.0.9" 2023-10-17 LTS
  • Maven version: Apache Maven 3.9.6 (bc0240f3c744dd6b6ec2920b3cd08dcc295161ae)
  • STUdio application version: 0.5.2

Additional context Add any other context about the problem here.

apic-jeremy avatar Feb 09 '24 10:02 apic-jeremy