server icon indicating copy to clipboard operation
server copied to clipboard

[BUG] An unkown error ocurred! New UI

Open zyronix opened this issue 2 years ago • 14 comments

When using version 0.14.0, it comes with a technical preview of the new API and new UI. However, if you didn't enable the new API; the UI will return the error: An unkown error ocurred!

The fix for this is to rerun the backend / server container with the environment variable HASHTOPOLIS_APIV2_ENABLE to 1 See https://github.com/hashtopolis/server/wiki/Installation for the full instructions.

However, it might be nice that the UI gives a more user friendly error when this happens.

image

Todo:

  • [ ] Make the UI throw an understandeable error when the API is disabled
  • [x] Make the UI not throw a 404 error when config.json does not exists.

zyronix avatar Jun 17 '23 09:06 zyronix

@xbenyx Could you have a look at this?

zyronix avatar Jun 17 '23 09:06 zyronix

@zyronix The UI has mainly an interceptor that displays any http error but Auth has an additional alert. I'll have a look at this.

xbenyx avatar Jun 17 '23 09:06 xbenyx

When HASHTOPOLIS_APIV2_ENABLE is not set the API will just return a hardcode string, no json or slim errors just: one line: APIv2 is not enabled, it can be enabled via environment variable!

If you would like this error to be placed in the normal slim format; let me know.

zyronix avatar Jun 17 '23 10:06 zyronix

Thanks. Just clarifying, does return a 401 error and then the plain text above?

xbenyx avatar Jun 17 '23 10:06 xbenyx

Just status code 200.

zyronix avatar Jun 17 '23 11:06 zyronix

I have had a similar issue to this. I found that with HASHTOPOLIS_API_ENABLE set to 1 it works on localhost. However it still doesn't work when accessing the page from any other machine.

snoopy245 avatar Aug 10 '23 13:08 snoopy245

Yeah, we fixed this in the dev branches already. You can potentially run the hashtopolis/frontend:dev and hashtopolis/backend:dev containers; note that that code is highly expirimental

zyronix avatar Aug 10 '23 14:08 zyronix

Thanks for the swift reply. Any idea when it might be merged? Just so I can decide if it’s worth waiting or running the risk with the branch.

snoopy245 avatar Aug 10 '23 20:08 snoopy245

Our goal is to merge dev into master next week and create a release in two weeks; but that all depends on our availability and if we run into any issues.

zyronix avatar Aug 22 '23 08:08 zyronix

This one was not fixed, now no error is currently returned:

Image

zyronix avatar Sep 07 '23 12:09 zyronix

So the changes missed the release train :(. But, are in the current dev branch. The code so far is returning a 404 because config.json is not there. This is expected behavior, the config.json is not always there. @xbenyx Could you exclude config.json from throwing a 404 error like this:

image

Also when the API is not enabled, it still throws the same error, is this maybe a api error because CORS is broken @xbenyx ?

image

zyronix avatar Sep 07 '23 12:09 zyronix

Linking #998 for API implementation

zyronix avatar Sep 07 '23 13:09 zyronix

Excluded error 404 when config.json exist (605dba4)

xbenyx avatar Sep 07 '23 13:09 xbenyx

👍 confirmed, the 404 error is fixed. Still waiting for #998.

zyronix avatar Sep 08 '23 09:09 zyronix