coralproject / talk

A better commenting experience from Vox Media
https://coralproject.net
Other
1.89k stars 355 forks source link

Story cache - DATA_CACHING_NOT_AVAILABLE #4547

Closed MadsNRK closed 6 months ago

MadsNRK commented 7 months ago

Problems caching stories in Coral

Expected behavior: From admin > story details > "Recache story". When pressing this button, I expect the story to be cached or recached.

Actual behavior: Console error: DATA_CACHING_NOT_AVAILABLE

Versions:

losowsky commented 6 months ago

Hi there, when your team upgraded from v7 to v8, did they enable the Redis Cache as detailed in our migration docs? https://docs.coralproject.net/migrating-7-to-8

MadsNRK commented 6 months ago

Hi

Thanks for your reply. I will check with my team what specs we are running on in the production enviroment. But is the same hardware specs required to run coral in a develompent enviroment? Does the software check what resources it has avaliable, and disable the cache if the specs are not met?

Thanks

Best regards Mads

losowsky commented 6 months ago

Version 8 is built around optimizing for the redis cache being implemented. We can't guarantee performance if you choose to go in another direction.

MadsNRK commented 6 months ago

We are not looking to go in another direction. But for some reason the "Story cache" is not working in our setup, and I'm just trying to figure out why. Therefor I'm wondering if the hardware setup has a direct impact on the error message we encounter (DATA_CACHING_NOT_AVAILABLE) or if there's a setting we have overlooked or something :)

losowsky commented 6 months ago

I'm afraid as an open source user, we can't dedicate the resources to help you troubleshoot your own set up. Good luck in figuring it out!

ideallical commented 4 months ago

It was not clear for us either from reading just the migration docs. However, we found it hidden in the main docs. Turns out you need to turn on a feature flag using a mutation: https://docs.coralproject.net/api/mutations/enable-feature-flag

Which feature flag? This one: DATA_CACHE

So POST to your graphQL endpoint /api/graphql: Using the header: Authorization: Bearer here your admin jwt And this json in the body:

mutation {
  enableFeatureFlag(
    input: {
      clientMutationId: "turn-on-cache", 
      flag: DATA_CACHE
    }) {
        clientMutationId
        flags
    }
}

Once that is done, your tenant (found out by the domain the graphQL endpoint is on), will gain this feature flag. Not sure if this is needed, but you might want to restart the servers as the tenant configuration is cached.