DEV Community

Cover image for Troubleshooting masalah pada Nextcloud
Erol Joudy
Erol Joudy

Posted on • Originally published at blog.erol.dev

Troubleshooting masalah pada Nextcloud

Berikut ini adalah beberapa masalah yang sering dihadapi para admin Nextcloud beserta cara penyelesaiannya. Sebab tampilan pada gambar dibawah ini, adalah segalanya.

Nextcloud - All checks passed

Arahan

Dalam artikel ini dituliskan beberapa field seperti ini {TEKS} dalam baris perintah yang akan dijalankan. Berikut keterangan dari field yang muncul, dan apa yang harus dilakukan.

  • {DB_NAME} = ganti ini dengan nama database mysql
  • {DB_USERNAME} = ganti ini dengan username database mysql
  • {USERNAME} = ganti dengan nama user bawaan Nextcloud www-data atau nama user lain yang punya akses di sistem, jika sudah diubah.
  • {PHP_VERSION} = ganti dengan versi PHP yang aktif, contoh format php72. Khusus Centos.
  • URL_NEXTCLOUD = ganti dengan alamat URL instalasi Nextcloud, contoh nextcloud.domain.com

Troubleshooting

Some files have not passed the integrity check

Pesan lengkap problemnya adalah,

Some files have not passed the integrity check. Further information on how to resolve this issue can be found in the documentation.

Cara penyelesaiannya,

  1. Buka link List of invalid files… dan lihat file/folder apa saja yang ditampilkan.
  2. Verifikasi keberadaan file tersebut, jika ditemukan langsung hapus.

MySQL is used as database but does not support 4-byte characters

Pesan lengkap problemnya adalah,

MySQL is used as database but does not support 4-byte characters. To be able to handle 4-byte characters (like emojis) without issues in filenames or comments for example it is recommended to enable the 4-byte support in MySQL. For further details read the documentation page about this.

Cara penyelesaiannya,

  1. Login ke mysql (jgn menggunakan root).
  2. Ketik show variables like 'innodb_file_format'; lalu cek kolom Value apakah = Barracuda. Jika benar, lanjutkan ke langkah nomor 5.
  3. Apabila Value ternyata justru = Antelope atau lainnya, edit konfigurasi file /etc/mysql/conf.d/mysql.cnf, tambahkan kode dibawah ini.
[mysqld]
innodb_large_prefix=true
innodb_file_format=barracuda
innodb_file_per_table=1
Enter fullscreen mode Exit fullscreen mode
  1. Login ke mysql dan cek lagi apakah sudah berubah.
  2. Kalau sudah, jalankan perintah berikut.
ALTER DATABASE {DB_NAME} CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
Enter fullscreen mode Exit fullscreen mode
  1. Keluar dari mysql, jalankan perintah dibawah ini secara berurutan dari dalam path tempat Nextcloud.

Untuk CentOS

sudo -u {USERNAME} /opt/rh/{PHP_VERSION}/root/bin/php occ config:system:set mysql.utf8mb4 --type boolean --value="true"
sudo -u {USERNAME} /opt/rh/{PHP_VERSION}/root/bin/php occ maintenance:repair
Enter fullscreen mode Exit fullscreen mode

Untuk Ubuntu

sudo -u {USERNAME} php occ config:system:set mysql.utf8mb4 --type boolean --value="true"
sudo -u {USERNAME} php occ maintenance:repair
Enter fullscreen mode Exit fullscreen mode

The “X-Content-Type-Options” HTTP header is not set to “nosniff”

Pesan lengkap problemnya adalah,

The "X-Content-Type-Options" HTTP header is not set to "nosniff". This is a potential security or privacy risk, as it is recommended to adjust this setting accordingly.

Cara penyelesaiannya,

  1. Dari terminal, jalankan perintah berikut.
