server
server copied to clipboard
[BUG] An unkown error ocurred! New UI
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.
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.
@xbenyx Could you have a look at this?
@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.
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.
Thanks. Just clarifying, does return a 401 error and then the plain text above?
Just status code 200.
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.
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
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.
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.
This one was not fixed, now no error is currently returned:
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:
Also when the API is not enabled, it still throws the same error, is this maybe a api error because CORS is broken @xbenyx ?
Linking #998 for API implementation
Excluded error 404 when config.json exist (605dba4)
👍 confirmed, the 404 error is fixed. Still waiting for #998.