HubSpot / hubspot-cli

A CLI for HubSpot
https://developers.hubspot.com
Other
154 stars 57 forks source link

Update 5.1.1 -> 5.1.3. no data #1015

Open juekbr opened 6 months ago

juekbr commented 6 months ago

Here my situation. We have updated 5.1.1 -> 5.1.3. We are using environment vars for configuration not any config file. In the environment we got two variables:

When I do this: hs fetch / ./ --use-env I will get the following error and no data whatsoever is going to be downloaded error message: [ERROR] A Error has occurred. Failed fetch of folder "/" to "/local/directory" from the Design Manager"

It works with 5.1.1, so we had to roll back. Sidenote: int the older version we have to modify the timeout setting in requestOptions.js to a higher value, since timeout settings are pulled from config files only and not from the environment.

camden11 commented 6 months ago

Hey @juekbr, we're having trouble reproducing this one. Couple questions for you that might help steer us in the right direction:

Also, could you try running this again with the --debug flag? It's possible that could provide us with some more details as to what's going on here

juekbr commented 6 months ago

Hi there We are using debian 11 and this is our gitlab runner. The Variables are project variables and sitting in the gitlab UI. For this test I have exported the values in the shell and executed the fetch statement on the command line as root: hs fetch / ./ --use-env --debug

I get over 2000 Lines of output. Here are the first 60ish lines. I have replaced the account id with a random number. The rest is quite repetitive and there is also data in it which I dont want to post here. For example the Bearer token. If you need all the data pls let me know, and we are going to find a way.

Debugging info
==============
CLI version: 5.1.3
node version: v16.20.2
platform: linux

[DEBUG] Loaded config from environment variables for account 123456789
[DEBUG] Loaded environment variable config
[DEBUG] Updating config for 123456789
[DEBUG] Attempting to track usage of "fetch" command
[DEBUG] Sending usage event to authenticated endpoint
[DEBUG] Sent usage tracking command event: {
  action: 'cli-command',
  os: 'linux',
  nodeVersion: 'v16.20.2',
  nodeMajorVersion: 'v16',
  version: '5.1.3',
  command: 'fetch',
  authType: 'personalaccesskey',
  mode: 'publish'
}
[ERROR] A Error has occurred. Failed fetch of folder "/" to "/local/directory" from the Design Manager
[DEBUG] Error: Error: Failed fetch of folder "/" to "/local/directory" from the Design Manager
[DEBUG] Cause: Error: AxiosError: timeout of 15000ms exceeded
    at throwError (/usr/lib/node_modules/@hubspot/cli/node_modules/@hubspot/local-dev-lib/errors/standardErrors.js:50:11)
    at fetchFolderFromApi (/usr/lib/node_modules/@hubspot/cli/node_modules/@hubspot/local-dev-lib/lib/fileMapper.js:267:45)
    at async downloadFolder (/usr/lib/node_modules/@hubspot/cli/node_modules/@hubspot/local-dev-lib/lib/fileMapper.js:274:22)
    at async downloadFileOrFolder (/usr/lib/node_modules/@hubspot/cli/node_modules/@hubspot/local-dev-lib/lib/fileMapper.js:324:9)
    at async Object.exports.handler (/usr/lib/node_modules/@hubspot/cli/commands/fetch.js:45:5) {
  [cause]: AxiosError: timeout of 15000ms exceeded
      at RedirectableRequest.handleRequestTimeout (/usr/lib/node_modules/@hubspot/cli/node_modules/axios/dist/node/axios.cjs:3124:16)
      at RedirectableRequest.emit (node:events:513:28)
      at Timeout.<anonymous> (/usr/lib/node_modules/@hubspot/cli/node_modules/follow-redirects/index.js:210:12)
      at listOnTimeout (node:internal/timers:559:17)
      at processTimers (node:internal/timers:502:7)
      at Axios.request (/usr/lib/node_modules/@hubspot/cli/node_modules/axios/dist/node/axios.cjs:3877:41)
      at async Object.getRequest [as get] (/usr/lib/node_modules/@hubspot/cli/node_modules/@hubspot/local-dev-lib/http/index.js:90:22)
      at async fetchFolderFromApi (/usr/lib/node_modules/@hubspot/cli/node_modules/@hubspot/local-dev-lib/lib/fileMapper.js:257:15)
      at async downloadFolder (/usr/lib/node_modules/@hubspot/cli/node_modules/@hubspot/local-dev-lib/lib/fileMapper.js:274:22)
      at async downloadFileOrFolder (/usr/lib/node_modules/@hubspot/cli/node_modules/@hubspot/local-dev-lib/lib/fileMapper.js:324:9)
      at async Object.exports.handler (/usr/lib/node_modules/@hubspot/cli/commands/fetch.js:45:5) {
    code: 'ECONNABORTED',
    config: {
      transitional: {
        silentJSONParsing: true,
        forcedJSONParsing: true,
        clarifyTimeoutError: false
      },
      adapter: [ 'xhr', 'http' ],
      transformRequest: [ [Function: transformRequest] ],
      transformResponse: [ [Function: transformResponse] ],
      timeout: 15000,
      xsrfCookieName: 'XSRF-TOKEN',
      xsrfHeaderName: 'X-XSRF-TOKEN',
      maxContentLength: -1,
      maxBodyLength: -1,
      env: {
        FormData: [Function: FormData] {
          LINE_BREAK: '\r\n',
          DEFAULT_CONTENT_TYPE: 'application/octet-stream'
        },
        Blob: null
      },