question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

hdb_catalog schema Inconsistent between Instances

See original GitHub issue

Version Information

Server Version: v2.13.0-cloud.1

Environment

Cloud

What is the current behaviour?

I have two Hasura instances which differ in how they have constructed the hdb_catalog in the database.

If I run this sql in both:

SELECT * FROM information_schema.tables 
WHERE table_schema = 'hdb_catalog'

I see different results. The first is what we have (rightly or wrongly) considered to be the ‘correct’ behaviour (the behaviour we have coded against) image

The second instance does not surface these tables, instead (for the same query) giving us:

image

I’m not sure which is the intended behaviour. The reason this is an issue is because we have a script which can return the number of unprocessed events at any one time:

post(HASURA_QUERY_ENDPOINT, {
      headers: {"X-Hasura-Admin-Secret": HASURA_ADMIN_SECRET},
      body: JSON.stringify({
         type: "run_sql",
         args: { sql: "select count(*) from hdb_catalog.hdb_scheduled_events where status = 'scheduled'" },
      }),
});

This obviously throws an error in the second example as the table does not exist. I would like to understand:

  1. Which of these two results is intended/expected?
  2. How/where are events stored in the second example?
  3. How can I go about making these consistent?

Thanks in advance

(Related: https://stackoverflow.com/q/70010557/3001761)

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:13 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
DomVinyardcommented, Nov 28, 2022

Great, and I’ve yet to test this yet but I assume we can filter by comment too

{
    "type": "get_scheduled_events",
    "args": {
        "type": "one_off",
        "limit": 0,
        "offset": 0,
        "get_rows_count": true,
        "comment": "event_type_a"
    }
}

Between this and delete_scheduled_event we now have everything we need to manage our events directly within hasura, thank you

1reaction
adas98012commented, Nov 24, 2022

@DomVinyard

You can try the same POST query as above, with a small variation in the Body :

{
    "type": "get_scheduled_events",
    "args": {
        "type": "one_off",
        "limit": 0,
        "offset": 0,
        "get_rows_count": true
    }
}

Here is a sample response :

{
    "count": 1,
    "events": []
}
Read more comments on GitHub >

github_iconTop Results From Across the Web

Failed to build schema-cache because of inconsistent ...
I tried downgrading Hasura from 1.0.0 to hasura/graphql-engine:pull2395-7ea7f82c so I could create remote data relationships.
Read more >
Managing Metadata | Hasura GraphQL Docs
Metadata Formats​. Internally, Hasura saves Metadata as a single JSON blob in a table called hdb_metadata in a schema called hdb_catalog in the...
Read more >
Metadata API Reference: Manage metadata (v2.0 and above)
APIs to manage Hasura metadata which is stored in hdb_catalog schema. Supported from ... can be used to purge all inconsistent objects from...
Read more >
Source - GitHub
server: errors from `/healthz` endpoint are now logged with more details ... result of fixing some inconsistencies and edge cases in writing array...
Read more >
How to make Hasura connect to a specific postgresql schema
Hasura needs 2 schemas to work: hdb_catalog and hdb_views . All other schemas are optional. You can register objects from any schema if ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found