recognize icon indicating copy to clipboard operation
recognize copied to clipboard

Classifier process output: RangeError [ERR_OUT_OF_RANGE]: The value of "length" is out of range

Open oiwrhnoieajv opened this issue 3 years ago • 7 comments

Describe the bug After finding/searching files, the process will freeze at

Running array (
            0 => '/var/www/nextcloud/apps/recognize/bin//node',
            1 => '/var/www/nextcloud/apps/recognize/src/classifier_imagenet.js',
            2 => '-',
             )

before the following Error occures


    Classifier process output: RangeError [ERR_OUT_OF_RANGE]: The value of "length" is out of range. It must be >= 0 && <=                                   1073741823. Received 1097234836
        at validateOffset (buffer.js:111:3)
        at Function.concat (buffer.js:565:5)
        at PassThrough.stream.getBufferedValue (/var/www/nextcloud/apps/recognize/node_modules/get-stream/buffer-stream.js:45:26)
        at /var/www/nextcloud/apps/recognize/node_modules/get-stream/index.js:44:23
        at processTicksAndRejections (internal/process/task_queues.js:95:5)
        at async Promise.all (index 0)
        at async main (/var/www/nextcloud/apps/recognize/src/classifier_imagenet.js:82:3) {
      code: 'ERR_OUT_OF_RANGE'
    }

    Classifier process output: RangeError [ERR_OUT_OF_RANGE]: The value of "length" is out of range. It must be >= 0 && <=     1073741823. Received 1097234836
        at validateOffset (buffer.js:111:3)
        at Function.concat (buffer.js:565:5)
        at PassThrough.stream.getBufferedValue (/var/www/nextcloud/apps/recognize/node_modules/get-stream/buffer-stream.js:45:26)
        at /var/www/nextcloud/apps/recognize/node_modules/get-stream/index.js:44:23
        at processTicksAndRejections (internal/process/task_queues.js:95:5)
        at async Promise.all (index 0)
        at async main (/var/www/nextcloud/apps/recognize/src/classifier_imagenet.js:82:3) {
      code: 'ERR_OUT_OF_RANGE'
    }

Failed to classify images
Classifier process error

To Reproduce

Steps to reproduce the behavior:

  1. Go to shell
  2. run /occ recognize:classify-images
  3. Wait for processing
  4. See error

Expected behavior Tagging all images

Recognize (please complete the following information):

  • Tensorflow plain mode: JavaScript mode enabled
  • Enabled modes: face, object, landmark

Server (please complete the following information):

  • Nextcloud: [e.g. 21.0.4]
  • 4 GB RAM on Rasberry Pi 4 ( Linux 5.10.92)
  • PHP 8.0

oiwrhnoieajv avatar Feb 06 '22 21:02 oiwrhnoieajv

Which version of recognize is this?

marcelklehr avatar Feb 08 '22 11:02 marcelklehr

Off, this seems to be some limitation of the download library for download sizes more than 1GiB :/

marcelklehr avatar Feb 08 '22 11:02 marcelklehr

same error here on pi4, nextcloud 23.0.2, Apache/2.4.38, PHP 7.3.31-1~deb10u1, Recognize 1.11.0 cli, run classify command results in error:

/occ recognize:classify-images 10711 => '/var/data/admin/files/Video/Wyjazd.Integracyjny 2011 DVDRip.XviD-BiDA FILM POLSKI Upload zaloga TC/GIf....png', ) Running array ( 0 => '/var/www/nextcloud/apps/recognize/bin//node', 1 => '/var/www/nextcloud/apps/recognize/src/classifier_imagenet.js', 2 => '-', ) 0

Classifier process output: RangeError [ERR_OUT_OF_RANGE]: The value of "length" is out of range. It must be >= 0 && <= 1073741823. Received 1097235711 at validateOffset (buffer.js:111:3) at Function.concat (buffer.js:565:5) at PassThrough.stream.getBufferedValue (/var/www/nextcloud/apps/recognize/node_modules/get-stream/buffer-stream.js:45:26) at /var/www/nextcloud/apps/recognize/node_modules/get-stream/index.js:44:23 at processTicksAndRejections (internal/process/task_queues.js:95:5) at async Promise.all (index 0) at async exports.downloadAll (/var/www/nextcloud/apps/recognize/src/model-manager.js:8:2) at async main (/var/www/nextcloud/apps/recognize/src/classifier_imagenet.js:82:3) { code: 'ERR_OUT_OF_RANGE' }

Classifier process output: RangeError [ERR_OUT_OF_RANGE]: The value of "length" is out of range. It must be >= 0 && <= 1073741823. Received 1097235711 at validateOffset (buffer.js:111:3) at Function.concat (buffer.js:565:5) at PassThrough.stream.getBufferedValue (/var/www/nextcloud/apps/recognize/node_modules/get-stream/buffer-stream.js:45:26) at /var/www/nextcloud/apps/recognize/node_modules/get-stream/index.js:44:23 at processTicksAndRejections (internal/process/task_queues.js:95:5) at async Promise.all (index 0) at async exports.downloadAll (/var/www/nextcloud/apps/recognize/src/model-manager.js:8:2) at async main (/var/www/nextcloud/apps/recognize/src/classifier_imagenet.js:82:3) { code: 'ERR_OUT_OF_RANGE' }

Failed to classify images

spicemint avatar Mar 06 '22 22:03 spicemint

@marcelklehr Should we use another library then? I don't know if that's already the "recommended" one, but I see the download parent library that we use hasn't been updated for quite a few years

bonswouar avatar Mar 11 '22 12:03 bonswouar

same error, want to stay updated

droogi avatar Jun 01 '22 18:06 droogi

In the mean time. A temporary workaround is to manually download the library : wget https://github.com/marcelklehr/recognize/archive/refs/tags/v2.2.1.tar.gz (the number is the version number in the package.json file) Extract the files and copy or link to the "models" folder /apps/recognize/model. The process then does not try to download the file.

b4lrog avatar Aug 31 '22 07:08 b4lrog

In v3 you can now download models using an occ command, which should be a simple workaround.

marcelklehr avatar Oct 06 '22 07:10 marcelklehr