FreeBSD / Nextcloud 13.0.1 update / "Too many redirects error" bug

Hi everyone,

I had a Nextcloud instance up and running great… since I updated from PHP 7.1.15 to PHP 7.1.16 on my FreeBSD system this afternoon.
Since that update, when I use valid credentials, I get a “Too many redirect” error in my WebServer (apache).

In the data/nextcloud.log, nothing happens.
In the apache logfile, multiple lines repeated only 10 times :
86.247.XX.XX - - [17/Apr/2018:15:52:58 +0200] "GET /index.php/apps/files/ HTTP/1.1" 302 -

I tried to tweak the VirtualHost, and even disabled them to access Nextcloud directly, but the same error triggers…

So it seems to me that PHP 7.1.16 could raise a bug somewhere, but I don’t know how to trace the events to find the bug precisely.

If someone has an idea… :slight_smile:


Leo.

Other informations : I installed OwnCloud in the same environment.
Switched the VirtualHost paths to owncloud instead of nextcloud directory.
Same configuration files, except database informations (built a new one for owncloud).

It’s working…

Seems to be a NextCloud issue with PHP, but logs aren’t very helpful.


Léo.

Another info :
I tried a fresh install with php7.2.4 instead of php7.1.16, same behavior.
I also tried with php56 instead of php7.1.16, now it works…

I don’t know how to investigate any further…


Léo.

And last edit, to close the request for assistance.
Everyone should pay attention to post-install messages.

/!\ NEXTCLOUD 13.0.1 UPDATE /!
The nextcloud 13.0.1 package changes the location of the bundled apps.
After updating to 13.0.1 you MUST adapt your configuration. You MUST
add an additional entry to the “apps-paths” array in config/config.php
1 =>
array (
‘path’ => ‘/usr/local/www/nextcloud/apps-pkg’,
‘url’ => ‘/apps-pkg’,
‘writable’ => false,
),
For the default installation, the fix can be applied with:
cd /usr/local/www/nextcloud
su -m www -c “php ./occ config:import < /usr/local/share/nextcloud/fix-apps_paths.json”

It can save you several hours of digging/tweaking/messing around…


Léo.

1 Like

Hi,

Could you please let me know, where your quoted text is coming from? I can’t find it in the admin guide.
And I’m not sure if I fully understand how exactly I have to change the config.php.

Hi Schmu,

This is from the post-install message from FreeBSD ports tree.
Maybe it’s only FreeBSD-related (but why would it be ?).

To change the config.php safely, I recommend to use the method described, and execute those two commands consecutively :

cd /usr/local/www/nextcloud
su -m www -c “php ./occ config:import &lt; /usr/local/share/nextcloud/fix-apps_paths.json”

It will modify the config.php on its own, and restart your webserver and you’re good to go :slight_smile:

EDIT : I modified the title to highlight better the FreeBSD environment.


Léo.

Oh I see.
The thing is, I don’t have a file fix-apps_paths.json on my server.
Maybe really an issue that effects FreeBSD only.

But thanks for clarifying! :+1:

Schmu,

I think maybe the file is created when installing Nextcloud from ports and not from packages ?
Anyway, here is the content :

{"system": {"apps_paths":
    [
        {
            "path": "\/usr\/local\/www\/nextcloud\/apps",
            "url": "\/apps",
            "writable": true
        },
        {
            "path": "\/usr\/local\/www\/nextcloud\/apps-pkg",
            "url": "\/apps-pkg",
            "writable": false
        }
    ]
}}

And at the end, the config file should look like this :

<?php
$CONFIG = array (
  'instanceid' => 'xx',
  'passwordsalt' => 'xx',
  'secret' => 'xx',
  'trusted_domains' =>
  array (
    0 => 'nextcloud.domain.com',
  ),
  'datadirectory' => '/usr/local/www/nextcloud/data',
  'overwrite.cli.url' => 'https://nextcloud.domain.com',
  'dbtype' => 'mysql',
  'version' => '13.0.1.1',
  'dbname' => 'nextcloud',
  'dbhost' => 'localhost',
  'dbport' => '',
  'dbtableprefix' => 'oc_',
  'mysql.utf8mb4' => true,
  'dbuser' => 'dblogin',
  'dbpassword' => 'dbpass',
  'installed' => true,
  '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,
    ),
  ),
);

Cheers :slight_smile:


Léo.

1 Like