Forge storage returns status code 431

Hi,

I am using the Storage API to store a value if it doesn’t already exist.

I have added the scope in the permissions:

permissions:
  scopes:
    - storage:app

The code does nothing extraordinary:

import { storage } from '@forge/api';

export async function addValue(value) {

            let _getValue = await storage.get("register");

            if(!_getValue ) {
                await storage.set("register", {"id": value});
            }
});

The app is deployed in development without problems, but storage.get() call returns a status code 431:

Error: Unknown error. Received status code '431'
at Function.forStatus (index.js:1443:16)
at getResponseBody (index.js:1474:33)
at GlobalStorage.query (index.js:1577:22)
at async GlobalStorage.getInternal (index.js:1558:48)
at async addValue(index.js:10444:23)

I have the packages updated to the latest versions. I have searched for information about the problem but have not found anything.

Any idea what may be happening?

Thank you very much in advance.

Hi dortiz

Is this happening every time or an intermittent issue?

If you could provide a traceid of your app experiencing this that would be super helpful.

Cheers

Hi JoshuaHwang,

It always happens to me in the development environment.
The strange thing is that in Staging and Production environments it works fine.

Trace ID: 0000000000000000b1bff6ece52a830d-223ea36a53221db2

Cheers

Hi dortiz

To confirm this is affecting your Forge tunnel and when your app is deployed to development?

Or does this only affect your Forge tunnel experience?

I know you mentioned this before but I would like to double check here. It’s very strange what you’re experiencing.

Hi JoshuaHwang,

It always happens to me in development no matter what I do.

Hi doritz

As we continue to investigate you could try something that might alleviate the problem.

Would you be able to remove some permission scopes from you manifest and attempt to redeploy?

Let us know if such a fix works and I’ll get to when the investigation goes further.

Hi JoshuaHwang,

Sorry for the delay in answering, but I couldn’t before.

I don’t know if it was a specific problem, but currently the storage works in development without having made any changes to the app.

Ahh that might be because of recent changes to our Forge Storage offering.

We had increased the size of the requests we will accept. These requests have the all the scopes you’ve defined.

For future proofing and for any other developer experiencing the same problem you could try reducing scopes to only those you need.

ok.

Thank you very much for the support and information.

Cheers.