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

Developer UI displays SyntaxError: Unexpected token '<', "<html> <h"... is not valid JSON #661

Open
b1conrad opened this issue Oct 4, 2024 · 2 comments

Comments

@b1conrad
Copy link
Member

b1conrad commented Oct 4, 2024

After much time has passed, with just "Loading..." on the page.

May be related to issue 493.

@b1conrad
Copy link
Member Author

b1conrad commented Oct 4, 2024

From the pico-engine.log file we see that a query has started but not finished. It is a pico-engine-ui/box query.

I thought the pico engine had a timeout for long-running queries?

Instead, it is nginx that times out and returns HTML:

<html>
<head><title>504 Gateway Time-out</title></head>
<body>
<center><h1>504 Gateway Time-out</h1></center>
<hr><center>nginx/1.24.0</center>
</body>
</html>

But the developer UI (in React) is expecting a JSON response from this query, hence the unexpected token complaint.

The console log shows the entire query URL. For example:

GET https://plan.picolabs.io/c/cljt4sikq0001ojpra6zs4kw0/query/io.picolabs.pico-engine-ui/box 504 (Gateway Time-out)

and running that query directly in a browser shows (after some delay (the nginx timeout)) the rendered HTML for the 504 Gateway Time-out.

@b1conrad
Copy link
Member Author

b1conrad commented Oct 4, 2024

Never mind. While writing the above comment, I tried the failing query directly and it worked. Hm.

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

No branches or pull requests

1 participant