[SOLVED] My Moralis server cloud functions stopped working

Can you please look into my server. The cloud functions and logs stopped working using the sdk. They all return invalid function when run from the javascript SDK. My whole website is down.

I have NOT migrated to self hosting yet.

I cannot access the logs via CLI anymore (It shows other servers on my moralis, but not my main server).

I restarted the server but still no luck.

Moralis CLI version 9.1.1
Server version 3.9.2
Server: fmcb23u78jkw

1 Like

I see this error in server logs:

Error: {"message":"Cannot access 'queryMoralis' before initialization","code":141}

Thanks that helps narrow it down.

A seperate issue: I still cannot see errors in my logs. I posted a forum topic here, but wasn’t able to fix this issue (admittedly didn’t follow up because I was using the console, but I guess this error is server side and causes the whole thing to crash). Moralis server logs do not showing errors

I suspect the issue is with the index.js file compiled by the CLI. Somehow a new cloud function I created is being placed before the queryMoralis function. When I delete the queryMoralis call in the new cloud function, the whole thing goes back online.

We used to be able to go in and see the file created. Is there a way to do that now so I could confirm if this is the issue?

Or…another possibility is Moralis server is trying to execute cloud code before moralis is initialized? Why would it do that?

you can see the cloud code in admin interface

maybe you can control the order somehow, or add both functions in the same file

how do you check the logs? (with cli or in admin interface)

you can see the cloud code in admin interface

Where? I thought this was removed

how do you check the logs? (with cli or in admin interface)

Both places do not have errors. inline logs yes, errors no.

in admin interface, there is a cloud code tab where you can see your cloud code, you can not edit there, but you can see it there

I’m not sure how I fixed it. I renamed the cloud function, maybe it placed it somewhere else where it was more happy.

I’m in the process of trying to migrate to self-host so this wouldn’t be an issue moving forward.

1 Like