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

Node doesn't work on Gentoo #693

Closed
fr3ddy-sudo opened this issue Feb 19, 2023 · 20 comments
Closed

Node doesn't work on Gentoo #693

fr3ddy-sudo opened this issue Feb 19, 2023 · 20 comments
Labels

Comments

@fr3ddy-sudo
Copy link

fr3ddy-sudo commented Feb 19, 2023

Which version of recognize are you using?

3.5.0

Enabled Modes

Object recognition, Face recognition

TensorFlow mode

Normal mode

Which Nextcloud version do you have installed?

26 beta4

Which Operating system do you have installed?

Gentoo

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

none

How much RAM does your server have?

64GiB

What processor Architecture does your CPU have?

x86_64

Describe the Bug

After instalation of regognize i become the error Failed to install Tensorflow.js:

Manual instalation of tensorflow change nothing

libtensorflow konnte nicht in Node.js geladen werden. Du kannst versuchen, libtensorflow manuell zu installieren oder im WASM-Modus auszuführen.

or

Tensorflow WASM konnte nicht in Node.js geladen werden. Irgendetwas stimmt mit deinem Setup nicht.

Expected Behavior

How i can correct the error?

To Reproduce

Fresh Setup of regognize.

Debug log

Exception: Failed to install Tensorflow.js: # # Fatal error in , line 0 # Check failed: reservation_.SetPermissions(protect_start, protect_size, permission). # # # #FailureMessage Object: 0x7ffd53fac880 1: 0xaa6321 [/var/www/localhost/htdocs/nextcloud/apps/recognize/bin/node] 2: 0x1a3b584 V8_Fatal(char const*, ...) [/var/www/localhost/htdocs/nextcloud/apps/recognize/bin/node] 3: 0xdd081f [/var/www/localhost/htdocs/nextcloud/apps/recognize/bin/node] 4: 0xdf6978 v8::internal::PagedSpace::SetReadAndExecutable() [/var/www/localhost/htdocs/nextcloud/apps/recognize/bin/node] 5: 0xd1f4df v8::internal::Isolate::Init(v8::internal::ReadOnlyDeserializer*, v8::internal::StartupDeserializer*) [/var/www/localhost/htdocs/nextcloud/apps/recognize/bin/node] 6: 0x1130d5b [/var/www/localhost/htdocs/nextcloud/apps/recognize/bin/node] 7: 0xbe2758 v8::Isolate::Initialize(v8::Isolate*, v8::Isolate::CreateParams const&) [/var/www/localhost/htdocs/nextcloud/apps/recognize/bin/node] 8: 0xa78bb9 node::NodeMainInstance::NodeMainInstance(v8::Isolate::CreateParams*, uv_loop_s*, node::MultiIsolatePlatform*, std::vector<std::string, std::allocatorstd::string > const&, std::vector<std::string, std::allocatorstd::string > const&, std::vector<unsigned long, std::allocator > const*) [/var/www/localhost/htdocs/nextcloud/apps/recognize/bin/node] 9: 0xa0174d node::Start(int, char**) [/var/www/localhost/htdocs/nextcloud/apps/recognize/bin/node] 10: 0x7f6535b7334a [/usr/lib64/libc.so.6] 11: 0x7f6535b733fc __libc_start_main [/usr/lib64/libc.so.6] 12: 0x98a4cc [/var/www/localhost/htdocs/nextcloud/apps/recognize/bin/node]
/var/www/localhost/htdocs/nextcloud/apps/recognize/lib/Migration/InstallDeps.php - line 90:

OCA\Recognize\Migration\InstallDeps->runTfjsInstall()

/var/www/localhost/htdocs/nextcloud/lib/private/Repair.php - line 126:

OCA\Recognize\Migration\InstallDeps->run()

/var/www/localhost/htdocs/nextcloud/lib/private/legacy/OC_App.php - line 1077:

OC\Repair->run()

/var/www/localhost/htdocs/nextcloud/lib/private/Installer.php - line 164:

OC_App::executeRepairSteps()

/var/www/localhost/htdocs/nextcloud/apps/settings/lib/Controller/AppSettingsController.php - line 451:

OC\Installer->installApp()

/var/www/localhost/htdocs/nextcloud/lib/private/AppFramework/Http/Dispatcher.php - line 230:

OCA\Settings\Controller\AppSettingsController->enableApps()

