Unity Hub CLI Issues (403 Request and Ampli Errors)

Hey everyone,

I’m having trouble using Unity Hub CLI to install the editor. Unity Hub is installed with a Visual Studio managed workload through the CLI. Whenever I try to run any commands (including help) with the hub closed, I get a 403 request error:

Summary
PS C:\Program Files\Unity Hub> & '.\Unity Hub.exe' -- -- headless help

PS C:\Program Files\Unity Hub> Checking for update
Update for version 3.10.0 is not available (latest version: 3.10.0, downgrade is disallowed).
[23632:1221/210101.465:ERROR:gpu_init.cc(523)] Passthrough is not supported, GL is disabled, ANGLE is
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:
[AxiosError: Request failed with status code 403] {
  code: 'ERR_BAD_REQUEST',
  config: {
    transitional: {
      silentJSONParsing: true,
      forcedJSONParsing: true,
      clarifyTimeoutError: false
    },
    adapter: [Function: httpAdapter],
    transformRequest: [ [Function: transformRequest] ],
    transformResponse: [ [Function: transformResponse] ],
    timeout: 0,
    xsrfCookieName: 'XSRF-TOKEN',
    xsrfHeaderName: 'X-XSRF-TOKEN',
    maxContentLength: -1,
    maxBodyLength: -1,
    env: { FormData: [Function] },
    validateStatus: [Function: validateStatus],
    headers: {
      Accept: 'application/json, text/plain, */*',
      Authorization: 'Bearer eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCIsImtpZCI6InVuaXR5OjhjOGU4Nzc4LTg4OTktNDczNC1hZGRhLTcxODY4MGY2MDI5YyJ9.eyJhdWQiOiJ1bml0eV9kYXNoYm9hcmQiLCJpc3MiOiJ1bml0eS1zZXJ2aWNlcy1mb3VuZGF0aW9uIiwidXVpZCI6Ijc5Njg3M2MwLTc4YzAtNDk0Ny0wMDAwLTAwMDAwMDBkYTIwMiIsInJvbGVzIjpbXSwiaWF0IjoxNzM0ODQxNTUxLCJleHAiOjE3MzQ4NDg3NTgsInN1YiI6Ijg5MzQ0MiIsImp0aSI6Ijk0YWM1MTRlZGViZjZjODc0NDU2NThjNmNlMjU1N2JkMGUwYjQ2NDA5NDIxZmQ4MTY5MjlhM2E0N2IyOGIzYTIifQ.t9jn94Z0SMPdCI0zRs0ivU-7J9yFtiRjlFS6rn2XT7zpHeAebgAKVI8cAL0bI-b9kyGhGBG1q-qdrFR5h82hFK3Quj-ME_PSHC-p5YjIiVNIjDx8haG5j7uK_3uaDwvVnjbm-BELG_1v0QAganO7zCDi75Tn17-k2_IBsMOW_zyin58bUx17tLECLQQkXd_zcuVk15uxNESyHxelu74UrG9lFN1TBLsazYFBbtqCQh991K4_yPrYtewdu4dhPpL3I3YlybL6JJh0bf-u8nYKxMF61hq1P1voOFfsDeFLEKXJGeSje4f_PblYUzj0g_wPaNAVeNhiMGsehV2UK-kYow',
      'User-Agent': 'axios/0.27.2'
    },
    proxy: false,
    method: 'get',
    url: 'https://services.unity.com/api/plastic/v1/hub-repositories',
    data: undefined
  },
  request: <ref *1> ClientRequest {
    _events: [Object: null prototype] {
      abort: [Function (anonymous)],
      aborted: [Function (anonymous)],
      connect: [Function (anonymous)],
      error: [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: false,
    sendDate: false,
    _removedConnection: false,
    _removedContLen: false,
    _removedTE: false,
    _contentLength: 0,
    _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: 'services.unity.com',
      alpnProtocol: false,
      authorized: true,
      authorizationError: null,
      encrypted: true,
      _events: [Object: null prototype],
      _eventsCount: 10,
      connecting: false,
      _hadError: false,
      _parent: null,
      _host: 'services.unity.com',
      _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)]: 1223,
      [Symbol(kHandle)]: [TLSWrap],
      [Symbol(lastWriteQueueSize)]: 0,
      [Symbol(timeout)]: null,
      [Symbol(kBuffer)]: null,
      [Symbol(kBufferCb)]: null,
      [Symbol(kBufferGen)]: null,
      [Symbol(kCapture)]: false,
      [Symbol(kSetNoDelay)]: false,
      [Symbol(kSetKeepAlive)]: true,
      [Symbol(kSetKeepAliveInitialDelay)]: 60,
      [Symbol(kBytesRead)]: 0,
      [Symbol(kBytesWritten)]: 0,
      [Symbol(connect-options)]: [Object],
      [Symbol(RequestTimeout)]: undefined
    },
    _header: 'GET /api/plastic/v1/hub-repositories HTTP/1.1\r\n' +
      'Accept: application/json, text/plain, */*\r\n' +
      'Authorization: Bearer eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCIsImtpZCI6InVuaXR5OjhjOGU4Nzc4LTg4OTktNDczNC1hZGRhLTcxODY4MGY2MDI5YyJ9.eyJhdWQiOiJ1bml0eV9kYXNoYm9hcmQiLCJpc3MiOiJ1bml0eS1zZXJ2aWNlcy1mb3VuZGF0aW9uIiwidXVpZCI6Ijc5Njg3M2MwLTc4YzAtNDk0Ny0wMDAwLTAwMDAwMDBkYTIwMiIsInJvbGVzIjpbXSwiaWF0IjoxNzM0ODQxNTUxLCJleHAiOjE3MzQ4NDg3NTgsInN1YiI6Ijg5MzQ0MiIsImp0aSI6Ijk0YWM1MTRlZGViZjZjODc0NDU2NThjNmNlMjU1N2JkMGUwYjQ2NDA5NDIxZmQ4MTY5MjlhM2E0N2IyOGIzYTIifQ.t9jn94Z0SMPdCI0zRs0ivU-7J9yFtiRjlFS6rn2XT7zpHeAebgAKVI8cAL0bI-b9kyGhGBG1q-qdrFR5h82hFK3Quj-ME_PSHC-p5YjIiVNIjDx8haG5j7uK_3uaDwvVnjbm-BELG_1v0QAganO7zCDi75Tn17-k2_IBsMOW_zyin58bUx17tLECLQQkXd_zcuVk15uxNESyHxelu74UrG9lFN1TBLsazYFBbtqCQh991K4_yPrYtewdu4dhPpL3I3YlybL6JJh0bf-u8nYKxMF61hq1P1voOFfsDeFLEKXJGeSje4f_PblYUzj0g_wPaNAVeNhiMGsehV2UK-kYow\r\n' +
      'User-Agent: axios/0.27.2\r\n' +
      'Host: services.unity.com\r\n' +
      'Connection: close\r\n' +
      '\r\n',
    _keepAliveTimeout: 0,
    _onPendingData: [Function: nop],
    agent: BoundHttpsProxyAgent {
      fallbackAgent: [Agent],
      isProxyConfigured: [Function (anonymous)],
      mustUrlUseProxy: [Function (anonymous)],
      getUrlProxy: [Function (anonymous)],
      socketConnectionTimeout: 60000,
      protocol: 'https:',
      defaultPort: 443
    },
    socketPath: undefined,
    method: 'GET',
    maxHeaderSize: undefined,
    insecureHTTPParser: undefined,
    path: '/api/plastic/v1/hub-repositories',
    _ended: true,
    res: IncomingMessage {
      _readableState: [ReadableState],
      _events: [Object: null prototype],
      _eventsCount: 4,
      _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://services.unity.com/api/plastic/v1/hub-repositories',
      redirects: [],
      [Symbol(kCapture)]: false,
      [Symbol(kHeaders)]: [Object],
      [Symbol(kHeadersCount)]: 42,
      [Symbol(kTrailers)]: null,
      [Symbol(kTrailersCount)]: 0,
      [Symbol(RequestTimeout)]: undefined
    },
    aborted: false,
    timeoutCb: null,
    upgradeOrConnect: false,
    parser: null,
    maxHeadersCount: null,
    reusedSocket: false,
    host: 'services.unity.com',
    protocol: 'https:',
    _redirectable: Writable {
      _writableState: [WritableState],
      _events: [Object: null prototype],
      _eventsCount: 3,
      _maxListeners: undefined,
      _options: [Object],
      _ended: true,
      _ending: true,
      _redirectCount: 0,
      _redirects: [],
      _requestBodyLength: 0,
      _requestBodyBuffers: [],
      _onNativeResponse: [Function (anonymous)],
      _currentRequest: [Circular *1],
      _currentUrl: 'https://services.unity.com/api/plastic/v1/hub-repositories',
      [Symbol(kCapture)]: false
    },
    [Symbol(kCapture)]: false,
    [Symbol(kNeedDrain)]: false,
    [Symbol(corked)]: 0,
    [Symbol(kOutHeaders)]: [Object: null prototype] {
      accept: [Array],
      authorization: [Array],
      'user-agent': [Array],
      host: [Array]
    },
    [Symbol(kUniqueHeaders)]: null
  },
  response: {
    status: 403,
    statusText: 'Forbidden',
    headers: {
      'content-security-policy': "default-src 'self';base-uri 'self';font-src 'self' https: data:;form-action 'self';frame-ancestors 'self';img-src 'self' data:;object-src 'none';script-src 'self';script-src-attr 'none';style-src 'self' https: 'unsafe-inline';upgrade-insecure-requests",
      'referrer-policy': 'no-referrer',
      'strict-transport-security': 'max-age=31536000; includeSubDomains',
      'x-content-type-options': 'nosniff',
      'x-dns-prefetch-control': 'off',
      'x-download-options': 'noopen',
      'x-frame-options': 'SAMEORIGIN',
      'x-permitted-cross-domain-policies': 'none',
      'x-xss-protection': '0',
      'surrogate-control': 'no-store',
      'cache-control': 'no-store, no-cache, must-revalidate, proxy-revalidate',
      expires: '0',
      vary: 'Origin, Accept-Encoding',
      'content-type': 'application/problem+json; charset=utf-8',
      'x-request-id': 'e2eb2b0d-a090-4bdb-9154-b9d5edf498e7',
      'content-length': '124',
      etag: 'W/"7c-XK7lRQLLcn7edrk271+EH6Vueuk"',
      date: 'Sun, 22 Dec 2024 05:01:23 GMT',
      via: '1.1 google',
      'alt-svc': 'h3=":443"; ma=2592000,h3-29=":443"; ma=2592000',
      connection: 'close'
    },
    config: {
      transitional: [Object],
      adapter: [Function: httpAdapter],
      transformRequest: [Array],
      transformResponse: [Array],
      timeout: 0,
      xsrfCookieName: 'XSRF-TOKEN',
      xsrfHeaderName: 'X-XSRF-TOKEN',
      maxContentLength: -1,
      maxBodyLength: -1,
      env: [Object],
      validateStatus: [Function: validateStatus],
      headers: [Object],
      proxy: false,
      method: 'get',
      url: 'https://services.unity.com/api/plastic/v1/hub-repositories',
      data: undefined
    },
    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: false,
      sendDate: false,
      _removedConnection: false,
      _removedContLen: false,
      _removedTE: false,
      _contentLength: 0,
      _hasBody: true,
      _trailer: '',
      finished: true,
      _headerSent: true,
      _closed: false,
      socket: [TLSSocket],
      _header: 'GET /api/plastic/v1/hub-repositories HTTP/1.1\r\n' +
        'Accept: application/json, text/plain, */*\r\n' +
        'Authorization: Bearer eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCIsImtpZCI6InVuaXR5OjhjOGU4Nzc4LTg4OTktNDczNC1hZGRhLTcxODY4MGY2MDI5YyJ9.eyJhdWQiOiJ1bml0eV9kYXNoYm9hcmQiLCJpc3MiOiJ1bml0eS1zZXJ2aWNlcy1mb3VuZGF0aW9uIiwidXVpZCI6Ijc5Njg3M2MwLTc4YzAtNDk0Ny0wMDAwLTAwMDAwMDBkYTIwMiIsInJvbGVzIjpbXSwiaWF0IjoxNzM0ODQxNTUxLCJleHAiOjE3MzQ4NDg3NTgsInN1YiI6Ijg5MzQ0MiIsImp0aSI6Ijk0YWM1MTRlZGViZjZjODc0NDU2NThjNmNlMjU1N2JkMGUwYjQ2NDA5NDIxZmQ4MTY5MjlhM2E0N2IyOGIzYTIifQ.t9jn94Z0SMPdCI0zRs0ivU-7J9yFtiRjlFS6rn2XT7zpHeAebgAKVI8cAL0bI-b9kyGhGBG1q-qdrFR5h82hFK3Quj-ME_PSHC-p5YjIiVNIjDx8haG5j7uK_3uaDwvVnjbm-BELG_1v0QAganO7zCDi75Tn17-k2_IBsMOW_zyin58bUx17tLECLQQkXd_zcuVk15uxNESyHxelu74UrG9lFN1TBLsazYFBbtqCQh991K4_yPrYtewdu4dhPpL3I3YlybL6JJh0bf-u8nYKxMF61hq1P1voOFfsDeFLEKXJGeSje4f_PblYUzj0g_wPaNAVeNhiMGsehV2UK-kYow\r\n' +
        'User-Agent: axios/0.27.2\r\n' +
        'Host: services.unity.com\r\n' +
        'Connection: close\r\n' +
        '\r\n',
      _keepAliveTimeout: 0,
      _onPendingData: [Function: nop],
      agent: [BoundHttpsProxyAgent],
      socketPath: undefined,
      method: 'GET',
      maxHeaderSize: undefined,
      insecureHTTPParser: undefined,
      path: '/api/plastic/v1/hub-repositories',
      _ended: true,
      res: [IncomingMessage],
      aborted: false,
      timeoutCb: null,
      upgradeOrConnect: false,
      parser: null,
      maxHeadersCount: null,
      reusedSocket: false,
      host: 'services.unity.com',
      protocol: 'https:',
      _redirectable: [Writable],
      [Symbol(kCapture)]: false,
      [Symbol(kNeedDrain)]: false,
      [Symbol(corked)]: 0,
      [Symbol(kOutHeaders)]: [Object: null prototype],
      [Symbol(kUniqueHeaders)]: null
    },
    data: {
      title: 'Error from Plastic',
      detail: 'Forbidden',
      status: 403,
      type: 'https://tools.ietf.org/html/rfc9110#section-15.5.4'
    }
  }
