I’m having an issue with my API, I’ve done a bug report on Directus and they said it’s likely two instances are running of Directus, which shouldn’t happen:
Each refresh will toggle between answers. I have been slowly moving away from Cleavr because of the amount of bugs. I now host my front-end with Vercel, but moving the back-end is a much bigger task. I hope these issues get ironed out because without the bugs Cleavr is amazing.
Hi Tom, this would be expected when running in cluster mode - which utilizes available cores. In this instance, I’d assume your server has 2 cores which is why you see two processes running with PM2. The number of cores used can be altered, but we run apps in cluster mode for multi-core servers by default as it’s more performant.
Can you try again? I think this was related to the undefined processes - which I believe was the product of a domain renaming bug for node sites that we’ve since fixed. In any case, I cleared the unknown process and the url seems more stable now when refreshing.
The activate deployment step reloads/restarts pm2, are there any clues in the deployment logs (web app > deployments > deployment > activate deployment) for that step?
You might try adding the following custom deployment step at the end as well -
cd {{ releasePath }}
pm2 restart .cleavr.config.js
I think you’re misunderstanding the issue. When I create a new collection in Directus and set it to public in the permissions, each refresh will give a different response between “forbidden” and the results. Each refresh will give one or the other;
For example refresh 1 will give “forbidden”, refresh 2 will give the results, refresh 3 will give “forbidden” and so on.
This will also break the CMS with newly created collections as sometimes it doesn’t think the collection exists and sometimes it does, so it starts to break adding fields to the collection or updating the page.
It isn’t until I restart Directus (PM2) or redeploy does this issue correct itself.
Updating the web app > environments tab in either one of the following ways worked for me:
Add the following variables:
CACHE_SCHEMA=false
CACHE_PERMISSIONS=false
Above is disabling additional caching. Though, if your server is running Redis (check server > services > redis) then the following is probably better:
CACHE_STORE=redis
After syncing the env variables, redeploy the app.
We’ll likely add CACHE_STORE=redis as a default variable for new directus apps.