Database converting on netcup webserver results in an error

When i try to convert my database to mysql via occ with “php occ …” i result in an error. I aready searched for solutions but cant find none.
The permissions for the file mentioned in the error are on edit for each user.

Error log in SSH Client:

Doctrine\DBAL\DBALException: Failed to connect to the database: An exception occ                                                                                                             urred in driver: SQLSTATE[HY000] [14] unable to open database file in /httpdocs/                                                                                                             Modules/Nextcloud/lib/private/DB/Connection.php:67
Stack trace:
#0 /httpdocs/Modules/Nextcloud/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Connecti                                                                                                             on.php(889): OC\DB\Connection->connect()
#1 /httpdocs/Modules/Nextcloud/lib/private/DB/Connection.php(194): Doctrine\DBAL                                                                                                             \Connection->executeQuery('SELECT * FROM "...', Array, Array, NULL)
#2 /httpdocs/Modules/Nextcloud/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Query/Qu                                                                                                             eryBuilder.php(200): OC\DB\Connection->executeQuery('SELECT * FROM "...', Array,                                                                                                              Array)
#3 /httpdocs/Modules/Nextcloud/lib/private/DB/QueryBuilder/QueryBuilder.php(216)                                                                                                             : Doctrine\DBAL\Query\QueryBuilder->execute()
#4 /httpdocs/Modules/Nextcloud/lib/private/AppConfig.php(331): OC\DB\QueryBuilde                                                                                                             r\QueryBuilder->execute()
#5 /httpdocs/Modules/Nextcloud/lib/private/AppConfig.php(109): OC\AppConfig->loa                                                                                                             dConfigValues()
#6 /httpdocs/Modules/Nextcloud/lib/private/AppConfig.php(287): OC\AppConfig->get                                                                                                             Apps()
#7 /httpdocs/Modules/Nextcloud/lib/private/legacy/OC_App.php(883): OC\AppConfig-                                                                                                             >getValues(false, 'installed_versi...')
#8 /httpdocs/Modules/Nextcloud/lib/private/Server.php(665): OC_App::getAppVersio                                                                                                             ns()
#9 /httpdocs/Modules/Nextcloud/3rdparty/pimple/pimple/src/Pimple/Container.php(1                                                                                                             18): OC\Server->OC\{closure}(Object(OC\Server))
#10 /httpdocs/Modules/Nextcloud/lib/private/ServerContainer.php(124): Pimple\Con                                                                                                             tainer->offsetGet('OC\\Memcache\\Fac...')
#11 /httpdocs/Modules/Nextcloud/lib/private/Server.php(1704): OC\ServerContainer                                                                                                             ->query('OC\\Memcache\\Fac...')
#12 /httpdocs/Modules/Nextcloud/lib/private/Server.php(856): OC\Server->getMemCa                                                                                                             cheFactory()
#13 /httpdocs/Modules/Nextcloud/3rdparty/pimple/pimple/src/Pimple/Container.php(                                                                                                             118): OC\Server->OC\{closure}(Object(OC\Server))
#14 /httpdocs/Modules/Nextcloud/lib/private/ServerContainer.php(124): Pimple\Con                                                                                                             tainer->offsetGet('OC\\App\\AppManag...')
#15 /httpdocs/Modules/Nextcloud/lib/private/AppFramework/Utility/SimpleContainer                                                                                                             .php(163): OC\ServerContainer->query('OC\\App\\AppManag...')
#16 /httpdocs/Modules/Nextcloud/3rdparty/pimple/pimple/src/Pimple/Container.php(                                                                                                             114): OC\AppFramework\Utility\SimpleContainer->OC\AppFramework\Utility\{closure}                                                                                                             (Object(OC\Server))
#17 /httpdocs/Modules/Nextcloud/lib/private/ServerContainer.php(124): Pimple\Con                                                                                                             tainer->offsetGet('OCP\\App\\IAppMan...')
#18 /httpdocs/Modules/Nextcloud/lib/private/Server.php(1894): OC\ServerContainer                                                                                                             ->query('OCP\\App\\IAppMan...')
#19 /httpdocs/Modules/Nextcloud/lib/private/legacy/OC_App.php(347): OC\Server->g                                                                                                             etAppManager()
#20 /httpdocs/Modules/Nextcloud/lib/private/legacy/OC_App.php(114): OC_App::getE                                                                                                             nabledApps()
#21 /httpdocs/Modules/Nextcloud/lib/base.php(648): OC_App::loadApps(Array)
#22 /httpdocs/Modules/Nextcloud/lib/base.php(1094): OC::init()
#23 /httpdocs/Modules/Nextcloud/console.php(49): require_once('/httpdocs/Modul..                                                                                                             .')
#24 /httpdocs/Modules/Nextcloud/occ(11): require_once('/httpdocs/Modul...')

