Push Forest branch error: environments must have the same schema


Now that I have deployed my develop branch to my integration environment. I would like to push my forest branch to my integration environment but when I do so I get an error saying:

 ›   Error: Failed to push branch: source and destination environments must have the same schema

However schema are supposed to be the same since I just deployed the dev one to the integration env.

Hey @Guiguijo :wave:,

Would you mind giving me the exact name of the source & destination environment?

It appears to me that one of your development environment does not have a forestadmin-schema.json saved on our end, but I just want to be sure I’m looking at the right data here.

In the meantime, I’ll check in our log if I can spot anything.

Thanks for your help :pray:

Hi @jeffladiray ,

target env: INTEGRATION

1 Like


I did some changes on my prod env which were applied to preprod, staging and integration env, but not on my dev branch feature/smart-refunds

If I understood well, those changes should have been applied on my feature/smart-refunds branch too

I just looked on my end, and indeed, your schemas are the same across these environment, and the error might just not be super explicit for your case.

On our end, I’ve got an environment with no forestadmin-schema which seems to be the base for your feature/smart-refunds. I also looked at the code that throws the error you are mentionning and this environment is the only one having a different forestadmin-schema hash (Which we use to detect changes).

Could you share with me the last 5 characters of the FOREST_ENV_SECRET of the environment you use as the source?

yes: here they are: 545f1

Hello @jeffladiray ,

Did you find anything about this forestadmin-schema on my Docker_development env ? (Locally I do have a forestadmin-schema)



Just to sum up what I understand looking at your environments data:

  • The environment matching your environment secret is marked as a remote one on my end, but I’m pretty sure that not what you are expecting
  • Both of these environments (DOCKER_DEVELOPMENT, INTEGRATION) have the same schema, so I’m pretty sure you might have a third environment involve here (See next point)
  • Base environment for your branch feature/smart-refunds is not DOCKER_DEVELOPMENT, but an environment with a secret ending with f7b0

I’m still investigating, but it seems like forest-cli have a very specific way of detecting the source environment on forest push, and looking at your previous thread (this one), I think something might have introduced a missconfiguration in your project.

I would suggest the following if that’s ok for you (Let me know otherwise)

  • Start your backend with your schema using the environment secret ending with f7b0 to sync your forestadmin-schema
  • Test if everything is working as expected on your forest (And that your branch changes looks right)
  • If everything is ok, retry the push command to see your changes on the INTEGRATION environment.
  • Then, let me know once done.

To be as explicit as possible on the issue here: Our new dev workflow automatically create a development environment for you on forest init. I suppose that the DOCKER_DEVELOPMENT your have was created after your forest init, and strangely enough, was marked as a remote environment on our end (Still not sure why, I need to investigate this part).

If I’m right, your push command is issued from the source environment ending with f7b0, which has a mismatching schema (?) in our system, that would explain the error.
If I’m wrong, we might have an issue in our code base that have introduced this strange behavior. I’ll take a look on my end to see if I can spot anything.

Sorry for the delayed response, and I hope this will help. Let me know :pray:

No problem, thank you for your return.

Just to be sure, are you speaking of the environment secret or of the auth secret ?

In any case, I don’t have any secret ending by f7b0 :frowning:

Just to be sure, are you speaking of the environment secret or of the auth secret ?

Environment secret indeed

In any case, I don’t have any secret ending by f7b0 :frowning:

That would explain everything!
I’ll need some time to put a setup similar to yours to find out what solution I can share with you, but everything seems related to this environment.

All right! So, given the number of last changes we made on Forest (converting project to TS. + V7 migration) that may explain that, at some point, I generated this branch with a wring env secret, I suggest you don’t lose time with this. I am going to handle this and will create a new branch with our new stable Forest.
Then, I will let you know if we meet any difficulties :wink:

1 Like

Nice, thanks.

I’m pretty sure this is the kind of issue that might re-happen to other users, so I’ll still setup everything just in case.

Let me know if I can help in any way :pray:

1 Like