Error 400 Bad request

Are you looking for help?

This is a support forum for reporting issues related to Backendless services. Please note that due to our support policy we cannot provide you help with debugging your code, consulting in regards to any language or third-party library usage. For this kind of questions we recommend using more appropriate forums like Stack Overflow.

In order to suggest you a quality solution, we shall usually ask you to provide the details mentioned below first. Including them into your topic right away helps us to start investigating your issue much faster.

In case you have a suggestion or an idea, the details below are not always required, though still any additional background is welcome.

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

Online

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

.net

Application ID

E45A3A00-3001-2C22-FF90-2BE03E914500

Actual Behavior

Please provide a description of what actually happens, working from the same starting point.

Be descriptive: “it doesn’t work” does not describe what the behavior actually is – instead, say “the request returns a 400 error with message XXX”. Copy and paste your logs, and include any URLs.

Starting this morning, many requests that have been fine for the past year or more are suddenly returning error 400. Doesn’t seem to matter the type of request, from basic data retrieval to logins.

It is intermittent, sometimes the requests go through but over 50% of the time all requests are failing application wide.

here is an example log / call stack

Backendless BackendlessFault. Code: Internal client exception, Message: The remote server returned an error: (400) Bad Request. The remote server returned an error: (400) Bad Request.
UnityEngine.Debug:Log(Object)
LoginController:b__13_1(BackendlessFault) (at Assets/[ExperimentalDesign]/Code/UI/LoginController.cs:133)
BackendlessAPI.Service.<>c__DisplayClass33_0:b__1(BackendlessFault)
BackendlessAPI.Engine.<>c__DisplayClass10_01:<InvokeAsync>b__1(Fault) Weborb.Client.Engine:ProccessException(Exception, Responder1)
Weborb.Client.HttpEngine:ProcessAMFResponse(IAsyncResult)
System.Runtime.CompilerServices.AsyncTaskMethodBuilder1:SetResult(Int32) Mono.Net.Security.<StartOperation>d__58:MoveNext() System.Runtime.CompilerServices.AsyncTaskMethodBuilder1:SetResult(AsyncProtocolResult)
Mono.Net.Security.d__23:MoveNext()
System.Runtime.CompilerServices.AsyncTaskMethodBuilder:SetResult()
Mono.Net.Security.d__24:MoveNext()
System.Runtime.CompilerServices.AsyncTaskMethodBuilder1:SetResult(Nullable1)
Mono.Net.Security.d__25:MoveNext()
System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1:SetResult(Int32)
Mono.Net.Security.d__66:MoveNext()
System.Threading._ThreadPoolWaitCallback:PerformWaitCallback()

Expected Behavior

Please describe the expected behavior of the issue, starting from the first action.

Hello @Experimental_Design

In the response body from the server there should be a message and code, could you please provide them?

Regards, Vlad

Backendless BackendlessFault. Code: Internal client exception, Message: The remote server returned an error: (400) Bad Request.

according to your API Calls analytics for the past 30 days I can see there are errors only for specific APIs login/find/findById, so I assume it depends on input parameters

Also, I do not see that 50% requests are failed, I would say only
for Login it’s around 2.5%
for Data it’s less than 1%

That makes sense. The past 30 days have been fine. It’s just starting this morning that we started seeing a large number of failures.

Backendless BackendlessFault. Code: Internal client exception, Message: The remote server returned an error: (400) Bad Request.

no, the code should be a Number and the message should describe the error with details, for instance if you send an invalid whereClause the server returns (400) Bad Request, but in the response we can see what exactly was wrong:

let’s try to reproduce the error with Login API

do you have the input parameters (login/password)? can you try to login using our REST Console (in the Data service) or some other service (Postman/etc)?

Backendless BackendlessFault. Code: Internal client exception, Message: The remote server returned an error: (400) Bad Request.

That was printed with the following line of code.
Debug.Log(exception.ToString() + “Code:” + fault.FaultCode + “Message:” + fault.Message);

That is what I’m seeing in in code and message.

here is the today’s analytics, seems like there no many errors

in order to fix a problem we need to reproduce it first

That seems like incorrect logging.

I’m seeing at least 10 or so fails with every user log in as the application loads ups and makes a number of requests at startup.

Can you test with the .net library? Other users in the slack are also mention the same with the .net api.
image

Alright, we will check the Login API with the .Net SDK and notify you here about any result

what version of the SDK do you use?

I’m not sure. Is there a place I can check?
We first started using Backendless in late 2019-ish, I think.
I have not updated the sdk since.

Looks like it is BackendlessSDK-UnityPackage-5.1.0 was what I initially imported. But I also remember a year or more ago there was an issue we resolved over slack and Mark Piller sent a single dll to swap out.

This is from my analytics showing about 50% fail rate on the logins. Also using .net.

Hi @parley-burnett

Ok, do you have the same in your log?

Here’s a copy-paste from real-time logging. Does this help?
12:58:44 | SERVER_CODE | ERROR | [1174] Error: The Company Id is empty at individual.create (/opt/backendless/repo/4e129fa8-ed2b-5021-ff84-966e95bc0d00/files/servercode/JS/default/PRODUCTION/services/IndividualRegister.js:22:19) at ServiceWrapper.invokeMethod (/usr/local/lib/node_modules/backendless-coderunner/lib/server-code/model/service.js:81:29) at Domain. (/usr/local/lib/node_modules/backendless-coderunner/lib/server-code/runners/tasks/invoke-service.js:78:31) at Domain.run (domain.js:373:15) at /usr/local/lib/node_modules/backendless-coderunner/lib/server-code/runners/tasks/invoke-service.js:77:7 at new Promise () at execute (/usr/local/lib/node_modules/backendless-coderunner/lib/server-code/runners/tasks/invoke-service.js:62:10) at executeTask (/usr/local/lib/node_modules/backendless-coderunner/lib/server-code/runners/tasks/executor.js:82:7) at Object.executor.execute (/usr/local/lib/node_modules/backendless-coderunner/lib/server-code/runners/tasks/executor.js:191:22) at executeTask (/usr/local/lib/node_modules/backendless-coderunner/lib/server-code/runners/cloud-worker.js:58:44)

yes, thanks

Does the Error: The Company Id is empty at individual.create error come from your custom Business Logic?

What’s your AppId?