ownCloud client errors after migration: 403 forbidden, 404 not found and 503 service unavailable

I migrated an ownCloud 10.1.0 server between two Ubuntu 18.04 / MySQL 5.7 systems. The owncloud data folder chowned to www-data:www-data.

The problem is that files do not sync:
2019-05-01 22:10:28, , ownCloud,Server replied “503 Service Unavailable” to “PROPFIND https://externalcortex.com/remote.php/dav/uploads/admin/2144752054” (Error: Call to a member function getPath() on boolean)
2019-05-01 22:10:28,Honours/graphs.key, ownCloud,Server replied “503 Service Unavailable” to “PROPFIND https://externalcortex.com/remote.php/dav/uploads/admin/2144752054” (Error: Call to a member function getPath() on boolean)
2019-05-01 22:10:28,Honours/article assignment.pages, ownCloud,Server replied “404 Not Found” to “GET https://externalcortex.com/remote.php/dav/files/admin/Honours/article assignment.pages” (Sabre\DAV\Exception\NotFound)
2019-05-01 22:10:28,Honours/Assignment.docx, ownCloud,Server replied “404 Not Found” to “GET https://externalcortex.com/remote.php/dav/files/admin/Honours/Assignment.docx” (Sabre\DAV\Exception\NotFound)
2019-05-01 22:10:28, Honours/Defence, ownCloud,Server replied “403 Forbidden” to “MKCOL https://externalcortex.com/remote.php/dav/files/admin/Honours/Defence” (skipped due to earlier error, trying again in 30 minute(s))

The following script was executed to address the problem but did not resolve any of the issues: https://doc.owncloud.org/server/10.1/admin_manual/installation/installation_wizard.html

Steps to reproduce

  1. migrate server

Expected behaviour

no errors

Actual behaviour

  • 2 files to be uploaded showing 403 forbidden
  • 2 files to be downloaded showing 404 not found (probably an unrelated issue)
  • 2 files showing 503 service unavailable

Server configuration

Operating system: Ubuntu 18.04

Web server: Apache 2.4

Database: MySQL 5.7

PHP version: 7.2

ownCloud version: 10.1.0

Updated from an older ownCloud or fresh install:, fresh

Where did you install ownCloud from: owncloud.org

Signing status (ownCloud 9.0 and above):

Login as admin user into your ownCloud and access 
http://example.com/index.php/settings/integrity/failed 
paste the results into https://gist.github.com/ and puth the link here.

The content of config/config.php:

{
    "system": {
        "maintenance": false,
        "instanceid": "ock9zdtldw5l",
        "passwordsalt": "***REMOVED SENSITIVE VALUE***",
        "secret": "***REMOVED SENSITIVE VALUE***",
        "trusted_domains": [
            "35.203.118.88",
            "https:\/\/externalcortex.com",
            "externalcortex.com"
        ],
        "datadirectory": "\/var\/www\/data",
        "overwrite.cli.url": "http:\/\/35.203.118.88",
        "dbtype": "mysql",
        "version": "10.1.1.1",
        "dbname": "owncloud",
        "dbhost": "localhost",
        "dbtableprefix": "oc_",
        "mysql.utf8mb4": true,
        "dbuser": "***REMOVED SENSITIVE VALUE***",
        "dbpassword": "***REMOVED SENSITIVE VALUE***",
        "logtimezone": "UTC",
        "installed": true,
        "loglevel": 2,
        "mail_domain": "***REMOVED SENSITIVE VALUE***",
        "mail_from_address": "***REMOVED SENSITIVE VALUE***",
        "mail_smtpmode": "php"
    }
}

Hey,

have you migrated the ownCloud installation / data dir from/to the same location or to a different path?

Hey Tom,
Yes the path has changed.

Hey,

i think the changed path might be the reason for this. From what i have read in the past there are some hardcoded path variables in the ownCloud database which needs to be manually changed if the path has changed.

It seems the ownCloud migration guide has some notes on this:

You must keep the data/ directory’s original file path during the migration. However, you can change it before you begin the migration, or after the migration’s completed.

1 Like

That couldn’t be done in this case. The instance went from a server where the data directory was on the same volume to a new server with an attached volume.

The problem was that the directory paths are hardcoded (or can be) in two tables, oc_storages and oc_accounts. In my case the problem was only in oc_accounts. I ran this MySQL command to update the hardcoded paths:

update oc_accounts set home = replace(home, "/var/www/data", "/data/owncloud-data") where home like "/var/www/data%";

Problem resolved.

Thanks!

1 Like

Yes – looks like we came to the solution at the same time. Thank you!

1 Like