Moralis-admin-cli deploy "unknown problem"

PS C:\Users\dinsa\OneDrive\Bureau\Moralis developement\NFT 01> moralis-admin-cli deploy
Specify Moralis Api Secret: ***************
Unexpected error
Error: Request failed with status code 403
    at createError (C:\Users\dinsa\AppData\Roaming\npm\node_modules\moralis-admin-cli\node_modules\axios\lib\core\createError.js:16:15)
    at settle (C:\Users\dinsa\AppData\Roaming\npm\node_modules\moralis-admin-cli\node_modules\axios\lib\core\settle.js:17:12)
    at IncomingMessage.handleStreamEnd (C:\Users\dinsa\AppData\Roaming\npm\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:1340:12)
    at processTicksAndRejections (node:internal/process/task_queues:83:21) {
  config: {
    url: 'https://admin.moralis.io/api/cli/userServers',
    method: 'post',
    data: '{"apiKey":"4fj5edfj553jdj5jfd","apiSecret":"2Hp9HtrTVQSy3vQ"}',
    headers: {
      Accept: 'application/json, text/plain, */*',
      'Content-Type': 'application/json',
      'User-Agent': 'axios/0.21.4',
      'Content-Length': 61
    },
    transformRequest: [ [Function: transformRequest] ],
    transformResponse: [ [Function: transformResponse] ],
    timeout: 0,
    adapter: [Function: httpAdapter],
    xsrfCookieName: 'XSRF-TOKEN',
    xsrfHeaderName: 'X-XSRF-TOKEN',
    maxContentLength: -1,
    maxBodyLength: -1,
    validateStatus: [Function: validateStatus],
    transitional: {
      silentJSONParsing: true,
      forcedJSONParsing: true,
      clarifyTimeoutError: false
    }
  },
  request: <ref *1> ClientRequest {
    _events: [Object: null prototype] {
      error: [Array],
      abort: [Function (anonymous)],
      aborted: [Function (anonymous)],
      connect: [Function (anonymous)],
      socket: [Function (anonymous)],
      timeout: [Function (anonymous)],
      prefinish: [Function: requestOnPrefinish]
    },
    _eventsCount: 7,
    _maxListeners: undefined,
    outputData: [],
    outputSize: 0,
    writable: true,
    destroyed: false,
    _last: true,
    chunkedEncoding: false,
    shouldKeepAlive: false,
    maxRequestsOnConnectionReached: false,
    _defaultKeepAlive: true,
    useChunkedEncodingByDefault: true,
    sendDate: false,
    _removedConnection: false,
    _removedContLen: false,
    _removedTE: false,
    _contentLength: null,
    _hasBody: true,
    _trailer: '',
    finished: true,
    _headerSent: true,
    _closed: false,
    socket: TLSSocket {
      _tlsOptions: [Object],
      _secureEstablished: true,
      _securePending: false,
      _newSessionPending: false,
      _controlReleased: true,
      secureConnecting: false,
      _SNICallback: null,
      servername: 'admin.moralis.io',
      alpnProtocol: false,
      authorized: true,
      authorizationError: null,
      encrypted: true,
      _events: [Object: null prototype],
      _eventsCount: 10,
      connecting: false,
      _hadError: false,
      _parent: null,
      _host: 'admin.moralis.io',
      _readableState: [ReadableState],
      _maxListeners: undefined,
      _writableState: [WritableState],
      allowHalfOpen: false,
      _sockname: null,
      _pendingData: null,
      _pendingEncoding: '',
      server: undefined,
      _server: null,
      ssl: [TLSWrap],
      _requestCert: true,
      _rejectUnauthorized: true,
      parser: null,
      _httpMessage: [Circular *1],
      [Symbol(res)]: [TLSWrap],
      [Symbol(verified)]: true,
      [Symbol(pendingSession)]: null,
      [Symbol(async_id_symbol)]: 8,
      [Symbol(kHandle)]: [TLSWrap],
      [Symbol(kSetNoDelay)]: false,
      [Symbol(lastWriteQueueSize)]: 0,
      [Symbol(timeout)]: null,
      [Symbol(kBuffer)]: null,
      [Symbol(kBufferCb)]: null,
      [Symbol(kBufferGen)]: null,
      [Symbol(kCapture)]: false,
      [Symbol(kBytesRead)]: 0,
      [Symbol(kBytesWritten)]: 0,
      [Symbol(connect-options)]: [Object],
      [Symbol(RequestTimeout)]: undefined
    },
    _header: 'POST /api/cli/userServers HTTP/1.1\r\n' +
      'Accept: application/json, text/plain, */*\r\n' +
      'Content-Type: application/json\r\n' +
      'User-Agent: axios/0.21.4\r\n' +
      'Content-Length: 61\r\n' +
      'Host: admin.moralis.io\r\n' +
      'Connection: close\r\n' +
      '\r\n',
    _keepAliveTimeout: 0,
    _onPendingData: [Function: nop],
    agent: Agent {
      _events: [Object: null prototype],
      _eventsCount: 2,
      _maxListeners: undefined,
      defaultPort: 443,
      protocol: 'https:',
      options: [Object: null prototype],
      requests: [Object: null prototype] {},
      sockets: [Object: null prototype],
      freeSockets: [Object: null prototype] {},
      keepAliveMsecs: 1000,
      keepAlive: false,
      maxSockets: Infinity,
      maxFreeSockets: 256,
      scheduling: 'lifo',
      maxTotalSockets: Infinity,
      totalSocketCount: 1,
      maxCachedSessions: 100,
      _sessionCache: [Object],
      [Symbol(kCapture)]: false
    },
    socketPath: undefined,
    method: 'POST',
    maxHeaderSize: undefined,
    insecureHTTPParser: undefined,
    path: '/api/cli/userServers',
    _ended: true,
    res: IncomingMessage {
      _readableState: [ReadableState],
      _events: [Object: null prototype],
      _eventsCount: 3,
      _maxListeners: undefined,
      socket: [TLSSocket],
      httpVersionMajor: 1,
      httpVersionMinor: 1,
      httpVersion: '1.1',
      complete: true,
      rawHeaders: [Array],
      rawTrailers: [],
      aborted: false,
      upgrade: false,
      url: '',
      method: null,
      statusCode: 403,
      statusMessage: 'Forbidden',
      client: [TLSSocket],
      _consuming: false,
      _dumped: false,
      req: [Circular *1],
      responseUrl: 'https://admin.moralis.io/api/cli/userServers',
      redirects: [],
      [Symbol(kCapture)]: false,
      [Symbol(kHeaders)]: [Object],
      [Symbol(kHeadersCount)]: 20,
      [Symbol(kTrailers)]: null,
      [Symbol(kTrailersCount)]: 0,
      [Symbol(RequestTimeout)]: undefined
    },
    aborted: false,
    timeoutCb: null,
    upgradeOrConnect: false,
    parser: null,
    maxHeadersCount: null,
    reusedSocket: false,
    host: 'admin.moralis.io',
    protocol: 'https:',
    _redirectable: Writable {
      _writableState: [WritableState],
      _events: [Object: null prototype],
      _eventsCount: 2,
      _maxListeners: undefined,
      _options: [Object],
      _ended: true,
      _ending: true,
      _redirectCount: 0,
      _redirects: [],
      _requestBodyLength: 61,
      _requestBodyBuffers: [],
      _onNativeResponse: [Function (anonymous)],
      _currentRequest: [Circular *1],
      _currentUrl: 'https://admin.moralis.io/api/cli/userServers',
      [Symbol(kCapture)]: false
    },
    [Symbol(kCapture)]: false,
    [Symbol(kNeedDrain)]: false,
    [Symbol(corked)]: 0,
    [Symbol(kOutHeaders)]: [Object: null prototype] {
      accept: [Array],
      'content-type': [Array],
      'user-agent': [Array],
      'content-length': [Array],
      host: [Array]
    }
  },
  response: {
    status: 403,
    statusText: 'Forbidden',
    headers: {
      date: 'Thu, 04 Nov 2021 15:07:36 GMT',
      'content-type': 'application/json; charset=utf-8',
      'content-length': '28',
      connection: 'close',
      'x-powered-by': 'Express',
      etag: 'W/"1c-maYKmqoZlL7zJpfc5058YwpODgM"',
      'cf-cache-status': 'DYNAMIC',
      'expect-ct': 'max-age=604800, report-uri="https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct"',
      server: 'cloudflare',
      'cf-ray': '6a8ec0be7df0ff20-MAD'
    },
    config: {
      url: 'https://admin.moralis.io/api/cli/userServers',
      method: 'post',
      data: '{"apiKey":"4fj5edfj553jdj5jfd","apiSecret":"2Hp9HtrTVQSy3vQ"}',
      headers: [Object],
      transformRequest: [Array],
      transformResponse: [Array],
      timeout: 0,
      adapter: [Function: httpAdapter],
      xsrfCookieName: 'XSRF-TOKEN',
      xsrfHeaderName: 'X-XSRF-TOKEN',
      maxContentLength: -1,
      maxBodyLength: -1,
      validateStatus: [Function: validateStatus],
      transitional: [Object]
    },
    request: <ref *1> ClientRequest {
      _events: [Object: null prototype],
      _eventsCount: 7,
      _maxListeners: undefined,
      outputData: [],
      outputSize: 0,
      writable: true,
      destroyed: false,
      _last: true,
      chunkedEncoding: false,
      shouldKeepAlive: false,
      maxRequestsOnConnectionReached: false,
      _defaultKeepAlive: true,
      useChunkedEncodingByDefault: true,
      sendDate: false,
      _removedConnection: false,
      _removedContLen: false,
      _removedTE: false,
      _contentLength: null,
      _hasBody: true,
      _trailer: '',
      finished: true,
      _headerSent: true,
      _closed: false,
      socket: [TLSSocket],
      _header: 'POST /api/cli/userServers HTTP/1.1\r\n' +
        'Accept: application/json, text/plain, */*\r\n' +
        'Content-Type: application/json\r\n' +
        'User-Agent: axios/0.21.4\r\n' +
        'Content-Length: 61\r\n' +
        'Host: admin.moralis.io\r\n' +
        'Connection: close\r\n' +
        '\r\n',
      _keepAliveTimeout: 0,
      _onPendingData: [Function: nop],
      agent: [Agent],
      socketPath: undefined,
      method: 'POST',
      maxHeaderSize: undefined,
      insecureHTTPParser: undefined,
      path: '/api/cli/userServers',
      _ended: true,
      res: [IncomingMessage],
      aborted: false,
      timeoutCb: null,
      upgradeOrConnect: false,
      parser: null,
      maxHeadersCount: null,
      reusedSocket: false,
      host: 'admin.moralis.io',
      protocol: 'https:',
      _redirectable: [Writable],
      [Symbol(kCapture)]: false,
      [Symbol(kNeedDrain)]: false,
      [Symbol(corked)]: 0,
      [Symbol(kOutHeaders)]: [Object: null prototype]
    },
    data: 'Invalid apiKey / apiSecret'
  },
  isAxiosError: true,
  toJSON: [Function: toJSON]
}
PS C:\Users\dinsa\OneDrive\Bureau\Moralis developement\NFT 01>

