No Results found when querying my custom entity

I have seen on status page that that there was an outrage with hosted storage. Even though, the issue is resolved already according to green indicator on status page, I still get the response from storage only on my 5th attempt, as it keeps returning error: APIError: Unknown error. Received status code ‘504’. And when it doesn’t, it returns no results. No I’m a little confused, I don’t understand if the problem is with my query or the issues is with the hosted storage.

Is there someone experiencing hosted storage incidents now, especially the data not being stored properly (even though you get somewhat success response. In my case it returns “undefined”, but I think it’s okay, if it is not please let me know), or just getting empty array for your query.

FYI. Here my get query:

    const queryResponse = await storage
        .entity("similar_ideas")
        .query()
        .index("score")
        .where(WhereConditions.isGreaterThan(0))
        .getMany()

Store query:

const storeSimilarPairs = async (similarPairs) => {
    for (const pair of similarPairs) {
        try {
            const response = await storage.entity('similar_ideas').set(pair.pair_one + ':' + pair.pair_two, {
                project: pair.project,
                project_two: pair.project_two,
                is_same_project: pair.is_same_project,
                pair_one: pair.pair_one,
                pair_two: pair.pair_two,
                score: pair.score
            });

Indexes list:

:wave: @Robert_Mian
I’m an engineer from Forge Storage and would like to assist you with this issue.
Could you please share your app ID?

Hi @FarhadYasir , thanks for getting in touch.

Here is my app id: ari:cloud:ecosystem::app/1c94eb5c-69b0-4248-993d-f0f782181c09

let me know if you need anything else.

I just checked again, and I get empty array for my request:

    const queryResponse = await storage
        .entity("similar_ideas")
        .query()
        .index("score")
        .where(WhereConditions.isGreaterThan(0))
        .getMany()

also for this query:

    const queryResponse = await storage
        .entity("similar_ideas")
        .query()
        .index("project")
        .getMany()

Hello @FarhadYasir

I’m getting back with an update. The storage availability issue seems to be solved so far, but I’m still not able to query by index. When I query by key, it works fine, but when I use index it doesn’t work, here is an example, if possible, could you please check?

Storing test data:

    const queryResponse = await storage.entity('similar_ideas').set('test_key2', {
        project: 'test_project1',
        project_two: 'test_project_two2',
        is_same_project: false,
        pair_one: 'test_pair_one2',
        pair_two: "test_pair_two2",
        score: 0.5
    });

Querying test data by key:

const queryResponse = await storage.entity("similar_ideas").get('test_key2');

Response:

 {"score":0.5,"pair_one":"test_pair_one2","project_two":"test_project_two2","pair_two":"test_pair_two2","project":"test_project1","is_same_project":false}

So far so good…

But when I query by index (for example “project” index)

    const queryResponse = await storage
        .entity("similar_ideas")
        .query()
        .index('project')
        . where(WhereConditions.equalsTo("test_project1"))
        .getMany()

Response:

{"results":[],"nextCursor":null}

Or if I query using getOne() I get “undefined”

Do you have an idea what is the problem that I can’t query by index?

Hi @Robert_Mian! Did you get anywhere with this? I seem to have similar problem with my app.

Hi @TaliveO , the problem still exists on my end. Moreover, no one from @Atlassian-Staff got back to me with an update yet, and have opened a dedicated topic explaining my issue in more details hoping it will win more attention, but no updates still…

You can watch it here: Storage API return empty array for custom entity queries - #2 by AaronCollier

1 Like

I was told that they identified this as an issue affect some (but not all) apps using custom entities and they’re trying to find the cause and next steps.

1 Like

@AaronCollier thanks for the update. If it is with some apps, then I might create a new app, as I’m still in development and simply copy files to new app.