# Impossible to retrieve the smart action at endpoint

**URL:** <https://community.forestadmin.com/t/impossible-to-retrieve-the-smart-action-at-endpoint/2577>\
**Category:** Help me!\
**Created:** [May 28, 2021, 8:48pm UTC](https://community.forestadmin.com/t/impossible-to-retrieve-the-smart-action-at-endpoint/2577 "2021-05-28T20:48:38Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![cto\_nexus](https://dub1.discourse-cdn.com/flex013/user_avatar/community.forestadmin.com/cto_nexus/32/2244_2.png) [@cto\_nexus](https://community.forestadmin.com/u/cto_nexus)\
**Post date:** [May 28, 2021, 8:48pm UTC](https://community.forestadmin.com/t/impossible-to-retrieve-the-smart-action-at-endpoint/2577/1 "2021-05-28T20:48:38Z")

</div>

Alright, this one is interesting. I would love to know how this bug got to production… (I think its a bug).

## Expected behavior

The smart action should complete successfully.

## Actual behavior

I have a smart action configured to download a file (`download: true` in the action definition). When this is set to true… the action (which is supposed to download a file) fails. It doesn’t even call the body. Instead it fails because Forest can’t find it.

For example:

Impossible to retrieve the smart action at endpoint /forest/actions/get-engagement-report?timezone=America%2FLos\_Angeles and method POST

The issue is in this file, line 61:

forest-express-sequelize/node\_modules/forest-express/dist/middlewares/permissions.js

 ![Screen Shot 2021-05-28 at 4.30.02 PM](https://europe1.discourse-cdn.com/flex013/uploads/forest/original/2X/5/597ee2990cce5c9eda9c53bf459d58031b02af04.jpeg)

I added a print-out to see why it is not finding the action and I got this:

 ![Screen Shot 2021-05-28 at 4.45.28 PM](https://europe1.discourse-cdn.com/flex013/uploads/forest/original/2X/0/0c434b0b5d9f08ec4450afd0cc2c2a2c3047b815.jpeg)

When I set the action to a regular non-download action (`download: false`) Things work as expected (but I can’t trigger the file download). However, Forest does find the action.

![Screen Shot 2021-05-28 at 4.45.35 PM](https://europe1.discourse-cdn.com/flex013/uploads/forest/optimized/2X/0/0985748b1d6603098fa0cb5d2708faf965dd511c_2_690x16.jpeg)

Notice how setting “`download: true`” causes the action to be called with the timezone attached to the request, whereas, “`download: false`” causes the request to not have the timezone attached. When the timezone is attached to the request, Forest fails to find the corresponding action.

Looks like a bug. 🧐

## Context

7.9.3 (forest-express-sequelize)  
8.5.2 (forest-express)  
4.17.1( express)

---

<div class="post-metadata">

**Author:** ![anon37102731](https://avatars.discourse-cdn.com/v4/letter/a/c6cbf5/32.png) [@anon37102731](https://community.forestadmin.com/u/anon37102731)\
**Post date:** [May 31, 2021, 8:30am UTC](https://community.forestadmin.com/t/impossible-to-retrieve-the-smart-action-at-endpoint/2577/2 "2021-05-31T08:30:02Z")

</div>

Hi @cto_nexus,

Thank you for pointing out this issue. We made a small update on way smart actions are working that should not have been breaking.

Things should be back to normal now. Sorry for the inconvenience. 🙏

---

<div class="post-metadata">

**Author:** ![cto\_nexus](https://dub1.discourse-cdn.com/flex013/user_avatar/community.forestadmin.com/cto_nexus/32/2244_2.png) [@cto\_nexus](https://community.forestadmin.com/u/cto_nexus)\
**Post date:** [May 31, 2021, 3:32pm UTC](https://community.forestadmin.com/t/impossible-to-retrieve-the-smart-action-at-endpoint/2577/3 "2021-05-31T15:32:17Z")

</div>

Nice! Thanks. Very interesting bug.