/var/www/localhost/htdocs/nextcloud/lib/private/AppFramework/Http/Dispatcher.php - line 137:

OC\AppFramework\Http\Dispatcher->executeController()

/var/www/localhost/htdocs/nextcloud/lib/private/AppFramework/App.php - line 183:

OC\AppFramework\Http\Dispatcher->dispatch()

/var/www/localhost/htdocs/nextcloud/lib/private/Route/Router.php - line 315:

OC\AppFramework\App::main()

/var/www/localhost/htdocs/nextcloud/lib/base.php - line 1050:

OC\Route\Router->match()

/var/www/localhost/htdocs/nextcloud/index.php - line 36:

OC::handleRequest()

@fr3ddy-sudo fr3ddy-sudo added the bug Something isn't working label Feb 19, 2023
@marcelklehr
Copy link
Member

Not sure what's going on there. Likely problem is that the node executable doesn't work on your system. You can try installing node.js on your system manually and then setting the path to it in the recognize settings manually.

@marcelklehr marcelklehr changed the title libtensorflow Node doesn't work on Gentoo Feb 19, 2023
@fr3ddy-sudo
Copy link
Author

fr3ddy-sudo commented Feb 19, 2023

i have also manual on my system installt nodejs 14.21.1
and linkt it on recognize but i become the same error.

Node.js
Node.js {Version} Bibliothek wurde erfolgreich installiert.

it cant read the version of nodejs maybe is this the problem?

the error is with the locale version and the binary version from recognize of nodejs

@fr3ddy-sudo
Copy link
Author

fr3ddy-sudo commented Feb 19, 2023

Strange is on Terminal with
occ recognize:classify

Result for /fr3ddy/files/Photos/2003/P1020124.JPG(oc_tmp_fI3rPB-.jpg) = [{"angle":{"roll":88,"pitch":-37,"yaw":22},"vector":{"0":-0.06637763231992722,"1":0.062204066663980484,"2":0.0713300108909607,"3":-0.035278722643852234,"4":-0.0677230954170227,"5":-0.0676397755742073,"6":0.0005522444844245911,"7":-0.018418073654174805,"8":0.16295194625854492,"9":-0.025026988238096237,"10":0.1957385092973709,"11":-0.017261333763599396,"12":-0.22691281139850616,"13":-0.06142222508788109,"14":-0.015120669268071651,"15":0.09701904654502869,"16":-0.13024206459522247,"17":-0.08729539811611176,"18":-0.12606936693191528,"19":-0.12427869439125061,"20":0.0308418869972229,"21":0.05320034176111221,"22":0.04912058264017105,"23":0.011742860078811646,"24":-0.12911106646060944,"25":-0.24861444532871246,"26":-0.052688680589199066,"27":-0.12753652036190033,"28":0.050745639950037,"29":-0.14891844987869263,"30":-0.0024130684323608875,"31":0.059473101049661636,"32":-0.1384122222661972,"33":-0.05537308007478714,"34":0.04573272168636322,"35":-0.003724861890077591,"36":0.02043531835079193,"37":-0.03372887521982193,"38":0.1920774281024933,"39":-0.04317953810095787,"40":-0.175248384475708,"41":-0.06848357617855072,"42":0.025594841688871384,"43":0.2717212438583374,"44":0.2502259910106659,"45":-0.004867289215326309,"46":-0.0310317724943161,"47":-0.05099007114768028,"48":0.10554765164852142,"49":-0.2750650942325592,"50":0.005543399602174759,"51":0.16656722128391266,"52":0.07084660232067108,"53":0.09352030605077744,"54":0.044275879859924316,"55":-0.1477300375699997,"56":-0.023158859461545944,"57":0.1320151686668396,"58":-0.17401622235774994,"59":0.022286968305706978,"60":0.002630610018968582,"61":-0.12101229280233383,"62":-0.05414152517914772,"63":-0.09807462990283966,"64":0.2041972279548645,"65":0.03847756236791611,"66":-0.16338494420051575,"67":-0.15268570184707642,"68":0.1157340332865715,"69":-0.14434468746185303,"70":0.018455106765031815,"71":0.12069030106067657,"72":-0.1455276906490326,"73":-0.17495429515838623,"74":-0.22407519817352295,"75":0.0779728889465332,"76":0.3764517903327942,"77":0.11026075482368469,"78":-0.16730254888534546,"79":0.03227154165506363,"80":-0.1637476533651352,"81":-0.0194263719022274,"82":-0.04692275822162628,"83":0.026127632707357407,"84":-0.05324243754148483,"85":-0.0011637583374977112,"86":-0.05767718702554703,"87":0.03820103406906128,"88":0.15102078020572662,"89":-0.11934112012386322,"90":0.0069051384925842285,"91":0.17318542301654816,"92":-0.058499060571193695,"93":-0.0010208338499069214,"94":-0.02367120236158371,"95":0.05241946876049042,"96":-0.11576970666646957,"97":0.03871643543243408,"98":-0.08480482548475266,"99":0.016003726050257683,"100":0.048307742923498154,"101":-0.1336154043674469,"102":0.05711165815591812,"103":0.09440502524375916,"104":-0.1811383217573166,"105":0.14913299679756165,"106":-0.0026399344205856323,"107":-0.03953062370419502,"108":-0.005494875833392143,"109":-0.027745507657527924,"110":-0.03651808947324753,"111":-0.061505209654569626,"112":0.18916071951389313,"113":-0.26112374663352966,"114":0.2428864985704422,"115":0.19746410846710205,"116":0.04256533831357956,"117":0.17751769721508026,"118":-0.02029237523674965,"119":0.10799272358417511,"120":-0.021635767072439194,"121":0.01691829413175583,"122":-0.06184516102075577,"123":-0.031116284430027008,"124":0.033209409564733505,"125":-0.01362043060362339,"126":-0.008677927777171135,"127":-0.012752033770084381},"x":0.48515522480010986,"y":0.19037892421086627,"height":0.1347740888595581,"width":0.07740354537963867,"score":0.6622191071510315}]
Face results for 2259 are in
Face score too low. continuing with next face.

