Cloud Code UserService API Error 400 Time Out

Backendless Version (3.x / 5.x, Online / Managed / Pro )

6.0, Online

Client SDK (REST / Android / Objective-C / Swift / JS )

JS

Application ID

028AF23A-DE67-970F-FF7B-CE73726F3E00

Expected Behavior

  1. Adding a function to an existing working Cloud Deployed Service
  2. Calling Backendless.UserService.update(user), or Backendless.UserService.register(user)
  3. Get Call Result as if being called from client side.

Actual Behavior

  1. Adding a function to an existing working Cloud Deployed Service
  2. Calling Backendless.UserService.update(user), or Backendless.UserService.register(user)
  3. Error 400 Bad Request message: "Task execution is aborted due to timeout"

Reproducible Test Case

Below is the Exact code used (which was previously functional)

/**
  * @param {object} user
  * 
  * */
  async registerUser(user) {

    return Backendless.UserService.register(user).then((result) => {
      console.log(result);
      return result;
    });

  }

How about changing the code to this?

/**
  * @param {object} user
  * 
  * */
  async registerUser(user) {

    return await Backendless.UserService.register(user);

  }

Unfortunately, tried this too, still giving me a timeout error.
Please note that this issue is recent and i have been using this exact function previously with not issues.
The same is happening with another function where i am calling
Backendless.UserService.update(user)
For testing purposes, i called Backendless.UserService.register(user) from my frontend code, and it worked. So this seems to be like an issue with CloudCode and UserService, as i have several Backendless.Data calls working seamlessly.
Thanks!

I played with a test service in your app, and here’s what I noticed:
If the service is invoked with a “BL API Key”, the invocation goes through. However, if I use any other API key, the invocation times out. We will need to investigate this further. I will open an internal ticket.

Regards,
Mark

1 Like

Additionally, even though I get a timeout (I am using user registration API in the body of the API service), the user is still registered. This might be a clue for the product team for where to look for the problem.

1 Like

For tracking purposes, the internal ticket is BKNDLSS-22014

1 Like

Hello @andriy_konoz !

Actually as @mark-piller has noted earlier, and as per my tests, the issue is that only the “BL API Key” can be used to run Cloud Code Methods containing any UserService API calls. So when calling the methods from my JS application using “JS API Key” , the error persists, so the fix had to be switching back and forth from “BL API Key” to “JS API Key” whenever i need to call a Cloud Code Method. This seems a bit of a weird hack which I assume is caused by some internal error.
Will be waiting for your reply.
Thanks!

Karim

Hello Again,

So tested again with both keys and here’s what’s happening:

In my Users Schema i have a Column named ‘username’ which is set to Unique, previously, whenever this method was called, which was with the JS key, it used to give me a specific error regarding duplicate usernames whenever it is the case, and go through otherwise. I also get a specific error regarding duplicate emails whenever it is the case.

Now whenever i call the method with the JS key or BL key, if email duplicates are found, the correct error is returned, if no errors are found the call goes through and the user object is returned just fine,
but, and here is the issue, if the username is a duplicate, the call times out and i get an error 400.

Please note that UserService.update is always returning an error 400 timeout regardless of which API key i use.

I am not sure if something has changed or not internally, but now i am getting the same results for UserService.update as i am with UserService.register, that is, if any duplicates exist i get a timeout error, otherwise the call goes through.

Hi @karim-wazzan!

Thanks for additional information. We are working on the fix.

Regards, Andriy

Hey guys!

Any updates on the fix?

Hello @karim-wazzan

We are working into it. Now the fix is at the testing stage by our QA team.

1 Like

Hello @karim-wazzan

We’ve just updated cloud servers with a fix for the issue you described above. Could you kindly let us know whether fix works for you well?

Regards,
Inna

1 Like

Hello @Inna_Shkolnaya!

Tested the case where updating a unique column resulted in a 400 error and so far the issue seems to be resolved!

Thank you for your efforts, keep up the great work!