Server error on migrated ownCloud installation


#1

Steps to reproduce

  1. Transfer data and config folders from old host (shared on GoDaddy) to new one (Storage VPS, CentOS, already configured)
  2. Install same ownCloud version (9.1.0) on new server.
  3. Move data and config folders to newly installed ownCloud.
  4. Modify ownCloud config file on new server to match it's address and path do data folder.

Expected behaviour

Navigate to the address of the new server where oenCloud is located and login.

Actual behaviour

So, I tried to navigate to the address of the installed ownCloud on the new server and all I see is this message:

Internal Server Error

The server encountered an internal error and was unable to complete your request.
Please contact the server administrator if this error reappears multiple times, please include the technical details below in your report.
More details can be found in the server log.

Server configuration

Operating system: centos-6-x86_64-filer

Web server:

Database: SQLite

PHP version: 5.6

ownCloud version: 9.1.0

Updated from an older ownCloud or fresh install: migrated

Where did you install ownCloud from: Old host on shared server to new host on Storage VPS

Signing status (ownCloud 9.0 and above):

Can't login, ng

The content of config/config.php:

<?php
$CONFIG = array (
  'instanceid' => ' ND ',
  'passwordsalt' => ' ND ',
  'secret' => ' ND ',
  'trusted_domains' => 
  array (
    0 => 'w9z.f.time4vps.cloud',
    1 => 'almafoto.it',
    2 => 'www.almafoto.it',
  ),
 'datadirectory' => '/var/www/html/owncloud/data',
  'overwrite.cli.url' => 'http://w9z.f.time4vps.cloud/owncloud',
  'dbtype' => 'sqlite3',
  'version' => '9.1.0.15',
  'logtimezone' => 'UTC',
  'installed' => true,
  'appstore.experimental.enabled' => true,
  'filesystem_check_changes' => 1,
  'default_language' => 'it',
  'session_keepalive' => true,
  'updater.server.url' => 'https://updates.owncloud.com/server/',
  'maintenance' => false,
);

Report:

An unhandled exception has been thrown:
exception 'PDOException' with message 'SQLSTATE[HY000]: General error: 26 file is encrypted or is not a database' in /var/www/html/owncloud/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOConnection.php:104
Stack trace:
#0 /var/www/html/owncloud/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOConnection.php(104): PDO->query('SELECT * FROM "...')
#1 /var/www/html/owncloud/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Connection.php(833): Doctrine\DBAL\Driver\PDOConnection->query('SELECT * FROM "...')
#2 /var/www/html/owncloud/lib/private/DB/Connection.php(188): Doctrine\DBAL\Connection->executeQuery('SELECT * FROM "...', Array, Array, NULL)
#3 /var/www/html/owncloud/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Query/QueryBuilder.php(206): OC\DB\Connection->executeQuery('SELECT * FROM `...', Array, Array)
#4 /var/www/html/owncloud/lib/private/DB/QueryBuilder/QueryBuilder.php(141): Doctrine\DBAL\Query\QueryBuilder->execute()
#5 /var/www/html/owncloud/lib/private/AppConfig.php(274): OC\DB\QueryBuilder\QueryBuilder->execute()
#6 /var/www/html/owncloud/lib/private/AppConfig.php(77): OC\AppConfig->loadConfigValues()
#7 /var/www/html/owncloud/lib/private/AppConfig.php(253): OC\AppConfig->getApps()
#8 /var/www/html/owncloud/lib/private/legacy/app.php(1080): OC\AppConfig->getValues(false, 'installed_versi...')
#9 /var/www/html/owncloud/lib/private/Server.php(324): OC_App::getAppVersions()
#10 /var/www/html/owncloud/3rdparty/pimple/pimple/src/Pimple/Container.php(113): OC\Server->OC\{closure}(Object(OC\Server))
#11 /var/www/html/owncloud/lib/private/AppFramework/Utility/SimpleContainer.php(102): Pimple\Container->offsetGet('MemCacheFactory')
#12 /var/www/html/owncloud/lib/private/ServerContainer.php(87): OC\AppFramework\Utility\SimpleContainer->query('MemCacheFactory')
#13 /var/www/html/owncloud/lib/private/Server.php(950): OC\ServerContainer->query('MemCacheFactory')
#14 /var/www/html/owncloud/lib/private/Server.php(457): OC\Server->getMemCacheFactory()
#15 /var/www/html/owncloud/3rdparty/pimple/pimple/src/Pimple/Container.php(113): OC\Server->OC\{closure}(Object(OC\Server))
#16 /var/www/html/owncloud/lib/private/AppFramework/Utility/SimpleContainer.php(102): Pimple\Container->offsetGet('AppManager')
#17 /var/www/html/owncloud/lib/private/ServerContainer.php(87): OC\AppFramework\Utility\SimpleContainer->query('AppManager')
#18 /var/www/html/owncloud/lib/private/Server.php(1146): OC\ServerContainer->query('AppManager')
#19 /var/www/html/owncloud/lib/private/legacy/app.php(284): OC\Server->getAppManager()
#20 /var/www/html/owncloud/lib/private/legacy/app.php(105): OC_App::getEnabledApps()
#21 /var/www/html/owncloud/lib/base.php(573): OC_App::loadApps(Array)
#22 /var/www/html/owncloud/lib/base.php(967): OC::init()
#23 /var/www/html/owncloud/console.php(50): require_once('/var/www/html/o...')
#24 /var/www/html/owncloud/occ(11): require_once('/var/www/html/o...')
#25 {main}

