# Unable to connect after upgrading to v7

**URL:** <https://community.forestadmin.com/t/unable-to-connect-after-upgrading-to-v7/6451>\
**Category:** Help me!\
**Tags:** setup\
**Created:** [June 30, 2023, 1:26pm UTC](https://community.forestadmin.com/t/unable-to-connect-after-upgrading-to-v7/6451 "2023-06-30T13:26:27Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![JulienGaladrim](https://avatars.discourse-cdn.com/v4/letter/j/ce7236/32.png) [@JulienGaladrim](https://community.forestadmin.com/u/JulienGaladrim)\
**Post date:** [June 30, 2023, 1:26pm UTC](https://community.forestadmin.com/t/unable-to-connect-after-upgrading-to-v7/6451/1 "2023-06-30T13:26:27Z")

</div>

## Feature(s) impacted

Login when upgrading to v7.

## Observed behavior

I am upgrading a project from the version 6 to 7 (I aim to upgrade to v9 later).  
When upgrading to v7 I can’t login anymore. I have an error 401 with the message “Invalid password”.

## Expected behavior

To be able to login correctly. In v6 login works well.

## Failure Logs

{“errors”: [{  
“status”:401,  
“detail”:“Forest cannot authenticate the user for this request.”,  
“name”:“Unauthorized”  
}]  
}

## Context

- Project name: interbev
- Team name: Galadrim
- Environment name: Production
- Agent (forest package) name & version: 6.0.0 to 7.12.5
- Database type: mysql
- Recent changes made on your end if any: upgrade to v7

---

<div class="post-metadata">

**Author:** ![arnaud](https://dub1.discourse-cdn.com/flex013/user_avatar/community.forestadmin.com/arnaud/32/32_2.png) [@arnaud](https://community.forestadmin.com/u/arnaud)\
**Post date:** [June 30, 2023, 1:30pm UTC](https://community.forestadmin.com/t/unable-to-connect-after-upgrading-to-v7/6451/2 "2023-06-30T13:30:53Z")

</div>

Hi @JulienGaladrim,

Did you read the [migration note](https://docs.forestadmin.com/documentation/extra-help/maintain/upgrade-notes-sql-mongodb/upgrade-to-v7) and follow all the breaking changes migration guidelines?

---

<div class="post-metadata">

**Author:** ![JulienGaladrim](https://avatars.discourse-cdn.com/v4/letter/j/ce7236/32.png) [@JulienGaladrim](https://community.forestadmin.com/u/JulienGaladrim)\
**Post date:** [June 30, 2023, 1:51pm UTC](https://community.forestadmin.com/t/unable-to-connect-after-upgrading-to-v7/6451/3 "2023-06-30T13:51:31Z")

</div>

Yes, we did follow the migration note, updated the app.js, forestadmin.js, indexs.js files and created the config/databases.js.

---

<div class="post-metadata">

**Author:** ![morganperre](https://dub1.discourse-cdn.com/flex013/user_avatar/community.forestadmin.com/morganperre/32/1296_2.png) [@morganperre](https://community.forestadmin.com/u/morganperre)\
**Post date:** [June 30, 2023, 2:07pm UTC](https://community.forestadmin.com/t/unable-to-connect-after-upgrading-to-v7/6451/4 "2023-06-30T14:07:06Z")

</div>

Hey @JulienGaladrim,

Ok, let’s try to find the guilty thing. We need a bit more information to help you diagnose this issue.

- Can you share your `APPLICATION_URL`?
- Could you give me more context about your issue ( **Network tabs** of your browser, logs of your server if any, etc)?
- Did you define a static `CLIENT_ID`? (_The whole part about static `CLIENT_ID` is not mandatory anymore._)

Kind regards,  
Morgan

---

<div class="post-metadata">

**Author:** ![JulienGaladrim](https://avatars.discourse-cdn.com/v4/letter/j/ce7236/32.png) [@JulienGaladrim](https://community.forestadmin.com/u/JulienGaladrim)\
**Post date:** [June 30, 2023, 2:37pm UTC](https://community.forestadmin.com/t/unable-to-connect-after-upgrading-to-v7/6451/5 "2023-06-30T14:37:53Z")

</div>

Sure :

- My APPLICATION\_URL is [https://adminapp.interbev.fr](https://adminapp.interbev.fr)

- The error I get is when trying to login is from the /sessions endpoint  

- I don’t think I have any CLIENT\_ID set up.

---

<div class="post-metadata">

**Author:** ![morganperre](https://dub1.discourse-cdn.com/flex013/user_avatar/community.forestadmin.com/morganperre/32/1296_2.png) [@morganperre](https://community.forestadmin.com/u/morganperre)\
**Post date:** [June 30, 2023, 2:47pm UTC](https://community.forestadmin.com/t/unable-to-connect-after-upgrading-to-v7/6451/6 "2023-06-30T14:47:11Z")

</div>

> [@JulienGaladrim](#):
>
> My APPLICATION\_URL is [https://adminapp.interbev.fr](https://adminapp.interbev.fr)

That’s the URL for your **production** environment. 👀

- Did you try with a development environment first?

> [@JulienGaladrim](#):
>
> The error I get is when trying to login is from the /sessions endpoint

It tries to call the old endpoint. This **endpoint has been removed since the v7** so it’s a really weird behavior. I will double-check with the team.

Morgan

---

<div class="post-metadata">

**Author:** ![morganperre](https://dub1.discourse-cdn.com/flex013/user_avatar/community.forestadmin.com/morganperre/32/1296_2.png) [@morganperre](https://community.forestadmin.com/u/morganperre)\
**Post date:** [June 30, 2023, 2:56pm UTC](https://community.forestadmin.com/t/unable-to-connect-after-upgrading-to-v7/6451/7 "2023-06-30T14:56:38Z")

</div>

We detected that your version is still outdated.

- **Production version is 6.5.0**
- **Development version is 6.5.0 too**

Are you sure you synchronise the schemas? **You need to remove the `NODE_ENV=production` to make the synchronisation happen**.

Let me know if it helps. 🙏

---

<div class="post-metadata">

**Author:** ![JulienGaladrim](https://avatars.discourse-cdn.com/v4/letter/j/ce7236/32.png) [@JulienGaladrim](https://community.forestadmin.com/u/JulienGaladrim)\
**Post date:** [June 30, 2023, 3:05pm UTC](https://community.forestadmin.com/t/unable-to-connect-after-upgrading-to-v7/6451/8 "2023-06-30T15:05:15Z")

</div>

Alright, this was the issue.

Could you tell me why we had to remove the NODE\_ENV variable though ?

---

<div class="post-metadata">

**Author:** ![morganperre](https://dub1.discourse-cdn.com/flex013/user_avatar/community.forestadmin.com/morganperre/32/1296_2.png) [@morganperre](https://community.forestadmin.com/u/morganperre)\
**Post date:** [June 30, 2023, 3:14pm UTC](https://community.forestadmin.com/t/unable-to-connect-after-upgrading-to-v7/6451/9 "2023-06-30T15:14:04Z")

</div>

> [@JulienGaladrim](#):
>
> Could you tell me why we had to remove the NODE\_ENV variable though?

Well, that is an issue that has been tackled on the latest versions of our agent (with more variables to control this behavior)…

The idea is that the changes should not be done in production but should be done in development or a remote environment before going to production.  
This way **we ensure you don’t delete everything in production by mistake**.

Let me know if you have any more questions.

Kind regards,  
Morgan

---

<div class="post-metadata">

**Author:** ![JulienGaladrim](https://avatars.discourse-cdn.com/v4/letter/j/ce7236/32.png) [@JulienGaladrim](https://community.forestadmin.com/u/JulienGaladrim)\
**Post date:** [June 30, 2023, 3:16pm UTC](https://community.forestadmin.com/t/unable-to-connect-after-upgrading-to-v7/6451/10 "2023-06-30T15:16:40Z")

</div>

I think we can close the issue, thank you a lot for your answers.  
Regards,  
Julien
