Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Internal Server Error in admin panel / {"Exception":"Error","Message":"Class \"CnnFaceDetection\" not found" #704

Closed
marcopolousa opened this issue Oct 16, 2023 · 17 comments

Comments

@marcopolousa
Copy link

Admin page should load normally, but instead, it generates an internal server error.

Ubuntu 22.04 installation with Nextcloud 27.1.2
php 8,2 installed via: sudo add-apt-repository ppa:ondrej/php
nginx and postgres;l
pdlib version 1.1.0 installed with

cd ~
git clone https://github.com/goodspb/pdlib.git
cd pdlib
phpize
PKG_CONFIG_PATH=/usr/local/lib/pkgconfig ./configure --enable-debug
make
sudo make install

dlib installed with

cd ~
apt install -y cmake
git clone https://github.com/davisking/dlib.git
cd dlib/dlib
mkdir build
cd build
cmake -DBUILD_SHARED_LIBS=ON ..
apt install -y libopenblas-dev liblapack-dev libavdevice-dev libavfilter-dev libavformat-dev libavcodec-dev libswresample-dev libswscale-dev libavutil-dev
make
sudo make install

pdlib and dlib are functioning correctly based on test script found at https://github.com/matiasdelellis/pdlib-min-test-suite

Models 1-4 are installed, and all models have been chosen as default, but error message is the same.
Memory and other options have been made using 'occ' command line tool.
Personal option page for Face Recognition is working correctly, and "Analyze my images" option is selected.
Admin page for Face Recognition results in error message:

_Internal Server Error

The server was unable to complete your request.

If this happens again, please send the technical details below to the server administrator.

More details can be found in the server log.
Technical details

Remote Address: 102.129.152.203
Request ID: YzNb5zMdNODleUlu6pc2_

Unable to configure the temporary area for image processing due to admin page not being accessible, resulting in this error:

sudo -u www-data php /var/www/html/nextcloud/occ face:background_job

_1/8 - Executing task CheckRequirementsTask (Check all requirements)
Seems that still don't configured the image area used for temporary files.
Please read the documentation about this: https://github.com/matiasdelellis/facerecognition/wiki/Settings#temporary-files
and then configure it in the admin panel to continue

Fill an issue here if that doesn't help: https://github.com/matiasdelellis/facerecognition/issues
Task CheckRequirementsTask signalled we should not continue, bailing out_
set up face recognition settings_

sudo -u www-data php /var/www/html/nextcloud/occ app:install facerecognition --force
sudo -u www-data php /var/www/html/nextcloud/occ app:enable facerecognition --force
sudo -u www-data php /var/www/html/nextcloud/occ face:setup -M 7.5G
sudo -u www-data php /var/www/html/nextcloud/occ face:setup --model 1
sudo -u www-data php /var/www/html/nextcloud/occ face:setup --model 2
sudo -u www-data php /var/www/html/nextcloud/occ face:setup --model 3
sudo -u www-data php /var/www/html/nextcloud/occ face:setup --model 4
sudo -u www-data php /var/www/html/nextcloud/occ config:app:set facerecognition sensitivity --value 0.4
sudo -u www-data php /var/www/html/nextcloud/occ config:app:set facerecognition max_image_area --value 786432
sudo -u www-data php /var/www/html/nextcloud/occ config:app:set facerecognition handle_external_files --value true
sudo -u www-data php /var/www/html/nextcloud/occ config:app:set facerecognition handle_shared_files --value false
sudo -u www-data php /var/www/html/nextcloud/occ config:app:set facerecognition min_image_size --value 128

Nextcloud logs show:

"File":"/var/www/html/nextcloud/lib/private/AppFramework/Http/Dispatcher.php","Line":169,"Previous":{"Exception":"Error","Message":"Class "CnnFaceDetection" not found","Code":0,"Trace":[{"file":"/var/www/html/nextcloud/apps/facerecognition/lib/Settings/Admin.php","line":81,"function":"open","class":"OCA\FaceRecognition\Model\DlibCnnModel\DlibCnnModel","type":"->"},{"file":"/var/www/html/nextcloud/apps/settings/lib/Controller/CommonSettingsTrait.php","line":129,"function":"getForm","class":"OCA\FaceRecognition\Settings

@ExionDev
Copy link

Im having the same issue

@riveragluis
Copy link

Same issue. Any solution or walk around?

@lelehier
Copy link

same here :(

@Erreur32
Copy link

Erreur32 commented Nov 6, 2023

Same issue

pdlib and dlib are functioning correctly based on test script found at https://github.com/matiasdelellis/pdlib-min-test-suite

Is working also.

@javiersteg
Copy link

javiersteg commented Nov 14, 2023

Same issue. pdlib test works fine:
Exception: Class "CnnFaceDetection" not found in file '/var/www/nextcloud/apps/facerecognition/lib/Model/DlibCnnModel/DlibCnnModel.php' line 179

Using -m 3 on the occ tool to change the method.
Class "FaceLandmarkDetection" not found in file '/var/www/nextcloud/apps/facerecognition/lib/Model/DlibHogModel/DlibHogModel.php'

I'm not sure if putting thoose errors helps.

@ezmanboy
Copy link

same here :(

@kidfruit
Copy link

kidfruit commented Nov 30, 2023

same issue

ubuntu 22.04
php8.1
nextcloud 27.1.4
facerecognition 0.9.31

@kidfruit
Copy link

kidfruit commented Dec 4, 2023

same issue

ubuntu 22.04 php8.1 nextcloud 27.1.4 facerecognition 0.9.31

I solve this in my server.

Custom install in ubuntu22.04, after installed pdlib, we must add extension=pdlib.so to php.ini
I checked /etc/php/8.1/mod-available, there is pdlib.ini, and has linked to /etc/php/8.1/cli/conf.d and /etc/php/8.1/fpm/conf.d, but in /etc/php/8.1/apache2/conf.d it's not there, so I create a link
ln -s /etc/php/8.1/mods-available/pdlib.ini /etc/php/8.1/apache2/conf.d/20-pdlib.ini

It works.

@brccabral
Copy link

same here, pdlib.ini did not work

Technical details

    Remote Address: 127.0.0.1
    Request ID: ldl72a6wO9TvSgSSKXwX
    Type: Exception
    Code: 0
    Message: Class "CnnFaceDetection" not found in file '/mnt/HDExtra/nextcloud-server/nextcloud/apps/facerecognition/lib/Model/DlibCnnModel/DlibCnnModel.php' line 197
    File: /mnt/HDExtra/nextcloud-server/nextcloud/lib/private/AppFramework/Http/Dispatcher.php
    Line: 169


Trace

#0 /mnt/HDExtra/nextcloud-server/nextcloud/lib/private/AppFramework/App.php(184): OC\AppFramework\Http\Dispatcher->dispatch()
#1 /mnt/HDExtra/nextcloud-server/nextcloud/lib/private/Route/Router.php(315): OC\AppFramework\App::main()
#2 /mnt/HDExtra/nextcloud-server/nextcloud/lib/base.php(1069): OC\Route\Router->match()
#3 /mnt/HDExtra/nextcloud-server/nextcloud/index.php(39): OC::handleRequest()
#4 {main}


Previous

#0 /mnt/HDExtra/nextcloud-server/nextcloud/apps/facerecognition/lib/Settings/Admin.php(81): OCA\FaceRecognition\Model\DlibCnnModel\DlibCnnModel->open()
#1 /mnt/HDExtra/nextcloud-server/nextcloud/apps/settings/lib/Controller/CommonSettingsTrait.php(129): OCA\FaceRecognition\Settings\Admin->getForm()
#2 /mnt/HDExtra/nextcloud-server/nextcloud/apps/settings/lib/Controller/AdminSettingsController.php(86): OCA\Settings\Controller\AdminSettingsController->formatSettings()
#3 /mnt/HDExtra/nextcloud-server/nextcloud/apps/settings/lib/Controller/CommonSettingsTrait.php(149): OCA\Settings\Controller\AdminSettingsController->getSettings()
#4 /mnt/HDExtra/nextcloud-server/nextcloud/apps/settings/lib/Controller/AdminSettingsController.php(71): OCA\Settings\Controller\AdminSettingsController->getIndexResponse()
#5 /mnt/HDExtra/nextcloud-server/nextcloud/lib/private/AppFramework/Http/Dispatcher.php(230): OCA\Settings\Controller\AdminSettingsController->index()
#6 /mnt/HDExtra/nextcloud-server/nextcloud/lib/private/AppFramework/Http/Dispatcher.php(137): OC\AppFramework\Http\Dispatcher->executeController()
#7 /mnt/HDExtra/nextcloud-server/nextcloud/lib/private/AppFramework/App.php(184): OC\AppFramework\Http\Dispatcher->dispatch()
#8 /mnt/HDExtra/nextcloud-server/nextcloud/lib/private/Route/Router.php(315): OC\AppFramework\App::main()
#9 /mnt/HDExtra/nextcloud-server/nextcloud/lib/base.php(1069): OC\Route\Router->match()
#10 /mnt/HDExtra/nextcloud-server/nextcloud/index.php(39): OC::handleRequest()
#11 {main}

@brccabral
Copy link

I was able to make it work. After adding the pdlib.ini I also restarted the php8.1-fpm service

sudo systemctl start php8.1-fpm

My Nginx has to point to the correct socket location

	upstream php-handler {
		server unix:/run/php/php8.1-fpm.sock;
	}

Now it works.

@matiasdelellis
Copy link
Owner

Hi everyone,
Excuse me. I'm very busy. 😞

From what I see in your messages, pdlib is not configured correctly.

Do you all use Ubuntu?
Remember that you must enable pdlib both in the cli and in the server you are using.

https://github.com/matiasdelellis/facerecognition/wiki/PDlib-Installation#pdlib-configuration

@axeljerabek
Copy link

axeljerabek commented Jan 25, 2024

Not Ubuntu, Debian 12 Bookworm here. This seems to have popped up when I upgraded to php8.3
It dies with a segmentation fault.

@axeljerabek
Copy link

It is not php8.3. Also all the older versions do not work for me anymore. Just before anyone tries to install older ones.

@Tux61
Copy link

Tux61 commented Apr 28, 2024

I've had the same problem (debian 12, php8.2)
I had added "pdlib.so" to the php.ini file in the "cli" and "apache2" directories, but I still got the same message.

Then I thought of php.ini in the fpm directory ! And bingo, the problem's been solved !

@CebirSoftware
Copy link

Try to call
sudo phpenmod pdlib
Then restart apache/nginx/php-fpm

@Tux61
Copy link

Tux61 commented Apr 29, 2024

Thank you very much for the reply, but as indicated in my message the problem has been solved by adding "pdlib.so" to the php.ini file in the /etc/php8.2/fpm directory.
Very happy !

@matiasdelellis
Copy link
Owner

I understand that everyone fixed it. In general they are problems with enabling pdlib. 🙈

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests