After Nextcloud update access forbidden (403)

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 13.0.2.1:
Operating system and version (eg, Ubuntu 17.04):
Apache or nginx version (eg, Apache 2.4.25):
PHP version (eg, 7.1):

The issue you are facing:

I started the nextcloud update and now i don’t have any access to my nextcloud anymore.
webbrowser says “Forbidden”.

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

Steps to replicate it:

  1. Start update via Nextcloud updater
  2. wait for question whether to continue in maintenance-mode or not.
  3. choose to continue in web mode.

The output of your Nextcloud log in Admin > Logging:

can't access.

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

<?php
$CONFIG = array (
  'instanceid' => 'id',
  'passwordsalt' => 'password',
  'secret' => 'secret',
  'trusted_domains' => 
  array (
    0 => 'domain',
  ),
  'datadirectory' => '/home/user/data/nextcloud',
  'overwrite.cli.url' => 'domain',
  'dbtype' => 'mysql',
  'version' => '13.0.2.1',
  'dbname' => 'name',
  'dbhost' => 'localhost',
  'dbport' => '',
  'dbtableprefix' => 'oc_',
  'mysql.utf8mb4' => true,
  'dbuser' => 'user',
  'dbpassword' => 'password',
  'installed' => true,
  'maintenance' => false,
  'mail_from_address' => 'cloud',
  'mail_smtpmode' => 'php',
  'mail_smtpauthtype' => 'LOGIN',
  'mail_domain' => 'domain',
  'theme' => '',
  'loglevel' => 2,
  'updater.secret' => 'secret',
);

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

does not exist.

To which version did you want to update?
Check for more logs on your server. The updater automatically downloads new files, extracts them, puts current thing in backup-folders, there is probably a permission missing.

1 Like

ok, i found this in the version.php file:

<?php $OC_Version = array(14,0,3,0); $OC_VersionString = '14.0.3'; $OC_Edition = ''; $OC_Channel = 'stable'; $OC_VersionCanBeUpgradedFrom = array ( 'nextcloud' => array ( '13.0' => true, '14.0' => true, ), 'owncloud' => array ( ), ); $OC_Build = '2018-10-12T06:49:20+00:00 549d53cd93807270a18495a08dac72b24aabf5bb'; $vendor = 'nextcloud';

i think the could have something to do with this:

If you have installed Nextcloud on a subdomain it can happen that the update fails: Access to the UI is not possible and HTTP 403 errors are thrown. In most cases this happens due to wrong SELinux labels which can be fixed with finishing the update via console and setting the labels according the loaded SELinux policy.
(found at my webhoster’s website)

but i still don’t know how to fix it…

This topic is a bit older, but the following may help somebody else looking for a solution.

To fix SELinux labels when nextcloud is in a bad state (403 forbidden) after upgrading on a subdomain run these commands in your nextcloud directory (restorecon -R . is the relevant one):

php occ maintenance:mode --on
php occ upgrade
restorecon -R .
php occ maintenance:mode --off

further reading and references:

This helped me in that exact situation.