[/details]

Nextcloud version (eg, 18.0.2): 19.0.4
Operating system and version (eg, Ubuntu 20.04): Linux a2f1e 4.9.0-13-amd64 #1 SMP Debian 4.9.228-1 (2020-07-05) x86_64

Apache or nginx version (eg, Apache 2.4.25):
PHP version (eg, 7.1): 7.4 but i tried each version from 7.1 up

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

Steps to replicate it:

  1. access occ via ssh

The output of your Nextcloud log in Admin > Logging:

there is nothing about the topic in it

Config.PHP

<?php
$CONFIG = array (
  'debug' => 'true',
  'instanceid' => 'ocXXqtXXXXXXXq7',
  'passwordsalt' => '',
  'secret' => '',
  'trusted_domains' => 
  array (
    0 => 'www.xxxxxx.de',
    1 => 'xxxxxx.de',
  ),
  'datadirectory' => '/var/www/vhosts/domain/httpdocs/Modules/Nextcloud/data',
  'dbtype' => 'sqlite',
  'version' => '19.0.4.2',
  'overwrite.cli.url' => 'https://www.domain/Modules/Nextcloud',
  'installed' => true,
  'maintenance' => false,
  'ldapIgnoreNamingRules' => false,
  'ldapProviderFactory' => 'OCA\\User_LDAP\\LDAPProviderFactory',
  'mail_from_address' => 'server',
  'mail_smtpmode' => 'smtp',
  'mail_sendmailmode' => 'smtp',
  'mail_domain' => 'domain.de',
  'mail_smtphost' => 'maildomain.net',
  'mail_smtpauthtype' => 'LOGIN',
  'mail_smtpauth' => 1,
  'mail_smtpname' => 'adress',
  'mail_smtppassword' => 'password',
  'theme' => '',
  'loglevel' => 2,
  'mail_smtpport' => '',
  'mail_smtpsecure' => 'ssl',
  'app_install_overwrite' => 
  array (
    0 => 'files_external_gdrive',
    1 => 'activitylog',
    2 => 'files_external_onedrive',
    3 => 'occweb',
  ),
  'user_sql.db.database' => 'k126970_main',
  'user_sql.db.hostname' => 'mysql adress',
  'user_sql.db.password' => 'mypassword',
  'user_sql.db.username' => 'my user',
);

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

there are no files in there

Is your nextcloud working in general?

Which db are you using? sqlite?

Its working absolutely fine as it is, but i’d like to change the database in order to get better performance. Currently its running on sqlite.

Fully understand this one.

Please show us the complete convert command.
Please make sure the new db server is reacheable and you can connect to the new empty db.

Hey Rekeknive,

I already figured the problem out by myself. But thanks for your help!

The solutions (if someone maybe got the same problem) were:

  1. Use the Option to execute Task in Webserver Control Page and give the command the option --no-interaction or edit some codelines in the dbconverter php file as it is written in some post on here already
  2. Deinstall the polls app as it generates an indiz problem when trying to convert from sqlite to mysql

As a suggestion, you may should create a better solution for executing the occ php file, as for webserver users its pretty difficult to execute the file with the needed permissions as you only got limited privileges. Also webserver users may not be able to have access to server logs and the logging feature in the admin tab is not very detailled or doesn’t even show any info regarding those problems at all. (maybe you can change something to show this but i didn’t figured out how)

1 Like