it cant find any face but it is running

and now on recognize shows

Bild-Markierung
Gesichtserkennung funktionsfähig.
Gesichtserkennung: 193 Dateien in der Warteschlange:, Letzte Klassifikation: 4 Sekunden her

but on nodejs

Node.js
Node.js {Version} Bibliothek wurde erfolgreich installiert.
libtensorflow konnte nicht in Node.js geladen werden. Du kannst versuchen, libtensorflow manuell zu installieren oder im WASM-Modus auszuführen.

and the Object recognize runs without any problems on the Terminal but not on the Webpage

@marcelklehr
Copy link
Member

So, there's multiple things going on here.

  1. Node.js {Version} Bibliothek wurde erfolgreich installiert.

This means node.js works. (Let's ignore the {Version} thing, that's a translation bug).

  1. libtensorflow konnte nicht in Node.js geladen werden.

This means recognize cannot run in normal mode. But it can run in WASM mode. Which is what it falls back to automatically, if you do nothing.

If you want to you can try installing libtensorflow manually, by running npm ci inside recognize/ directory in your nextcloud apps.

@fr3ddy-sudo
Copy link
Author

libtensorflow konnte nicht in Node.js geladen werden. Du kannst versuchen, libtensorflow manuell zu installieren oder im WASM-Modus auszuführen.

or

Tensorflow WASM konnte nicht in Node.js geladen werden. Irgendetwas stimmt mit deinem Setup nicht.

22:49-root@server:[/var/www/localhost/htdocs/nextcloud]: sudo -u apache php occ app:remove recognize
recognize disabled
recognize 3.5.0 removed
22:49-root@server:[/var/www/localhost/htdocs/nextcloud]: sudo -u apache php occ app:install recognize
recognize 3.5.0 installed
recognize enabled
22:50-root@server:[/var/www/localhost/htdocs/nextcloud]: sudo -u apache php occ recognize:download-models
22:51-root@server:[/var/www/localhost/htdocs/nextcloud]: cd re
remote.php  resources/  
22:51-root@server:[/var/www/localhost/htdocs/nextcloud]: cd apps/recognize/
22:51-root@server:[/var/www/localhost/htdocs/nextcloud/apps/recognize]: npm ci
npm WARN prepare removing existing node_modules/ before installation

22:51-root@server:[/var/www/localhost/htdocs/nextcloud/apps/recognize]: rm -R -f node_modules/
22:52-root@server:[/var/www/localhost/htdocs/nextcloud/apps/recognize]: npm ci

> [email protected] postinstall /var/www/localhost/htdocs/nextcloud/apps/recognize/node_modules/core-js
> node -e "try{require('./postinstall')}catch(e){}"

