# Your server encountered an error -

**URL:** <https://community.forestadmin.com/t/your-server-encountered-an-error/2350>\
**Category:** Help me!\
**Created:** [April 21, 2021, 7:53am UTC](https://community.forestadmin.com/t/your-server-encountered-an-error/2350 "2021-04-21T07:53:39Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Marc\_Antoine](https://dub1.discourse-cdn.com/flex013/user_avatar/community.forestadmin.com/marc_antoine/32/2036_2.png) [@Marc\_Antoine](https://community.forestadmin.com/u/Marc_Antoine)\
**Post date:** [April 21, 2021, 7:53am UTC](https://community.forestadmin.com/t/your-server-encountered-an-error/2350/1 "2021-04-21T07:53:39Z")

</div>

Since Friday, several user from our CS team get this message while using Forest

## Expected behavior

When we want to search for a user, I want to find him quickly with his name for example

## Actual behavior

As a result, we get : `Your server encountered an error`

 ![Screenshot 2021-04-21 at 09.10.38](https://europe1.discourse-cdn.com/flex013/uploads/forest/original/2X/4/4bdfe4932948476023f3bc8bd25f254f0e149901.png)

What is the current behavior?

## Failure Logs

Inspecting the console, we get 3 errors :

- `Failed to load resource: net::ERR_BLOCKED_BY_CLIENT`
- `Failed to load resource: the server responded with a status of 404 ()`
- `Failed to load resource: the server responded with a status of 500 (Internal Server Error)`

On network, we get few errors from

- `analytics.js`
- `404` [https://www.gravatar.com/avatar/72cbb05202102ed057b25e394681de7f?s=40&d=404](https://www.gravatar.com/avatar/72cbb05202102ed057b25e394681de7f?s=40&d=404)
- `500` errors: [{status: 500, detail: “ResourceRequest timed out”}]

You can check the loom below : [Forest Admin ‣ Data ‣ Users | Loom](https://www.loom.com/share/110fa349d0914b789e3dd0ad7b64358f?focus_title=1&muted=1&from_recorder=1)

## Context

I’m not dev, but CS lead. Will ask Pierre Megret about theses infos

Please provide any relevant information about your setup.

- Package Version:
- Express Version:
- Sequelize Version:
- Database Dialect:
- Database Version:
- Project Name:

---

<div class="post-metadata">

**Author:** ![anon90145840](https://avatars.discourse-cdn.com/v4/letter/a/ed8c4c/32.png) [@anon90145840](https://community.forestadmin.com/u/anon90145840)\
**Post date:** [April 21, 2021, 8:38am UTC](https://community.forestadmin.com/t/your-server-encountered-an-error/2350/2 "2021-04-21T08:38:21Z")

</div>

Hello @Marc_Antoine,

I am sorry to read you have some issues with ForestAdmin.

This looks like an issue with the server deployed on your side, as the `500` error comes from it.

Let’s try to understand what’s going on 👀

In order to troubleshoot it, I would need some information.

Does it happen for all the collections or just this particular one?  
Does it happen for the same CS users or it occurs randomly?  
Does it happen only when searching or also when using the filter?

I would also require some technical information. As I understood you’re not a tech person, but it would be cool if you can ask your tech team to answer those questions.

Do you have any custom code added for retrieving the list of users?  
Do you have any errors in the server console?  
Is the communication between the server and the database stable?

Thank you

---

<div class="post-metadata">

**Author:** ![Marc\_Antoine](https://dub1.discourse-cdn.com/flex013/user_avatar/community.forestadmin.com/marc_antoine/32/2036_2.png) [@Marc\_Antoine](https://community.forestadmin.com/u/Marc_Antoine)\
**Post date:** [April 21, 2021, 8:52am UTC](https://community.forestadmin.com/t/your-server-encountered-an-error/2350/3 "2021-04-21T08:52:38Z")

</div>

Hi @anon90145840 !

Thanks for your quick answer !

It’s no working again… but could be great to know what happened.

- While testing, it was only on `Users collections`
- It was randomly impacting our CS
- Only when searching (we don’t use a lot filters)

I ask a tech to answers others questions

See you

---

<div class="post-metadata">

**Author:** ![Pierre\_Megret](https://dub1.discourse-cdn.com/flex013/user_avatar/community.forestadmin.com/pierre_megret/32/257_2.png) [@Pierre\_Megret](https://community.forestadmin.com/u/Pierre_Megret)\
**Post date:** [April 21, 2021, 12:57pm UTC](https://community.forestadmin.com/t/your-server-encountered-an-error/2350/4 "2021-04-21T12:57:58Z")

</div>

Hi @anon90145840 !

To follow up on @Marc_Antoine and answer your questions:

- Do you have any custom code added for retrieving the list of users? Yes, when searching for a user name, we actually search through a Smart Field `fullname` built from `firstname` and `lastname`.
- Do you have any errors in the server console? We did not spot any errors from our servers.
- Is the communication between the server and the database stable? Yes, no latency there.

Could it be that our backend takes time to process the answer and Forest’s frontend considers the request as having timed out ?

---

<div class="post-metadata">

**Author:** ![anon90145840](https://avatars.discourse-cdn.com/v4/letter/a/ed8c4c/32.png) [@anon90145840](https://community.forestadmin.com/u/anon90145840)\
**Post date:** [April 21, 2021, 1:48pm UTC](https://community.forestadmin.com/t/your-server-encountered-an-error/2350/5 "2021-04-21T13:48:50Z")

</div>

Hello @Pierre_Megret

Thank you for those details!

The timeout error is definitely generated by your server since it’s in the network response with a `500` error. If it would be a frontend timeout the request response would look differently.  
Would you like to share with me the code of the search function you use? So I can have a look at it and see if I spot any issues. (If it contains any sensible information, you can share it in private message.)

---

<div class="post-metadata">

**Author:** ![Pierre\_Megret](https://dub1.discourse-cdn.com/flex013/user_avatar/community.forestadmin.com/pierre_megret/32/257_2.png) [@Pierre\_Megret](https://community.forestadmin.com/u/Pierre_Megret)\
**Post date:** [April 21, 2021, 3:01pm UTC](https://community.forestadmin.com/t/your-server-encountered-an-error/2350/6 "2021-04-21T15:01:13Z")

</div>

Here’s a screenshot of the code we use to create our Smart Field “Fullname”:

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

And our version of forest:

```javascript
pierre@luko-pierre ~/forest (dev) $ npm -v sequilize
6.14.10

```

---

<div class="post-metadata">

**Author:** ![anon90145840](https://avatars.discourse-cdn.com/v4/letter/a/ed8c4c/32.png) [@anon90145840](https://community.forestadmin.com/u/anon90145840)\
**Post date:** [April 21, 2021, 3:20pm UTC](https://community.forestadmin.com/t/your-server-encountered-an-error/2350/7 "2021-04-21T15:20:18Z")

</div>

well, I am not sure what is causing the issue, but maybe you could replace this code by

```javascript
    search(query, search) {
      const s = models.sequelize;
      const split = search.split(' ');

      const searchCondition = s.and(
        { user_firstname: { [Op.iLike]: `%${split[0]}%` } },
        { user_lastname: { [Op.iLike]: `%${split[1]}%` } },
      );

      query.where.$and[0].$or.push(searchCondition);
    },

```

We have this code running in our production and no timeouts noticed. So maybe you can give it a try?

Let me know if it helps