Next exception 'Doctrine\DBAL\Driver\PDOException' with message 'SQLSTATE[HY000]: General error: 26 file is encrypted or is not a database' in /var/www/html/owncloud/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOConnection.php:106
Stack trace:
#0 /var/www/html/owncloud/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Connection.php(833): Doctrine\DBAL\Driver\PDOConnection->query('SELECT * FROM "...')
#1 /var/www/html/owncloud/lib/private/DB/Connection.php(188): Doctrine\DBAL\Connection->executeQuery('SELECT * FROM "...', Array, Array, NULL)
#2 /var/www/html/owncloud/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Query/QueryBuilder.php(206): OC\DB\Connection->executeQuery('SELECT * FROM `...', Array, Array)
#3 /var/www/html/owncloud/lib/private/DB/QueryBuilder/QueryBuilder.php(141): Doctrine\DBAL\Query\QueryBuilder->execute()
#4 /var/www/html/owncloud/lib/private/AppConfig.php(274): OC\DB\QueryBuilder\QueryBuilder->execute()
#5 /var/www/html/owncloud/lib/private/AppConfig.php(77): OC\AppConfig->loadConfigValues()
#6 /var/www/html/owncloud/lib/private/AppConfig.php(253): OC\AppConfig->getApps()
#7 /var/www/html/owncloud/lib/private/legacy/app.php(1080): OC\AppConfig->getValues(false, 'installed_versi...')
#8 /var/www/html/owncloud/lib/private/Server.php(324): OC_App::getAppVersions()
#9 /var/www/html/owncloud/3rdparty/pimple/pimple/src/Pimple/Container.php(113): OC\Server->OC\{closure}(Object(OC\Server))
#10 /var/www/html/owncloud/lib/private/AppFramework/Utility/SimpleContainer.php(102): Pimple\Container->offsetGet('MemCacheFactory')
#11 /var/www/html/owncloud/lib/private/ServerContainer.php(87): OC\AppFramework\Utility\SimpleContainer->query('MemCacheFactory')
#12 /var/www/html/owncloud/lib/private/Server.php(950): OC\ServerContainer->query('MemCacheFactory')
#13 /var/www/html/owncloud/lib/private/Server.php(457): OC\Server->getMemCacheFactory()
#14 /var/www/html/owncloud/3rdparty/pimple/pimple/src/Pimple/Container.php(113): OC\Server->OC\{closure}(Object(OC\Server))
#15 /var/www/html/owncloud/lib/private/AppFramework/Utility/SimpleContainer.php(102): Pimple\Container->offsetGet('AppManager')
#16 /var/www/html/owncloud/lib/private/ServerContainer.php(87): OC\AppFramework\Utility\SimpleContainer->query('AppManager')
#17 /var/www/html/owncloud/lib/private/Server.php(1146): OC\ServerContainer->query('AppManager')
#18 /var/www/html/owncloud/lib/private/legacy/app.php(284): OC\Server->getAppManager()
#19 /var/www/html/owncloud/lib/private/legacy/app.php(105): OC_App::getEnabledApps()
#20 /var/www/html/owncloud/lib/base.php(573): OC_App::loadApps(Array)
#21 /var/www/html/owncloud/lib/base.php(967): OC::init()
#22 /var/www/html/owncloud/console.php(50): require_once('/var/www/html/o...')
#23 /var/www/html/owncloud/occ(11): require_once('/var/www/html/o...')
#24 {main}

