Dashboard and DevChainProxy connection problems

Anyone else facing connection issues with moralis right now? My DevChainProxy jumps from connected to disconnected, therefore connection from DApp to backend fails. Also, the App Dashboard just keeps loading and never shows up.
Also, I noticed that the url changes from https://lwg4jsnzwdtr.moralis.io:2083/apps to https://lwg4jsnzwdtr.moralis.io:2083/apps/moralisDashboard/browser after approx. 20 seconds, the loading animations dissapears, and the site then freezes, only showing a blank page.
This only concerns the server I am connected to via FRPC. the other dashboards show up.

Observations:
I see DevChainProxy is connected,
I try to connect with metamask to dapp, it fails and brings up error (XMLHTTP fails, Cors, bla bla…),
I check back with the DevChainProxy => it’s disconnected.

Even just tried reinstalling FRPC, but the issue remains.

The dashboard not loading can be a sign of an error in your Cloud Functions. Try temporarily removing all of your Cloud Code (and saving it somewhere… ideally this is already part of your repo). If the Dashboard loads then you know it’s a Cloud Function error.

Unless it’s internet connectivity issues, the other reason the devchain proxy can become disconnected is when an update to the Moralis Server code is pushed. This should only be temporary though as the server updates with the patch.

1 Like

ok, thanks for the response. Just tried that, didn’t work. The good old Cors is back. my localhost keeps getting rejected

Access to XMLHttpRequest at 'https://lwg4jsnzwdtr.moralis.io:2053/server/users' from origin 'http://localhost:8000' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource.
main.js:36 Error: XMLHttpRequest failed: "Unable to connect to the Parse API"
    at handleError (moralis.js:21781)
moralis.js:21641 POST https://lwg4jsnzwdtr.moralis.io:2053/server/users net::ERR_FAILED

there got to be a way to solve this :thinking:
I am very certain that my setup is exactly the same as this morning.

Some other things to watch out for:

  • If using the graphical Ganache UI it’s best to reuse the same workspace whenever possible. The sync state can become corrupted when using the “Quick Start” as this generates a new local blockchain so all the state will be different
  • Similar with ganache-cli, it’s best to use the deterministic flag to start it with the same seed phrase

Some other things to try

  • Verify that the frp settings match those in “view server details > devchain proxy settings”
    • These frp setttings are different for each server. So if you spin up a new server or switch to working on a different Moralis project that uses a separate Moralis server then you need to update the frp settings.
  • Manually restarting the server instance by clicking the “update / restart” button
    • It’s a good idea to do this regularly as new server versions are pushed often (multiple per day), but it can also be used just to restart the instance
  • If “turning it off and on again” doesn’t work…try spinning up a new server instance. If the sync state has become corrupted due to the above then that will reset everything
    • Make sure to copy the new frp settings for the new server instance
2 Likes

Thanks @mayjer,
I did indeed follow all these precautions since yesterday, as I encountered CORS policy issues the past days. Everything worked fine 'til before. Will try to spin up a new server instance again soon.
I also wonder if moving to testnet would probably cause less issues? I am just wondering, as I encountered irregularities in local dev chain environments with other projects as well, f.e. a unit test passing 95% of the time, but sometimes it will just throw RCP errors and needs a restart of the whole system.

Ok, I moved to Ropsten and no Cors error anymore, Yiha! BUT, the cloud function for ‘getUserItems’ does not work. Is there anything I have to change when moving to TestNet? Here is the CloudFunction Code:

CloudFunction
Moralis.Cloud.define("getUserItems", async (request) => {
  const query = new Moralis.Query("EthNFTTokenOwners");
  query.equalTo("contract_type", "ERC721");
  query.containedIn("owner_of", request.user.attributes.accounts);
  const queryResults = await query.find();
  const results = [];

  for (let i = 0; i < queryResults.length; ++i) {
	results.push({
       "id": queryResults[i].attributes.objectId,
      "tokenId": queryResults[i].attributes.token_Id,
      "tokenAddress": queryResults[i].attributes.token_address,
      "symbol": queryResults[i].attributes.symbol,
      "tokenuri": queryResults[i].attributes.token_uri,
    });
  }
  return results;
});

Also, if you want to try and see if it works for you? I mean, when you create an Item, will it be shown in MyItems?
The Item gets minted and added to moralis successfully on my side. but it won’t print it, no errors thrown in the console though.
MyRaribleOnRopsten