TrueNAS - Nextcloud Plugin - 301 error (ERR_TOO_MANY_REDIRECTS)

Support intro

Sorry to hear you’re facing problems :slightly_frowning_face:

help.nextcloud.com is for home/non-enterprise users. If you’re running a business, paid support can be accessed via portal.nextcloud.com where we can ensure your business keeps running smoothly.

In order to help you as quickly as possible, before clicking Create Topic please provide as much of the below as you can. Feel free to use a pastebin service for logs, otherwise either indent short log examples with four spaces:

example

Or for longer, use three backticks above and below the code snippet:

longer
example
here

Some or all of the below information will be requested if it isn’t supplied; for fastest response please provide as much as you can :heart:

Nextcloud version (eg, 20.0.5): 20.0.3
Operating system and version (eg, Ubuntu 20.04): TrueNAS - 12.0
Apache or nginx version (eg, Apache 2.4.25): nginx/1.20.1
PHP version (eg, 7.4):

The issue you are facing:

  • My setup is as follows, I had Nextcloud running as a plugin on FreeNAS system with pFsense managing the access of nextcloud from external to my network through HAProxy and SSL certificates.
  • This was working fine until I decided to move from FreeNAS to TrueNAS and update the plugin to the latest 23.0.2 version.
  • The update of the plugin caused a few issues so I decided to start from scratch and did a clean install.
  • Once the clean install was done I migrated my config.php setting over and through everything would be fine… nop.
  • Since the update I have not been able access my nextcloud instance from external to my nextcloud, keep getting “ERR_TOO_MANY_REDIRECTS”.
  • I’ve tried a few solutions that I have found on the internet with no success.
  • I know my HAProxy and pFsense side of things are ok as I can access another external facing network with out any issues.
  • I can still access the nextcloud instance through the local IP (192.168.240.150) without any issues.

Is this the first time you’ve seen this error? (Y/N): Y

Steps to replicate it:

  1. Updated from FreeNAS 11.3 to TrueNAS 12.0
  2. Updated Nextcloud plugin to 23.0.2

The output of your Nextcloud log in Admin > Logging:

{"reqId":"YM7CAAKMjRLzOg3Au5IV","level":2,"time":"2022-03-22T20:37:41+00:00","remoteAddr":"192.168.250.200","user":"--","app":"no app in context","method":"POST","url":"/login","message":"Login failed: Blue.R (Remote IP: 192.168.250.200)","userAgent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/99.0.4844.74 Safari/537.36","version":"23.0.2.1"}
{"reqId":"B6dwxukUv62Pcp4fUddv","level":2,"time":"2022-03-22T20:37:49+00:00","remoteAddr":"192.168.250.200","user":"--","app":"no app in context","method":"POST","url":"/login","message":"Login failed: Blue.R (Remote IP: 192.168.250.200)","userAgent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/99.0.4844.74 Safari/537.36","version":"23.0.2.1"}

The output of your config.php file in /path/to/nextcloud (make sure you remove any identifiable information!):

<?php
$CONFIG = array (
  'apps_paths' =>
  array (
    0 =>
    array (
      'path' => '/usr/local/www/nextcloud/apps',
      'url' => '/apps',
      'writable' => true,
    ),
    1 =>
    array (
      'path' => '/usr/local/www/nextcloud/apps-pkg',
      'url' => '/apps-pkg',
      'writable' => false,
    ),
  ),
  'logfile' => '/var/log/nextcloud/nextcloud.log',
  'memcache.local' => '\\OC\\Memcache\\APCu',
  'one-click-instance' => true,
  'one-click-instance.user-limit' => 100,
  'memcache.distributed' => '\\OC\\Memcache\\Redis',
  'memcache.locking' => '\\OC\\Memcache\\Redis',
  'redis' =>
  array (
    'host' => 'localhost',
  ),
  'passwordsalt' => '**redacted**',
  'secret' => '**redacted**',
  'trusted_domains' =>
  array (
    0 => 'localhost',
    1 => '192.168.240.140',
    2 => '192.168.240.150',
    3 => 'vgnextcloud.mywire.org',
    4 => 'https://test.mywire.org',
  ),
  'datadirectory' => '/usr/local/www/nextcloud/data',
  'dbtype' => 'mysql',
  'version' => '23.0.2.1',
  'overwrite.cli.url' => 'http://localhost',
  'overwriteprotocol' => 'https',
  'dbname' => 'nextcloud',
  'dbhost' => 'localhost',
  'dbport' => '',
  'dbtableprefix' => 'oc_',
  'mysql.utf8mb4' => true,
  'dbuser' => 'oc_ncadmin',
  'dbpassword' => '**redacted**',
  'installed' => true,
  'instanceid' => 'oc66j4mw2bpv',
);

The output of your Apache/nginx/system log in /var/log/____:

N\A