Failed running cloud function watchEthAddress for user undefined

Hi,
I was following this tutorial: https://www.youtube.com/watch?v=tYTW0U7IlK0 Web3 Cloud Functions for Noobs - Basic Queries [Part 2], I added the plugin, then went to the Dashboard to look for the EthTokenTransfers and EthTransactions under the Browser section, and they where not created.

I went to the error log and found this:


and this:

My Moralis Server Url: https://jcubkyk1bhis.moralis.io:2053/server

1 Like

Please double-check our common issues at FAQ - Common Issues & How To Get Help as well as how to properly submit if you didn’t manage to find a solution on your own. This will speed up the process, so we can help you as soon as possible.

:man_shrugging:

Did I miss any step in the FAQ?

1 Like

I am not sure, but it’s a checklist I would advise you to go through before our technical team can help you. Could you double-check your cloud functions as well? (post a picture of your could functions)

Have you put the correct contract address in your cloud function?

Thank you. I did review the FAQ, it is the first thing the forum software tells you to do, and I’m a good boi. And I did check other posts too.

This issue is not about cloudFunctions, it is about the watchEthAddress as is stated in the title. Here is a screen capture of the plugin setup:

The way I see it, the only steps necessary in the youtube tutorial are to add the plugin, and set the eth address to be synchronized, and Moralis will go ahead and pull the data from the chain and save it to the EthTokenTransfers and EthTransactions tables and expose it in the dashboard.

From my original post, you can clearly see that Moralis plugin is failing while trying to fetch from an endpoint that is throwing, not only a 404, but HTML in the 404 which means that something is really wrong with that endpoint.

You added “have you put the correct contract address in your cloud function”:

  1. This issue is not related to cloud functions and this is not about the SyncAndWatchContractEvents, so there is no contract address
  2. The eth address I entered to set up the plugin is valid, it is a random eth address with some transactions that I pulled of ethscan just like was done in the youtube tutorial: https://etherscan.io/address/0x842892ab8D2d79d13003C8eBCFDB3107545F5a63

Thanks again. Hopefully someone can take a look at those logs I posted and figure out what is wrong with the endpoint being called by moralis-server/node_modules/…/RESTController.js line 422.

Hi Krb,

I tried this just now in version 0.0.203… didn’t get a plugin error but the tables were not populated. After updating to the latest version, currently 0.0.208 the tables were created with all 11 transactions.

Please update to the latest Moralis server version and try again. Hopefully that fixes your issue.

This is a good rule in general. The back end code is evolving very quickly with a continuous integration cycle so new versions are constantly being released.

1 Like

Thank you, that makes sense.

I updated the server. Deleted the plugin. Created the plugin again with the same eth address.

No errors, but no tables created.

I see this message “Address is required”:

But there is an address set up in that plugin. It seems it is not entirely fixed. What eth address did you use when you got the 11 transactions? Here you can see that the address is set up in the plugin:

I used the address you linked above. Clicked on the Etherscan link and copied it from there. If you read the error message from May 2nd at the very end it says

<p><em>Failthfully yours, frp</em></p>

Could this be related to frp? Are you using frp? Seems strange that you would for this demo as that is only for listening to the local dev chain (i.e. ganache, hardhat). For the demo when you create the Moralis server use Mainnet. If you selected the local dev chain please create a new server on Mainnet.

FYI when you manually run the syncEthAddress function by pressing the button in the dashboard it will not do anything as the job requires the address param which cannot be provided by pressing the button, so it will always fail.

Ok, I think I understand what is going on!

When I created that server, on “Select Network” I had chosen “Local Dev Chain” because I was following a different youtube tutorial.

A couple of days went by and had completed the original tutorial and was using the same server for this tutorial. The problem is that I was not running hardhat at the moment, and I assume when the Moralis server is trying to pull the chain data, it is being responded with my local web server.

Now I did spin up a Moralis server pointing at main net and ran the plugin and the tables where created successfully.

I guess that what I would change in the way that Moralis is reacting to my mess up, is that if it does not receive a valid json rpc response from the chain, it should hint that it could not correctly connect to the selected blockchain node and output which node it tried to connect to.

Thank you so much mayjer.

1 Like

Another good suggestion. A more explicit error message in the logs would be useful. When connecting to the local dev chain the internal sync state in the Moralis server can become corrupted if you start mixing up dev chain types- like switching between hardhat and ganache.

2 Likes