After upgrade can't login anymore

Steps to reproduce

  1. Access my Owncloud Server (SERVER.FQDN/owncloud)
  2. Enter User / Pass (Normal user or Admin user)
  3. Got from SERVER_FQDN/owncloud/index.php/login: “This page isn’t working - HTTP ERROR 500”

Expected behaviour

Should be able to authenticate and access files.

Actual behaviour

HTTP ERROR 500

Server configuration

Operating system:
Fedora 28
Linux cloud.home 4.17.14-202.fc28.x86_64 #1 SMP Wed Aug 15 12:29:25 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux

Web server:
httpd -v
Server version: Apache/2.4.34 (Fedora)
Server built: Jul 20 2018 10:29:32

Database:

mysql -V

mysql Ver 15.1 Distrib 10.2.16-MariaDB, for Linux (x86_64) using readline 5.1

PHP version:
PHP Version => 7.2.8

ownCloud version: (see ownCloud admin page)

Updated from an older ownCloud or fresh install:
Updated

Where did you install ownCloud from:
DNF Repository

Signing status (ownCloud 9.0 and above):

Cant login as admin

The content of config/config.php:

sudo -u apache php occ config:list system

{
“system”: {
“log_type”: “syslog”,
“datadirectory”: “/var/lib/owncloud/data”,
“updatechecker”: false,
“check_for_working_htaccess”: false,
“asset-pipeline.enabled”: false,
“assetdirectory”: “/var/lib/owncloud”,
“preview_libreoffice_path”: “/usr/bin/libreoffice”,
“apps_paths”: [
{
“path”: “/usr/share/owncloud/apps”,
“url”: “/apps”,
“writable”: false
},
{
“path”: “/var/lib/owncloud/apps”,
“url”: “/apps-appstore”,
“writable”: true
}
],
“instanceid”: “ocg2kkz0oit8”,
“passwordsalt”: “REMOVED SENSITIVE VALUE”,
“secret”: “REMOVED SENSITIVE VALUE”,
“trusted_domains”: [
“172.16.10.30”,
“PUBLIC_IP_REMOVED”,
“SERVER_FQDN”
],
“overwrite.cli.url”: “http://172.16.10.30/owncloud”,
“dbtype”: “mysql”,
“version”: “9.1.5.2”,
“dbname”: “owncloud”,
“dbhost”: “localhost”,
“dbtableprefix”: “oc_”,
“dbuser”: “REMOVED SENSITIVE VALUE”,
“dbpassword”: “REMOVED SENSITIVE VALUE”,
“logtimezone”: “UTC”,
“installed”: true
}
}

List of activated apps:

Enabled:

  • activity: 2.3.2
  • comments: 0.3.0
  • configreport: 0.1.1
  • dav: 0.2.7
  • federatedfilesharing: 0.3.0
  • federation: 0.1.0
  • files: 1.5.1
  • files_pdfviewer: 0.8.1
  • files_sharing: 0.10.0
  • files_texteditor: 2.1
  • files_trashbin: 0.9.0
  • files_versions: 1.3.0
  • files_videoplayer: 0.9.8
  • firstrunwizard: 1.1
  • gallery: 15.0.0
  • notifications: 0.3.0
  • provisioning_api: 0.5.0
  • systemtags: 0.3.0
  • templateeditor: 0.1
    Disabled:
  • encryption
  • external
  • files_antivirus
  • files_external
  • user_external
  • user_ldap

Are you using external storage, if yes which one: local/smb/sftp/…

NO

Are you using encryption: yes/no

NO

Are you using an external user-backend, if yes which one: LDAP/ActiveDirectory/Webdav/…

NO

Client configuration

Browser:
Chrome / Firefox

Operating system:
Fedora and RHEL

Logs

Web server error log

tail -20 error_log