curl -vvv https://URL_NEXTCLOUD
Enter fullscreen mode Exit fullscreen mode
  1. Pastikan entri X-Content-Type-Options: nosniff ada disitu.
  2. Jika ternyata entri tersebut muncul beberapa kali, periksa file /etc/httpd/conf/httpd.conf. Kemungkinan entri ini pernah ada sebagai bagian setting-an dari versi yang lama. Hapus jika ditemukan.

The “X-Robots-Tag” HTTP header is not set to “none”

Pesan lengkap problemnya adalah,

The "X-Robots-Tag" HTTP header is not set to "none". This is a potential security or privacy risk, as it is recommended to adjust this setting accordingly.

Cara penyelesaiannya,

  1. Dari terminal, jalankan perintah berikut.
curl -vvv https://URL_NEXTCLOUD
Enter fullscreen mode Exit fullscreen mode
  1. Pastikan entri X-Robots-Tag: none ada disitu.
  2. Jika ternyata entri tersebut muncul beberapa kali, periksa file /etc/httpd/conf/httpd.conf. Kemungkinan entri ini pernah ada sebagai bagian setting-an dari versi yang lama. Hapus jika ada disitu.

SQLite is currently being used as the backend database

Pesan lengkap problemnya adalah,

SQLite is currently being used as the backend database. For larger installations we recommend that you switch to a different database backend. This is particularly recommended when using the desktop client for file synchronisation. To migrate to another database use the command line tool: 'occ db:convert-type', or see the documentation ↗.

Cara penyelesaiannya,

  1. Buat db mysql baru.
  2. Jalankan perintah berikut pada folder Nextcloud diinstal.

Untuk CentOS

  sudo -u {USERNAME} /opt/rh/{PHP_VERSION}/root/bin/php occ db:convert-type --all-apps mysql {DB_USERNAME} localhost {DB_NAME}
Enter fullscreen mode Exit fullscreen mode

Untuk Ubuntu

  sudo -u {USERNAME} php occ db:convert-type --all-apps mysql {DB_USERNAME} localhost {DB_NAME}
Enter fullscreen mode Exit fullscreen mode
  1. Masukkan pass db jika diminta.

Some columns in the database are missing a conversion to big int.

Pesan lengkap problemnya adalah,

Some columns in the database are missing a conversion to big int. Due to the fact that changing column types on big tables could take some time they were not changed automatically. By running 'occ db:convert-filecache-bigint' those pending changes could be applied manually. This operation needs to be made while the instance is offline. For further details read the documentation page about this.

Cara penyelesaiannya,

Jalankan perintah berikut pada folder Nextcloud diinstal.

Untuk CentOS

sudo -u {USERNAME} /opt/rh/{PVP_VERSION}/root/bin/php occ db:convert-filecache-bigint
Enter fullscreen mode Exit fullscreen mode

Untuk Ubuntu

sudo -u {USERNAME} php occ db:convert-filecache-bigint
Enter fullscreen mode Exit fullscreen mode

The PHP OPcache is not properly configured.

Pesan lengkap problemnya adalah,

The PHP OPcache is not properly configured. For better performance we recommend to use following settings in the php.ini:

Cara penyelesaiannya,

  1. Edit file /etc/opt/rh/{PHP_VERSION}/php.d/10-opcache.ini sesuaikan dengan konfigurasi yang disarankan pada halaman admin Nextcloud.
  2. Jangan lupa aktifkan opcache.enable_cli=1 juga.
  3. Simpan, dan restart dengan systemctl restart httpd.

The database is missing some indexes.

Pesan lengkap problemnya adalah,

The database is missing some indexes. Due to the fact that adding indexes on big tables could take some time they were not added automatically. By running "occ db:add-missing-indices" those missing indexes could be added manually while the instance keeps running. Once the indexes are added queries to those tables are usually much faster.

Cara penyelesaiannya,

Jalankan perintah berikut pada folder Nextcloud diinstal.

Untuk CentOS

sudo -u {USERNAME} /opt/rh/{PHP_VERSION}/root/bin/php occ db:add-missing-indices
Enter fullscreen mode Exit fullscreen mode

Untuk Ubuntu

