Cloud File Not Syncing Error:

I’m attempting to sync a local file to my Moralis server but getting the following error when running this command in the terminal:

moralis-admin-cli watch-cloud-folder --moralisApiKey xxx --moralisApiSecret xxx --moralisSubdomain xxx.usemoralis.com --autoSave 1 --moralisCloudfolder /path/to/cloud/folder/

This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). The promise rejected with the reason:
Error: Request failed with status code 403
    at createError (/usr/local/lib/node_modules/moralis-admin-cli/node_modules/axios/lib/core/createError.js:16:15)
    at settle (/usr/local/lib/node_modules/moralis-admin-cli/node_modules/axios/lib/core/settle.js:17:12)
    at IncomingMessage.handleStreamEnd (/usr/local/lib/node_modules/moralis-admin-cli/node_modules/axios/lib/adapters/http.js:269:11)
    at IncomingMessage.emit (node:events:402:35)
    at IncomingMessage.emit (node:domain:475:12)
    at endReadableNT (node:internal/streams/readable:1343:12)
    at processTicksAndRejections (node:internal/process/task_queues:83:21)

It doesn’t appear to matter what’s inside the CloudFile.js

That error looks like some credentials were not right

Using the exact creds provided and format given when in cloud function window on the server and tried multiple variations in --moralisCloudfolder, still identical error.

Is there an obvious step missed in set-up? :thinking:

you need to use CLI API Key: and CLI API Secret:, for server you need your server domain

Using both in terminal command and tried multiple variants, still same error.

moralis-admin-cli watch-cloud-file -p /path/CloudFile.js --moralisApiKey xxx --moralisApiSecret xxx --moralisSubdomain xxx.usemoralis.com --moralisCloudFile /path/CloudFile.js

I’ve also pasted the code into the cloud functions window in the browser and it works, but need to be able to edit the js file at source.

Any other ideas?

the command should look like this (that works for me):

moralis-admin-cli watch-cloud-folder --moralisApiKey fads --moralisApiSecret sdfsdf --moralisSubdomain gfsdfgsdfg.usemoralis.com --autoSave 1 --moralisCloudfolder /path/to/file.js

are you sure you are using the right --moralisApiKey and --moralisApiSecret ?

Unfortunately I used that identical format too and still the same error. I can’t find any further info on the error across the forums.

moralis-admin-cli watch-cloud-folder --moralisApiKey xxx --moralisApiSecret xxx --moralisSubdomain xxx.usemoralis.com --autoSave 1 --moralisCloudfolder /path/CloudFile.js

if you try other commands with moralis-admin-cli they work? like trying to deploy a folder with an empty index.html

Appears keys and secret aren’t working, but I’m using the exact ones given by the server.

there are multiple secrets on the server info, you have to use those that are specific to CLI

These? :point_up_2:

yes, those ones should work

These are the ones I’m using, yes.

can you try to regenerate all secrets? it is a button on same page where you have those keys, it will take few minutes to regenerate the secrets

You can also double check if the server name is the right one

Werid, still 403 error on all requests using both old and now regenerated secrets and keys.

moralis-admin-cli get-logs --moralisApiKey xxx ----moralisApiSecret xxx

Unexpected error
Error: Request failed with status code 403

did you check the server name, what happens if you change it to something random?

you can also try to reinstall moralis-admin-cli in a local folder

Same error after trying both:

moralis-admin-cli watch-cloud-folder --moralisApiKey xxx --moralisApiSecret xxx --moralisSubdomain testingtesting.usemoralis.com --autoSave 1 --moralisCloudfolder /path/CloudFile.js

Hello, I have the same issue (although not 403)

I ran this query, using what the dashboard gave me (+double check it was the right CLI API key and secret)

moralis-admin-cli watch-cloud-folder --moralisApiKey XXXX --moralisApiSecret XXXX --moralisSubdomain XXXX.usemoralis.com --autoSave 1 --moralisCloudfolder /Users/myname/Prog/Crypto/project/src/cloud

But I got this returned:

ncc: Version 0.29.2
ncc: Compiling file index.js into CJS
This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). The promise rejected with the reason:
Error: error:0308010C:digital envelope routines::unsupported

Any fixed? I’m running on the version: 2.1.16 of Moralis Admin CLI
My cloud file cloud.js is empty, so I’m just setting things up.

other commands work well for you for moralis-admin-cli?