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

Feature(s) impacted

Problem while pushing a forest branch

Observed behavior

When trying to push a forest branch we always receive the following error: Failed to push branch: source and destination environments must have the same schema

We checked that we have the same .forestadmin-schema and ran npm ci in both servers.

Expected behavior

To have in our test forest branch the changes that we have done in the forest frontend in a development forest branch

Failure Logs

forest push
? Select the remote environment you want to push onto Test
? Push branch ***** onto Test Yes
× Failed to push branch: source and destination environments must have the same schema

Context

  • Project name: Backoffice
  • Team name: Fintecture
  • Environment name: test
  • Agent type & version: forest-express-sequelize:8.4.8
  • Recent changes made on your end if any: Updated model names

Hi,
Can you share the name of the environment from wich you want to push, adn the destination environment ?

Hello,
Push branch gateway-models-refactor (development env) onto Test (test env)

It looks like the forestadmin-schema.json are different between the two environments, you need to sync them first.

We already sync both environments, that is the problem that we have. We already had this problem before and a developer detected a bug and fixed it and we was able to push the changes, and now we are having the same problem.

As @anon94532230 said, both the environment does not share the same .forestadmin-schema.json on our end.

Could you check:

  • That both environment have the same .forestadmin-schema.json?
  • That the .forestadmin-schema.json is handled by your VCS?
  • That both environment have been restarted after the update of .forestadmin-schema.json?

If that’s the case, you should be able to fix the issue by using forest schema:apply (Forcing the schema to be re-sent to forestadmin servers), then forest push should work.

2 Likes

I was able to push my changes but i did not run anything, i pushed extra changes and then i tried again the forest push and it worked.

Gonna close the ticket, thanks.

Hello @jeffladiray ,

If I read you well, the problem is on your side. On the my server the schema is the same of the development env. If forestadmin servers doesn’t take in consideration the schema, it would be great if you can try to understand why.
To do the forest schema apply, I will need to install the Forest CLI on the server and to run some command to init and login the project. It’s something I would not do.

For information, this problem is recurrent. We have it today again. It’s complicated to work smoothly with forestadmin.

The schema on the test server and the dev env are the same. I checked it.

Bastien

Hey @Bastien_Blanc :wave:

To do the forest schema apply, I will need to install the Forest CLI on the server and to run some command to init and login the project. It’s something I would not do.

I’m totally ok with this and I understand this is far from being ideal. This was a suggestion to unlock the situation, since I’m not able to reproduce this issue at all.

For information, this problem is recurrent. We have it today again. It’s complicated to work smoothly with forestadmin.

I’ll just need the source and destination environment name, as well as the branch name you are working on to check what is happening, so I can check why our system detects different .forestadmin-schema.json on these environments. Feel free to send those to me as DM if you consider it private.

As a side note:

The forestadmin-schema.json is send on every server restart to our own server - independant of the environment.
This file is generated/updated on development environment only - and remote/production environment only forward the existing schema (That should be present in your VCS).
Logs should be displayed every time this schema is sent.

Every time we receive, we compute a hash based on the received schema, and this hash is used to raised the error mentioned in the thread (When source.hash and target.hash are different).

Sorry for the inconvenience here, I’ll check what is happening once I have all the required informations

Hello @jeffladiray,

Push branch discounts-management onto Test Yes
× Failed to push branch: source and destination environments must have the same schema

I restart the project and I have this log: ’ No change in apimap, nothing sent to Forest.'

Bastien

Thanks.

Indeed, I can spot that both schema are the same this time.

I’ll open a bug report on our end, and we will let you know once the issue is resolved.

@jeffladiray Do you have a timeline ?

Because we are stuck.

Hi @Bastien_Blanc

Here is the associated ticket in our bug tracker

We don’t provide ETA for bug fixes, however the ticket has already been dispatched to the team in charge of it, and be sure you’ll be pinged on this thread once fixed

As a side node, I also spotted that both environment you share are not running the same nodejs version. This is actually something that could lead to this kind of issue, so I would highly suggest to check if forcing the same nodejs version could resolve the issue.