Collection not showing on production but showing fine on development

Feature(s) impacted

Smart Collections is not updated to display the new model “AvatarFrames” on production. It is showing fine for me on development though.

Observed behavior

I expected this collections to be not visible until turned visible through ‘Edit Layout’ but the collection doesn’t exist even while editing. I’ve checked .forestadmin-schema.json and the collection exists.

Expected behavior

Expected new collection to show up on production since it was displaying fine on development

Context

  • Project name: Rhabit

  • Team name: Operations

  • Environment name: production api.rhabitapp.com

In production the agent rely solely on the .forestadmin-schema.json file when sending the schema to our server (unlike in development mode, your models are not introspected)

Can you

  • Check that the .forestadmin-schema.json file is up-to-date and available on your production environment? (not locally)
  • Check that the .forestadmin-schema.json is not referenced in your .gitignore file (if you are versioning your agent code)
  • Restart the process hosting the agent in your production server (the schema is sent when the agent starts)

Hi,

I can confirm that .forestadmin-schema.json is up to date and available on my production environment. I’ve also restarted heroku, but the collection is still not visible even when editing layout.

Hi @anon39940173,
Could you give me any updates on this issue?

I’m not sure why your schema is not getting updated on our servers.

Last schema update we got was 10/08/2022 19:33:40 from IP 44.200.52.102.
Strangely, it seems your production server IP is changing very often.

Did you check your server logs (when the agent starts)?
Can you provide them to us?

You should get messages when the schema is sent to our servers

Are you seeing one of the error cases on the link above?

Hi,
Attached is a screenshot of the production server logs when I log in on our production forest admin.
I don’t see any errors that stand out from these logs.

Thanks,

hi @anon39940173,
Can I get any updates after showing my production logs as to what is going on?
Thanks!

Hi @anon39940173 can we get an update on this? We’re very frustrated on our side and this is having a significant negative impact on our development cycle at this point.

Hello @rsupport

You are totally entitled to an update, your thread went under the radar.

Are you sure those logs show your server starting?

I was expecting to see either of the message that are contained in the link I sent before.

I suspect your agent not restarting when you think it does, which would explain why we don’t get the schemas from our side, and you not seeing errors in the logs.

We can trigger a manual update of your schema (using the CLI), but that would not solve the source problem.
I’ll check up with the team that did the ruby agent tomorrow, as its 11pm here

Hi @anon39940173,

Yes, I am sure those are the logs that show when the forest admin logs in on our production logs. I don’t see any loud errors like the messages contained in the link you’ve sent before.

Please do let me know when you trigger the manual update and I’ll check forest afterwards to see if it changed anything.

Thanks,

When I said “we can trigger a manual update”, I actually meant you and me.

This command force-sends the schema that is on the current folder to any forestadmin environment.

You can run it, from either your production server (if forest CLI is installed there), or from your local machine, as long as you are sure that your local models match the production ones.

forest schema:apply --secret ENV_SECRET_OF_THE_ENVIRONMENT

However, even if that works, the .forestadmin-schema.json should always be posted when your production server restarts.
In your case, it seems like this was the issue (The .forestadmin-schema.json not being posted).

To be as clear as possible, your forest admin agent is supposed to be read and post the .forestadmin-schema.json of the production server as long as NODE_ENV=production, and FOREST_DISABLE_AUTO_SCHEMA_APPLY is not defined

Hi @anon39940173,

When I tried running forest schema:apply --secret ENV_SECRET_OF_THE_ENVIRONMENT
I received the error: × Cannot find the project related to the environment secret you configured.

I can confirm that FOREST_DISABLE_AUTO_SCHEMA_APPLY is not defined

Which environment secret did you provide?
It should be the env secret key of your production environment

Hi @romaing,

I’ve also tried running forest schema:apply --secret ENV_SECRET_OF_THE_ENVIRONMENT in production server but I’m getting a syntax error:
SyntaxError ((irb):2: syntax error, unexpected unary-, expecting do’ or ‘{’ or ‘(’)
forest schema:apply --secret ENV['FOREST_ENV_SECRE…`

The environment secret is provided through heroku production environment

You can retrieve the environment secret from your admin panel settings

Go to Project Settings > Environments > Production

Hi @anon39940173,

Thank you! Running the line did the job. The new tables are now visible on forest. I’ve also double checked the forest_env_secret in heroku to make sure it matched the one on our production env and it does.

Still we don’t understand why your agent server is not sending the schema when it starts…

I would love to know.
Don’t hesitate to tell us if you investigate further into that issue

Hi @anon39940173,

Will do, thank you so much for your help