AH00558: httpd: Could not reliably determine the server’s fully qualified domain name, using akhome.eufui.blog.br. Set the ‘ServerName’ directive globally to suppress this message
[Thu Aug 23 18:32:35.517728 2018] [lbmethod_heartbeat:notice] [pid 958:tid 140342531012864] AH02282: No slotmem from mod_heartmonitor
[Thu Aug 23 18:32:35.518634 2018] [http2:warn] [pid 958:tid 140342531012864] AH02951: mod_ssl does not seem to be enabled
[Thu Aug 23 18:32:35.521694 2018] [mpm_event:notice] [pid 958:tid 140342531012864] AH00489: Apache/2.4.34 (Fedora) configured – resuming normal operations
[Thu Aug 23 18:32:35.521721 2018] [core:notice] [pid 958:tid 140342531012864] AH00094: Command line: ‘/usr/sbin/httpd -D FOREGROUND’
[Thu Aug 23 18:32:54.920761 2018] [autoindex:error] [pid 1101:tid 140341797705472] [client 172.16.10.51:38004] AH01276: Cannot serve directory /var/www/html/: No matching DirectoryIndex (index.html,index.php) found, and server-generated directory index forbidden by Options directive
[Thu Aug 23 18:40:29.322665 2018] [mpm_event:notice] [pid 958:tid 140342531012864] AH00492: caught SIGWINCH, shutting down gracefully
[Thu Aug 23 18:40:30.820720 2018] [core:notice] [pid 2617:tid 140019412707584] SELinux policy enabled; httpd running as context system_u:system_r:httpd_t:s0
[Thu Aug 23 18:40:30.822648 2018] [suexec:notice] [pid 2617:tid 140019412707584] AH01232: suEXEC mechanism enabled (wrapper: /usr/sbin/suexec)
[Thu Aug 23 18:40:30.859030 2018] [lbmethod_heartbeat:notice] [pid 2617:tid 140019412707584] AH02282: No slotmem from mod_heartmonitor
[Thu Aug 23 18:40:30.859699 2018] [http2:warn] [pid 2617:tid 140019412707584] AH02951: mod_ssl does not seem to be enabled
[Thu Aug 23 18:40:30.862194 2018] [mpm_event:notice] [pid 2617:tid 140019412707584] AH00489: Apache/2.4.34 (Fedora) configured – resuming normal operations
[Thu Aug 23 18:40:30.862229 2018] [core:notice] [pid 2617:tid 140019412707584] AH00094: Command line: ‘/usr/sbin/httpd -D FOREGROUND’
[Thu Aug 23 18:43:49.430750 2018] [mpm_event:notice] [pid 2617:tid 140019412707584] AH00492: caught SIGWINCH, shutting down gracefully
[Thu Aug 23 18:50:09.683086 2018] [core:notice] [pid 3114:tid 140586038094080] SELinux policy enabled; httpd running as context system_u:system_r:httpd_t:s0
[Thu Aug 23 18:50:09.683676 2018] [suexec:notice] [pid 3114:tid 140586038094080] AH01232: suEXEC mechanism enabled (wrapper: /usr/sbin/suexec)
[Thu Aug 23 18:50:09.718041 2018] [lbmethod_heartbeat:notice] [pid 3114:tid 140586038094080] AH02282: No slotmem from mod_heartmonitor
[Thu Aug 23 18:50:09.718583 2018] [http2:warn] [pid 3114:tid 140586038094080] AH02951: mod_ssl does not seem to be enabled
[Thu Aug 23 18:50:09.720534 2018] [mpm_event:notice] [pid 3114:tid 140586038094080] AH00489: Apache/2.4.34 (Fedora) configured – resuming normal operations
[Thu Aug 23 18:50:09.720557 2018] [core:notice] [pid 3114:tid 140586038094080] AH00094: Command line: ‘/usr/sbin/httpd -D FOREGROUND’

ownCloud log (data/owncloud.log)

File is empty
-rw-r–r--. 1 apache apache 0 Jan 20 2018 owncloud.log

ADITIONAL DATA

Looking for some logs I found:

pwd

