Python/BRISQUE : Voir la « qualité » des photos NEXTCLOUD avec un script

C’est pas vraiment top, dès qu’il y a de l’herbe j’ai la valeur > 100. C’était donc une fausse bonne idée …

Voici le script que j’ai fait :

#!/usr/bin/env python3.6
from libsvm import svmutil
from brisque import *
import sys
import os.path
import glob

brisq = BRISQUE()

for filename in glob.iglob('./Nextcloud/Photos/**', recursive=True):
     if (filename.endswith('.jpg')):
         temp=brisq.get_score(filename)
         if (temp > 100):
             print(filename)
             print(temp)

Par exemple : BRISQUE = 107.82606599602599 pour cette photo :

 

NEXTCLOUD : Problème d’index

J’avais l’erreur suivante :

La base de données a quelques index manquants. L’ajout d’index dans de grandes tables peut prendre un certain temps. Elles ne sont donc pas ajoutées automatiquement. En exécutant « occ db:add-missing-indices », ces index manquants pourront être ajoutés manuellement pendant que l’instance continue de tourner. Une fois les index ajoutés, les requêtes sur ces tables sont généralement beaucoup plus rapides.

-Index « fs_id_storage_size » manquant dans la table « oc_filecache ».
-Index « fs_storage_path_prefix » manquant dans la table « oc_filecache ».
-Index « properties_pathonly_index » manquant dans la table « oc_properties ».
-Index « job_lastcheck_reserved » manquant dans la table « oc_jobs ».

J’ai du mal à comprendre pourquoi les index ne sont pas fait automatiquement :

$ sudo -u www-data php8.0 /usr/share/nginx/nextcloud/occ db:add-missing-indice
Check indices of the share table.
Check indices of the filecache table.
Adding additional size index to the filecache table, this can take some time...
Filecache table updated successfully.
Adding additional path index to the filecache table, this can take some time...
Filecache table updated successfully.
Check indices of the twofactor_providers table.
Check indices of the login_flow_v2 table.
Check indices of the whats_new table.
Check indices of the cards table.
Check indices of the cards_properties table.
Check indices of the calendarobjects_props table.
Check indices of the schedulingobjects table.
Check indices of the oc_properties table.
Adding properties_pathonly_index index to the oc_properties table, this can take some time...
oc_properties table updated successfully.
Check indices of the oc_jobs table.
Adding job_lastcheck_reserved index to the oc_jobs table, this can take some time...
oc_properties table updated successfully.

Le problème est maintenant fixé.

NextCloud : Erreur : « Unable to generate a URL for the named route \ »theming.Theming.getImage\ » as such route does not exist. »

Suite à la mise à jours en NextCloud 21.0.4 sur Ubuntu j’ai eu plusieurs erreurs (via la mise à jours sur l’interface):

"Unable to generate a URL for the named route \"theming.Theming.getImage\" as such route does not exist."
"Unable to generate a URL for the named route \"calendar.view.index\" as such route does not exist."
"Unable to generate a URL for the named route \"dashboard.dashboard.index\" as such route does not exist."
"Unable to generate a URL for the named route \"duplicatefinder.page.index\" as such route does not exist."
"Unable to generate a URL for the named route \"notes.page.index\" as such route does not exist."
..

J’ai donc fait le process de mise à jours en ligne de commande :

# sudo -u www-data php /usr/share/nginx/nextcloud/updater/updater.phar
Nextcloud Updater - version: v20.0.0beta4-11-g68fa0d4

Current version is 21.0.4.

Update to Nextcloud 21.0.4 available. (channel: "stable")
Following file will be downloaded automatically: https://download.nextcloud.com/server/releases/nextcloud-21.0.4.zip
Open changelog ↗

Steps that will be executed:
[✔] Check for expected files
[✔] Check for write permissions
[✔] Create backup
[✔] Downloading
[✔] Verify integrity
[✔] Extracting
[✔] Enable maintenance mode
[✔] Replace entry points
[✔] Delete old files
[✔] Move new files in place
[✔] Done

Continue update? [y/N] y
Info: Pressing Ctrl-C will finish the currently running step and then stops the updater.

[✔] Check for expected files
[✔] Check for write permissions
[✔] Create backup
[✔] Downloading
[✔] Verify integrity
[✔] Extracting
[✔] Enable maintenance mode
[✔] Replace entry points
[✔] Delete old files
[✔] Move new files in place
[✔] Done

Update of code successful.

Should the "occ upgrade" command be executed? [Y/n] Y

...
# sudo -u www-data php /usr/share/nginx/nextcloud/occ upgrade
Nextcloud is already latest version

Je pense donc qu’il y avait un problème de mémoire … la version de php est la suivante :

# php --version
PHP 8.0.9 (cli) (built: Jul 30 2021 13:03:39) ( NTS )
Copyright (c) The PHP Group
Zend Engine v4.0.9, Copyright (c) Zend Technologies
    with Zend OPcache v8.0.9, Copyright (c), by Zend Technologies

Quand j’ai regardé les logs : /var/log/php7.3-fpm.log j’avais énormément d’erreur :

WARNING: [pool www] server reached pm.max_children setting (5), consider raising it

Donc NGINX qui utilise 7.3 est limité … j’ai donc changé la configuration et relancé NGINX :

# grep "^pm.max_children" /etc/php/7.3/fpm/pool.d/www.conf 
pm.max_children = 10
# systemctl restart nginx.service

A suivre ….

Nextcloud : Problème dans la rotation des fichiers nextcloud.log

J’ai pas compris pourquoi cela ne fonctionnait pas, donc pour l’instant je fais manuellement …

# du -sh /usr/share/nginx/nextcloud/data/nextcloud.log 
3,5G	/usr/share/nginx/nextcloud/data/nextcloud.log
# du -sh /var/log/nextcloud.log
6,4G	/var/log/nextcloud.log
# sudo -u www-data truncate /usr/share/nginx/nextcloud/data/nextcloud.log --size 0
# sudo -u www-data truncate /var/log/nextcloud.log --size 0
# sudo systemctl restart php8.0-fpm 
# sudo systemctl restart ngnix

A suivre pour une vrai résolution.