Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PHP Fatal error: Uncaught Doctrine\\DBAL\\DBALException: Failed to connect to the database: Invalid platform version "5.5.5-10.1.25-MariaDB" #6193

Closed
stfast opened this issue Aug 21, 2017 · 11 comments
Labels
bug stale Ticket or PR with no recent activity

Comments

@stfast
Copy link

stfast commented Aug 21, 2017

Steps to reproduce

  1. Upgrade from NextCloud 11 to NextCloud 12

Expected behaviour

NextCloud should work as in version 11.x

Actual behaviour

error_log-owncloud:[Mon Aug 21 01:15:59.802107 2017] [:error] [pid 47351] [client 172.16.101.54:63176] PHP Fatal error: Uncaught Doctrine\DBAL\DBALException: Failed to connect to the database: Invalid platform version "5.5.5-10.1.25-MariaDB" specified. The platform version has to be specified in the format: "<major_version>.<minor_version>.<patch_version>". in .../nextcloud-12.0.2/lib/private/DB/Connection.php:61\nStack trace:\n#0 :q
(429): OC\DB\Connection->connect()\n#1 .../nextcloud-12.0.2/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Connection.php(389): Doctrine\DBAL\Connection->getDatabasePlatformVersion()\n#2 .../nextcloud-12.0.2/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Connection.php(328): Doctrine\DBAL\Connection->detectDatabasePlatform()\n#3 .../nextcloud-12.0.2/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Connection.php(623): Doctrine\DBAL\Connection->getDatabasePlatform()\n#4 .../n in .../nextcloud-12.0.2/lib/private/DB/Connection.php on line 61

Server configuration

Operating system:
Fedora 26

Web server:

Apache httpd 2.4.20

Database:

10.1.25-MariaDB MariaDB Server

PHP version:

PHP 7.0.7

Nextcloud version: (see Nextcloud admin page)

12.+

**Updated from an older Nextcloud/ownCloud or fresh install:

Update from OwnCloud 9.1.0 to NextCloud 10, NextCloud 11 and still working

Where did you install Nextcloud from:

Signing status:

Signing status
Login as admin user into your Nextcloud and access 
http://example.com/index.php/settings/integrity/failed 
paste the results here.

Not working

List of activated apps:

If you have access to your command line run e.g.:
sudo -u www-data php occ app:list
from within your Nextcloud installation folder

Enabled:
  - activity: 2.5.2
  - comments: 1.2.0
  - dav: 1.3.0
  - federatedfilesharing: 1.2.0
  - files: 1.7.2
  - files_pdfviewer: 1.1.1
  - files_texteditor: 2.4.1
  - files_trashbin: 1.2.0
  - files_versions: 1.5.0
  - files_videoplayer: 1.1.0
  - firstrunwizard: 2.1
  - gallery: true
  - logreader: 2.0.0
  - lookup_server_connector: 1.0.0
  - nextcloud_announcements: 1.1
  - notifications: 2.0.0
  - oauth2: 1.0.5
  - password_policy: 1.2.2
  - provisioning_api: 1.2.0
  - serverinfo: 1.2.0
  - sharebymail: 1.2.0
  - survey_client: 1.0.0
  - systemtags: 1.2.0
  - theming: 1.3.0
  - twofactor_backupcodes: 1.1.1
  - updatenotification: 1.2.0
  - user_ldap: 1.2.1
  - workflowengine: 1.2.0
Disabled:
  - admin_audit
  - encryption
  - federation
  - files_external
  - files_sharing
  - user_external

**Nextcloud configuration:**
<details>
<summary>Config report</summary>

If you have access to your command line run e.g.:
sudo -u www-data php occ config:list system
from within your Nextcloud installation folder

or

Insert your config.php content here.
Make sure to remove all sensitive content such as passwords. (e.g. database password, passwordsalt, secret, smtp password, …)

{
    "system": {
        "trusted_domains": [
            "owncloud",
            "oblak"
        ],
        "datadirectory": "\/WWW\/Production\/owncloud\/owncloud-data",
        "overwrite.cli.url": "https:\/\/owncloud",
        "logtimezone": "UTC",
        "dbtype": "mysql",
        "dbname": "owncloud",
        "dbhost": "localhost",
        "dbtableprefix": "oc_",
        "dbuser": "***REMOVED SENSITIVE VALUE***",
        "dbpassword": "***REMOVED SENSITIVE VALUE***",
        "mail_smtpmode": "smtp",
        "mail_smtphost": "localhost",
        "mail_smtpport": "25",
        "memcache.local": "\\OC\\Memcache\\APCu",
        "memcache.distributed": "\\OC\\Memcache\\Memcached",
        "memcached_servers": [
            [
                "localhost",
                11211
            ]
        ],
        "mail_from_address": "noreply",
        "mail_domain": "",
        "theme": "",
        "loglevel": 0,
        "instanceid": "ocoegowaaylv",
        "passwordsalt": "***REMOVED SENSITIVE VALUE***",
        "secret": "***REMOVED SENSITIVE VALUE***",
        "installed": true,
        "ldapIgnoreNamingRules": false,
        "preview_libreoffice_path": "\/usr\/bin\/libreoffice",
        "ldapProviderFactory": "\\OCA\\User_LDAP\\LDAPProviderFactory",
        "updater.secret": "***REMOVED SENSITIVE VALUE***",
        "updater.release.channel": "stable",
        "maintenance": true
    }
}

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