/var/log/php-fpm
[root@akhome php-fpm]# tail -10 www-error.log
[23-Aug-2018 21:34:46 UTC] PHP Fatal error: Declaration of OC\Files\Storage\Local::copyFromStorage(OCP\Files\Storage $sourceStorage, $sourceInternalPath, $targetInternalPath) must be compatible with OC\Files\Storage\Common::copyFromStorage(OCP\Files\Storage $sourceStorage, $sourceInternalPath, $targetInternalPath, $preserveMtime = false) in /usr/share/owncloud/lib/private/Files/Storage/Local.php on line 42
[23-Aug-2018 21:37:08 UTC] PHP Fatal error: Declaration of OC\Files\Storage\Local::copyFromStorage(OCP\Files\Storage $sourceStorage, $sourceInternalPath, $targetInternalPath) must be compatible with OC\Files\Storage\Common::copyFromStorage(OCP\Files\Storage $sourceStorage, $sourceInternalPath, $targetInternalPath, $preserveMtime = false) in /usr/share/owncloud/lib/private/Files/Storage/Local.php on line 42
[23-Aug-2018 21:37:26 UTC] PHP Fatal error: Declaration of OC\Files\Storage\Local::copyFromStorage(OCP\Files\Storage $sourceStorage, $sourceInternalPath, $targetInternalPath) must be compatible with OC\Files\Storage\Common::copyFromStorage(OCP\Files\Storage $sourceStorage, $sourceInternalPath, $targetInternalPath, $preserveMtime = false) in /usr/share/owncloud/lib/private/Files/Storage/Local.php on line 42
[23-Aug-2018 21:37:56 UTC] PHP Fatal error: Declaration of OC\Files\Storage\Local::copyFromStorage(OCP\Files\Storage $sourceStorage, $sourceInternalPath, $targetInternalPath) must be compatible with OC\Files\Storage\Common::copyFromStorage(OCP\Files\Storage $sourceStorage, $sourceInternalPath, $targetInternalPath, $preserveMtime = false) in /usr/share/owncloud/lib/private/Files/Storage/Local.php on line 42
[23-Aug-2018 21:38:17 UTC] PHP Fatal error: Declaration of OC\Files\Storage\Local::copyFromStorage(OCP\Files\Storage $sourceStorage, $sourceInternalPath, $targetInternalPath) must be compatible with OC\Files\Storage\Common::copyFromStorage(OCP\Files\Storage $sourceStorage, $sourceInternalPath, $targetInternalPath, $preserveMtime = false) in /usr/share/owncloud/lib/private/Files/Storage/Local.php on line 42
[23-Aug-2018 21:38:21 UTC] PHP Fatal error: Declaration of OC\Files\Storage\Local::copyFromStorage(OCP\Files\Storage $sourceStorage, $sourceInternalPath, $targetInternalPath) must be compatible with OC\Files\Storage\Common::copyFromStorage(OCP\Files\Storage $sourceStorage, $sourceInternalPath, $targetInternalPath, $preserveMtime = false) in /usr/share/owncloud/lib/private/Files/Storage/Local.php on line 42
[23-Aug-2018 21:40:39 UTC] PHP Fatal error: Declaration of OC\Files\Storage\Local::copyFromStorage(OCP\Files\Storage $sourceStorage, $sourceInternalPath, $targetInternalPath) must be compatible with OC\Files\Storage\Common::copyFromStorage(OCP\Files\Storage $sourceStorage, $sourceInternalPath, $targetInternalPath, $preserveMtime = false) in /usr/share/owncloud/lib/private/Files/Storage/Local.php on line 42
[23-Aug-2018 21:50:30 UTC] PHP Fatal error: Declaration of OC\Files\Storage\Local::copyFromStorage(OCP\Files\Storage $sourceStorage, $sourceInternalPath, $targetInternalPath) must be compatible with OC\Files\Storage\Common::copyFromStorage(OCP\Files\Storage $sourceStorage, $sourceInternalPath, $targetInternalPath, $preserveMtime = false) in /usr/share/owncloud/lib/private/Files/Storage/Local.php on line 42
[23-Aug-2018 22:02:03 UTC] PHP Fatal error: Declaration of OC\Files\Storage\Local::copyFromStorage(OCP\Files\Storage $sourceStorage, $sourceInternalPath, $targetInternalPath) must be compatible with OC\Files\Storage\Common::copyFromStorage(OCP\Files\Storage $sourceStorage, $sourceInternalPath, $targetInternalPath, $preserveMtime = false) in /usr/share/owncloud/lib/private/Files/Storage/Local.php on line 42
[23-Aug-2018 22:16:26 UTC] PHP Fatal error: Declaration of OC\Files\Storage\Local::copyFromStorage(OCP\Files\Storage $sourceStorage, $sourceInternalPath, $targetInternalPath) must be compatible with OC\Files\Storage\Common::copyFromStorage(OCP\Files\Storage $sourceStorage, $sourceInternalPath, $targetInternalPath, $preserveMtime = false) in /usr/share/owncloud/lib/private/Files/Storage/Local.php on line 42

