Server instance cannot receive the message sent by cloud - Feedback API

Hello everybody!

We’re trying to use the Feedback API from JCMA to check if the migration should continue to be processed or not.

We send pre-flight checks to the cloud instance, validating if all the Jira projects were migrated and then, on the cloud side, we send a message to the server by following this documentation.

On the Server side, we’re making a polling request to check if the cloud has sent any message.

In our test environment, we are forcing Cloud to send a Failed signal but nothing happens on Server side, it keeps receiving the following Jira message:

Received an unexpected status code; expected [200], but received 404: {"timestamp":"2021-06-15T14:02:33.138Z","status":404,"error":"Not Found","message":"No message available","path":"/feedback/091a9ffe-b164-375a-8e4f-ed40bc8cc134"}

Any suggestion to get it working?

Thanks in advance,
João Ferreira

Hi @joaocferreira10,

I can see in the logs the transferId so the transfer is happening. As I can see you’re getting a 404 response, what’s the exact URL you’re calling? It should be a POST request something like

https://<your-site>.atlassian.net/rest/atlassian-connect/1/migration/feedback/091a9ffe-b164-375a-8e4f-ed40bc8cc134

with a payload of the content you want your server app to receive, for example

{
  "details":{"key":"value"}
}

Let me know if this helps.

Regards,
James.

Hello James.
The problem is not related with the cloud since I send a POST request to that URL and it responds with 200 (success).
Regards,
Francisco Santos

Hello James,
As Francisco mentioned above, the body is being sent correctly and a response with a status code of 200 is being retrieved.
In our end, Jira Server, we are making polling requests to check when the feedback as any useful response for us to continue(or not) with the migration.
You can see what I’ve explained in these two methods:

private CompletableFuture<Map<String, Object>> pollFeedback() {
        CompletableFuture<Map<String, Object>> completionFuture = new CompletableFuture<>();
        feedbackPoller = executor.scheduleAtFixedRate(
                () -> fetchFeedback(completionFuture),
                0,
                interval,
                TimeUnit.SECONDS);

        completionFuture.whenComplete((result, thrown) -> feedbackPoller.cancel(true));
        return completionFuture;
    }

    private void fetchFeedback(CompletableFuture<Map<String, Object>> completionFuture) {
        Map<String, Object> feedback = gateway.getCloudFeedback(transferId);
        if (containsFeedback(feedback)) {
            logger.info("Cloud feedback contains migration feedback");
            completionFuture.complete(feedback);
        }
    }

Before and after Cloud triggers the feedback we always receive the 404 messages that we pasted in the original question.

Regards,
João Ferreira

Hi Team,

Thanks for the clarifications there. I’ve reviewed our code and tests, and also the logs. I can see for transferId=091a9ffe-b164-375a-8e4f-ed40bc8cc13 there are no feedback messages sent via Connect, which is why you’re getting the HTTP 404 message. From what I can see for that specific transferId there are other interactions like get mappings and containers.

I can see other transferId values attached to the same appKey for the feedback channel.

So, it’s just that specific one that is giving 404 because there’s nothing to pick up. Can you confirm you have sent from the Connect side a feedback message?

You will always get a HTTP 404 before the first feedback message is sent through Connect. We don’t provide an empty response.

Regards,
James.

Hi James.
I confirm that we send a feedback message from the Connect, here is the code for that:

const httpClient = context.createHttpClient();
    return new Promise((fulfill, reject) => {
        httpClient.post({
            url: `/rest/atlassian-connect/1/migration/feedback/${transferId}`,
            json: { details: feedback }
        }, (err: any, res: any = {}, data: any) => {
            if (err) {
                Logger.error(`Failed to send feedback to app migration for tenant: ${context.tenant}`, err);
                return reject(err);
            }

            if (res.statusCode === 200) {
                Logger.info(`Feedback to app migration sent successfully for tenant: ${context.tenant}`);
                return fulfill(data);
            }

            const error = new ServiceUnavailableError(`Unexpected error sending feedback to app migration for tenant: ${context.tenant}`, null, { data, statusCode: res.statusCode });
            Logger.error(error);
            return reject(error);
        });
    });

Please let me know if we are doing something wrong.
Regards,
Francisco.

Hi @Francisco.Santos,

Your code looks correct. What I’m saying is that I can see feedback being sent for other transferIds, just not for 091a9ffe-b164-375a-8e4f-ed40bc8cc134. Specifically, I can see feedback being sent for 24 transferIds for your app key in the last 7 days

11e4f644-c121-36b6-ba96-ae6472d321c0
12e315aa-9831-38f7-980e-14246982691f
162c7216-0f01-3a4b-9603-db1b60040b2d
19501393-8866-39ea-a4a8-9e225b278235
36786025-e923-3f0f-bf7b-c70d90b76807
3853aae1-43cc-357c-92f0-478df33af310
3d076ec0-f014-3588-a409-862b4036a199
3e3decb0-0630-31ce-bbef-8a83dc814412
4c2d7169-9e23-39d8-aea5-64bdd8a53098
50dd9fd4-e93f-365a-88f6-bfe4625a5943
5dba0e77-9abd-3277-ad9d-e73211760844
5f6a0b9c-2eb7-34fb-910d-adaeb3792e3b
64397189-ae6a-33c6-a352-9336977f0b77
73ed0b84-fdf9-3522-90a1-49a9b51e3a15
7d717d3c-a203-3b84-8141-52c0bb1e4132
831ab9f5-9129-3833-98ce-a937fb6ade91
a348c5bc-f079-3406-99fb-43bff62a90cf
a9c19115-cc2b-3ea2-a0af-3d78ab346d14
bf1c6216-3ace-31f7-826c-346b0806543f
c7457b29-e729-3d52-8438-3ce71c45116a
e4f22767-1abc-32ee-b2ec-b0deef3adb5c
ea4f9efd-abb5-310e-80f6-fa49c6d73a59
eaab1e2f-2cbb-3445-a210-14b8d8e29ff9
eb3ad057-a728-3839-aaa7-7eacb05190e2

So, it’s working. But I just can’t see anything for 091a9ffe-b164-375a-8e4f-ed40bc8cc13.

Regards,
James.

Hello @jrichards,

The transfer Id that we gave you on the original post was one example of many migrations we’ve tried in our test environment.

We understand and validate that those transfer Ids have feedback from the Cloud side, @Francisco.Santos posted that when Cloud sends feedback he gets a status code of 200 proving that he sent the feedback.

However, in all of those migrations, on the Server side, it kept receiving a 404 after Francisco forced the feedback to us.

The problem rellies at that stage when the feedback was sent successfully from Cloud, but when Server asks for it, JCMA returns a 404.

Best regards,
João Ferreira

Hi @joaocferreira10,

Thanks for that. I’ll need to do some testing to see what’s going on. It’s definitely going into the system but I’ll need to run some tests to confirm it’s working on the JCMA side. It will take me a day or two to get a confirmed result.

Thanks,
James.

Hi Team,

I’ve confirmed it’s a bug in JCMA only. I’ve raised a ticket

and will be fixing this in the next day. Sorry for the delay in getting this resolved. Please watch the ticket for updates and I expect the fix to be in the next JCMA release.

Regards,
James.

Hi @jrichards,
We’re glad that you found the issue.
We are going to watch the ticket and wait for the next release.
Do you have an estimated date for the next release?

Thank you,
João Ferreira

Hi @joaocferreira10,

Officially we don’t announce release dates, but the plan is for the 2nd week of July (part of the regular release cadence) unless there’s a hotfix release before that and I’ll try and get this fix included in that.

Regards,
James.