Source and destination environments must have the same schema. Please check your environments code is synchronized

Feature(s) impacted

Field and smart Field update

Observed behavior

A few fields added to a collection, currently working on local branch and environment (DEVELOPMENT) but not shown in remote environment (PRODUCTION).

The schema is updated and pushed to production servers, restart has already been made ofc,
When running the “forest deploy” code, i can see the following error message :

Source and destination environments must have the same schema. Please check your environments code is synchronized.

When looking at “forest schema:diff” there is indeed some difference between both environment schema.

Expected behavior

schema update and new fields being added to production environment

Failure Logs

Source and destination environments must have the same schema. Please check your environments code is synchronized.

Context

  • Project name: Tandem
  • Team name: Operations
  • Environment name: Production
  • Agent (forest package) name & version: @forestadmin/context , 1.31.0
  • Database type: NoSQL (MongoDB)
  • Recent changes made on your end if any: …

Hi @sadra_edrisaraki ,

The command forest deploy will apply your latest layout changes definitively to your reference environment (i.e production).
For your forestadmin-schema.json, you will have to push it through your version control system that you are using.

Best regards,

Shohan

Hello, thx for the answer, as said in the topic, The schema is updated and pushed to production servers, it means, i have the exact same schema for production env in my codebase and version control system. Am i missing an information ?

I might have misunderstood this sentence :

When looking at “forest schema:diff” there is indeed some difference between both environment schema.

Did you pushed your changes in the forestadmin-schema from your development folder to your production ?

No worries,
yes i have double checked everything, the forest schema are identical in both env in my side
i’ve heard about some schema push issue saturday and sunday, it might be related to this ? since i’ve tried to push changes sunday

Yes it is possible. Could you try to push your changes now to see if your issue persist ?

Another question on my end, what did you change in your schema ?

i just tried to push a small change and restart server but still no update.
the changes i try to push are adding fields and Smart fields to a collection named users, “nbr of exchanges” is one of the smart field i try to add and “hasBecomePro” is one of the field i try to add

OK thanks for the information.
They are indeed not in the production apimap.
Can you confirm me that in the forestschema in your production folder, there are your new fields ?

sure ! here is a sample of the schema directly from the production server, they are identical to our local schema

field

Hello, any news regarding the issue ? Our Team is kinda blocked by not being able to deploy changes

Hi @sadra_edrisaraki, do you still reproduce this issue below ?

When running the “forest deploy” code, i can see the following error message :
Source and destination environments must have the same schema. Please check your environments code is synchronized.
When looking at “forest schema:diff” there is indeed some difference between both environment schema.

Hello, yes it’s still reproducing the same error

Could you please try to restart your agent in Production ? It should re-update the schema on our side

agent just restarted :+1:

Hello,
Does the forest deploy work now?

nope, the forest deploy doesn’t work

It’s very weird. Your production schema has been updated for the last time the 14/05/2023 19:07:05.
Can you look your log when you are restarting your production agent and tell me if there is a log that displays “Schema was updated, sending new version” ?

Yes indeed the last time the schema has been updated is 14/05/2023 19:07:05, unfortunatly, we don’t store logs of forest admin output, i can try to modify the schema again right now and see if there is the “Schema was updated, sending new version” log

Is it working? I saw a request from you side.