nextcloud / twofactor_totp

πŸ”‘ Second factor TOTP (RFC 6238) provider for Nextcloud
https://apps.nextcloud.com/apps/twofactor_totp
GNU Affero General Public License v3.0
282 stars 57 forks source link

Error: This app cannot be enabled because it makes the server unstableβœ– #1527

Closed toczekmj closed 2 months ago

toczekmj commented 2 months ago

Steps to reproduce

  1. Search app in Nextcloud's applications
  2. Click enable
  3. Popup with the following messages pops up: Error: This app cannot be enabled because it makes the server unstableβœ– image

Expected behaviour

App should be enabled

Actual behaviour

Error occurs

Server configuration

Operating system: Operating System: Ubuntu 22.04 Linux 6.8.4-2-pve x86_64 CPU: Intel(R) Core(TM) i7-6700 CPU @ 3.40GHz (8 cores) Memory: 15.50 GB Nextcloud running in docker instance, and so is MariaDB instance

Web server: not sure

Database: MariaDB 10.11.6

PHP version: 8.3.6

Version: (see admin page) Nextcloud Hub 8 (29.0.0)

Updated from an older version or fresh install: Fresh install

List of activated apps: Activity Calendar Collaborative tags Comments Contacts Contacts Interaction Dashboard Deleted files Federation File reminders File sharing Files download limit First run wizard Log Reader Mail Monitoring Nextcoud Announcements Nextcloud Office Notes Notifications Password policy PDF viewer Photos Privacy Recommendations Related Resources Share by mail Support Talk Teams Text Update notification Usage survey User status Versions Weather status

If you have access to your command line run e.g.:
sudo -u www-data php occ app:list
from within your server installation folder

The content of config/config.php:

If you have access to your command line run e.g.:
sudo -u www-data php occ config:list system
from within your Nextcloud installation folder

or

Insert your config.php content here
Make sure to remove all sensitive content such as passwords. (e.g. database password, passwordsalt, secret, smtp password, 
…)

<?php
$CONFIG = array (
  'datadirectory' => '/data',
  'instanceid' => '************',
  'passwordsalt' => '*************',
  'secret' => '************',
  'trusted_domains' =>
  array (
    0 => '192.168.0.186:444',
    1 => 'drive.********.com',
    2 => 'drive.********.duckdns.org',
  ),
  'dbtype' => 'mysql',
  'version' => '29.0.0.19',
  'overwrite.cli.url' => 'https://192.168.0.186:444',
  'dbname' => 'nextcloud',
  'dbhost' => '192.168.0.186:3306',
  'dbport' => '',
  'dbtableprefix' => 'oc_',
  'mysql.utf8mb4' => true,
  'dbuser' => 'nextcloud',
  'dbpassword' => '*****************',
  'installed' => true,
  'memcache.local' => '\\OC\\Memcache\\APCu',
  'filelocking.enabled' => true,
  'memcache.locking' => '\\OC\\Memcache\\APCu',
  'upgrade.disable-web' => true,
);

Client configuration

Browser: Brave

Operating system: MacOS Ventura

Logs

Web server error log
[migrations] started
[migrations] 01-nginx-site-confs-default: skipped
[migrations] 02-default-location: skipped
[migrations] done
usermod: no changes
───────────────────────────────────────
      β–ˆβ–ˆβ•—     β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•—β–ˆβ–ˆβ•— β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•—
      β–ˆβ–ˆβ•‘     β–ˆβ–ˆβ•”β•β•β•β•β•β–ˆβ–ˆβ•‘β–ˆβ–ˆβ•”β•β•β•β–ˆβ–ˆβ•—
      β–ˆβ–ˆβ•‘     β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•—β–ˆβ–ˆβ•‘β–ˆβ–ˆβ•‘   β–ˆβ–ˆβ•‘
      β–ˆβ–ˆβ•‘     β•šβ•β•β•β•β–ˆβ–ˆβ•‘β–ˆβ–ˆβ•‘β–ˆβ–ˆβ•‘   β–ˆβ–ˆβ•‘
      β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•—β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•‘β–ˆβ–ˆβ•‘β•šβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•”β•
      β•šβ•β•β•β•β•β•β•β•šβ•β•β•β•β•β•β•β•šβ•β• β•šβ•β•β•β•β•β•
   Brought to you by linuxserver.io
───────────────────────────────────────
To support LSIO projects visit:
https://www.linuxserver.io/donate/
───────────────────────────────────────
GID/UID
───────────────────────────────────────
User UID:    1000
User GID:    1000
───────────────────────────────────────
using keys found in /config/keys
System config value memcache.local set to string \OC\Memcache\APCu
System config value filelocking.enabled set to boolean true
System config value memcache.locking set to string \OC\Memcache\APCu
System config value upgrade.disable-web set to boolean true
Removing richdocumentscode
[custom-init] No custom files found, skipping...
[ls.io-init] done.
Server log (data/nextcloud.log)
https://pastebin.com/raw/cFLDYSBq
Browser log
Insert your browser log here, this could for example include:

a) The javascript console log
nothing to see there 
b) The network log
https://drive.google.com/file/d/152NL3nsoJA26PQL9VX_YMx6SMWtov1KX/view?usp=sharing
toczekmj commented 2 months ago

In case someone is facing the same problem, seems that I've just found a solution. In my case it was simple setup:

Even tho the NGINX proxy seemd to be configured properly for both cloudflare, and duckdns, the issue only exists on the address2.duckdns (which i have been using all the time while testing, since it is the one configured to work from the inside of my network). So to conclude, the solution was to simply access nextcloud apps and install TOTP using the public domain, and after that TOTP works like a charm, even when accessing nextcloud from local domain.