Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error 500 when calling API #3

Open
apic-jeremy opened this issue Feb 9, 2024 · 1 comment
Open

Error 500 when calling API #3

apic-jeremy opened this issue Feb 9, 2024 · 1 comment

Comments

@apic-jeremy
Copy link

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.

@MathieuIko
Copy link

If your problem still holds, could you share the full HTTP Request sent by your frontend to the API?
The error seems to be related with an empty body (or maybe some missing headers).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants