hcengineering/platform · error

get-file-error

Error message

get-file-error

What it means

In the front server's getFile handler, any error thrown while reading a file from storage for a workspace is logged as 'get-file-error' and converted to an HTTP 500 response. It is a generic wrapper around storage read failures (storage adapter errors, network issues to storage backend, permission problems).

Source

Thrown at server/front/src/index.ts:241

        await new Promise<void>((resolve, reject) => {
          dataStream.on('end', function () {
            res.end()
            dataStream.destroy()
            resolve()
          })
          dataStream.on('error', function (err) {
            Analytics.handleError(err)
            ctx.error('error', { err })

            res.end()
            dataStream.destroy()
            reject(err)
          })
        })
      } catch (err: any) {
        ctx.error('get-file-error', { workspace: wsIds.uuid, err })
        Analytics.handleError(err)
        res.status(500).send()
      }
    },
    {}
  )
}

/**
 * @public
 * @param port -
 */
export function start (
  ctx: MeasureContext,
  config: {
    storageAdapter: StorageAdapter
    accountsUrl: string
    accountsUrlInternal?: string
    uploadUrl: string
    filesUrl: string

View on GitHub (pinned to 63e28dc964)

Solutions

  1. Inspect the logged err object in ctx.error output to find the underlying storage failure.
  2. Verify storage adapter configuration (endpoint, credentials, bucket) in the front server config.
  3. Check connectivity from the front server to the object storage backend.
  4. Retry the file request once storage is confirmed healthy.

Example fix

// before (config)
endpoint: 'http://old-minio:9000'
// after
endpoint: process.env.STORAGE_ENDPOINT // correct reachable endpoint with valid creds
Defensive patterns

Strategy: try-catch

Validate before calling

// Preflight storage reachability before requesting files
const healthy = await fetch(`${storageEndpoint}/minio/health/live`)
if (!healthy.ok) throw new Error('storage backend unreachable')

Type guard

function isStorageError(err: unknown): err is Error & { code?: string } {
  return err instanceof Error
}

Try / catch

try {
  const res = await fetch(fileUrl)
  if (!res.ok) throw new Error(`file fetch failed: ${res.status}`)
  return await res.blob()
} catch (err) {
  console.error('get-file-error', err)
  throw new Error('File download failed; check storage adapter config and connectivity')
}

Prevention

When it happens

Trigger: config.storageAdapter getFile operation throws or rejects during GET/HEAD file requests (bucket unreachable, key access error, adapter misconfiguration).

Common situations: S3/MinIO credentials invalid or expired; storage bucket misconfigured; network partition between front server and object storage; oversized/corrupted objects.

Related errors


AI-assisted analysis of hcengineering/platform@63e28dc964 (2026-08-29). Data as JSON: /api/errors/a8f4be3dbec658ec. Report an issue: GitHub.