SQLite Web not working (400 bad request)

Hello all,

Can someone help me figure out why the subject is occuring when I try to execute the below query:

I am logged into home assistant through my ddns setup through nginx proxy. I don’t think that matters but I may be wrong.

SELECT 
    entity_id,
    COUNT(*) AS cnt
FROM states
GROUP BY
    entity_id
ORDER BY
    COUNT(*) DESC;

Also, I have the below in my config.yaml (also not sure if that matters)

http:
  use_x_forwarded_for: true
  trusted_proxies:
    - 172.30.33.0/24

I dont know if it helps, but I had the same error because entity_id is actually NULL.

I have same issue. I found that when removing all LF/CR chars in the query and replace them by a space so all is in a single row, the query works.
To me it looks like the query prompt does not accept anymore line breaks!?!

Actually it is an issue with the SQlite Addon that is heavily discussed in Github and not fixed yet with V4.0.0. There is a link to an older 3.9.2 version that still works with multiple lines. Solution is to restore the old Addon version, disable auto-updates of the Add on and wait until it is fixed in future:

2 Likes