Im moving an existing backend from express/sequelize to nest.js. Using the same credentials ( FOREST_API_KEY and others ), Im getting this error message when tries to get a collection:
Error: Roles V2 are unsupported
at Function.getPermissions (/usr/src/app/node_modules/@forestadmin/agent/src/agent/utils/forest-http-api.ts:142:15)
at processTicksAndRejections (internal/process/task_queues.js:93:5)
Expected behavior
Let get all collections information
Failure Logs
2022-08-30T16:21:49.041Z - [INFO] [forestadmin] [200] POST /authentication - 0ms
2022-08-30T16:21:51.260Z - [INFO] [forestadmin] [200] GET /authentication/callback - 1931ms
2022-08-30T16:21:51.279Z - [ERROR] [forestadmin] [500] GET /company - 0ms
===== An exception was raised =====
GET /company?{
timezone: America/Buenos_Aires,
fields[company]: id,logo,background,website,facebook,instagram,twitter,linkedin,youtube,isHidden,createdAt,updatedAt,legalEntity,useTradeNameAsPrimary,hideEmail,hidePhone,
page[number]: 1,
page[size]: 15,
sort: -id
}
Roles V2 are unsupported
Error: Roles V2 are unsupported
at Function.getPermissions (/usr/src/app/node_modules/@forestadmin/agent/src/agent/utils/forest-http-api.ts:142:15)
at processTicksAndRejections (internal/process/task_queues.js:93:5)
Actually that’s a bug… the message should say something like “Roles V1 are unsupported, please migrate to Roles V2”.
I’m opening a bug report on our side to update the message.
About the reason why you are getting this error with an older project, but not on a more recent one is because the role system have evolved in Forest Admin, but we kept retro-compatibility.
We released the NestJS agent only a couple months ago (actually still in beta, but not for long), and did not implement support for the older role system in it.
To upgrade, you can follow this tutorial:
The documentation is slightly outdated: if I remember correctly it is no longer needed to contact the support and ask for the project to be “ready to migrate”.
Good afternoon ! We are not using a free plan, but … before migrating anything I need to talk with my boss, because … application is actually working with express and sequelize …
If I update the application and something goes wrong, I will not have the app working with nest.js and I will not have the app working with express too, so I will be in trouble.
Met me ask to my boss what to do. Thanks for the INCREDIBLE support !
Sadly there is no way to migrate only one environment, this is a global project thing.
Let’s decide on a course of action tomorrow.
In the meantime, you can test your new agent by creating a free project on another account (in development all paying features are available), that should give you another envSecret/authSecret tuple that does support the new role system
I already did, using a personal account just for testing, and it worked like a charm. Unfortunatelly, I need to mantain the existing corporate site.
I will discuss this topic with my boss tomorrow morning, and I will let you know what I will do. Thanks for all, your support is awesome
Very simple question: If we decide to migrate our actual site, and there is a problem later … it is possible to rollback that change and restore the old version ?
It will be possible to rollback if anything happen.
Keep us updated for the decision and our customer success team will be there to help for the migration.
Sure @Maximiliano_Carrizo.
Our team enable your roles to migrate and then you will decide through the interface whenever it please you (i.e. on Sunday).
The roles have been activated.
You can now proceed with the migration whenever you want from the Roles tab of the project settings.
The process is fully transparent for the users and no interruptions will be caused even if you perform the actions during work day.
The process will only take a few minutes.
(Corrected: Please forget the first message about the pending invitation, it is irrelevant)