# Collection not showing on production but showing fine on development

**URL:** <https://community.forestadmin.com/t/collection-not-showing-on-production-but-showing-fine-on-development/5173>\
**Category:** Help me!\
**Created:** [August 30, 2022, 3:50pm UTC](https://community.forestadmin.com/t/collection-not-showing-on-production-but-showing-fine-on-development/5173 "2022-08-30T15:50:56Z")\
**Posts on this page:** 18\
**Page:** 1

<div class="post-metadata">

**Author:** ![rsupport](https://avatars.discourse-cdn.com/v4/letter/r/45deac/32.png) [@rsupport](https://community.forestadmin.com/u/rsupport)\
**Post date:** [August 30, 2022, 3:50pm UTC](https://community.forestadmin.com/t/collection-not-showing-on-production-but-showing-fine-on-development/5173/1 "2022-08-30T15:50:57Z")

</div>

## 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](http://api.rhabitapp.com)

---

<div class="post-metadata">

**Author:** ![anon39940173](https://avatars.discourse-cdn.com/v4/letter/a/8c91f0/32.png) [@anon39940173](https://community.forestadmin.com/u/anon39940173)\
**Post date:** [August 31, 2022, 9:54am UTC](https://community.forestadmin.com/t/collection-not-showing-on-production-but-showing-fine-on-development/5173/2 "2022-08-31T09:54:02Z")

</div>

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)

---

<div class="post-metadata">

**Author:** ![rsupport](https://avatars.discourse-cdn.com/v4/letter/r/45deac/32.png) [@rsupport](https://community.forestadmin.com/u/rsupport)\
**Post date:** [August 31, 2022, 1:27pm UTC](https://community.forestadmin.com/t/collection-not-showing-on-production-but-showing-fine-on-development/5173/3 "2022-08-31T13:27:38Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![rsupport](https://avatars.discourse-cdn.com/v4/letter/r/45deac/32.png) [@rsupport](https://community.forestadmin.com/u/rsupport)\
**Post date:** [September 1, 2022, 8:03pm UTC](https://community.forestadmin.com/t/collection-not-showing-on-production-but-showing-fine-on-development/5173/4 "2022-09-01T20:03:53Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![anon39940173](https://avatars.discourse-cdn.com/v4/letter/a/8c91f0/32.png) [@anon39940173](https://community.forestadmin.com/u/anon39940173)\
**Post date:** [September 2, 2022, 2:53pm UTC](https://community.forestadmin.com/t/collection-not-showing-on-production-but-showing-fine-on-development/5173/5 "2022-09-02T14:53:26Z")

</div>

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](https://github.com/ForestAdmin/forest-rails/blob/22980817c2e5edeb437c32da404e75e79e8cb8bf/lib/forest_liana/bootstrapper.rb#L258)

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

---

<div class="post-metadata">

**Author:** ![rsupport](https://avatars.discourse-cdn.com/v4/letter/r/45deac/32.png) [@rsupport](https://community.forestadmin.com/u/rsupport)\
**Post date:** [September 5, 2022, 1:21am UTC](https://community.forestadmin.com/t/collection-not-showing-on-production-but-showing-fine-on-development/5173/6 "2022-09-05T01:21:45Z")

</div>

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.

 ![Screen Shot 2022-09-04 at 8.16.53 PM](https://europe1.discourse-cdn.com/flex013/uploads/forest/original/2X/e/e514542e41f577ba50f596332142fc2146145a5c.jpeg)

Thanks,

---

<div class="post-metadata">

**Author:** ![rsupport](https://avatars.discourse-cdn.com/v4/letter/r/45deac/32.png) [@rsupport](https://community.forestadmin.com/u/rsupport)\
**Post date:** [September 9, 2022, 1:27pm UTC](https://community.forestadmin.com/t/collection-not-showing-on-production-but-showing-fine-on-development/5173/8 "2022-09-09T13:27:21Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![rsupport](https://avatars.discourse-cdn.com/v4/letter/r/45deac/32.png) [@rsupport](https://community.forestadmin.com/u/rsupport)\
**Post date:** [September 12, 2022, 8:56pm UTC](https://community.forestadmin.com/t/collection-not-showing-on-production-but-showing-fine-on-development/5173/9 "2022-09-12T20:56:02Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![anon39940173](https://avatars.discourse-cdn.com/v4/letter/a/8c91f0/32.png) [@anon39940173](https://community.forestadmin.com/u/anon39940173)\
**Post date:** [September 12, 2022, 9:01pm UTC](https://community.forestadmin.com/t/collection-not-showing-on-production-but-showing-fine-on-development/5173/10 "2022-09-12T21:01:57Z")

</div>

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.](https://github.com/ForestAdmin/forest-rails/blob/22980817c2e5edeb437c32da404e75e79e8cb8bf/lib/forest_liana/bootstrapper.rb#L258)

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

---

<div class="post-metadata">

**Author:** ![rsupport](https://avatars.discourse-cdn.com/v4/letter/r/45deac/32.png) [@rsupport](https://community.forestadmin.com/u/rsupport)\
**Post date:** [September 12, 2022, 9:08pm UTC](https://community.forestadmin.com/t/collection-not-showing-on-production-but-showing-fine-on-development/5173/11 "2022-09-12T21:08:58Z")

</div>

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,

---

<div class="post-metadata">

**Author:** ![anon39940173](https://avatars.discourse-cdn.com/v4/letter/a/8c91f0/32.png) [@anon39940173](https://community.forestadmin.com/u/anon39940173)\
**Post date:** [September 13, 2022, 8:56am UTC](https://community.forestadmin.com/t/collection-not-showing-on-production-but-showing-fine-on-development/5173/12 "2022-09-13T08:56:28Z")

</div>

> [@rsupport](#):
>
> Please do let me know when you trigger the manual update and I’ll check forest afterwards to see if it changed anything.

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.

```javascript
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

---

<div class="post-metadata">

**Author:** ![rsupport](https://avatars.discourse-cdn.com/v4/letter/r/45deac/32.png) [@rsupport](https://community.forestadmin.com/u/rsupport)\
**Post date:** [September 13, 2022, 2:21pm UTC](https://community.forestadmin.com/t/collection-not-showing-on-production-but-showing-fine-on-development/5173/13 "2022-09-13T14:21:32Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![anon39940173](https://avatars.discourse-cdn.com/v4/letter/a/8c91f0/32.png) [@anon39940173](https://community.forestadmin.com/u/anon39940173)\
**Post date:** [September 13, 2022, 2:24pm UTC](https://community.forestadmin.com/t/collection-not-showing-on-production-but-showing-fine-on-development/5173/14 "2022-09-13T14:24:31Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![rsupport](https://avatars.discourse-cdn.com/v4/letter/r/45deac/32.png) [@rsupport](https://community.forestadmin.com/u/rsupport)\
**Post date:** [September 13, 2022, 2:32pm UTC](https://community.forestadmin.com/t/collection-not-showing-on-production-but-showing-fine-on-development/5173/15 "2022-09-13T14:32:14Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![anon39940173](https://avatars.discourse-cdn.com/v4/letter/a/8c91f0/32.png) [@anon39940173](https://community.forestadmin.com/u/anon39940173)\
**Post date:** [September 13, 2022, 3:05pm UTC](https://community.forestadmin.com/t/collection-not-showing-on-production-but-showing-fine-on-development/5173/16 "2022-09-13T15:05:29Z")

</div>

You can retrieve the environment secret from your admin panel settings

Go to Project Settings \> Environments \> Production

 ![Screenshot 2022-09-13 at 17.04.05](https://europe1.discourse-cdn.com/flex013/uploads/forest/original/2X/1/19cac37dbfa57db2119549382431bc89fe632b64.png)

---

<div class="post-metadata">

**Author:** ![rsupport](https://avatars.discourse-cdn.com/v4/letter/r/45deac/32.png) [@rsupport](https://community.forestadmin.com/u/rsupport)\
**Post date:** [September 13, 2022, 3:19pm UTC](https://community.forestadmin.com/t/collection-not-showing-on-production-but-showing-fine-on-development/5173/17 "2022-09-13T15:19:28Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![anon39940173](https://avatars.discourse-cdn.com/v4/letter/a/8c91f0/32.png) [@anon39940173](https://community.forestadmin.com/u/anon39940173)\
**Post date:** [September 13, 2022, 3:43pm UTC](https://community.forestadmin.com/t/collection-not-showing-on-production-but-showing-fine-on-development/5173/18 "2022-09-13T15:43:43Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![rsupport](https://avatars.discourse-cdn.com/v4/letter/r/45deac/32.png) [@rsupport](https://community.forestadmin.com/u/rsupport)\
**Post date:** [September 13, 2022, 4:24pm UTC](https://community.forestadmin.com/t/collection-not-showing-on-production-but-showing-fine-on-development/5173/19 "2022-09-13T16:24:15Z")

</div>

Hi @anon39940173,

Will do, thank you so much for your help