sudo -u {USERNAME} php occ db:add-missing-indices
Enter fullscreen mode Exit fullscreen mode

The database is missing some optional columns.

Pesan lengkap problemnya adalah,

The database is missing some optional columns. Due to the fact that adding columns on big tables could take some time they were not added automatically when they can be optional. By running "occ db:add-missing-columns" those missing columns could be added manually while the instance keeps running. Once the columns are added some features might improve responsiveness or usability.

Cara penyelesaiannya,

Jalankan perintah berikut pada folder instalasi Nextcloud.

Untuk CentOS

sudo -u {USERNAME} /opt/rh/{PVP_VERSION}/root/bin/php occ db:add-missing-columns
Enter fullscreen mode Exit fullscreen mode

Untuk Ubuntu

sudo -u {USERNAME} php occ db:add-missing-columns
Enter fullscreen mode Exit fullscreen mode

This instance is missing some recommended PHP modules.

Pesan lengkap problemnya adalah,

This instance is missing some recommended PHP modules. For improved performance and better compatibility it is highly recommended to install them.

Cara penyelesaiannya,

  1. Install modul PHP yang diminta. Contoh,

Untuk CentOS

sudo yum install php7.0-gmp -y
Enter fullscreen mode Exit fullscreen mode

Untuk Ubuntu

sudo apt install php7.0-gmp -y
Enter fullscreen mode Exit fullscreen mode
  1. Cari tahu lokasi file php.ini dalam server dengan perintah,
php --ini
Enter fullscreen mode Exit fullscreen mode
  1. Kemudian tambahkan pada file php.ini baris dibawah, pada bagian Dynamic Extension.
extension=php_gmp.so
Enter fullscreen mode Exit fullscreen mode
  1. Langkah terakhir, restart httpd dengan perintah berikut.
systemctl restart httpd
Enter fullscreen mode Exit fullscreen mode

No memory cache has been configured.

Pesan lengkap problemnya adalah,

No memory cache has been configured. To enhance performance, please configure a memcache, if available.

Perhatian:

Menurut dokumentasi Nextcloud , APCu akan menyita resource RAM yang besar, sebaiknya gunakan Redis caching jika memori server < 2GB.

Cara penyelesaiannya,

  1. Untuk server Nextcloud yang berskala small, single server, dengan jumlah user aktif < 10, disarankan untuk menggunakan APCu data cache. Adapun cara instalasinya sebagai berikut.
sudo apt install php7.4-apcu -y
Enter fullscreen mode Exit fullscreen mode
  1. Sesudah instalasi, restart kembali php7.4-fpm dan nginx.
 sudo systemctl restart php7.4-fpm
sudo systemctl restart nginx
Enter fullscreen mode Exit fullscreen mode
  1. Buka file php.ini dengan perintah berikut.
sudo nano /etc/php/7.4/cli/php.ini
Enter fullscreen mode Exit fullscreen mode
  1. Temukan bagian yang bernama Dynamic Extensions, lalu tambahkan baris dibawah ini dalam bagian tersebut.
apc.enable_cli=1
Enter fullscreen mode Exit fullscreen mode
  1. Simpan perubahan pada file itu, dan lanjutkan dengan membuka file config.php Nextcloud.
sudo nano /var/www/nextcloud/config/config.php
Enter fullscreen mode Exit fullscreen mode
  1. Salin dan tambahkan baris dibawah ini kedalam file tersebut.
'memcache.local' => '\OC\Memcache\APCu',
Enter fullscreen mode Exit fullscreen mode
  1. Simpan perubahan terhadap file tersebut, dan ulangi restart php7.4-fpm dan nginx.
 sudo systemctl restart php7.4-fpm
sudo systemctl restart nginx
Enter fullscreen mode Exit fullscreen mode

Untuk server Nextcloud dengan skala medium dan besar, disarankan untuk mengkombinasikan penggunaan APCu + Redis. Adapun cara instalasi Redis bisa dilihat pada artikel panduan Redis oleh Tech and Me .

Oldest comments (0)