Next exception 'Doctrine\DBAL\Exception\DriverException' with message 'An exception occurred while executing 'SELECT * FROM "oc_appconfig"':

SQLSTATE[HY000]: General error: 26 file is encrypted or is not a database' in /var/www/html/owncloud/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Driver/AbstractSQLiteDriver.php:85
Stack trace:
#0 /var/www/html/owncloud/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/DBALException.php(116): Doctrine\DBAL\Driver\AbstractSQLiteDriver->convertException('An exception oc...', Object(Doctrine\DBAL\Driver\PDOException))
#1 /var/www/html/owncloud/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Connection.php(836): Doctrine\DBAL\DBALException::driverExceptionDuringQuery(Object(Doctrine\DBAL\Driver\PDOSqlite\Driver), Object(Doctrine\DBAL\Driver\PDOException), 'SELECT * FROM "...', Array)
#2 /var/www/html/owncloud/lib/private/DB/Connection.php(188): Doctrine\DBAL\Connection->executeQuery('SELECT * FROM "...', Array, Array, NULL)
#3 /var/www/html/owncloud/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Query/QueryBuilder.php(206): OC\DB\Connection->executeQuery('SELECT * FROM `...', Array, Array)
#4 /var/www/html/owncloud/lib/private/DB/QueryBuilder/QueryBuilder.php(141): Doctrine\DBAL\Query\QueryBuilder->execute()
#5 /var/www/html/owncloud/lib/private/AppConfig.php(274): OC\DB\QueryBuilder\QueryBuilder->execute()
#6 /var/www/html/owncloud/lib/private/AppConfig.php(77): OC\AppConfig->loadConfigValues()
#7 /var/www/html/owncloud/lib/private/AppConfig.php(253): OC\AppConfig->getApps()
#8 /var/www/html/owncloud/lib/private/legacy/app.php(1080): OC\AppConfig->getValues(false, 'installed_versi...')
#9 /var/www/html/owncloud/lib/private/Server.php(324): OC_App::getAppVersions()
#10 /var/www/html/owncloud/3rdparty/pimple/pimple/src/Pimple/Container.php(113): OC\Server->OC\{closure}(Object(OC\Server))
#11 /var/www/html/owncloud/lib/private/AppFramework/Utility/SimpleContainer.php(102): Pimple\Container->offsetGet('MemCacheFactory')
#12 /var/www/html/owncloud/lib/private/ServerContainer.php(87): OC\AppFramework\Utility\SimpleContainer->query('MemCacheFactory')
#13 /var/www/html/owncloud/lib/private/Server.php(950): OC\ServerContainer->query('MemCacheFactory')
#14 /var/www/html/owncloud/lib/private/Server.php(457): OC\Server->getMemCacheFactory()
#15 /var/www/html/owncloud/3rdparty/pimple/pimple/src/Pimple/Container.php(113): OC\Server->OC\{closure}(Object(OC\Server))
#16 /var/www/html/owncloud/lib/private/AppFramework/Utility/SimpleContainer.php(102): Pimple\Container->offsetGet('AppManager')
#17 /var/www/html/owncloud/lib/private/ServerContainer.php(87): OC\AppFramework\Utility\SimpleContainer->query('AppManager')
#18 /var/www/html/owncloud/lib/private/Server.php(1146): OC\ServerContainer->query('AppManager')
#19 /var/www/html/owncloud/lib/private/legacy/app.php(284): OC\Server->getAppManager()
#20 /var/www/html/owncloud/lib/private/legacy/app.php(105): OC_App::getEnabledApps()
#21 /var/www/html/owncloud/lib/base.php(573): OC_App::loadApps(Array)
#22 /var/www/html/owncloud/lib/base.php(967): OC::init()
#23 /var/www/html/owncloud/console.php(50): require_once('/var/www/html/o...')
#24 /var/www/html/owncloud/occ(11): require_once('/var/www/html/o...')

