Nextcloud è una delle soluzioni open-source più popolari per la gestione e la condivisione dei file in ambienti privati e aziendali. Sebbene offra un’esperienza intuitiva e molte funzionalità avanzate, la sua configurazione e manutenzione possono presentare delle sfide, specialmente per gli utenti meno esperti o quando si lavora in ambienti complessi.
L’obiettivo di questo articolo è fornire una guida pratica per identificare e risolvere i problemi più comuni che gli utenti di Nextcloud possono incontrare. Dal troubleshooting degli errori di connessione al database, fino ai problemi di sincronizzazione e di configurazione del server, ogni sezione offre soluzioni testate e consigli per migliorare l’affidabilità e la sicurezza della piattaforma.
Questo articolo è pensato per amministratori di sistema, utenti avanzati e chiunque voglia ottimizzare l’uso di Nextcloud, garantendo un funzionamento fluido e una gestione efficiente dei dati.
PREREQUISITI
Installazione e Configurazione base di Nextcloud Community Edition su Ubuntu Server 24.04
LISTA DEGLI ERRORI E DEI WARNINGS
Al termine dell’installazione o dell’aggiornamento di Nextcloud potremmo imbatterci in una serie di errori e warning dovuti a configurazioni errate o mancanti
Cliccando su Overview è possibile accedere alla sezione Security & setup warnings dove è possibile visualizzare tutti gli Errori e i Warnings
Di seguito un elenco degli Errori e dei Warnings più comuni con le relative risoluzioni
ERRORI
1 – The PHP memory limit is below the recommended value of 512 MB
Editare il seguente file di configurazione:
0 |
sudo nano /etc/php/8.3/apache2/php.ini |
Individuare nel file le seguenti righe:
0 1 2 |
post_max_size = 8M memory_limit = 128M |
Quindi sostituirle con le seguenti righe:
0 1 2 |
post_max_size = 1G memory_limit = 512M |
Salvare e chiudere il file di configurazione
Editare il seguente file di configurazione:
0 |
sudo nano /etc/php/8.3/cli/php.ini |
Individuare nel file la seguente riga:
0 |
post_max_size = 8M |
Quindi sostituirla con la seguenti riga:
0 |
post_max_size = 1G |
Per rendere effettive le impostazioni riavviare Apache con il comando:
0 |
sudo service apache2 restart |
A questo punto fare un refresh della pagina Security & setup warnings e l’errore dovrebbe essere scomparso
2 – PHP configuration option “output_buffering” must be disabled
Editare i seguenti files di configurazione:
0 1 |
sudo nano /etc/php/8.3/apache2/php.ini sudo nano /etc/php/8.3/cli/php.ini |
Individuare nei files la seguente riga:
0 |
output_buffering = 4096 |
Quindi sostituirla con la seguenti riga:
0 |
;output_buffering = 4096 |
Salvare e chiudere entrambe i file di configurazione
0 |
sudo service apache2 restart |
A questo punto fare un refresh della pagina Security & setup warnings e l’errore dovrebbe essere scomparso
3 – Some files have not passed the integrity check. List of invalid files… Rescan… For more details see the documentation ↗.
Per verificare quali sono i files invalidi cliccare su List of invalid files…
Nel mio caso questo è l’output:
0 1 2 3 4 5 6 7 8 9 10 11 12 |
Technical information ===================== The following list covers which files have failed the integrity check. Please read the previous linked documentation to learn more about the errors and how to fix them. Results ======= - core - FILE_MISSING - .htaccess - .reuse/dep5 - .user.ini |
Quindi i file che Nextcloud non trova sono i seguenti:
- .htaccess
- .reuse/dep5
- .user.ini
In questo caso recuperare il file di installazione utilizzato (latest.zip) quindi estrarlo in una cartella temporanea.
Al termine della decompressione copiare i files e la cartella all’interno del path di Nextcloud (Es: /var/www/html)
Utilizzare WinSCP per copiare il tutto.
Dopo aver terminato la copia fare un refresh della pagina Security & setup warnings e l’errore dovrebbe essere scomparso.
WARNINGS
4 – 3692 errors in the logs since nextcloud
Questa voce rappresenta il numero di log presenti in NextCloud
Se si intende resettare la voce basta procedere alla cancellazione del file nextcloud.log
Il file si trova di default nella cartella di installazione di Nextcloud e quindi al seguente path:
0 |
/var/www/html/data/nextcloud.log |
Fare un refresh della pagina Security & setup warnings e il warning dovrebbe essere scomparso.
5 – Your web server is not properly set up to resolve .well-known
URLs, failed on: /.well-known/webfinger
For more details see the documentation ↗.
Se la tua istanza Nextcloud è installata in una sottocartella chiamata nextcloud e stai utilizzando Apache, crea o modifica il file .htaccess all’interno della directory principale del documento del tuo server Web e aggiungi le seguenti righe:
0 1 2 3 4 5 6 |
<IfModule mod_rewrite.c> RewriteEngine on RewriteRule ^\.well-known/carddav /nextcloud/remote.php/dav [R=301,L] RewriteRule ^\.well-known/caldav /nextcloud/remote.php/dav [R=301,L] RewriteRule ^\.well-known/webfinger /nextcloud/index.php/.well-known/webfinger [R=301,L] RewriteRule ^\.well-known/nodeinfo /nextcloud/index.php/.well-known/nodeinfo [R=301,L] </IfModule> |
Quindi abilitare il mod_rewrite in Apache con il comando:
0 |
sudo a2enmod rewrite |
Quindi aggiornare il file di configurazione di Apache con il comando:
0 |
sudo nano /etc/apache2/sites-available/000-default.conf |
Trovare il blocco <Directory /var/www/html> e modifica la direttiva AllowOverride da Nessuno a Tutti. Se la riga non esiste, puoi aggiungerla:
0 1 2 |
<Directory /var/www/html> AllowOverride All </Directory> |
Riavviare Apache per rendere effettive le modifiche con il comando:
0 |
sudo systemctl restart apache2 |
Fare un refresh della pagina Security & setup warnings e il warning dovrebbe essere scomparso.
6 – Your web server is not properly set up to resolve “/ocm-provider/”. This is most likely related to a web server configuration that was not updated to deliver this folder directly. Please compare your configuration against the shipped rewrite rules in “.htaccess” for Apache or the provided one in the documentation for Nginx. On Nginx those are typically the lines starting with “location ~” that need an update. For more details see the documentation ↗.
Posizionarsi nella cartella dove è installato Nextcloud con il comando:
0 |
cd /var/www/html |
quindi eseguire il comando:
0 |
ln -s ocs-provider ocm-provider |
Fare un refresh della pagina Security & setup warnings e il warning dovrebbe essere scomparso.
7 – Server has no maintenance window start time configured. This means resource intensive daily background jobs will also be executed during your main usage time. We recommend to set it to a time of low usage, so users are less impacted by the load caused from these heavy tasks. For more details see the documentation ↗.
Questo warning è relativo alla finestra di manutenzione non configurata in Nextcloud
Editare il file config.php con il comando:
0 |
sudo nano /var/www/html/config/config.php |
Quindi inserire la riga seguente:
0 |
'maintenance_window_start' => 1, |
Salvare e chiudere il file di configurazione
ATTENZIONE: Un valore pari a 1, ad esempio, eseguirà solo questi processi in background tra le 01:00 UTC e le 05:00 UTC
Fare un refresh della pagina Security & setup warnings e il warning dovrebbe essere scomparso.
8 – One or more mimetype migrations are available. Occasionally new mimetypes are added to better handle certain file types. Migrating the mimetypes take a long time on larger instances so this is not done automatically during upgrades. Use the command occ maintenance:repair --include-expensive
to perform the migrations.
Eseguire il comando:
0 |
#!/bin/bash |
Quindi digitare il comando:
0 |
sudo -u www-data php8.3 occ maintenance:repair --include-expensive |
Dovremmo visualizzare il seguente output:
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 |
- Repair MySQL collation - All tables already have the correct collation -> nothing to do - Clean tags and favorites - 0 tags of deleted users have been removed. - 0 tags for delete files have been removed. - 0 tag entries for deleted tags have been removed. - 0 tags with no entries have been removed. - Repair invalid shares - Move .step file of updater to backup location - Add move avatar background job - Add background job - Add preview cleanup background jobs - Migrate oauth2_clients table to nextcloud schema - Update the oauth2_access_tokens table schema. - Update the oauth2_clients table schema. - Delete clients (and their related access tokens) with the redirect_uri starting with oc:// or ending with * - Repair language codes - Add log rotate job - Clear frontend caches - Image cache cleared - JS cache cleared - Clear every generated avatar - Add preview background cleanup job - Queue a one-time job to cleanup old backups of the updater - Cleanup invalid photocache files for carddav - Add background job to cleanup login flow v2 tokens - Remove potentially over exposing share links - No need to remove link shares. - Clear access cache of projects - Reset generated avatar flag - Keep legacy encryption enabled - Check encryption key format - Remove old dashboard app config data - Add job to cleanup the bruteforce entries - Queue a one-time job to check for user uploaded certificates - Repair DAV shares - Add background job to set the lookup server share state for users - Add token cleanup job - Clean up abandoned apps - Add possibly missing system config - Add AI tasks cleanup jobs - Queue a job to generate metadata - migrate lazy config values - Cache logo dimension to fix size in emails on Outlook - Theming is not used to provide a logo - Remove legacy ".ocdata" file - Add cleanup-deleted-users background job - Remove shares of old group memberships - Repair mime types - Validate the phone number and store it in a known format for search - WARNING: Can not validate phone numbers without `default_phone_region` being set in the config file - Handle outdated scheduling events - Cleaning up old scheduling events - Adding background job to delete old scheduling objects - AppAPI Daemons configuration GPU params update - Daemons configuration GPU params updated: 0 - Fix component of birthday calendars - 1 birthday calendars updated. - Regenerating birthday calendars to use new icons and fix old birthday events without year - Adding background jobs to regenerate birthday calendar - Fix broken values of calendar objects 0 [->--------------------------] - Registering building of calendar search index as background job - Add background job - Register building of social profile search index as background job - Add background job - Registering background jobs to update cache for webcal calendars - Added 0 background jobs to update webcal calendars - Registering building of calendar reminder index as background job - Add background job - Clean up orphan event and contact data - 0 events without a calendar have been cleaned up - 0 properties without an events have been cleaned up - 0 changes without a calendar have been cleaned up - 0 cached events without a calendar subscription have been cleaned up - 0 changes without a calendar subscription have been cleaned up - 0 contacts without an addressbook have been cleaned up - 0 properties without a contact have been cleaned up - 0 changes without an addressbook have been cleaned up - Remove activity entries of private events - Removed 0 activity entries - Clean up old calendar subscriptions from deleted users that were not cleaned-up 0 [----->----------------------] - 0 calendar subscriptions without an user have been cleaned up - Remove invalid object properties - 0 invalid object properties removed. - Fix the share type of guest shares when migrating from ownCloud - Copy the share password into the dedicated column - Set existing shares as accepted - Clean up meta table - Show a hint about the new editor to existing users - Update OAuth token expiration times - init metadata - Switches from default updater server to the customer one if a valid subscription is available - Send an admin notification if monthly report is disabled - Force-reset all Text document sessions - Initialize migration of background images from dashboard to theming app - Add background job to check for backup codes - Populating added database structures for workflows |
Fare un refresh della pagina Security & setup warnings e il warning dovrebbe essere scomparso.
9 – Detected some missing optional indices. Occasionally new indices are added (by Nextcloud or installed applications) to improve database performance. Adding indices can sometimes take awhile and temporarily hurt performance so this is not done automatically during upgrades. Once the indices are added, queries to those tables should be faster. Use the command occ db:add-missing-indices
to add them. Missing indices: “systag_by_objectid” in table “systemtag_object_mapping”. For more details see the documentation ↗.
Eseguire il comando:
0 |
#!/bin/bash |
Quindi digitare il comando:
0 |
sudo -u www-data php8.3 occ db:add-missing-indices |
Dovremmo visualizzare il seguente output:
0 1 |
Adding additional systag_by_objectid index to the oc_systemtag_object_mapping table, this can take some time... oc_systemtag_object_mapping table updated successfully. |
Fare un refresh della pagina Security & setup warnings e il warning dovrebbe essere scomparso.
10 – Some headers are not set correctly on your instance – The Strict-Transport-Security
HTTP header is not set (should be at least 15552000
seconds). For enhanced security, it is recommended to enable HSTS. For more details see the documentation ↗.
Sebbene il reindirizzamento di tutto il traffico verso HTTPS sia positivo, potrebbe non impedirlo completamente attacchi man-in-the-middle.
Pertanto, gli amministratori sono incoraggiati a impostare il protocollo HTTP Strict Transport Security, che indica ai browser di non consentire alcun connessione all’istanza Nextcloud tramite HTTP e tenta di impedire al sito visitatori di ignorare gli avvisi di certificati non validi.
Ciò può essere ottenuto impostando le seguenti impostazioni all’interno di Apache File VirtualHost:
0 1 2 3 4 5 |
<VirtualHost *:443> ServerName cloud.nextcloud.com <IfModule mod_headers.c> Header always set Strict-Transport-Security "max-age=15552000; includeSubDomains" </IfModule> </VirtualHost> |
0 |
sudo nano /etc/apache2/sites-available/000-default.conf |
Riavviare Apache per applicare la configurazione con il comando:
0 |
sudo systemctl restart apache2 |
Fare un refresh della pagina Security & setup warnings e il warning dovrebbe essere scomparso.
11 – The PHP module “imagick” in this instance has no SVG support. For better compatibility it is recommended to install it. For more details see the documentation ↗.
Innanzitutto, aggiornare i repository dei pacchetti e installare ImageMagick utilizzando i seguenti comandi:
0 1 |
sudo apt-get update sudo apt-get install -y imagemagick |
Dopo aver installato ImageMagick, installare l’estensione PHP Imagick. Installare le dipendenze necessarie e l’estensione utilizzando i comandi seguenti:
0 |
sudo apt-get install -y php-imagick |
Abilitare l’estensione PHP Imagick con il comando:
0 |
sudo phpenmod imagick |
Per finalizzare l’installazione, riavviare il server web Apache per caricare l’estensione PHP Imagick:
0 |
sudo systemctl restart apache2 |
Fare un refresh della pagina Security & setup warnings e il warning dovrebbe essere scomparso.
12 – Your installation has no default phone region set. This is required to validate phone numbers in the profile settings without a country code. To allow numbers without a country code, please add “default_phone_region” with the respective ISO 3166-1 code of the region to your config file. For more details see the documentation ↗.
Editare il file di configurazione config.php con il comando:
0 |
sudo nano /var/www/html/config/config.php |
Quindi aggiungere le seguenti righe:
0 1 |
'default_phone_region' => 'IT', 'default_timezone' => 'Europe/Rome', |
Salvare e chiudere il file di configurazione
Fare un refresh della pagina Security & setup warnings e il warning dovrebbe essere scomparso.
13 – The database is used for transactional file locking. To enhance performance, please configure memcache, if available. For more details see the documentation ↗.
Per configurare memcache sul Database accertarsi di aver installato Redis sul server Nextcloud quindi aggiungere all’interno del file config.php le seguentin righe:
0 1 2 3 4 5 6 |
'memcache.locking' => '\OC\Memcache\Redis', 'redis' => array( 'host' => 'localhost', 'port' => 6379, 'timeout' => 0.0, 'password' => '', // Optional, if not defined no password will be used. ), |
Salvare e chiudere il file di configurazione
Fare un refresh della pagina Security & setup warnings e il warning dovrebbe essere scomparso.
14 – No memory cache has been configured. To enhance performance, please configure a memcache, if available. For more details see the documentation ↗.
Per configurare memcache su NextCloud accertarsi di aver installato Redis sul server Nextcloud quindi aggiungere all’interno del file config.php le seguentin righe:
0 1 2 3 4 5 |
'memcache.local' => '\OC\Memcache\Redis', 'redis' => array ( 'host' => '/var/run/redis/redis.sock', 'port' => 0, 'timeout' => 1.5, ), |
Salvare e chiudere il file di configurazione
Fare un refresh della pagina Security & setup warnings e il warning dovrebbe essere scomparso.
15 – The PHP OPcache module is not properly configured. The OPcache interned strings buffer is nearly full. To assure that repeating strings can be effectively cached, it is recommended to apply “opcache.interned_strings_buffer” to your PHP configuration with a value higher than “8”.. For more details see the documentation ↗.
Questo Warning ci indica che OPCache non è configurato in modo appropriato.
Per risolvere questo problema editare il file php.ini con il comando:
0 |
sudo nano /etc/php/8.2/apache2/php.ini |
quindi individuare la riga:
0 |
opcache.interned_strings_buffer=8 |
e sostituirla con la seguente:
0 |
opcache.interned_strings_buffer=16 |
Riavviare Apache per applicare la configurazione con il comando:
0 |
sudo systemctl restart apache2 |
Fare un refresh della pagina Security & setup warnings e il warning dovrebbe essere scomparso.
Quando tutti gli errori e i warnings saranno risolti
dovremmo visualizzare una schermata come mostrato nell’immagine sovrastante
0 commenti