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

Unexpect Behavior when issuing shutdown command over HTTP #1683

Closed
apttap opened this issue Aug 6, 2024 · 1 comment
Closed

Unexpect Behavior when issuing shutdown command over HTTP #1683

apttap opened this issue Aug 6, 2024 · 1 comment
Assignees
Labels
bug Something isn't working fixed
Milestone

Comments

@apttap
Copy link

apttap commented Aug 6, 2024

ArcadeDB Version:

24.6.1

OS and JDK Version:

Ubuntu 22.04 LTS, openjdk version "11.0.23" 2024-04-16

Expected behavior

The documentation states that for a shutdown command it should return a json reponse of:

{ "result": 'ok' }

Actual behavior

curl yields an empty reponse, and fetch or axios.post yields an error

Steps to reproduce

$ curl -X POST http://localhost:2480/api/v1/server \
       -d '{ "command": "shutdown" }' \
       -H "Content-Type: application/json" \
       --user root:arcadedb-password

will yield: curl: (52) Empty reply from server

or a post from axios (nodejs):

axios
  .post("http://localhost:2480/api/v1/server", {
    "command": "shutdown",
  }, {
    headers: {
      Authorization: `Basic ${Buffer.from("root:arcadedb-password").toString('base64')}`
    }
  })
  .then((res)=>console.log(res.data));

will throw an exception

as will a fetch (nodejs):

fetch("http://localhost:2480/api/v1/server", {
  method: "POST",
  headers: {
    Authorization: `Basic ${Buffer.from("root:arcadedb-password").toString('base64')}`
  },
    body: JSON.stringify({"command": "shutdown"}),
  })
  .then(console.log);
@lvca lvca self-assigned this Aug 9, 2024
@lvca lvca added the bug Something isn't working label Aug 9, 2024
@lvca lvca added this to the 24.8.1 milestone Aug 9, 2024
lvca added a commit that referenced this issue Aug 9, 2024
@lvca lvca closed this as completed Aug 9, 2024
@lvca lvca added the fixed label Aug 9, 2024
@lvca
Copy link
Contributor

lvca commented Aug 9, 2024

Now the shutdown is executed on a different thread and the command returns "ok".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working fixed
Projects
None yet
Development

No branches or pull requests

2 participants