List of activated apps:
as above?

Are you using external storage, if yes which one: no

Are you using encryption: no

Are you using an external user-backend, if yes which one: FileZila?

Client configuration

Browser:

Operating system:

Logs

Apache log:

http://w9z.f.time4vps.cloud/apache%20error%20log.txt

Web server error log

Insert your webserver log here

ownCloud log (data/owncloud.log)

Do not have it as it's not generated

Browser log

Insert your browser log here, this could for example include:

a) The javascript console log
b) The network log 
c) ...

#2

Since in the log files is a Database error - have you exported (from the old instance) and imported (on the new instance) the database?

or is the database external?


#3

This step also copied over the sqlite database file.
Maybe something went wrong on transferring (e.g. ftp text mode) or the sqlite version is not supported any more.


#4

Yes, if you mean the SQLite database. As with al of the other files and folders I simply downloaded it to my machine and then uploaded it to the new CentOs server.
I was thinking that maybe I messed up somewhere. Like, should I disable all apps before downloading the files from the original installation?


#5

I used SSH with preserve timestamps.
And I installed the same (9.1.0) ownCloud on the new machine.


#6

Also, I was wondering if maybe there was another way of getting this to work.
Like so:

  • What if I do a fresh installation of ownCloud (9.1.0 or maybe another version) and then only transfer from the original installation the data directory and from the database I export the user tables (like name, email and password) for then to import them to the new database?

  • Maybe I should convert the database from SQLite to MySQL in original installation, could this help? The problem is that I do not have access to console as it's a shared hosting.

Thanks a lot in advance!


#7

how would you convert the database if you don't have access to the console?


#8

Ok, I now got access to console SSH of shared host but when I try to convert the database I get this error below.
And I think it's the same problem not letting me get the migration to work.
What should I do? Maybe I could transfer the users and passwords from the original database to a new one (using some SQLite tool)? So that they keep their accounts and data.

