[SOLVED] Cant see my sync contracts and wallets

Hi admin team i cant see my synced wallets and contracts. details as per pictures attached.

server url: https://ehnbauzmp7sl.usemoralis.com:2053/server

Did you have any events synced?

I can see 6 watched addresses in the database
since when did this happen? if you look in network tab do you see any error?

I have been using cloud code to watch, but my question is why can’t I see them in the admin page

to what you are referring here in particular with them?

did you check if there were any errors? did you click on the tab specific to addresses watched in the admin interface?

thats what im referring to. please see my screen shots. notice how its completely empty? yet in the database the are 6 synced addresses.
I just want to know why cant i see the synced addresses in the admin interface.

you can try to restart coreservices

you can look on this forum post: How to programmatically reset local chain

and replace reset_local_chain with restart_core_services

did you see anything in network tab or browser console?

honestly I don’t wanna do that in case I mess up my server. but you understand my problem right?
all other dapps I can see synced contracts and/ir wallets in the syncs tab in admin page. but for this particular server the screens are competely blank as per my screenshots

I understand the problem, it doesn’t look like new watched addresses were added by code, it looks like they were added in the interface based on what it is in the database

it shouldn’t mess up the server if you restart coreservices

they are currently being added in the cloud code using the following code:

    await Moralis.Cloud.run(
      "watchBscAddress",
      { address },
      { useMasterKey: true }
    );

ill try restart core services

maybe you can check the returned result for that call, in case that there was an error

1 Like

i seem to be getting the following errors in my database error log:

2022-08-28T12:21:26.789Z - Error: [object Object]
    at Object.resolveError (/moralis-server/lib/triggers.js:632:17)
    at error (/moralis-server/lib/Routers/FunctionsRouter.js:184:32)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
2022-08-28T12:21:26.785Z - Failed running cloud function watchWallet for user undefined with:
  Input: {"address":"0xb7A5dc906ec4F6Da12b6910e2Cd1043B54817A65"}
  Error: {"message":{"status":502,"headers":{"x-powered-by":"Express","access-control-allow-origin":"*","content-type":"application/json; charset=utf-8","content-length":"24","etag":"W/\"18-py7kky+nYw+KpM//zLTacYk1OLw\"","x-response-time":"2.807ms","date":"Sun, 28 Aug 2022 12:21:26 GMT","connection":"close"},"buffer":{"type":"Buffer","data":[123,34,101,114,114,111,114,34,58,116,114,117,101,44,34,100,97,116,97,34,58,123,125,125]},"text":"{\"error\":true,\"data\":{}}","data":{"error":true,"data":{}}},"code":141}
2022-08-28T12:21:26.784Z - Failed running cloud function watchBscAddress for user undefined with:
  Input: {"address":"0xb7A5dc906ec4F6Da12b6910e2Cd1043B54817A65"}
  Error: {"message":{"status":502,"headers":{"x-powered-by":"Express","access-control-allow-origin":"*","content-type":"application/json; charset=utf-8","content-length":"24","etag":"W/\"18-py7kky+nYw+KpM//zLTacYk1OLw\"","x-response-time":"2.807ms","date":"Sun, 28 Aug 2022 12:21:26 GMT","connection":"close"},"buffer":{"type":"Buffer","data":[123,34,101,114,114,111,114,34,58,116,114,117,101,44,34,100,97,116,97,34,58,123,125,125]},"text":"{\"error\":true,\"data\":{}}","data":{"error":true,"data":{}}},"code":141}
2022-08-28T12:21:26.781Z - Failed running cloud function coreservices_addAddressSync for user undefined with:
  Input: {"chainId":"0x61","address":"0xb7A5dc906ec4F6Da12b6910e2Cd1043B54817A65"}
  Error: {"message":{"status":502,"headers":{"x-powered-by":"Express","access-control-allow-origin":"*","content-type":"application/json; charset=utf-8","content-length":"24","etag":"W/\"18-py7kky+nYw+KpM//zLTacYk1OLw\"","x-response-time":"2.807ms","date":"Sun, 28 Aug 2022 12:21:26 GMT","connection":"close"},"buffer":{"type":"Buffer","data":[123,34,101,114,114,111,114,34,58,116,114,117,101,44,34,100,97,116,97,34,58,123,125,125]},"text":"{\"error\":true,\"data\":{}}","data":{"error":true,"data":{}}},"code":141}

my test cloud code is:

Moralis.Cloud.define("watchWallet", async (request) => {
  const watchAddress = await Moralis.Cloud.run(
    "watchBscAddress",
    { address: request.params.address },
    { useMasterKey: true }
  );
  return watchAddress;
});

and im running the following code from JS Console:

const watchAddress = await Parse.Cloud.run(
"watchWallet",
{ address: "0xb7A5dc906ec4F6Da12b6910e2Cd1043B54817A65" }
);
    
console.log(watchAddress)

any thoughts on what my be going wrong?

so in Postman
i go:
a) POST https://ehnbauzmp7sl.usemoralis.com:2053/restart_core_services
b) POST https://ehnbauzmp7sl.usemoralis.com:2087/restart_core_services
c) POST https://ehnbauzmp7sl.usemoralis.com:2053/server/restart_core_services
d) POST https://ehnbauzmp7sl.usemoralis.com:2087/server/restart_core_services

which is correct?

then in body i send raw JSON as the following is that right?

{
“moralisMasterKey”: “xxxxxx"
}

for body you have to use your master key there

the the url, is one of those with port 2087

this syntax worked for me at some point directly in node js:

    const results = await Moralis.Cloud.run("watchBscAddress", {address: "0x4324234324", syncHistorical: true}, {useMasterKey: true})
    console.log(results)

ok i have managed to restart core services. but problem still persists.

I could try to remove all the watched addresses that the server has, those 6 of them

yes please can you try remove?i can add them again after

done, they are removed now, you have to restart coreservices again

restarted coreservices.
still cant watch or unwatch BSC addresses.

i tried uploading the exact same cloud functions to another server and watch and unwatch is running fine. so there is something messed up with this server. can you please ask one of your backend team to take a look?