sqlfluff / sqlfluff-online

An online SQL formatter, via SQLFluff.
https://online.sqlfluff.com/
34 stars 14 forks source link

Website is down #389

Closed oresttokovenko closed 2 months ago

oresttokovenko commented 2 months ago

The website seems to be down

Internal Server Error

The server encountered an internal error and was unable to complete your request. Either the server is overloaded or there is an error in the application.
nolanbconaway commented 2 months ago

Hi! Apologies for the delay-

Are you able to reproduce this error? The site is loading for me right now. Did you find the error after sending through a particular query?

fey commented 2 months ago

Got error too image https://online.sqlfluff.com/fluffed?sql=H4sIAKiP-WYC_9PVVUhMT41PL8ovLSjm5Qp29XF1DuHlUgACDQgFAs6Owa4IHgiEe7j6oYqAQLIe0DAFO1sFQzNMSUc_F6gCG1sFI1OFEKARCuqGZrpGpuokGW5EyHATA6jhRma6JgZohrv6BLsqqJsYaCOJu_q5QDiaCo7B4ABJTixJTc8vqtSBiDv7h_qFaIAtQCjJL80r4eVyC_L3hShKLi0uyc9NLSoGqUjm5XIP8g8NUHCKVDDk5fIPcnENArOtebkAubffuXUBAAA%3D&dialect=PostgreSQL

Steps to reproduce:

  1. Go to online.sqlfluff.on
  2. Put some code
-- age_groups
SELECT
    (
        CASE
            WHEN
                c.age >= 16
                AND c.age <= 25 THEN '16-25'
            WHEN
                c.age >= 26
                AND c.age <= 40 THEN '26-40'
            ELSE '40+'
        END
    ) AS age_category,
    COUNT(c.age) AS age_count
FROM
    customers AS c
GROUP BY 1
ORDER BY 1;
  1. Error! 500 Internal Server Error
oresttokovenko commented 2 months ago

@nolanbconaway The front end loads, but any query results in a 500 error

nolanbconaway commented 2 months ago

Yes I see now! On it. Thanks for raising the issue!

fey commented 2 months ago

I have start server on local, and got error

[2024-09-29 20:07:04,731] ERROR in app: Exception on /fluffed [GET]
Traceback (most recent call last):
  File "/usr/local/lib/python3.10/site-packages/sqlfluff/api/simple.py", line 26, in get_simple_config
    dialect_selector(dialect)
  File "/usr/local/lib/python3.10/site-packages/sqlfluff/core/dialects/__init__.py", line 98, in dialect_selector
    dialect = load_raw_dialect(s)
  File "/usr/local/lib/python3.10/site-packages/sqlfluff/core/dialects/__init__.py", line 67, in load_raw_dialect
    raise KeyError("Unknown dialect")
KeyError: 'Unknown dialect'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/lib/python3.10/site-packages/flask/app.py", line 1473, in wsgi_app
    response = self.full_dispatch_request()
  File "/usr/local/lib/python3.10/site-packages/flask/app.py", line 882, in full_dispatch_request
    rv = self.handle_user_exception(e)
  File "/usr/local/lib/python3.10/site-packages/flask/app.py", line 880, in full_dispatch_request
    rv = self.dispatch_request()
  File "/usr/local/lib/python3.10/site-packages/flask/app.py", line 865, in dispatch_request
    return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args)  # type: ignore[no-any-return]
  File "/app/src/app/routes.py", line 48, in fluff_results
    linted = lint(sql, dialect=dialect)
  File "/usr/local/lib/python3.10/site-packages/sqlfluff/api/simple.py", line 87, in lint
    cfg = config or get_simple_config(
  File "/usr/local/lib/python3.10/site-packages/sqlfluff/api/simple.py", line 30, in get_simple_config
    raise SQLFluffUserError(f"Error: Unknown dialect '{dialect}'")
sqlfluff.core.errors.SQLFluffUserError: Error: Unknown dialect 'PostgreSQL'
172.17.0.1 - - [2024-09-29 20:07:04] "GET /fluffed?sql=H4sIAGiz-WYC_8VW3W-bMBB_R-J_uLckW4JC2mYPaydlCW2ZEpiArtuTRYmbooWPgdMqUv_4GeyAnULSVprmPATM3c_38TvfDQYQbHKSRDjLUZBsYqIqrjE3ph5M7RvL6-6-onDZg0vHXtTyn1VFVQYDIEmK9CEiCfHXKIwD-lFVbk3vGnK8XlNBmLjQVRWgi2Gz52JhDUfpOtliTA8o5JgKfenXQl2s3YdZTlDsRxien6FDf_QPa2uf7_ZqXaZXmrrDLi2gRvUKi0UTuIEa--dHMsc_lJBJijOfhEmc84-Xc9t2uu7NoptrfzZ-TEKyhQ-QamkWBrhXKu1iUNrAj1AV07IMB77ZpgW5v2Y25WBbe0YUcbgA-lbIIHp8nsR0T9JPs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