# Serverless Functions - hs secrets add is not working

**URL:** <https://community.hubspot.com/t/serverless-functions-hs-secrets-add-is-not-working/102821>\
**Category:** CMS Development\
**Tags:** enterprise\
**Created:** [March 18, 2024, 3:43pm UTC](https://community.hubspot.com/t/serverless-functions-hs-secrets-add-is-not-working/102821 "2024-03-18T15:43:48Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![ChrisSosa1337](https://avatars.discourse-cdn.com/v4/letter/c/9dc877/32.png) [@ChrisSosa1337](https://community.hubspot.com/u/ChrisSosa1337)\
**Post date:** [March 18, 2024, 3:43pm UTC](https://community.hubspot.com/t/serverless-functions-hs-secrets-add-is-not-working/102821/1 "2024-03-18T15:43:48Z")

</div>

Hello.

I am trying to work on the mapbox-api project, and for some reason, when trying to run “hs secrets add” when adding the Mapbox access token, I get an obscure generic error that the secret was not added. There seems to be nothing on the web at all about this, and even Copilot was no help.

I checked my serverless functions permissions, and the verified that the secret name in serverless.json is correct.

So does anyone know what would cause this error? I guess I am all alone here.

---

<div class="post-metadata">

**Author:** ![ChrisSosa1337](https://avatars.discourse-cdn.com/v4/letter/c/9dc877/32.png) [@ChrisSosa1337](https://community.hubspot.com/u/ChrisSosa1337)\
**Post date:** [March 18, 2024, 10:00pm UTC](https://community.hubspot.com/t/serverless-functions-hs-secrets-add-is-not-working/102821/2 "2024-03-18T22:00:44Z")

</div>

Ok, I was able to add the secret using a sandbox account, but it doesn’t work in our production account. It might be some mysterious permissions issue that we have to research.

---

<div class="post-metadata">

**Author:** ![daveroma](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/daveroma/32/82727_2.png) [@daveroma](https://community.hubspot.com/u/daveroma)\
**Post date:** [December 27, 2024, 1:39pm UTC](https://community.hubspot.com/t/serverless-functions-hs-secrets-add-is-not-working/102821/3 "2024-12-27T13:39:04Z")

</div>

Ever get to the bottom of this? I’m running into the same issue

---

<div class="post-metadata">

**Author:** ![GRajput](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/grajput/32/102020_2.png) [@GRajput](https://community.hubspot.com/u/GRajput)\
**Post date:** [October 13, 2026, 11:04am UTC](https://community.hubspot.com/t/serverless-functions-hs-secrets-add-is-not-working/102821/4 "2026-10-13T11:04:23Z")

</div>

This post was flagged by the community and is temporarily hidden.
