XMLHttpRequest failed: "Unable to connect to the Parse API"

Hi!

I’m using parse server on a EC2 AWS server. My parser serveur version is 3.9.0.
I’m trying to update my server from a js file from a S3 server. But each time I have the error:
XMLHttpRequest failed: “Unable to connect to the Parse API”.

Parse.initialize('xxxxxx');

Parse.serverURL = 'https://xxxxx';


const Table = new Parse.Object.extend('xxxx');
const table = new Table();
table.set('xxxx', 'toto');
table.save()
.then((table) => {
	// Execute any logic that should take place after the object is saved.
		alert('New object created with objectId: ' + table.id);
	}, (error) => {
	// Execute any logic that should take place if the save fails.
	// error is a Parse.Error with an error code and message.
	alert('Failed to create new object, with error code: ' + error.message);
});

Best regards,
Valentin PERRIN

If you open a Parse Dashboard connecting to this server, does it work? Can you successfully execute a curl command against this server from your machine?

I find the problem.
I was having a security problem. I wasn’t have any certificate of sécurity.

Thanks for yout help,
Best regards,
Valentin PERRIN

Can you elaborate on the solution? What do you mean you didn’t have any certificate of security?

I am having a similar issue. I am trying to read and update from a node.js script. I am able to read data but unable to save data. Getting the same error as the title of this post. Here is my overall code:

const Parse = require('parse/node');
Parse.serverURL = 'https://xxx.back4app.io'; // This is your Server URL
Parse.initialize(
    'xxx', // This is your Application ID
    'xxx', // This is your Javascript key
    'xxx' // masterKey
);

const SomeClass = Parse.Object.extend('SomeClass');
const query = new Parse.Query(SomeClass);
query.get('someID').then((object) => {
    object.set('someColumn', 'A string');
    object.save().then((response) => {
        console.log('Updated Model', response);
      })
})

The get is working. The save is taking a lot of time and in the end it returns an error:
code:100
message:“XMLHttpRequest failed: “Unable to connect to the Parse API””

Nevemind… I found the issue.

I had a beforeSave cloud function on the object I was trying to save that prevented the save of the object.

If I got a more explicit error message it would have shorten my search for the issue.