I don’t understand what the problem is !!

Maybe you didn’t provide the right keys

I provided the correct key and every time I get the same message

I see this and that is why I thought that something was wrong with the keys.

Did you use CLI API Key and CLI API Secret from your server settings?

Yes, I use it from my server settings?

Yes, from server details tab in your Moralis server settings.

Yes I did, but same problem

have you got any solution?

did you try with CLI API Key and CLI API Secret?

Yes I did and went through correctly but the last step gave error:
En error occured when trying to deploy
Error: Request failed with status code 502
at createError (C:\Users\user\AppData\Roaming\npm\node_modules\moralis-admin-cli\node_modules\axios\lib\core\createError.js:16:15)
at settle (C:\Users\user\AppData\Roaming\npm\node_modules\moralis-admin-cli\node_modules\axios\lib\core\settle.js:17:12)
at IncomingMessage.handleStreamEnd (C:\Users\user\AppData\Roaming\npm\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) {
config: {
.
.
.

can you try to reinstall moralis-admin-cli? I would expect it to work

OK, I will try now, should I uninstalled first?

you could install it in a separate folder too:

npm init --yes
npm install --save moralis-admin-cli

and then use it from that folder

Thank you for your replay,
Still got the same issue?
I created a new folder called (mor) in the project and install above commands (init, install) then I move public index file to the new folder then write commands:
C:\Users\user…\mor>moralis-admin-cli deploy
Specify Moralis Api Key: …
Specify Moralis Api Secret: …
What server do you want to connect to?: 0

I got similar error?
En error occured when trying to deploy
Error: Request failed with status code 502
at createError (C:\Users\user\AppData\Roaming\npm\node_modules\moralis-admin-cli\node_modules\axios\lib\core\createError.js:16:15)
at settle (C:\Users\user\AppData\Roaming\npm\node_modules\moralis-admin-cli\node_modules\axios\lib\core\settle.js:17:12)
at IncomingMessage.handleStreamEnd (C:\Users\user\AppData\Roaming\npm\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) {
config: {…

you don’t have to move index.html in that folder named mor, it should be in a folder where only index.html is

I deleted now (index.html) from mor folder but gave error:
C:\Users\user\marketplace1\marketplace1\mor>moralis-admin-cli deploy
Destination folder must contain: index.html!

you create a new folder, named index_folder for example, you put there index.html, and then you call
moralis-admin-cli deploy --folderPath index_folder

still the same error?
C:\Users\user\marketplace1\marketplace1>moralis-admin-cli deploy --folderPath public
Specify Moralis Api Key: …
Specify Moralis Api Secret: …
Following servers were found:
(0) Marketplace_
What server do you want to connect to?: 0
En error occured when trying to deploy
Error: Request failed with status code 502
at createError (C:\Users\user\AppData\Roaming\npm\node_modules\moralis-admin-cli\node_modules\axios\lib\core\createError.js:16:15)
at settle (C:\Users\user\AppData\Roaming\npm\node_modules\moralis-admin-cli\node_modules\axios\lib\core\settle.js:17:12)
at IncomingMessage.handleStreamEnd (C:\Users\user\AppData\Roaming\npm\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) {
config: {

ok, can you try to check the server then, to restart/update it

Thank you very much for your help
It deployed successfully after updating the server
but now the site is empty (only blank white page)?
I run it in local server and works fine!