````Preformatted text`
}

When Unity Hub is opened and I try to call any command, I get this error message instead:

PS C:\Program Files\Unity Hub> ERROR: Ampli is not yet initialized. Have you called ampli.load() on app start?

I’m not familiar with Ampli and because I’m only calling the commands, I’m not sure where to begin to look to resolve this issue. Any idea what can be occurring here and how to fix it? Also, when I use the error flag, the same logs are displayed so I can’t use that info to investigate further.

Any insights would be appreciated!

I have the same issue. If that helps, i am on a fresh Debian 12 install.

In my case, i can’t sing in. The Browser opens, the site loads, it wants me to sign in, but Unity hub doesn’t act on it. I didn’t get that “You wanna open a link” from Firefox too.

EDIT : Nearly forgot, happy holidays you’all

1 Like

Hey @MTLPGaming , thank you for your response - and happy holidays as well!

I successfully installed the editor using this developer’s CLI script. Here’s the post I found it at. I have tested it and installs correctly on Windows.

Regarding your issue, last year I attempted to install Unity on the Steam Deck, which uses Arch Linux as its operating system. I encountered the same issue when trying to log in with Unity Hub. my memory is somewhat rusty, but I recall having to download additional packages via pacman to enable Chromium to redirect back to the Hub with the proper authorization. Sorry if I can’t be more help.