Problems with cloud functions triggers

Hi I’m having tons of problems with moralis cloud functions. some times they work, somw times they don’t and it doesn’t log any error, it simply doesn’t fire.

Today morning I had a server with the same problem, I killed it and created a new one. This new one worked with the same functions. Then it stopped updating, although the log says the function has updated, and the preview in the dashboards shows the new function, the execution is of the old version.

Now I created a new server in another network and it is not firing again.

On top of that i don’t know if I have to use “Moralis.Cloud…” or “Parse.Cloud…”, with Parse it works, with Moralis doesn’t, but the documentation and examples all use “Moralis.Cloud…”

Anyone that can help?

btw one of my function looks like this:

Parse.Cloud.afterSave("SellTBsc", async (request) => {

  const confirmed = request.object.get("confirmed");
  const amount = request.object.get("amount");
  const buyer = request.object.get("buyer");"TBSC: Confirmed: " + confirmed);"TBSC: Amount: " + amount);"TBSC: Buyer: " + buyer);

  // An HTTP Request

  logger.error("DONE! TBSC");


** The comment about the http request is because there will be one there, but right now is only a comment, it is not working just like this.

are there new rows added in this table when it is not triggered?

it should be same thing with Moralis.Cloud as Parse.Cloud, better to use Moralis.Cloud

Hi, yes the sync is working well, the cloud functions are the problem.

In the errors panel i have this:

2022-05-11T16:09:58.698Z - Error: connect ECONNREFUSED
    at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1187:16)
    at TCPConnectWrap.callbackTrampoline (node:internal/async_hooks:130:17)

And In the old server I had one more related to plugins, I don’t know if this is normal or related to the setting up of the server

what is the server url?

This is the last one where the function is not working:

Thanks for the help btw, we have and ICO on sunday and I need this to work or I’ll have to move to other solutions. Hope you can find the error, It has been a quite frustrating day.

can you try now on that server?

Of course, I could see you changing things, I’ll let you know how it goes. Thanks!

Nothing, it is still not firing.

this should be something basic

cand you use Moralis.Cloud instead of Parse.Cloud?

I was using that and you change it back hahaha, but sure i’ll try again. I hear you, that is my frustration :wink:

Hope we can make it work consistently

Nothing, no result! Any other ideas? Do you want me to nuke this account and start over?? hahaha

In fact, in this server:
That is the other one I have in Mumbai, the event fires, but non of the data in request.object works:

const confirmed = request.object.get("confirmed");
const amount = request.object.get("amount");
const buyer = request.object.get("buyer");

This prints empty. But in the table you can see the data.

you can try to see all the data

Any ideas with the other server?

with the other server ( something is strange, it looks like cloud code is not updating, I tested on a separate server and it works as expected, but somethis is strange with that server, don’t nuke it yet

The first one is having a similar problem, the request params are not printing because it is using the first version of function that i deployed. Looks like the account is having the same problem.

how do you update the cloud code? always with moralis-admin-cli?

No I’ve tested with both, with the cli and without, no change with either

can you try to update it on both servers from admin interface? like adding only a comment on a line besides current cloud code