# Unable to register the client - TimeoutError

**URL:** <https://community.forestadmin.com/t/unable-to-register-the-client-timeouterror/2853>\
**Category:** Help me!\
**Tags:** setup\
**Created:** [July 7, 2021, 7:45pm UTC](https://community.forestadmin.com/t/unable-to-register-the-client-timeouterror/2853 "2021-07-07T19:45:13Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![fabmarc](https://avatars.discourse-cdn.com/v4/letter/f/6bbea6/32.png) [@fabmarc](https://community.forestadmin.com/u/fabmarc)\
**Post date:** [July 7, 2021, 7:45pm UTC](https://community.forestadmin.com/t/unable-to-register-the-client-timeouterror/2853/1 "2021-07-07T19:45:13Z")

</div>

Hey masters!

I’ve just done the upgrade to v7, and now I am facing this problem when I try to log in:  
(please see some screenshots)

 ![image](https://europe1.discourse-cdn.com/flex013/uploads/forest/original/2X/5/57852b264e171c99f91c3d800b8500b86f657036.png)

 ![image](https://europe1.discourse-cdn.com/flex013/uploads/forest/original/2X/e/e761398c989c89da3da4bd6087325089f4427711.png)

 ![image](https://europe1.discourse-cdn.com/flex013/uploads/forest/original/2X/b/b1d20f66f3e332c601745dedb55eaa77a910dd32.png)

Do they help you guys to help me with this issue?

BTW, this is the console log:

```javascript
[forest] 🌳🌳🌳 Unable to register the client
{
  "configuration": {
    "authorization_endpoint": "https://api.forestadmin.com/oidc/auth",
    "device_authorization_endpoint": "https://api.forestadmin.com/oidc/device/auth",
    "claims_parameter_supported": false,
    "claims_supported": [
      "sub",
      "email",
      "sid",
      "auth_time",
      "iss"
    ],
    "code_challenge_methods_supported": [
      "S256"
    ],
    "end_session_endpoint": "https://api.forestadmin.com/oidc/session/end",
    "grant_types_supported": [
      "authorization_code",
      "urn:ietf:params:oauth:grant-type:device_code"
    ],
    "id_token_signing_alg_values_supported": [
      "HS256",
      "RS256"
    ],
    "issuer": "https://api.forestadmin.com",
    "jwks_uri": "https://api.forestadmin.com/oidc/jwks",
    "registration_endpoint": "https://api.forestadmin.com/oidc/reg",
    "response_modes_supported": [
      "query"
    ],
    "response_types_supported": [
      "code",
      "none"
    ],
    "scopes_supported": [
      "openid",
      "email",
      "profile"
    ],
    "subject_types_supported": [
      "public"
    ],
    "token_endpoint_auth_methods_supported": [
      "none"
    ],
    "token_endpoint_auth_signing_alg_values_supported": [],
    "token_endpoint": "https://api.forestadmin.com/oidc/token",
    "request_object_signing_alg_values_supported": [
      "HS256",
      "RS256"
    ],
    "request_parameter_supported": false,
    "request_uri_parameter_supported": true,
    "require_request_uri_registration": true,
    "claim_types_supported": [
      "normal"
    ]
  },
  "registration": {
    "redirect_uris": [
      "http://localhost:3310/forest/authentication/callback"
    ],
    "token_endpoint_auth_method": "none"
  },
  "error": {
    "name": "TimeoutError",
    "code": "ETIMEDOUT",
    "timings": {
      "start": 1625686114556,
      "socket": 1625686114556,
      "error": 1625686118061,
      "phases": {
        "wait": 0,
        "total": 3505
      }
    },
    "event": "request"
  }
}
[forest] 🌳🌳🌳 Unexpected error: Timeout awaiting 'request' for 3500ms
{
  "name": "TimeoutError",
  "code": "ETIMEDOUT",
  "timings": {
    "start": 1625686114556,
    "socket": 1625686114556,
    "error": 1625686118061,
    "phases": {
      "wait": 0,
      "total": 3505
    }
  },
  "event": "request",
  "stack": "RequestError: Timeout awaiting 'request' for 3500ms\n at ClientRequest.<anonymous> (/Users/fabio.marconi/projects/forest-backend/UCM-3.0/node_modules/got/dist/source/core/index.js:956:65)\n at Object.onceWrapper (node:events:483:26)\n at ClientRequest.emit (node:events:388:22)\n at ClientRequest.origin.emit (/Users/fabio.marconi/projects/forest-backend/UCM-3.0/node_modules/@szmarczak/http-timer/dist/source/index.js:39:20)\n at TLSSocket.socketErrorListener (node:_http_client:490:9)\n at TLSSocket.emit (node:events:376:20)\n at emitErrorNT (node:internal/streams/destroy:188:8)\n at emitErrorCloseNT (node:internal/streams/destroy:153:3)\n at processTicksAndRejections (node:internal/process/task_queues:80:21)\n at Timeout.timeoutHandler [as _onTimeout] (/Users/fabio.marconi/projects/forest-backend/UCM-3.0/node_modules/got/dist/source/core/utils/timed-out.js:36:25)\n at listOnTimeout (node:internal/timers:558:17)\n at processTimers (node:internal/timers:499:7)"
}
POST /forest/authentication 500 98 - 5866.418 ms

```

My package.json:

```javascript
  "dependencies": {
    "chalk": "~1.1.3",
    "cookie-parser": "1.4.4",
    "debug": "~4.0.1",
    "dotenv": "~6.1.0",
    "express": "^4.17.1",
    "forest-express-sequelize": "^7.12.2",
    "morgan": "1.9.1",
    "pg": "8.2.2",
    "require-all": "^3.0.0",
    "sequelize": "^5.15.2"
  }

```

All changes I did was copied from here:

> **[Upgrade to v7](https://docs.forestadmin.com/documentation/how-tos/maintain/upgrade-notes-sql-mongodb/upgrade-to-v7)**
>
> The purpose of this note is to help developers to upgrade their liana from v6 to v7. Please read carefully and integrate the following breaking changes to ensure a smooth upgrade.​

I just didn’t do the section “Running up multiple server instances”.

What else do you need to see to help me out?

---

<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:** [July 8, 2021, 9:13am UTC](https://community.forestadmin.com/t/unable-to-register-the-client-timeouterror/2853/2 "2021-07-08T09:13:49Z")

</div>

Hello @fabmarc,

Thanks for this details post ! Let’s try to find the culprit.

- In which PORT the application is running ?
- Have you defined your environment variables ? ( **APPLICATION\_URL** , **FOREST\_ENV\_SECRET** , **FOREST\_AUTH\_SECRET** )
- Lastly, since you haven’t check the section “Running up multiple server instances” you haven’t define the **CLIENT\_ID**? (You don’t need to define this in development and when you have only one instance running)

Kind regards,  
Morgan

---

<div class="post-metadata">

**Author:** ![fabmarc](https://avatars.discourse-cdn.com/v4/letter/f/6bbea6/32.png) [@fabmarc](https://community.forestadmin.com/u/fabmarc)\
**Post date:** [July 8, 2021, 9:30am UTC](https://community.forestadmin.com/t/unable-to-register-the-client-timeouterror/2853/3 "2021-07-08T09:30:59Z")

</div>

Hi @morganperre ,

This is my `.env` content:

```javascript
APPLICATION_PORT=3310
APPLICATION_URL=http://localhost:3310
DATABASE_URL=postgres://fabio.marconi:@localhost:5432/falcon_api_development
DATABASE_SCHEMA=public
DATABASE_SSL=false
FOREST_AUTH_SECRET=blablabla
FOREST_ENV_SECRET=blablabla
FOREST_CLIENT_ID=blablabla.blablabla.blablabla-blablabla-blablabla-blablabla
NODE_ENV=development

```

And that is the output on the console when I try to log in with `FOREST_CLIENT_ID` set:

```javascript
➜ UCM-3.0 git:(master) ✗ npm run start

> ucm-3.0@0.5.2 start
> node ./bin/www

Your application is listening on port 3310.
Your admin panel is available here: https://app.forestadmin.com/projects
OPTIONS /forest/authentication 204 0 - 1.544 ms
POST /forest/authentication 200 923 - 2386.602 ms
OPTIONS /forest/authentication/callback?code=ysh9UmPPhJ3v9BkA7bN_6wiS66S9bN-YuKV25VsQ5alJvallzSvNTOgyVwsY9lCW&state=%7B%22renderingId%22%3A66917%7D 204 0 - 0.230 ms
[forest] 🌳🌳🌳 Unexpected error: Timeout awaiting 'request' for 3500ms
{
  "name": "TimeoutError",
  "code": "ETIMEDOUT",
  "timings": {
    "start": 1625735957248,
    "socket": 1625735957249,
    "error": 1625735960753,
    "phases": {
      "wait": 1,
      "total": 3505
    }
  },
  "event": "request",
  "stack": "RequestError: Timeout awaiting 'request' for 3500ms\n at ClientRequest.<anonymous> (/Users/fabio.marconi/projects/forest-backend/UCM-3.0/node_modules/got/dist/source/core/index.js:956:65)\n at Object.onceWrapper (node:events:483:26)\n at ClientRequest.emit (node:events:388:22)\n at ClientRequest.origin.emit (/Users/fabio.marconi/projects/forest-backend/UCM-3.0/node_modules/@szmarczak/http-timer/dist/source/index.js:39:20)\n at TLSSocket.socketErrorListener (node:_http_client:490:9)\n at TLSSocket.emit (node:events:376:20)\n at emitErrorNT (node:internal/streams/destroy:188:8)\n at emitErrorCloseNT (node:internal/streams/destroy:153:3)\n at processTicksAndRejections (node:internal/process/task_queues:80:21)\n at Timeout.timeoutHandler [as _onTimeout] (/Users/fabio.marconi/projects/forest-backend/UCM-3.0/node_modules/got/dist/source/core/utils/timed-out.js:36:25)\n at listOnTimeout (node:internal/timers:558:17)\n at processTimers (node:internal/timers:499:7)"
}
GET /forest/authentication/callback?code=ysh9UmPPhJ3v9BkA7bN_6wiS66S9bN-YuKV25VsQ5alJvallzSvNTOgyVwsY9lCW&state=%7B%22renderingId%22%3A66917%7D 500 98 - 3582.605 ms

```

I noticed the error printed on the console is shorter, but the same: **TimeoutError**.

So, as you can see above, the **PORT** the application is running is **3310**.

---

<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:** [July 8, 2021, 9:52am UTC](https://community.forestadmin.com/t/unable-to-register-the-client-timeouterror/2853/4 "2021-07-08T09:52:25Z")

</div>

Hey again,

Ok, It’s the first time a client get this issue.

So first of all remove the **FOREST\_CLIENT\_ID** from your config.

In your `server.js` file can you add the following code at the end of your file ? (I will let a longer time to you backend to try to resolve HTTP request)

```javascript
server.keepAliveTimeout = 60000;

```

Let me know if you still have the issue.

Thanks in advance,  
Morgan

---

<div class="post-metadata">

**Author:** ![fabmarc](https://avatars.discourse-cdn.com/v4/letter/f/6bbea6/32.png) [@fabmarc](https://community.forestadmin.com/u/fabmarc)\
**Post date:** [July 8, 2021, 10:06am UTC](https://community.forestadmin.com/t/unable-to-register-the-client-timeouterror/2853/5 "2021-07-08T10:06:54Z")

</div>

Hey @morganperre

I usually don’t use **FOREST\_CLIENT\_ID** , I just added now for test purpose, already removed it.  
So, I added the statement you said, the behavior/error remains the same though.  
Let me show you my Javascript console:

 ![image](https://europe1.discourse-cdn.com/flex013/uploads/forest/original/2X/2/249b03c37ea48de2fe8027539c86b7832836b20f.png)  
Does that help?

I even tried different node versions:

```javascript
➜ UCM-3.0 git:(master) ✗ nvm list
-> v10.24.1
       v12.22.3
        v15.3.0
         system
default -> node (-> v15.3.0)

```

With all 3 versions, the problem remains!

Any clue, like, any dependency I am missing?

---

<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:** [July 8, 2021, 10:17am UTC](https://community.forestadmin.com/t/unable-to-register-the-client-timeouterror/2853/6 "2021-07-08T10:17:15Z")

</div>

Hey @fabmarc,

It doesn’t help at all. I was wondering how/why you have this error and I thought it could help understand.

I propose you to update your dependencies. Use the following ones. (It’s from a recently created project on my side)

```javascript
 "dependencies": {
    "body-parser": "1.19.0",
    "chalk": "~1.1.3",
    "cookie-parser": "1.4.4",
    "cors": "2.8.5",
    "debug": "~4.0.1",
    "dotenv": "~6.1.0",
    "express": "~4.17.1",
    "express-jwt": "5.3.1",
    "forest-express-sequelize": "^7.12.2",
    "morgan": "1.9.1",
    "require-all": "^3.0.0",
    "sequelize": "~5.15.2",
    "pg": "~8.2.2"
  }

```

If it doesn’t work I propose to share your **app.js** and also you to create a fresh new project to see if you encounter the same issue.

Thanks for your time.  
Morgan

---

<div class="post-metadata">

**Author:** ![fabmarc](https://avatars.discourse-cdn.com/v4/letter/f/6bbea6/32.png) [@fabmarc](https://community.forestadmin.com/u/fabmarc)\
**Post date:** [July 8, 2021, 1:48pm UTC](https://community.forestadmin.com/t/unable-to-register-the-client-timeouterror/2853/7 "2021-07-08T13:48:48Z")

</div>

Hey @morganperre ,

This issue came up cause I decided to upgrade my backend, I was in a version before v6.  
I also wanna use a new feature (filterable smart field).

Now my **`package.json`** looks like:

```javascript
{
  "name": "ucm-3.0",
  "version": "0.5.2",
  "private": true,
  "scripts": {
    "start": "node ./bin/www"
  },
  "dependencies": {
    "body-parser": "^1.19.0",
    "chalk": "~1.1.3",
    "cookie-parser": "1.4.4",
    "cors": "^2.8.5",
    "debug": "~4.0.1",
    "dotenv": "~6.1.0",
    "express": "^4.17.1",
    "express-jwt": "^6.0.0",
    "forest-express-sequelize": "^7.12.2",
    "morgan": "1.9.1",
    "pg": "8.2.2",
    "require-all": "^3.0.0",
    "sequelize": "^5.15.2"
  }
}

```

I’ve added only **`body-parser`** , **`cors`** and **`express-jwt`** to it.  
After that, the error remains.

My **`app.js`** , here you are:

```javascript
const express = require('express');
const requireAll = require('require-all');
const path = require('path');
const cookieParser = require('cookie-parser');
const bodyParser = require('body-parser');
const cors = require('cors');
const jwt = require('express-jwt');
const morgan = require('morgan');
const {
  PUBLIC_ROUTES,
  ensureAuthenticated,
} = require('forest-express-sequelize');

const app = express();

app.use(morgan('tiny'));
app.use(bodyParser.json());
app.use(bodyParser.urlencoded({ extended: false }));
app.use(cookieParser());
app.use(express.static(path.join(__dirname, 'public')));

let allowedOrigins = [/\.forestadmin\.com$/, /localhost:\d{4}$/];

if (process.env.CORS_ORIGINS) {
  allowedOrigins = allowedOrigins.concat(process.env.CORS_ORIGINS.split(','));
}

const corsConfig = {
  origin: allowedOrigins,
  allowedHeaders: ['Authorization', 'X-Requested-With', 'Content-Type'],
  maxAge: 86400, // NOTICE: 1 day
  credentials: true,
};

app.use('/forest/authentication', cors({
  ...corsConfig,
  // The null origin is sent by browsers for redirected AJAX calls
  // we need to support this in authentication routes because OIDC
  // redirects to the callback route
  origin: corsConfig.origin.concat('null')
}));

app.use(cors(corsConfig));

app.use(jwt({
  secret: process.env.FOREST_AUTH_SECRET,
  credentialsRequired: false,
  algorithms: ['HS256'],
}));

app.use('/forest', (request, response, next) => {
  if (PUBLIC_ROUTES.includes(request.url)) {
    return next();
  }
  return ensureAuthenticated(request, response, next);
});

requireAll({
  dirname: path.join(__dirname, 'routes'),
  recursive: true,
  resolve: Module => app.use('/forest', Module),
});

requireAll({
  dirname: path.join(__dirname, 'middlewares'),
  recursive: true,
  resolve: Module => Module(app),
});

module.exports = app;

```

Kind regards,  
-Marconi

---

<div class="post-metadata">

**Author:** ![fabmarc](https://avatars.discourse-cdn.com/v4/letter/f/6bbea6/32.png) [@fabmarc](https://community.forestadmin.com/u/fabmarc)\
**Post date:** [July 9, 2021, 12:49am UTC](https://community.forestadmin.com/t/unable-to-register-the-client-timeouterror/2853/8 "2021-07-09T00:49:56Z")

</div>

Hey @morganperre ,

I did what you suggested, I created a fresh new project and unfortunately I get the same error 😞

---

<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:** [July 9, 2021, 8:08am UTC](https://community.forestadmin.com/t/unable-to-register-the-client-timeouterror/2853/9 "2021-07-09T08:08:41Z")

</div>

Hey @fabmarc,

Ok, that’s a bad new. I’m wondering if you have an issue with the connection to our server. Can you try the following command and paste the output ? 🙂

`curl -I https://api.forestadmin.com/`

Plus, can you describe your ecosystem (linux/Mac OS/docker ?) ?

I’m sure we will finally find the issue here.

Kind regards,  
Morgan

---

<div class="post-metadata">

**Author:** ![fabmarc](https://avatars.discourse-cdn.com/v4/letter/f/6bbea6/32.png) [@fabmarc](https://community.forestadmin.com/u/fabmarc)\
**Post date:** [July 9, 2021, 8:23am UTC](https://community.forestadmin.com/t/unable-to-register-the-client-timeouterror/2853/10 "2021-07-09T08:23:32Z")

</div>

Yes, locally I am on Mac Catalina version: 10.15.7 (19H2) and NPM 7.0.14 (no Docker).

Output:

```javascript
➜ UCM-4.0 git:(master) ✗ curl -I https://api.forestadmin.com/
HTTP/1.1 404 Not Found
Server: Cowboy
Connection: keep-alive
X-Dns-Prefetch-Control: off
X-Frame-Options: SAMEORIGIN
Strict-Transport-Security: max-age=15552000; includeSubDomains
X-Download-Options: noopen
X-Content-Type-Options: nosniff
X-Xss-Protection: 1; mode=block
Content-Security-Policy: default-src 'none'
Content-Type: text/html; charset=utf-8
Content-Length: 140
Vary: Accept-Encoding
Date: Fri, 09 Jul 2021 08:16:09 GMT
Via: 1.1 vegur

```

---

<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:** [July 9, 2021, 9:02am UTC](https://community.forestadmin.com/t/unable-to-register-the-client-timeouterror/2853/11 "2021-07-09T09:02:49Z")

</div>

Hey @fabmarc,

Thanks for your time. It indicates that you can accès our server.

I will try to summarize a little bit here.

- You have an issue at the `/authentification` route (error 500 on the agent caused by a TimeoutError)
- You have upgraded dependencies same issue
- You have created a fresh new project same issue
- You have verified that you can access our server from your hosting machin. OK
- Your ecosystem is the same as me. So no issue here

I’m wondering if your antivirus can block some networking request that could lead to the TimeoutError.

- Which antivirus are you using ?
- Can you also share your project name ?
- Can you update your source by adding a errorHandler to your code maybe we could have more informations.

```javascript
// add errorHandler to imports
const {
  errorHandler,
  ensureAuthenticated,
  PUBLIC_ROUTES,
} = require('forest-express-sequelize');

// add this to the end of the app.js file
app.use(errorHandler());

module.exports = app;

```

> **Side note - Working config on my side**
> 
> - npm v7.18.1
> - node v12.13.0 or v14.16.0
> - macOS BigSur 11.2.3 (20D91) (but I used to be in Catalina a few month ago)
> - antivirus SentinelOne (can lead to weird issue I try to have the latest version to avoid bugs)

---

<div class="post-metadata">

**Author:** ![fabmarc](https://avatars.discourse-cdn.com/v4/letter/f/6bbea6/32.png) [@fabmarc](https://community.forestadmin.com/u/fabmarc)\
**Post date:** [July 9, 2021, 10:14am UTC](https://community.forestadmin.com/t/unable-to-register-the-client-timeouterror/2853/12 "2021-07-09T10:14:45Z")

</div>

Hey @morganperre

The command `curl -I https://api.forestadmin.com/` result was:  
`HTTP/1.1 404 Not Found`  
You’ve seen that, right?

I already had added the `errorHandler` code lines to my old project ( **UCM-3.0** ), cause I had copied from the new/test project ( **UCM-4.0** ), so both already had and have the `errorHandler` set. The project I want to continue working on is the **UCM-3.0**.

morganperre, I actually don’t have AntiVirus.  
Now, desperate mode, I even rebooted my computer, but it didn’t solve the problem. 😞 😞 😞

One more thing, just FYI, when I try this URL **`http://localhost:3310/forest/authentication/callback`** in the browser, I get the same error printed in the console when trying to log in to the local environment:  
**`{"errors":[{"status":500,"detail":"Timeout awaiting 'request' for 3500ms","name":"TimeoutError"}]}`**

---

<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:** [July 9, 2021, 12:53pm UTC](https://community.forestadmin.com/t/unable-to-register-the-client-timeouterror/2853/13 "2021-07-09T12:53:00Z")

</div>

Hey again,

`HTTP/1.1 404 Not Found` means you access our server but it respond 404 which is normal is this case. 🙂

Don’t be desperate, we will find a solution. ☹

I’m asking some help from a colleague. He will take over the thread I think.

Kind regards,  
Morgan

---

<div class="post-metadata">

**Author:** ![GuillaumeGautreau](https://dub1.discourse-cdn.com/flex013/user_avatar/community.forestadmin.com/guillaumegautreau/32/557_2.png) [@GuillaumeGautreau](https://community.forestadmin.com/u/GuillaumeGautreau)\
**Post date:** [July 9, 2021, 1:05pm UTC](https://community.forestadmin.com/t/unable-to-register-the-client-timeouterror/2853/14 "2021-07-09T13:05:13Z")

</div>

Hello @fabmarc,

If I look at the original stack trace, we have:

```javascript
    at ClientRequest.<anonymous> (/Users/fabio.marconi/projects/forest-backend/UCM-3.0/node_modules/got/dist/source/core/index.js:956:65)
    at Object.onceWrapper (node:events:483:26)
    at ClientRequest.emit (node:events:388:22)
    at ClientRequest.origin.emit (/Users/fabio.marconi/projects/forest-backend/UCM-3.0/node_modules/@szmarczak/http-timer/dist/source/index.js:39:20)
    at TLSSocket.socketErrorListener (node:_http_client:490:9)
    at TLSSocket.emit (node:events:376:20)
    at emitErrorNT (node:internal/streams/destroy:188:8)
    at emitErrorCloseNT (node:internal/streams/destroy:153:3)
    at processTicksAndRejections (node:internal/process/task_queues:80:21)
    at Timeout.timeoutHandler [as _onTimeout] (/Users/fabio.marconi/projects/forest-backend/UCM-3.0/node_modules/got/dist/source/core/utils/timed-out.js:36:25)
    at listOnTimeout (node:internal/timers:558:17)
    at processTimers (node:internal/timers:499:7)

```

The package `got` is the one that is calling the forestadmin api, with a `POST` on `/api/oidc/reg`. This call is falling on your computer for an unknown reason.

Before this call, the agent is doing a `GET` on `/api/oidc/.well-known/openid-configuration` and retrieves the JSON without any problem. I don’t know if this call is made with the library `got` in this case.

Just to be sure, can you run `npm list got` on your repository, and post here the result? I doubt that there could be an issue related to its version, but it’s worth trying.

You also wrote that you tested with several versions of node, did you remove the `node_modules` directory after changing? Sometimes some packages can be built for a specific version, and changing can cause strange bugs.

---

<div class="post-metadata">

**Author:** ![fabmarc](https://avatars.discourse-cdn.com/v4/letter/f/6bbea6/32.png) [@fabmarc](https://community.forestadmin.com/u/fabmarc)\
**Post date:** [July 9, 2021, 1:25pm UTC](https://community.forestadmin.com/t/unable-to-register-the-client-timeouterror/2853/15 "2021-07-09T13:25:45Z")

</div>

Hi @GuillaumeGautreau ,

Here you are:

```javascript
➜ UCM-3.0 git:(master) ✗ npm list got
ucm-3.0@0.5.2 /Users/fabio.marconi/projects/forest-backend/UCM-3.0
└─┬ forest-express-sequelize@7.12.2
  └─┬ forest-express@8.7.4
    └─┬ openid-client@4.2.0
      └── got@11.8.2

```

And, yes, I cleaned my `node_modules` folder, I ran every time I changed Node/NPM:  
**`rm -rf ./node_modules/ && npm i`**

---

<div class="post-metadata">

**Author:** ![GuillaumeGautreau](https://dub1.discourse-cdn.com/flex013/user_avatar/community.forestadmin.com/guillaumegautreau/32/557_2.png) [@GuillaumeGautreau](https://community.forestadmin.com/u/GuillaumeGautreau)\
**Post date:** [July 9, 2021, 2:02pm UTC](https://community.forestadmin.com/t/unable-to-register-the-client-timeouterror/2853/16 "2021-07-09T14:02:28Z")

</div>

You are using the last version of `got`, which has been released 4 months ago, it seems good.

Can you launch this command on the same machine you’re running the server?

```bash
curl -H "Content-Type: application/json" \
     -H "Authorization: Bearer FOREST_ENV_SECRET" \
     -X POST \
     -d '{"token_endpoint_auth_method": "none", "redirect_uris": ["APPLICATION_URL/forest/authentication/callback"]}' \
     https://api.forestadmin.com/oidc/reg

```

Please replace `FOREST_ENV_SECRET` and `APPLICATION_URL` by the values for your environment.

- `FOREST_ENV_SECRET` is the value from your `.env` file
- `APPLICATION_URL` is probably `http://localhost:3310`

If you do this, do you have a proper response, or a timeout?

---

<div class="post-metadata">

**Author:** ![fabmarc](https://avatars.discourse-cdn.com/v4/letter/f/6bbea6/32.png) [@fabmarc](https://community.forestadmin.com/u/fabmarc)\
**Post date:** [July 9, 2021, 6:02pm UTC](https://community.forestadmin.com/t/unable-to-register-the-client-timeouterror/2853/17 "2021-07-09T18:02:23Z")

</div>

Hi @GuillaumeGautreau ,

Here you are:

```javascript
➜ UCM-3.0 git:(master) ✗ curl -H "Content-Type: application/json" \
     -H "Authorization: Bearer fd4923ca502b0be36c25fb348490604d936ad4392211a8a53069c4665903edd6" \
     -X POST \
     -d '{"token_endpoint_auth_method": "none", "redirect_uris": ["http://localhost:3310/forest/authentication/callback"]}' \
     https://api.forestadmin.com/oidc/reg
{"token_endpoint_auth_method":"none","redirect_uris":["http://localhost:3310/forest/authentication/callback"],"application_type":"web","grant_types":["authorization_code"],"response_types":["code"],"environment_id":56529,"client_id":"eyJraWQiOiJ6d0VjbU5LVVpVTkdYUnlNRzZ2QUoyTTVfYzBoZGhfblBXS0hYWjhGUTFBIiwiYWxnIjoiUlMyNTYifQ.eyJ0b2tlbl9lbmRwb2ludF9hdXRoX21ldGhvZCI6Im5vbmUiLCJyZWRpcmVjdF91cmlzIjpbImh0dHA6Ly9sb2NhbGhvc3Q6MzMxMC9mb3Jlc3QvYXV0aGVudGljYXRpb24vY2FsbGJhY2siXSwiYXBwbGljYXRpb25fdHlwZSI6IndlYiIsImdyYW50X3R5cGVzIjpbImF1dGhvcml6YXRpb25fY29kZSJdLCJyZXNwb25zZV90eXBlcyI6WyJjb2RlIl0sImVudmlyb25tZW50X2lkIjo1NjUyOSwiaXNzIjoiRk9SRVNUX0FVVEhFTlRJQ0FUSU9OX1NZU1RFTSIsImlhdCI6MTYyNTg1MzY0MX0.P0UooC-rHL7DM06E8Z_2T-Vs4TdmWnwQOZupIpaIFKEsF4Hf8p3w7CQsDgzdwISqdEaSMIjkbTENrsAOXVCHqR1rEn4thNh1Ix1ITSv2YOv5aXDOhArcYrwIsSHChxSRsq0e62YWZUGX_SYPBnRJ8jaMXhEOSI-2_J2V94iboTp04gBoFBUAhMS6S7rfK_ll14CzquJ0lxikk8j2NFFxZ04EWcKqm0WJ70fqfEJ47rdjlaVXuexCYxd_YfL9RHe4jLHhGf5qtHsNjplFwTrD3LvylB3RqDIqwsiOUvxRhoBnNWhIOaxPenvUL5S5CSfRi8WJFHLjeKvfT0BnYMaVTQ"}%

```

I am wondering about my `FOREST_AUTH_SECRET`.  
I have 3 remote environments. Each remote environment has your own `FOREST_AUTH_SECRET` value.  
For local development, I am using the same value as in one of my 3 remote environments, and it always worked this way before this upgrade to v7.

Does this env. var. have to be changed for local development because of the v7?

---

<div class="post-metadata">

**Author:** ![GuillaumeGautreau](https://dub1.discourse-cdn.com/flex013/user_avatar/community.forestadmin.com/guillaumegautreau/32/557_2.png) [@GuillaumeGautreau](https://community.forestadmin.com/u/GuillaumeGautreau)\
**Post date:** [July 12, 2021, 8:08am UTC](https://community.forestadmin.com/t/unable-to-register-the-client-timeouterror/2853/18 "2021-07-12T08:08:45Z")

</div>

Hello @fabmarc,

Ok, it seems that the call that is failing is actually working on your machine. So the problem is not related to the network configuration or something blocking it.

The variable `FOREST_AUTH_SECRET` is only used to generate and verify JWT for authenticated users. So this variable is not used at all at this point.

The only values that are used and sent to the server, are `FOREST_ENV_SECRET` and `APPLICATION_URL`.

As you posted your env secret publicly, we will have to change it once your environment will be working, as it is supposed to be secret 🙂

Inside your project, could you please launch the same query, but with `got`, to see if we can reproduce the timeout error?

You’ll have to do something like:

```javascript
	const {body} = await got.post('https://api.forestadmin.com/oidc/reg', {
		json: {"token_endpoint_auth_method": "none", "redirect_uris": ["http://localhost:3310/forest/authentication/callback"]},
                headers: {
                  "Authorization": "Bearer [FOREST_ENV_SECRET]",
                },
		responseType: 'json'
	});

```

Are you able to log a response, if you add this in your code?

---

<div class="post-metadata">

**Author:** ![fabmarc](https://avatars.discourse-cdn.com/v4/letter/f/6bbea6/32.png) [@fabmarc](https://community.forestadmin.com/u/fabmarc)\
**Post date:** [July 12, 2021, 8:43am UTC](https://community.forestadmin.com/t/unable-to-register-the-client-timeouterror/2853/19 "2021-07-12T08:43:37Z")

</div>

> [@GuillaumeGautreau](#):
>
> it is supposed to be secret

Oh no, my bad ☹  
How can I generate a new one?

And, yes, that code block ran successfully instead of TimeoutError.  
Do you need to see the body/response?

---

<div class="post-metadata">

**Author:** ![GuillaumeGautreau](https://dub1.discourse-cdn.com/flex013/user_avatar/community.forestadmin.com/guillaumegautreau/32/557_2.png) [@GuillaumeGautreau](https://community.forestadmin.com/u/GuillaumeGautreau)\
**Post date:** [July 12, 2021, 9:27am UTC](https://community.forestadmin.com/t/unable-to-register-the-client-timeouterror/2853/20 "2021-07-12T09:27:21Z")

</div>

We will generate a new one, and change it in the project settings, but for that we need to make it work first. If you prefer I can generate a new one and update it in our database, and send it to you.

In the meantime, can you make another test, to try to replicate the issue? I logged the exact calls to `got` that are made by the library, and you can replicate them with the following code:

```javascript
const Got = require('got');
const got = Got.extend({
  followRedirect: false,
  headers: {
    'User-Agent': 'openid-client/4.2.0 (https://github.com/panva/node-openid-client)'
  },
  retry: 0,
  timeout: 3500,
  throwHttpErrors: false
});

const response = await got({
  headers: {
    Authorization: 'Bearer [FOREST_ENV_SECRET]'
  },
  responseType: 'json',
  json: {
    client_id: undefined,
    redirect_uris: ['http://localhost:3310/admin/forest/authentication/callback'],
    token_endpoint_auth_method: 'none'
  },
  url: 'https://api.forestadmin.com/oidc/reg',
  method: 'POST'
})

```

[Next page](https://community.forestadmin.com/t/unable-to-register-the-client-timeouterror/2853.md?page=2)