Thank you for using core-js ( https://github.com/zloirock/core-js ) for polyfilling JavaScript standard library!

The project needs your help! Please consider supporting of core-js:
> https://opencollective.com/core-js 
> https://patreon.com/zloirock 
> bitcoin: bc1qlea7544qtsmj2rayg0lthvza9fau63ux0fstcz 

Also, the author of core-js ( https://github.com/zloirock ) is looking for a good job -)


> [email protected] install /var/www/localhost/htdocs/nextcloud/apps/recognize/node_modules/ffmpeg-static
> node install.js

Downloading ffmpeg 4.4.1 [||||||||||||||||||||] 100% 0.0s 

> @tensorflow/[email protected] install /var/www/localhost/htdocs/nextcloud/apps/recognize/node_modules/@tensorflow/tfjs-node-gpu
> node scripts/install.js gpu download

GPU-linux-4.2.0.tar.gz
* Downloading libtensorflow
https://storage.googleapis.com/tensorflow/libtensorflow/libtensorflow-gpu-linux-x86_64-2.9.1.tar.gz
[==============================] 70760629/bps 100% 0.0s
* Building TensorFlow Node.js bindings

> @tensorflow/[email protected] install /var/www/localhost/htdocs/nextcloud/apps/recognize/node_modules/@tensorflow/tfjs-node
> node scripts/install.js

CPU-linux-4.2.0.tar.gz
* Downloading libtensorflow
https://storage.googleapis.com/tensorflow/libtensorflow/libtensorflow-cpu-linux-x86_64-2.9.1.tar.gz
[==============================] 52042474/bps 100% 0.0s
* Building TensorFlow Node.js bindings

> [email protected] postinstall /var/www/localhost/htdocs/nextcloud/apps/recognize/node_modules/@nextcloud/browser-storage/node_modules/core-js
> node -e "try{require('./postinstall')}catch(e){}"

Thank you for using core-js ( https://github.com/zloirock/core-js ) for polyfilling JavaScript standard library!

The project needs your help! Please consider supporting of core-js:
> https://opencollective.com/core-js 
> https://patreon.com/zloirock 
> bitcoin: bc1qlea7544qtsmj2rayg0lthvza9fau63ux0fstcz 

Also, the author of core-js ( https://github.com/zloirock ) is looking for a good job -)

added 597 packages in 17.774s

after

Node.js
Node.js {Version} Bibliothek wurde erfolgreich installiert.
Tensorflow WASM konnte nicht in Node.js geladen werden. Irgendetwas stimmt mit deinem Setup nicht.
Wenn die mitgelieferte Node.js-Binärdatei aus irgendeinem Grund auf deinem System nicht funktioniert, kannst du den Pfad zu einer benutzerdefinierte node.js-Binärdatei festlegen. Derzeit werden Node v14.17 und neuere v14-Releases unterstützt.
Node.js
Node.js {Version} Bibliothek wurde erfolgreich installiert.
libtensorflow konnte nicht in Node.js geladen werden. Du kannst versuchen, libtensorflow manuell zu installieren oder im WASM-Modus auszuführen.
Wenn die mitgelieferte Node.js-Binärdatei aus irgendeinem Grund auf deinem System nicht funktioniert, kannst du den Pfad zu einer benutzerdefinierte node.js-Binärdatei festlegen. Derzeit werden Node v14.17 und neuere v14-Releases unterstützt.

@fr3ddy-sudo
Copy link
Author

Have anyone an idea?

@marcelklehr
Copy link
Member

Tensorflow WASM konnte nicht in Node.js geladen werden. Irgendetwas stimmt mit deinem Setup nicht.

That's a weird one. Can you try running node recognize/src/test_wasmtensorflow.js manually and see what happens?

@fr3ddy-sudo
Copy link
Author

Hi,
this is whats happend in the console

15:41-root@server:[/var/www/localhost/htdocs/nextcloud/apps]: sudo -u apache /node/bin/node recognize/src/test_wasmtensorflow.js 
15:42-root@server:[/var/www/localhost/htdocs/nextcloud/apps]: 

@marcelklehr
Copy link
Member

Is node/bin/node the binary set in the recognize settings?

@fr3ddy-sudo
Copy link
Author

yes it is set in the recognize settings

@marcelklehr
Copy link
Member

Can you try running sudo -u apache /node/bin/node recognize/src/test_wasmtensorflow.js && echo "Successful!" so we see the exit code?

@fr3ddy-sudo
Copy link
Author

fr3ddy-sudo commented Feb 22, 2023

20:29-root@server:[/var/www/localhost/htdocs/nextcloud/apps]: sudo -u apache /node/bin/node recognize/src/test_wasmtensorflow.js && echo "Successful!"
Successful!
20:30-root@server:[/var/www/localhost/htdocs/nextcloud/apps]: 

@marcelklehr
Copy link
Member

Wow, that means it does actually work. The UI is wrong in displaying "Tensorflow WASM konnte nicht in Node.js geladen werden. Irgendetwas stimmt mit deinem Setup nicht."

I'll have to investigate why that would happen

@fr3ddy-sudo
Copy link
Author

Ok, but face regognize dont run correct, i become none face show.
Object recognize runs without any problem.

@marcelklehr
Copy link
Member

Ok, but face regognize dont run correct, i become none face show.

any error messages in the nextcloud log?

@fr3ddy-sudo
Copy link
Author

fr3ddy-sudo commented Feb 23, 2023

in the logs are no errors

In sql i have in the db oc_recognize_face_detections 4881 rows in set (0,057 sec)

@marcelklehr
Copy link
Member

Face results for 2259 are in
Face score too low. continuing with next face.

This would indicate that face recognition works but just doesn't find any good enough faces.

@marcelklehr
Copy link
Member

In sql i have in the db oc_recognize_face_detections 4881 rows in set (0,057 sec)

That's good. What happens if you execute occ recognize:cluster-faces

@fr3ddy-sudo
Copy link
Author

when i run sudo -u apache php occ recognize:cluster-faces

come the error:

13:30-root@server:[/var/www/localhost/htdocs/nextcloud]: sudo -u apache php occ recognize:cluster-faces
Clustering face detections for user fr3ddy
ClusterDebug: Retrieving face detections for user fr3ddy
ClusterDebug: Found 4577 unclustered detections. Calculating clusters.
An unhandled exception has been thrown:
Error: Call to undefined method Rubix\ML\Datasets\Labeled::features() in /var/www/localhost/htdocs/nextcloud/apps/recognize/lib/Clustering/DualTreeBall.php:107
Stack trace:
#0 /var/www/localhost/htdocs/nextcloud/apps/recognize/lib/Clustering/MrdBallTree.php(632): OCA\Recognize\Clustering\DualTreeBall::split()
#1 /var/www/localhost/htdocs/nextcloud/apps/recognize/lib/Clustering/MstSolver.php(22): OCA\Recognize\Clustering\MrdBallTree->grow()
#2 /var/www/localhost/htdocs/nextcloud/apps/recognize/lib/Clustering/HDBSCAN.php(90): OCA\Recognize\Clustering\MstSolver->__construct()
#3 /var/www/localhost/htdocs/nextcloud/apps/recognize/lib/Service/FaceClusterAnalyzer.php(73): OCA\Recognize\Clustering\HDBSCAN->__construct()
#4 /var/www/localhost/htdocs/nextcloud/apps/recognize/lib/Command/ClusterFaces.php(62): OCA\Recognize\Service\FaceClusterAnalyzer->calculateClusters()
#5 /var/www/localhost/htdocs/nextcloud/3rdparty/symfony/console/Command/Command.php(255): OCA\Recognize\Command\ClusterFaces->execute()
#6 /var/www/localhost/htdocs/nextcloud/3rdparty/symfony/console/Application.php(1009): Symfony\Component\Console\Command\Command->run()
#7 /var/www/localhost/htdocs/nextcloud/3rdparty/symfony/console/Application.php(273): Symfony\Component\Console\Application->doRunCommand()
#8 /var/www/localhost/htdocs/nextcloud/3rdparty/symfony/console/Application.php(149): Symfony\Component\Console\Application->doRun()
#9 /var/www/localhost/htdocs/nextcloud/lib/private/Console/Application.php(215): Symfony\Component\Console\Application->run()
#10 /var/www/localhost/htdocs/nextcloud/console.php(100): OC\Console\Application->run()
#11 /var/www/localhost/htdocs/nextcloud/occ(11): require_once('...')
#12 {main}

@marcelklehr
Copy link
Member

Call to undefined method Rubix\ML\Datasets\Labeled::features()

Aha! That's a known issue: #676

Will be fixed soon.

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

No branches or pull requests

2 participants