Feature(s) impacted
Pushing a branch, synchronising schemas
Observed behavior
I’m blocked from pushing a branch from local development to staging because the schemas are reported as not in sync. The only difference is in the liana_version, and I can’t work out how to get around that.
I have tried upgrading the local rpm agent package to the latest (1.52.0), I’ve tried a schema:update, and I’ve tried manually editing the liana_version field in my local schema json file
Expected behavior
There’s a way to align the liana versions so I can push a branch
Failure Logs
⚠ The schemas have differences.
{
meta: {
- liana_version: "1.41.7"
+ liana_version: "1.52.0"
}
}
Context
- Environment name: Development / Staging
- Agent technology: nodejs
- Agent (forest package) name & version: “@forestadmin/agent”: “^1.41.5”, (lock file is pointing to 1.41.7)
- Recent changes made on your end if any: This is my first time working with local development in an existing forest project
Hello @eddiesholl and welcome to the community!
If you are using the @forestadmin/agent, you must not use the forest schema commands, those are used for legacy agents. Could you share with me what mislead you to use those commands ? Maybe our documentation was unclear about this.
The intended flow would be to commit your schema changes in your repository and push the code with the updated schema on your production/remote servers. At the startup of the agent the schema will be updated automatically. You can find more information in this documentation page.
I was only using them because because I’m blocked from doing a push:
> forest "push"
? Push branch count-parties onto Staging Yes
× Failed to push branch: Source and destination environments must have the same schema. Please check your environments code is synchronized.
And because there seemed to be a schema variation, I was trying to understand what the variation might be.
I can start the agent locally, but when it starts it doesn’t modify the local schema file in any way. So I’m a bit stuck here. This would be the first push I’ve done, I’m taking over a system that has previously had people pushing to it successfully.
The only other thing I can think of to try is to modify that value by hand and push that change up to staging to see if it fixes things
I can start the agent locally, but when it starts it doesn’t modify the local schema file in any way. So I’m a bit stuck here.
Your schema file generation might be blocked by configuration,
do you have process.env.NODE_ENV=true
? or maybe the options passed to your agent have isProduction: true
hard set.
When you start your agent locally, it should recompute the schema (if not blocked by configuration) and send it to our server which should put you at the correct version after that you can push
your branch.
I’ve tried double checking with isProduction
forced to false, no change. I did notice this in the logs when the agent starts up:
forestadmin-agent:dev: warning: Dump failed for the namespace "forest": error:0680007B:asn1 encoding routines::header too long
forestadmin-agent:dev: info: Schema was not updated since last run (hash: bc5089e7c9c9ef81765be8155da1c9527fcc574a)
forestadmin-agent:dev: info: Successfully mounted on Standalone server (http://0.0.0.0:3310)
Is this the dump operation that should be writing the file out?
Could you retry with isProduction: false
and your package updated to
"@forestadmin/agent”: “1.52.0”
It seems that the schema generation behaves as expected.