nextcloud/recognize

can't set image area used for temporary files

Closed this issue ยท 6 comments

Which version of recognize are you using?

7.0.0

Enabled Modes

Face recognition

TensorFlow mode

Normal mode

Downstream App

Memories App

Which Nextcloud version do you have installed?

29.0.1

Which Operating system do you have installed?

docker

Which database are you running Nextcloud on?

MariaDB 10.6

Which Docker container are you using to run Nextcloud? (if applicable)

nextcloud:29-fpm

How much RAM does your server have?

16G

What processor Architecture does your CPU have?

x86_64

Describe the Bug

I've followed the documentation for docker compose :

volumes:
      - type: tmpfs
        target: /tmp:exec

recognize won't process any image and I can't set image area on the admin panel.
the slider shows NaNxNaN (4x3) instead of a value.

I have /tmp:exec as a directory in my container and I think it's looks weird. I wonder if the doc about this docker-compose file is correct :

root@c2e1ab4c5374:/var/www/html# df -h
Filesystem      Size  Used Avail Use% Mounted on
overlay         204G  189G  4.0G  98% /
tmpfs            64M     0   64M   0% /dev
shm              64M     0   64M   0% /dev/shm
tmpfs           7.8G     0  7.8G   0% /tmp:exec
/dev/sda1        15T   13T  1.1T  93% /fatcap
/dev/md0        204G  189G  4.0G  98% /etc/hosts
tmpfs           7.8G     0  7.8G   0% /proc/asound
tmpfs           7.8G     0  7.8G   0% /proc/acpi
tmpfs           7.8G     0  7.8G   0% /sys/firmware
tmpfs           7.8G     0  7.8G   0% /sys/devices/virtual/powercap

I will have a look about the :exec bit in docker doc.

you can find a description of an exact same bug there : https://www.reddit.com/r/NextCloud/comments/yqd74e/nextcloud_face_recognition_cant_set_image_area/

Expected Behavior

recognize should processing images

To Reproduce

Try this docker-compose setup I guess ?

Docker version 26.1.4, build 5650f9b

Debug log

No response

I wonder if it might be related to this issue : docker/compose#9873

I haven't found the correct syntax yet. Anyway the one on the README seems wrong about it.

no success either with

volumes:
      ...
      - type: tmpfs
        target: /tmp
        tmpfs:
          mode: 1777

From inside the container I can add an x bit to a file in /tmp, but still it seems I don't have the permission to execute it :

root@f2a0bf274416:/var/www/html# touch /tmp/test
root@f2a0bf274416:/var/www/html# chmod +x /tmp/test
root@f2a0bf274416:/var/www/html# ls -al /tmp/
total 4
d-wxrwS--t 2 root root   60 Jun 12 11:10 .
drwxr-xr-x 1 root root 4096 Jun 12 11:06 ..
-rwxr-xr-x 1 root root    0 Jun 12 11:10 test
root@f2a0bf274416:/var/www/html# /tmp/test
bash: /tmp/test: Permission denied

Hello ๐Ÿ‘‹

Thank you for taking the time to open this issue with recognize. I know it's frustrating when software
causes problems. You have made the right choice to come here and open an issue to make sure your problem gets looked at
and if possible solved.
I try to answer all issues and if possible fix all bugs here, but it sometimes takes a while until I get to it.
Until then, please be patient.
Note also that GitHub is a place where people meet to make software better together. Nobody here is under any obligation
to help you, solve your problems or deliver on any expectations or demands you may have, but if enough people come together we can
collaborate to make this software better. For everyone.
Thus, if you can, you could also look at other issues to see whether you can help other people with your knowledge
and experience. If you have coding experience it would also be awesome if you could step up to dive into the code and
try to fix the odd bug yourself. Everyone will be thankful for extra helping hands!
One last word: If you feel, at any point, like you need to vent, this is not the place for it; you can go to the forum,
to twitter or somewhere else. But this is a technical issue tracker, so please make sure to
focus on the tech and keep your opinions to yourself. (Also see our Code of Conduct. Really.)

I look forward to working with you on this issue
Cheers ๐Ÿ’™

I was wondering if it would be related with some execution permission, but still no luck with :

services:
  nextcloud:
    ...
    volumes:
     ...
      - tmp:/tmp
 
volumes:
  tmp:
    driver_opts:
      type: tmpfs
      device: tmpfs
      tmpfs-mode: 1777

I wonder if face recognition would not try to get memory_limit settings in a weird way...
according to this documentation e.g. :
https://github.com/matiasdelellis/facerecognition/wiki/PHP-memory_limit

using docker I don't have any "loaded configuration file" :

root@f57cfce659d1:/var/www/html# php --ini                                   
Configuration File (php.ini) Path: /usr/local/etc/php
Loaded Configuration File:         (none)
Scan for additional .ini files in: /usr/local/etc/php/conf.d
Additional .ini files parsed:      /usr/local/etc/php/conf.d/docker-fpm.ini,

Still, memory_limit is defined by an env var in /usr/local/etc/php/nextcloud.ini :

root@f57cfce659d1:/usr/local/etc/php/conf.d# cat nextcloud.ini 
memory_limit=${PHP_MEMORY_LIMIT}
upload_max_filesize=${PHP_UPLOAD_LIMIT}
post_max_size=${PHP_UPLOAD_LIMIT}
root@f57cfce659d1:/usr/local/etc/php/conf.d# php -i | grep memory_limit
memory_limit => 1G => 1G

Sorry right now I don't have the time to check the code in this app I don't know though...

Perhaps @thgoebel knows more as they are the one who changed this.

I wonder if face recognition would not try to get memory_limit settings in a weird way...

This seems not related to recognize? Face_recognition and recognize are two separate apps.