immich-app / immich

High performance self-hosted photo and video management solution.
https://immich.app
GNU Affero General Public License v3.0
44.98k stars 2.18k forks source link

Immich cli import error #8092

Closed gdamx closed 6 months ago

gdamx commented 6 months ago

The bug

oot@19da0a9a12b2:/# immich upload --recursive /photos/admin/ ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ | 0% | ETA: 0s | 0/136.8 GB: /photos/admin/2002/2002-12-08/IMG_20130224_144628.jpg file:///app/immich/server/node_modules/@immich/cli/dist/index.js:9775 throw new ResponseError(response, "Response returned an error code"); ^

ResponseError: Response returned an error code at AssetApi.request (file:///app/immich/server/node_modules/@immich/cli/dist/index.js:9775:11) at process.processTicksAndRejections (node:internal/process/task_queues:95:5) at async AssetApi.uploadFileRaw (file:///app/immich/server/node_modules/@immich/cli/dist/index.js:13469:22) at async AssetApi.uploadFile (file:///app/immich/server/node_modules/@immich/cli/dist/index.js:13481:22) at async UploadCommand.run (file:///app/immich/server/node_modules/@immich/cli/dist/index.js:22389:30) at async Command. (file:///app/immich/server/node_modules/@immich/cli/dist/index.js:22454:3) { response: Response {

[Symbol(state)]: {
  aborted: false,
  rangeRequested: false,
  timingAllowPassed: true,
  requestIncludesCredentials: true,
  type: 'default',
  status: 400,
  timingInfo: {
    startTime: 10592.103592,
    redirectStartTime: 0,
    redirectEndTime: 0,
    postRedirectStartTime: 10592.103592,
    finalServiceWorkerStartTime: 0,
    finalNetworkResponseStartTime: 0,
    finalNetworkRequestStartTime: 0,
    endTime: 0,
    encodedBodySize: 88,
    decodedBodySize: 88,
    finalConnectionTimingInfo: null
  },
  cacheState: '',
  statusText: 'Bad Request',
  headersList: HeadersList {
    cookies: null,
    [Symbol(headers map)]: Map(7) {
      'x-powered-by' => { name: 'X-Powered-By', value: 'Express' },
      'content-type' => {
        name: 'Content-Type',
        value: 'application/json; charset=utf-8'
      },
      'content-length' => { name: 'Content-Length', value: '88' },
      'etag' => { name: 'ETag', value: '"58-5QQXk1t2mYvr0HnfqRVVS1X3EY8"' },
      'date' => { name: 'Date', value: 'Wed, 20 Mar 2024 13:03:09 GMT' },
      'connection' => { name: 'Connection', value: 'keep-alive' },
      'keep-alive' => { name: 'Keep-Alive', value: 'timeout=5' }
    },
    [Symbol(headers map sorted)]: null
  },
  urlList: [ URL {} ],
  body: {
    stream: ReadableStream {
      [Symbol(kType)]: 'ReadableStream',
      [Symbol(kState)]: {
        disturbed: false,
        reader: undefined,
        state: 'readable',
        storedError: undefined,
        stream: undefined,
        transfer: [Object],
        controller: [ReadableStreamDefaultController]
      },
      [Symbol(nodejs.webstream.isClosedPromise)]: {
        promise: [Promise],
        resolve: [Function (anonymous)],
        reject: [Function (anonymous)]
      },
      [Symbol(nodejs.webstream.controllerErrorFunction)]: [Function: bound error]
    }
  }
},
[Symbol(headers)]: Headers {
  [Symbol(headers list)]: HeadersList {
    cookies: null,
    [Symbol(headers map)]: Map(7) {
      'x-powered-by' => { name: 'X-Powered-By', value: 'Express' },
      'content-type' => {
        name: 'Content-Type',
        value: 'application/json; charset=utf-8'
      },
      'content-length' => { name: 'Content-Length', value: '88' },
      'etag' => { name: 'ETag', value: '"58-5QQXk1t2mYvr0HnfqRVVS1X3EY8"' },
      'date' => { name: 'Date', value: 'Wed, 20 Mar 2024 13:03:09 GMT' },
      'connection' => { name: 'Connection', value: 'keep-alive' },
      'keep-alive' => { name: 'Keep-Alive', value: 'timeout=5' }
    },
    [Symbol(headers map sorted)]: null
  },
  [Symbol(guard)]: 'immutable',
  [Symbol(realm)]: null
}

} }

The OS that Immich Server is running on

Unraid

Version of Immich Server

1.98.2

Version of Immich Mobile App

na

Platform with the issue

Your docker-compose.yml content

Using immich conatiner unraid

Your .env content

Using immich conatiner unraid

Reproduction steps

immich upload --recursive /photos/admin/

Additional information

No response

gdamx commented 6 months ago

Immich -V yields version 2.0.7

bo0tzz commented 6 months ago

Please make sure your cli is up to date.

gdamx commented 6 months ago

It's not

On Wed, Mar 20, 2024, 4:30 p.m. kocane @.***> wrote:

Please make sure your cli is up to date.

I get this error if I use the cli in the docker container itself (immich_server).

Is the cli of the docker not kept up up-to-date?

— Reply to this email directly, view it on GitHub https://github.com/immich-app/immich/issues/8092#issuecomment-2010568253, or unsubscribe https://github.com/notifications/unsubscribe-auth/AXWEMYLPD6L5JLKX25VJ4QTYZHWXRAVCNFSM6AAAAABE7OHGMCVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDAMJQGU3DQMRVGM . You are receiving this because you authored the thread.Message ID: @.***>

kjkent commented 5 months ago

@bo0tzz I am also having this issue using the cli within the immich-server (latest release tag) container itself. Shall I open a new issue or post details here? My uploads have been working until recently.

For reference I'm running:

docker exec -it immich-server bash -c 'immich login-key '"$immich_endpoint"' '"$token"'; immich upload --recursive --album /files_to_upload; immich logout'

where /files_to_upload is a mapped volume, and $immich_endpoint is http://127.0.0.1:3001/api. Thanks in advance for any input/advice.

jrasm91 commented 5 months ago

It looks like the @immich/cli installed on the server is old. It'll be upgraded in the next release. Alternatively you can probably install it yourself with npm i -g @immich/cli@latest

kjkent commented 5 months ago

Thanks, @jrasm91 - Can confirm; running immich -V inside the server container returns 2.0.7 -- updated via npm as mentioned and that's worked great! For anyone who might do the same: I had to use docker exec -u 0 -it immich-server bash (the -u 0 argument gives you a root shell) for permissions.

I shall retry my upload now, and thanks again to you + everyone who works on this amazing platform.

Edit: Upload is working perfectly now :)