Not sure if this is related with file /usr/share/owncloud/lib/private/Files/Storage/Local.php

Line 42:

39 /**
40 * for local filestore, we only have to map the paths
41 */
42 class Local extends \OC\Files\Storage\Common {
43 protected $datadir;
44
45 protected $dataDirLength;
46
47 protected $allowSymlinks = false;
48
49 protected $realDataDir;
50
51 public function __construct($arguments) {
52 if (!isset($arguments[‘datadir’]) || !is_string($arguments[‘datadir’])) {
53 throw new \InvalidArgumentException(‘No data directory set for local storage’);
54 }
55 $this->datadir = $arguments[‘datadir’];
56 // some crazy code uses a local storage on root…
57 if ($this->datadir === ‘/’) {
58 $this->realDataDir = $this->datadir;
59 } else {
60 $this->realDataDir = rtrim(realpath($this->datadir), ‘/’) . ‘/’;
61 }
62 if (substr($this->datadir, -1) !== ‘/’) {
63 $this->datadir .= ‘/’;
64 }
65 $this->dataDi
66 }

This was my best guess.

Thanks in advance.

Related with the error I found “https://github.com/nextcloud/server/pull/5072/files” and applied the patch and looks like this is back and working.

So from /usr/share/owncloud/lib/private/Files/Storage/Local.php: Line 412 I changed:

public function copyFromStorage(\OCP\Files\Storage $sourceStorage, $sourceInternalPath, $targetInternalPath) {

TO

   public function copyFromStorage(\OCP\Files\Storage $sourceStorage, $sourceInternalPath, $targetInternalPath, $preserveMtime = false) {

Now it is working like a charm. :wink:

There are several things missing: no information of previous version, no information of current version, no information about the integrity check.

The target fix was there from at least 8 months ago, and it’s unclear if ownCloud released a version with that bug (I’m not going to spend time to investigate this). As far as I know, nothing to do.

Hi @jvillafanez,

In fact it was a bit hard to gather some information because I couldn’t access the server at all. Neither access the Owncloud (Admin or Not).

To give a small background here, the server was a Fedora 26 and was upgraded to Fedora 28. Using DNF and nothing else. The package version is:

rpm -qa | grep -i owncloud
owncloud-mysql-9.1.5-3.fc28.noarch
php-owncloud-tarstreamer-0.1.0-4.fc28.noarch
owncloud-9.1.5-3.fc28.noarch
owncloud-httpd-9.1.5-3.fc28.noarch

Previously I was into

dnf history info 15 | grep -i owncloud
Upgraded owncloud-9.1.5-1.fc26.noarch @fedora/26
Upgraded owncloud-httpd-9.1.5-1.fc26.noarch @fedora/26
Upgraded owncloud-mysql-9.1.5-1.fc26.noarch @fedora/26
Upgraded php-owncloud-tarstreamer-0.1.0-2.fc26.noarch @fedora/26

I need to double check if this patch was applied into Fedora’s package or not. If not it is simple and I will see if I can open a Bugzilla to them just to backport this small patch. So far this was the only thing I noticed that was not working. After change the Local.php file it worked again.

I am not sure if “9.1.5-3” is the last release and if already have the patch or if Fedora missed it when finished the package. But since this is simple to fix should not be a huge problem to backport.

Ok, a couple of problems:

  • 9.1.5 is already obsolete, and 9.1.x isn’t supported any longer. Latest version is 10.0.9 which has the bug fixed
  • If the repo isn’t the official ownCloud repository, I don’t think there is anything that ownCloud can do about it.
1 Like