> SQLSTATE[HY000]: General error: 26 file is encrypted or is not a database' in /home/alessio2016/public_html/owncloud/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Driver/AbstractSQLiteDriver.php:85
> Stack trace:
> #0 /home/alessio2016/public_html/owncloud/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/DBALException.php(116): Doctrine\DBAL\Driver\AbstractSQLiteDriver->convertException('An exception oc...', Object(Doctrine\DBAL\Driver\PDOException))
> #1 /home/alessio2016/public_html/owncloud/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Connection.php(836): Doctrine\DBAL\DBALException::driverExceptionDuringQuery(Object(Doctrine\DBAL\Driver\PDOSqlite\Driver), Object(Doctrine\DBAL\Driver\PDOException), 'SELECT * FROM "...', Array)
> #2 /home/alessio2016/public_html/owncloud/lib/private/DB/Connection.php(188): Doctrine\DBAL\Connection->executeQuery('SELECT * FROM "...', Array, Array, NULL)
> #3 /home/alessio2016/public_html/owncloud/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Query/QueryBuilder.php(206): OC\DB\Connection->executeQuery('SELECT * FROM `...', Array, Array)
> #4 /home/alessio2016/public_html/owncloud/lib/private/DB/QueryBuilder/QueryBuilder.php(141): Doctrine\DBAL\Query\QueryBuilder->execute()
> #5 /home/alessio2016/public_html/owncloud/lib/private/AppConfig.php(274): OC\DB\QueryBuilder\QueryBuilder->execute()
> #6 /home/alessio2016/public_html/owncloud/lib/private/AppConfig.php(77): OC\AppConfig->loadConfigValues()
> #7 /home/alessio2016/public_html/owncloud/lib/private/AppConfig.php(253): OC\AppConfig->getApps()
> #8 /home/alessio2016/public_html/owncloud/lib/private/legacy/app.php(1080): OC\AppConfig->getValues(false, 'installed_versi...')
> #9 /home/alessio2016/public_html/owncloud/lib/private/Server.php(324): OC_App::getAppVersions()
> #10 /home/alessio2016/public_html/owncloud/3rdparty/pimple/pimple/src/Pimple/Container.php(113): OC\Server->OC{closure}(Object(OC\Server))
> #11 /home/alessio2016/public_html/owncloud/lib/private/AppFramework/Utility/SimpleContainer.php(102): Pimple\Container->offsetGet('MemCacheFactory')
> #12 /home/alessio2016/public_html/owncloud/lib/private/ServerContainer.php(87): OC\AppFramework\Utility\SimpleContainer->query('MemCacheFactory')
> #13 /home/alessio2016/public_html/owncloud/lib/private/Server.php(950): OC\ServerContainer->query('MemCacheFactory')
> #14 /home/alessio2016/public_html/owncloud/lib/private/Server.php(457): OC\Server->getMemCacheFactory()
> #15 /home/alessio2016/public_html/owncloud/3rdparty/pimple/pimple/src/Pimple/Container.php(113): OC\Server->OC{closure}(Object(OC\Server))
> #16 /home/alessio2016/public_html/owncloud/lib/private/AppFramework/Utility/SimpleContainer.php(102): Pimple\Container->offsetGet('AppManager')
> #17 /home/alessio2016/public_html/owncloud/lib/private/ServerContainer.php(87): OC\AppFramework\Utility\SimpleContainer->query('AppManager')
> #18 /home/alessio2016/public_html/owncloud/lib/private/Server.php(1146): OC\ServerContainer->query('AppManager')
> #19 /home/alessio2016/public_html/owncloud/lib/private/legacy/app.php(284): OC\Server->getAppManager()
> #20 /home/alessio2016/public_html/owncloud/lib/private/legacy/app.php(105): OC_App::getEnabledApps()
> #21 /home/alessio2016/public_html/owncloud/lib/base.php(573): OC_App::loadApps(Array)
> #22 /home/alessio2016/public_html/owncloud/lib/base.php(967): OC::init()
> #23 /home/alessio2016/public_html/owncloud/console.php(50): require_once('/home/alessio20...')
> #24 /home/alessio2016/public_html/owncloud/occ(11): require_once('/home/alessio20...')


#9

And I get the same error when I try to run "php occ files:scan"


#10

Show us the output of:

rpm -qa sqlite


#11

The database is corrupted. No action within owncloud will work (occ file:scan) and will also not help.

When copying the files from the old server to the new server - did you use ftp and by accident use ascii mode and not binary mode?


#12

it gives:

sqlite-3.6.20-1.el6_7.2.x86_64


#13

The Problem is that I also get the error on the original machine where owncloud is still running! And in the original machine it's usable, my clients have slow speed but they can use the cloud.


#14

So, I was thinking of a solution and the only one that came to mind is as follows:

  • Install the last version of ownCloud in the new machine
  • Transfer the users (login, passwords, emails and maybe preferences?) to the newly installed database of the newly installed ownCloud of the new machine (maybe I will also need to manually create the folders structure for every user?)
  • Use a temporary domain on the new machine so that I begin uploading the new files there and clients start using the new cloud
  • When there's no need for the old installation I simply point the primary domain to the new cloud on the new machine substituting the temporary domain

In case I go with this, do you have any advice as per which tables I need to transfer from DB to DB?

Please I need to find a solution!
Thanks a lot!!!