**Are you using encryption:** yes/no

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

#### LDAP configuration (delete this part if not used)
<details>
<summary>LDAP config</summary>

With access to your command line run e.g.:
sudo -u www-data php occ ldap:show-config
from within your Nextcloud installation folder

Without access to your command line download the data/owncloud.db to your local
computer or access your SQL server remotely and run the select query:
SELECT * FROM oc_appconfig WHERE appid = 'user_ldap';

Eventually replace sensitive data as the name/IP-address of your LDAP server or groups.

</details>

### Client configuration
**Browser:**

**Operating system:**

### Logs
#### Web server error log
<details>
<summary>Web server error log</summary>

Insert your webserver log here

</details>

#### Nextcloud log (data/nextcloud.log)
<details>
<summary>Nextcloud log</summary>

cat owncloud-data/nextcloud.log |grep "starting upgrade from"

{"reqId":"vfet41Zm5ciN5SldzZvr","remoteAddr":"","app":"core","message":"starting upgrade from 9.1.0.15 to 9.1.5.2","level":0,"time":"2017-07-19T23:40:53+00:00","method":"--","url":"--","user":"--","version":"9.1.0.15"}
{"reqId":"vSkvldVQh5+xc1QNUwzN","remoteAddr":"","app":"core","message":"starting upgrade from 9.1.5.2 to 11.0.3.2","level":0,"time":"2017-07-19T23:48:19+00:00","method":"--","url":"--","user":"--","version":"9.1.5.2"}
{"reqId":"Js+zkm8ke+QHszbE/m1W","remoteAddr":"","app":"core","message":"starting upgrade from 9.1.5.2 to 11.0.3.2","level":0,"time":"2017-07-19T23:52:21+00:00","method":"--","url":"--","user":"--","version":"9.1.5.2"}
{"reqId":"RZvfvLG0HMUyFc2kgAoF","level":0,"time":"2017-07-24T14:27:05+00:00","remoteAddr":"","user":"--","app":"core","method":"--","url":"--","message":"starting upgrade from 11.0.3.2 to 12.0.0.29","userAgent":"--","version":"11.0.3.2"}
{"reqId":"QqkZ7vvMWvaBJWthrPoh","level":0,"time":"2017-08-03T22:36:09+00:00","remoteAddr":"","user":"--","app":"core","method":"--","url":"--","message":"starting upgrade from 0.0.0 to 12.0.0.29","userAgent":"--","version":""}
{"reqId":"yUF4fWnitPKUdZ3De8nD","level":0,"time":"2017-08-03T23:23:03+00:00","remoteAddr":"","user":"--","app":"core","method":"--","url":"--","message":"starting upgrade from 0.0.0 to 12.0.0.29","userAgent":"--","version":""}
{"reqId":"34rEGEbpTItv9khbMCLM","level":0,"time":"2017-08-03T23:26:52+00:00","remoteAddr":"","user":"--","app":"core","method":"--","url":"--","message":"starting upgrade from 0.0.0 to 12.0.0.29","userAgent":"--","version":""}
{"reqId":"YuKU8mu0DJpnUdV60I6B","level":0,"time":"2017-08-20T23:33:17+00:00","remoteAddr":"","user":"--","app":"core","method":"--","url":"--","message":"starting upgrade from 0.0.0 to 12.0.2.0","userAgent":"--","version":""}
{"reqId":"525QPDGBPoTYxQo7Ztil","level":0,"time":"2017-08-21T00:03:30+00:00","remoteAddr":"","user":"--","app":"core","method":"--","url":"--","message":"starting upgrade from 0.0.0 to 12.0.2.0","userAgent":"--","version":""

</details>

#### Browser log
<details>
<summary>Browser log</summary>

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

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

</details>
@MorrisJobke
Copy link
Member

Seems that doctrine does not support this version number of the Fedora MariaDB. Can I ask you to report this upstream to doctrine and link the issue here?

I don't know if Doctrine should support this artificial version number or if Fedora needs to fix it.

https://github.com/doctrine/dbal/issues

@stfast
Copy link
Author

stfast commented Aug 21, 2017

Reported at doctrine/dbal#2819

@stfast
Copy link
Author

stfast commented Aug 29, 2017

I've cloned new version of dbal, but getting a new error:

[Tue Aug 29 15:38:54.393757 2017] [:error] [pid 30288] [client 172.16.103.21:42650] PHP Fatal error: Uncaught TypeError: Return value of Doctrine\DBAL\DriverManager::_checkParams() must be an instance of Doctrine\DBAL\void, none returned in /owncloud/nextcloud-12.0.2/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/DriverManager.php:213\nStack trace:\n#0 /owncloud/nextcloud-12.0.2/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/DriverManager.php(153): Doctrine\DBAL\DriverManager::_checkParams(Array)\n#1 /owncloud/nextcloud-12.0.2/lib/private/DB/ConnectionFactory.php(149): Doctrine\DBAL\DriverManager::getConnection(Array, Object(Doctrine\DBAL\Configuration), Object(Doctrine\Common\EventManager))\n#2 /owncloud/nextcloud-12.0.2/lib/private/Server.php(579): OC\DB\ConnectionFactory->getConnection('mysql', Array)\n#3 /owncloud/nextcloud-12.0.2/3rdparty/pimple/pimple/src/Pimple/Container.php(113): OC\Server->OC\{closure}(Object(OC\Server))\n#4 /owncloud/nextcloud-12.0.2/lib/private/AppFramework in /owncloud/nextcloud-12.0.2/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/DriverManager.php on line 213

@MorrisJobke MorrisJobke added bug and removed 0. Needs triage Pending check for reproducibility or if it fits our roadmap labels Aug 31, 2017
@MorrisJobke
Copy link
Member

Let's wait here for upstream to get the PR merged and then we can look into how to apply it.

@cosenal
Copy link
Member

cosenal commented Feb 8, 2018

@MorrisJobke I got the same error when upgrading to NC 13 from NC 12 on Archlinux.

@Schmuuu
Copy link

Schmuuu commented Feb 8, 2018

@cosenal Do you know what actions resulted in this issue? I am running Archlinux and MariaDB too, but haven't seen this issue on my server yet. But I'm afraid that some of the automatic updates will leave me with a broken server as well.

ArchLinux 4.14.17-1-lts
MariaDB 10.1.30
Nextcloud 13.0.0 (stable)
PHP 7.2.2

@MorrisJobke
Copy link
Member

@MorrisJobke I got the same error when upgrading to NC 13 from NC 12 on Archlinux.

:/

I have also Archlinux with MariaDB and it went just smooth.

@MorrisJobke
Copy link
Member

cc @nickvergessen

@stfast
Copy link
Author

stfast commented Mar 1, 2018

Since I opened this bug, I found there is no issue at all if you disable pcre.jit in php.ini:

cat php.ini
...
pcre.jit=0
...

And this error dissapears:

[Thu Mar 01 18:48:16.056472 2018] [php7:error] [pid 9432] [client 10.192.96.14:42479] PHP Fatal error: Uncaught Doctrine\DBAL\DBALException: Failed to connect to the database: Invalid platform version "5.5.5-10.2.12-MariaDB" specified. The platform version has to be specified in the format: "<major_version>.<minor_version>.<patch_version>". in /WWW/Production/owncloud./nextcloud-12.0.5/lib/private/DB/Connection.php:64\nStack trace:\n#0 /WWW/Production/owncloud./nextcloud-12.0.5/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Connection.php(429): OC\DB\Connection->connect()\n#1 /WWW/Production/owncloud./nextcloud-12.0.5/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Connection.php(389): Doctrine\DBAL\Connection->getDatabasePlatformVersion()\n#2 /WWW/Production/owncloud./nextcloud-12.0.5/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Connection.php(328): Doctrine\DBAL\Connection->detectDatabasePlatform()\n#3 /WWW/Production/owncloud./nextcloud-12.0.5/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Connection.php(623): Doctrine\DBAL\Connection->getDatabasePlatform()\n#4 /WWW/Production/owncloud./n in /WWW/Production/owncloud./nextcloud-12.0.5/lib/private/DB/Connection.php on line 64

@stfast
Copy link
Author

stfast commented Mar 22, 2018 via email

@nextcloud-bot nextcloud-bot added the stale Ticket or PR with no recent activity label Jun 20, 2018
@skjnldsv
Copy link
Member

skjnldsv commented Jun 6, 2019

And this error dissapears:

closing then

@skjnldsv skjnldsv closed this as completed Jun 6, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug stale Ticket or PR with no recent activity
Projects
None yet
Development

No branches or pull requests

6 participants