hasura / hasura/graphql-engine
2.23.0 causes SQL errors in postgres logs due to incorrect EE validation
- Dominant language
- TypeScript
- Stars
- 32.1k
- Forks
- 3k
- PR merge metrics
- PR metrics pending
Description
### Version Information
Server Version: 2.23.0
### Environment
OSS
### What is the current behaviour?
Since upgrading to 2.23.0, we have several postgres errors due to Hasura assuming some columns exist.
### What is the expected behaviour?
I think adding new columns based on EE membership is bad design, but not my call to make. If you want to continue with optional columns, then check if they exist before attempting to get their values.
Something like this:
```sql
SELECT column_name
FROM information_schema.columns
WHERE table_schema='hdb_catalog' AND table_name='hdb_version' and column_name='ee_client_id';
```
### How to reproduce the issue?
1. start hasura 2.23.0 with postgres
2. look at the postgres logs
3. witness an SQL error
4. now repeat with over 20 hasura sidecars in kubernetes and witness the flood
### Please provide any traces or logs that could help here.
```
ERROR: column "ee_client_id" does not exist at character 17
STATEMENT:
SELECT ee_client_id::text, ee_client_secret
FROM hdb_catalog.hdb_version
```
Contributor guide
Research direction
Start by reproducing Hasura 2.23.0 startup with PostgreSQL and inspect the query against hdb_catalog.hdb_version. Compare the available columns with the ee_client_id and ee_client_secret lookup, then verify that startup no longer produces missing-column errors in the PostgreSQL logs.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- postgresql, sql
- Domain
- backend, databases
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100