Backendless.shared.userService.login() call always returning 404

This started happening all of a sudden today. I have two apps that use the same app ID and key to connect to Backendless, I am assuming that’s OK.

My call to Backendless.shared.userService.login() always returns an error with the following message and code in the Fault object for one of the apps and not the other. The user does exist in the user table.

The Swift version is 4.2 and Backendless version is 5.

Here’s the error message I get:

Fault Message: Not Found
Fault Code: 404

Never seen this before, any idea why this would start happening?

Thanks for your help!

Hi @sundar-krishnamurthy

Could you please provide your AppID, and we will investigate the issue.

Regards, Vlad

Thanks Vladimir, I sent you a message with the App ID.

yeah, thank you, I’m looking into it

I just tried to make a login using REST Console in Backendless Console and I always get 401 ({“code”:3003,“message”:“Invalid login or password”,“errorData”:{}}).
Our engineer will try it with Swift SDK, however could you please make sure you init app in the SDK correctly, make sure that serverUrl, appId and apiKey have correct values.

Hello @sundar-krishnamurthy,

I connected to your app and created a test user. Then I tried to login and everything works fine for me - I can login (using the mobile number) without any issues.
As @vladimir-upirov have already said, please check your AppId and Api key settings in your project.

Regards,
Olha

Thank you Vladimir and Olha, you both have been extremely helpful! I am using Swift-SDK (BackendlessSwift 5.7.1 pod)

I did confirm to make sure the server URL, the app ID, and the API key have the correct values I copied from the project template I downloaded.

When the call gets into UserService.login() in UserService.swift, the result object in the response from the call to BackendlessRequestManager() returns the following:

Foundation.NSError =	(NSError)	domain: "BackendlessErrorDomain" - code: 404
message = String? "Not Found"
faultCode = Int 404
backendlessDomain = String "BackendlessErrorDomain"

Do other API calls work? Can you do a test invocation for retrieving some data from the database?

Hi Mark, it feels like something is seriously broken here. I tried adding code to retrieve data from the database and that fails too with the same error message (“Not Found”, 404).

Even worse, in the app where the login continues to work, I can no longer access the data in my own table if I use the custom class approach.

All this started after upgrading to Backendless SDK 5.7.1.

I figured out the problem. Shamefully, it was an error on my part (but I can easily blame Xcode/Apple for this :slight_smile:).

I accidentally had set this call in the AppDelegate class:

func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {

to private and the Simulator silently ignores this, doesn’t call it, but loads the first view controller. This is where I do the initializations for the Backendless shared instance. Without the App and API keys not set, the call will fail.

Thank you for all your help, onto solving the issue around why the custom class data retrieval is failing :slight_smile:!

1 Like

That’s a good idea, thank you for suggesting—I will try it this evening.

Regards,
Sundar