# Permissions errors getting collections

**URL:** <https://community.forestadmin.com/t/permissions-errors-getting-collections/5177>\
**Category:** Help me!\
**Created:** [August 30, 2022, 6:56pm UTC](https://community.forestadmin.com/t/permissions-errors-getting-collections/5177 "2022-08-30T18:56:23Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![Maximiliano\_Carrizo](https://dub1.discourse-cdn.com/flex013/user_avatar/community.forestadmin.com/maximiliano_carrizo/32/4986_2.png) [@Maximiliano\_Carrizo](https://community.forestadmin.com/u/Maximiliano_Carrizo)\
**Post date:** [August 30, 2022, 6:56pm UTC](https://community.forestadmin.com/t/permissions-errors-getting-collections/5177/1 "2022-08-30T18:56:23Z")

</div>

## Feature(s) impacted

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:

```javascript
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

```javascript
 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)

```

## Context

- Project name: dunsguide
- Environment name: Development
- Agent type & version:

```javascript

    "@forestadmin/agent": "^1.0.0-beta.43",
    "@forestadmin/datasource-sql": "^1.0.0-beta.40",

```

---

<div class="post-metadata">

**Author:** ![anon39940173](https://avatars.discourse-cdn.com/v4/letter/a/8c91f0/32.png) [@anon39940173](https://community.forestadmin.com/u/anon39940173)\
**Post date:** [August 30, 2022, 8:04pm UTC](https://community.forestadmin.com/t/permissions-errors-getting-collections/5177/2 "2022-08-30T20:04:00Z")

</div>

Hi @Maximiliano_Carrizo

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:

> **[Migrate to the new role system](https://docs.forestadmin.com/documentation/how-tos/maintain/migrate-to-the-new-role-system)**

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”.

---

<div class="post-metadata">

**Author:** ![anon39940173](https://avatars.discourse-cdn.com/v4/letter/a/8c91f0/32.png) [@anon39940173](https://community.forestadmin.com/u/anon39940173)\
**Post date:** [August 30, 2022, 8:08pm UTC](https://community.forestadmin.com/t/permissions-errors-getting-collections/5177/3 "2022-08-30T20:08:16Z")

</div>

Before migrating, I just checked and roles are a paying feature (see [Pricing](https://www.forestadmin.com/pricing#4-pricing-collaborative)).

If you are using the free plan, tell us so we can check that your migration goes smoothly

---

<div class="post-metadata">

**Author:** ![Maximiliano\_Carrizo](https://dub1.discourse-cdn.com/flex013/user_avatar/community.forestadmin.com/maximiliano_carrizo/32/4986_2.png) [@Maximiliano\_Carrizo](https://community.forestadmin.com/u/Maximiliano_Carrizo)\
**Post date:** [August 30, 2022, 8:12pm UTC](https://community.forestadmin.com/t/permissions-errors-getting-collections/5177/4 "2022-08-30T20:12:20Z")

</div>

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 !

---

<div class="post-metadata">

**Author:** ![Maximiliano\_Carrizo](https://dub1.discourse-cdn.com/flex013/user_avatar/community.forestadmin.com/maximiliano_carrizo/32/4986_2.png) [@Maximiliano\_Carrizo](https://community.forestadmin.com/u/Maximiliano_Carrizo)\
**Post date:** [August 30, 2022, 8:13pm UTC](https://community.forestadmin.com/t/permissions-errors-getting-collections/5177/5 "2022-08-30T20:13:20Z")

</div>

Is there is a way to migrate **ONLY** development environment to make all the test that I need it would be lovely.

---

<div class="post-metadata">

**Author:** ![anon39940173](https://avatars.discourse-cdn.com/v4/letter/a/8c91f0/32.png) [@anon39940173](https://community.forestadmin.com/u/anon39940173)\
**Post date:** [August 30, 2022, 8:22pm UTC](https://community.forestadmin.com/t/permissions-errors-getting-collections/5177/6 "2022-08-30T20:22:38Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Maximiliano\_Carrizo](https://dub1.discourse-cdn.com/flex013/user_avatar/community.forestadmin.com/maximiliano_carrizo/32/4986_2.png) [@Maximiliano\_Carrizo](https://community.forestadmin.com/u/Maximiliano_Carrizo)\
**Post date:** [August 30, 2022, 8:25pm UTC](https://community.forestadmin.com/t/permissions-errors-getting-collections/5177/7 "2022-08-30T20:25:02Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Maximiliano\_Carrizo](https://dub1.discourse-cdn.com/flex013/user_avatar/community.forestadmin.com/maximiliano_carrizo/32/4986_2.png) [@Maximiliano\_Carrizo](https://community.forestadmin.com/u/Maximiliano_Carrizo)\
**Post date:** [September 1, 2022, 8:43am UTC](https://community.forestadmin.com/t/permissions-errors-getting-collections/5177/8 "2022-09-01T08:43:18Z")

</div>

Hi, Romaing, good morning !

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 ?

Thanks !

---

<div class="post-metadata">

**Author:** ![shohanr](https://dub1.discourse-cdn.com/flex013/user_avatar/community.forestadmin.com/shohanr/32/4999_2.png) [@shohanr](https://community.forestadmin.com/u/shohanr)\
**Post date:** [September 1, 2022, 11:29am UTC](https://community.forestadmin.com/t/permissions-errors-getting-collections/5177/9 "2022-09-01T11:29:43Z")

</div>

Hi @Maximiliano_Carrizo,

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.

Best,

Shohan

---

<div class="post-metadata">

**Author:** ![Maximiliano\_Carrizo](https://dub1.discourse-cdn.com/flex013/user_avatar/community.forestadmin.com/maximiliano_carrizo/32/4986_2.png) [@Maximiliano\_Carrizo](https://community.forestadmin.com/u/Maximiliano_Carrizo)\
**Post date:** [September 1, 2022, 2:32pm UTC](https://community.forestadmin.com/t/permissions-errors-getting-collections/5177/10 "2022-09-01T14:32:24Z")

</div>

Those are **GREAT** news ! Let me talk this topic !

---

<div class="post-metadata">

**Author:** ![Maximiliano\_Carrizo](https://dub1.discourse-cdn.com/flex013/user_avatar/community.forestadmin.com/maximiliano_carrizo/32/4986_2.png) [@Maximiliano\_Carrizo](https://community.forestadmin.com/u/Maximiliano_Carrizo)\
**Post date:** [September 1, 2022, 2:55pm UTC](https://community.forestadmin.com/t/permissions-errors-getting-collections/5177/11 "2022-09-01T14:55:35Z")

</div>

One more question. It is possible to make the migration on Sunday ? Because we have no users, and I can fix everything with no pressure.

We decided to make the migration. What we are talking now is when. Sunday would be a great win.

---

<div class="post-metadata">

**Author:** ![Maximiliano\_Carrizo](https://dub1.discourse-cdn.com/flex013/user_avatar/community.forestadmin.com/maximiliano_carrizo/32/4986_2.png) [@Maximiliano\_Carrizo](https://community.forestadmin.com/u/Maximiliano_Carrizo)\
**Post date:** [September 1, 2022, 8:01pm UTC](https://community.forestadmin.com/t/permissions-errors-getting-collections/5177/12 "2022-09-01T20:01:14Z")

</div>

Hi, @shohanr ! Hoping you are having a nice evening, my question: It is possible to run the migration on Sunday ?

Thanks !

---

<div class="post-metadata">

**Author:** ![Maximiliano\_Carrizo](https://dub1.discourse-cdn.com/flex013/user_avatar/community.forestadmin.com/maximiliano_carrizo/32/4986_2.png) [@Maximiliano\_Carrizo](https://community.forestadmin.com/u/Maximiliano_Carrizo)\
**Post date:** [September 2, 2022, 8:11am UTC](https://community.forestadmin.com/t/permissions-errors-getting-collections/5177/13 "2022-09-02T08:11:42Z")

</div>

@anon39940173 hi !

Im not getting responses from you, guys. It is possible to make the migration on Sunday ?

Thanks

---

<div class="post-metadata">

**Author:** ![shohanr](https://dub1.discourse-cdn.com/flex013/user_avatar/community.forestadmin.com/shohanr/32/4999_2.png) [@shohanr](https://community.forestadmin.com/u/shohanr)\
**Post date:** [September 2, 2022, 8:16am UTC](https://community.forestadmin.com/t/permissions-errors-getting-collections/5177/14 "2022-09-02T08:16:36Z")

</div>

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).

---

<div class="post-metadata">

**Author:** ![Maximiliano\_Carrizo](https://dub1.discourse-cdn.com/flex013/user_avatar/community.forestadmin.com/maximiliano_carrizo/32/4986_2.png) [@Maximiliano\_Carrizo](https://community.forestadmin.com/u/Maximiliano_Carrizo)\
**Post date:** [September 2, 2022, 8:22am UTC](https://community.forestadmin.com/t/permissions-errors-getting-collections/5177/16 "2022-09-02T08:22:50Z")

</div>

Lovely ! Please, enable it.

Project path is [https://app.forestadmin.com/Dunsguide](https://app.forestadmin.com/Dunsguide)

Thanks ! Let me know when its enabled !

---

<div class="post-metadata">

**Author:** ![shohanr](https://dub1.discourse-cdn.com/flex013/user_avatar/community.forestadmin.com/shohanr/32/4999_2.png) [@shohanr](https://community.forestadmin.com/u/shohanr)\
**Post date:** [September 2, 2022, 9:22am UTC](https://community.forestadmin.com/t/permissions-errors-getting-collections/5177/17 "2022-09-02T09:22:34Z")

</div>

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)

Have a good day @Maximiliano_Carrizo

Best regards,

Shohan

---

<div class="post-metadata">

**Author:** ![Maximiliano\_Carrizo](https://dub1.discourse-cdn.com/flex013/user_avatar/community.forestadmin.com/maximiliano_carrizo/32/4986_2.png) [@Maximiliano\_Carrizo](https://community.forestadmin.com/u/Maximiliano_Carrizo)\
**Post date:** [September 2, 2022, 9:45am UTC](https://community.forestadmin.com/t/permissions-errors-getting-collections/5177/18 "2022-09-02T09:45:48Z")

</div>

Thank you. Talk again to you on Monday !

---

<div class="post-metadata">

**Author:** ![anon34731316](https://avatars.discourse-cdn.com/v4/letter/a/eada6e/32.png) [@anon34731316](https://community.forestadmin.com/u/anon34731316)\
**Post date:** [September 5, 2022, 7:29am UTC](https://community.forestadmin.com/t/permissions-errors-getting-collections/5177/19 "2022-09-05T07:29:04Z")

</div>

Hello @Maximiliano_Carrizo,

Any news about the roles migration?  
How did it go?

Thanks!

---

<div class="post-metadata">

**Author:** ![Maximiliano\_Carrizo](https://dub1.discourse-cdn.com/flex013/user_avatar/community.forestadmin.com/maximiliano_carrizo/32/4986_2.png) [@Maximiliano\_Carrizo](https://community.forestadmin.com/u/Maximiliano_Carrizo)\
**Post date:** [September 5, 2022, 12:51pm UTC](https://community.forestadmin.com/t/permissions-errors-getting-collections/5177/20 "2022-09-05T12:51:13Z")

</div>

Oh, it worked perfectly !

THANK you very much, man ! Im very happy !

---

<div class="post-metadata">

**Author:** ![anon34731316](https://avatars.discourse-cdn.com/v4/letter/a/eada6e/32.png) [@anon34731316](https://community.forestadmin.com/u/anon34731316)\
**Post date:** [September 5, 2022, 1:39pm UTC](https://community.forestadmin.com/t/permissions-errors-getting-collections/5177/21 "2022-09-05T13:39:49Z")

</div>

@Maximiliano_Carrizo that’s a great news!

Thanks for your answer 🙂
