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

Owncloud update from 9x to 10. fails ubuntu 14.04 #27762

Closed
montanaviking opened this issue Apr 28, 2017 · 12 comments
Closed

Owncloud update from 9x to 10. fails ubuntu 14.04 #27762

montanaviking opened this issue Apr 28, 2017 · 12 comments

Comments

@montanaviking
Copy link

Steps to reproduce

  1. update php using: sudo add-apt-repository ppa:ondrej/php
    sudo apt-get update
    sudo apt-get install php5.6 php5.6-mbstring php5.6-mcrypt php5.6-mysql php5.6-xml
    php5.6-apcu php5.6-zip php5.6-gd php5.6-curl
    sudo a2dismod php5
    sudo a2enmod php5.6
    sudo service apache2 restart
    Tried mysql and phpmyadmin and working
  2. run automated update (synaptic) to update Owncloud to latest version (10.0)
  3. run owncloud update and got:
    #######################
    /var/www/owncloud$ sudo -u www-data php occ upgrade
    [sudo] password for viking:
    An unhandled exception has been thrown:
    Doctrine\DBAL\DBALException: Failed to connect to the database: An exception occured in driver: could not find driver in /var/www/owncloud/lib/private/DB/Connection.php:63
    Stack trace:
    #0 /var/www/owncloud/lib/composer/doctrine/dbal/lib/Doctrine/DBAL/Connection.php(429): OC\DB\Connection->connect()
    Fix URL to sources #1 /var/www/owncloud/lib/composer/doctrine/dbal/lib/Doctrine/DBAL/Connection.php(389): Doctrine\DBAL\Connection->getDatabasePlatformVersion()
    ca #2 /var/www/owncloud/lib/composer/doctrine/dbal/lib/Doctrine/DBAL/Connection.php(328): Doctrine\DBAL\Connection->detectDatabasePlatform()
    PHP notice after creating of new instance with sqlite #3 /var/www/owncloud/lib/composer/doctrine/dbal/lib/Doctrine/DBAL/Connection.php(623): Doctrine\DBAL\Connection->getDatabasePlatform()
    UI changes plus supprt for old browsers in Contacts app. #4 /var/www/owncloud/lib/private/DB/Connection.php(146): Doctrine\DBAL\Connection->setTransactionIsolation(2)
    German translation: In Adressbook the hinzufügen button is not escaped properly #5 /var/www/owncloud/lib/composer/doctrine/dbal/lib/Doctrine/DBAL/DriverManager.php(172): OC\DB\Connection->__construct(Array, Object(Doctrine\DBAL\Driver\PDOMySql\Driver), Object(Doctrine\DBAL\Configuration), Object(Doctrine\Common\EventManager))
    Patch 1 #6 /var/www/owncloud/lib/private/DB/ConnectionFactory.php(136): Doctrine\DBAL\DriverManager::getConnection(Array, Object(Doctrine\DBAL\Configuration), Object(Doctrine\Common\EventManager))
    Stackato Additions (Should be on separate branch) #7 /var/www/owncloud/lib/private/Server.php(461): OC\DB\ConnectionFactory->getConnection('mysql', Array)
    improved persistent cookies #8 /var/www/owncloud/lib/composer/pimple/pimple/src/Pimple/Container.php(113): OC\Server->OC{closure}(Object(OC\Server))
    add SSL proxy support #9 /var/www/owncloud/lib/private/AppFramework/Utility/SimpleContainer.php(111): Pimple\Container->offsetGet('DatabaseConnect...')
    Typos #10 /var/www/owncloud/lib/private/ServerContainer.php(87): OC\AppFramework\Utility\SimpleContainer->query('DatabaseConnect...')
    fix message about 'apps' directory #11 /var/www/owncloud/lib/private/Server.php(1101): OC\ServerContainer->query('DatabaseConnect...')
    check free space using folder's owner #12 /var/www/owncloud/lib/private/Server.php(226): OC\Server->getDatabaseConnection()
    fix js success callback on safari when uploading files #13 /var/www/owncloud/lib/composer/pimple/pimple/src/Pimple/Container.php(113): OC\Server->OC{closure}(Object(OC\Server))
    delete fscache on deleting user #14 /var/www/owncloud/lib/private/AppFramework/Utility/SimpleContainer.php(111): Pimple\Container->offsetGet('UserManager')
    use post to delete files, get has a limit and fails with many files #15 /var/www/owncloud/lib/private/ServerContainer.php(87): OC\AppFramework\Utility\SimpleContainer->query('UserManager')
    L10n fixes #16 /var/www/owncloud/lib/private/Server.php(953): OC\ServerContainer->query('UserManager')
    Fix some untranslated strings #17 /var/www/owncloud/lib/private/Server.php(267): OC\Server->getUserManager()
    Support interpolation in js translations #18 /var/www/owncloud/lib/composer/pimple/pimple/src/Pimple/Container.php(113): OC\Server->OC{closure}(Object(OC\Server))
    Reimplementation of CSRF protection strategy #19 /var/www/owncloud/lib/private/AppFramework/Utility/SimpleContainer.php(111): Pimple\Container->offsetGet('UserSession')
    undo interpolation in js for 4.5 #20 /var/www/owncloud/lib/private/ServerContainer.php(87): OC\AppFramework\Utility\SimpleContainer->query('UserSession')
    CSS typo fixed. #21 /var/www/owncloud/lib/private/Server.php(970): OC\ServerContainer->query('UserSession')
    oc-1875 : running OwnCloud on an alias (or not) with Nginx #22 /var/www/owncloud/lib/private/Server.php(507): OC\Server->getUserSession()
    Update apps/files/css/files.css #23 /var/www/owncloud/lib/composer/pimple/pimple/src/Pimple/Container.php(113): OC\Server->OC{closure}(Object(OC\Server))
    A suggestion for simple, yet efficient variable interpolation in js translations #24 /var/www/owncloud/lib/private/AppFramework/Utility/SimpleContainer.php(111): Pimple\Container->offsetGet('AppManager')
    fixed max possible upload size for files app in admin screen #25 /var/www/owncloud/lib/private/ServerContainer.php(87): OC\AppFramework\Utility\SimpleContainer->query('AppManager')
    resubmit: improved persistent cookies #26 /var/www/owncloud/lib/private/Server.php(1288): OC\ServerContainer->query('AppManager')
    Bug fixes for swift integration #27 /var/www/owncloud/lib/private/legacy/app.php(310): OC\Server->getAppManager()
    Various bug fixes for swift #28 /var/www/owncloud/lib/private/legacy/app.php(106): OC_App::getEnabledApps()
    Update l10n/nn_NO/contacts.po #29 /var/www/owncloud/lib/base.php(579): OC_App::loadApps(Array)
    extend logon page to display multiple error messages #30 /var/www/owncloud/lib/base.php(994): OC::init()
    reresubmit: improved persistent cookies :) #31 /var/www/owncloud/console.php(57): require_once('/var/www/ownclo...')
    Implement X-Sendfile support #32 /var/www/owncloud/occ(11): require_once('/var/www/ownclo...')
    Enforce user to enter password again when doing potential malicious actions #33 {main}PHP Fatal error: Uncaught Doctrine\DBAL\DBALException: Failed to connect to the database: An exception occured in driver: could not find driver in /var/www/owncloud/lib/private/DB/Connection.php:63
    Stack trace:
    #0 /var/www/owncloud/lib/composer/doctrine/dbal/lib/Doctrine/DBAL/Connection.php(429): OC\DB\Connection->connect()
    Fix URL to sources #1 /var/www/owncloud/lib/composer/doctrine/dbal/lib/Doctrine/DBAL/Connection.php(389): Doctrine\DBAL\Connection->getDatabasePlatformVersion()
    ca #2 /var/www/owncloud/lib/composer/doctrine/dbal/lib/Doctrine/DBAL/Connection.php(328): Doctrine\DBAL\Connection->detectDatabasePlatform()
    PHP notice after creating of new instance with sqlite #3 /var/www/owncloud/lib/composer/doctrine/dbal/lib/Doctrine/DBAL/Connection.php(623): Doctrine\DBAL\Connection->getDatabasePlatform()
    UI changes plus supprt for old browsers in Contacts app. #4 /var/www/owncloud/lib/private/DB/Connection.php(146): Doctrine\DBAL\Connection->setTransactionIsolation(2)
    German translation: In Adressbook the hinzufügen button is not escaped properly #5 /var/www/owncloud/lib/composer/doctrine/dbal/lib/Doctrine/DBAL/DriverManager.php(172): OC\DB\Connection->__construct(Array, Object(Doctrine\DBAL\Driver\PDOMySql\Driver), Object(Doctrine\D in
    #################################

Expected behaviour

Tell us what should happen
Owncloud should have updated normally

Actual behaviour

Tell us what happens instead
Errors as shown above Owncloud server cannot start

Server configuration

Operating system:
Ubuntu 14.04.5
Linux Sibyl 3.13.0-117-generic #164-Ubuntu SMP Fri Apr 7 11:05:26 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux

Web server:
Server version: Apache/2.4.7 (Ubuntu)
Server built: Jul 15 2016 15:34:04
Database:
mysql Ver 14.14 Distrib 5.5.55, for debian-linux-gnu (x86_64) using readline 6.3

PHP version:
php -v
PHP 7.1.4-1+deb.sury.orgtrusty+1 (cli) (built: Apr 11 2017 22:45:20) ( NTS )
Copyright (c) 1997-2017 The PHP Group
Zend Engine v3.1.0, Copyright (c) 1998-2017 Zend Technologies
with Zend OPcache v7.1.4-1+deb.sury.org
trusty+1, Copyright (c) 1999-2017, by Zend Technologies

ownCloud version: (see ownCloud admin page) version 10.0 I think (latest)

Updated from an older ownCloud or fresh install:
Updated from 9.1x
Where did you install ownCloud from:
used ppa from Owncloud and synaptic package manager as had been done successfully for previous owncloud versions

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.

Cannot sign into my ownCloud server because it's broken all I see is:
Update needed
Please use the command line updater because you have a big instance.

For help, see the documentation.

The content of config/config.php:

false, 'instanceid' => 'xxxxxxx', 'passwordsalt' => 'xxxxxxx', 'secret' => 'xxxxxxxxxxxx', 'trusted_domains' => array ( 0 => 'localhost', 1 => '192.168.1.10', 2 => 'xxr', 3 => 'xxl', 4 => 'xxx.xxx.xx.x49', 5 => 'xxr', 6 => 'xx', ), 'datadirectory' => '/carbonics/owncloud', 'overwrite.cli.url' => 'https://localhost/owncloud', 'dbtype' => 'mysql', 'version' => '9.1.5.2', 'dbname' => 'owncloud', 'dbhost' => 'localhost', 'dbtableprefix' => 'oc_', 'dbuser' => 'oc_xxxxx', 'dbpassword' => 'xxxxx', 'logtimezone' => 'UTC', 'installed' => true, 'memcache.local' => '\\OC\\Memcache\\APCu', 'maintenance' => false, 'ldapIgnoreNamingRules' => false, 'loglevel' => 3, 'session_lifetime' => 1728000, 'session_keepalive' => true, 'mail_from_address' => 'cloud', 'mail_smtpmode' => 'php', 'mail_domain' => 'xx.com', ); ``` Log in to the web-UI with an administrator account and click on 'admin' -> 'Generate Config Report' -> 'Download ownCloud config report' This report includes the config.php settings, the list of activated apps and other details in a well sanitized form. or If you have access to your command line run e.g.: sudo -u www-data php occ config:list system from within your ownCloud installation folder *ATTENTION:* Do not post your config.php file in public as is. Please use one of the above methods whenever possible. Both, the generated reports from the web-ui and from occ config:list consistently remove sensitive data. You still may want to review the report before sending. If done manually then it is critical for your own privacy to dilligently remove *all* host names, passwords, usernames, salts and other credentials before posting. You should assume that attackers find such information and will use them against your systems. ``` **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 ownCloud installation folder. ``` **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) ``` With access to your command line run e.g.: sudo -u www-data php occ ldap:show-config from within your ownCloud 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. ``` ### Client configuration **Browser:** **Operating system:** ### Logs #### Web server error log ``` Insert your webserver log here ``` #### ownCloud log (data/owncloud.log) ``` Insert your ownCloud log here ```nothing in this file #### Browser log ``` Insert your browser log here, this could for example include: a) The javascript console log b) The network log c) ... ```
@ghost
Copy link

ghost commented Apr 28, 2017

@montanaviking

Failed to connect to the database: An exception occured in driver: could not find driver

This shows that there is a misconfiguration in your PHP environment where the database driver is not correctly loaded. Please close here and ask for support on how to configure this correctly at the resources listed at https://secure.php.net/support.php

@montanaviking
Copy link
Author

kdslkdsaldsal, thanks very much for looking at this.
However, I would think that if PHP were misconfigured, then phpMyAdmin would also not function. However, phpMyAdmin functions with the same PHP configuration that the ownCloud 10 install failed on. Moreover, phpMyAdmin can access my MySQL database just fine.
I don't want to change any configurations on PHP unless this is clearly the cause of my problem. Then again, just maybe said PHP configuration could selectively fail Owncloud 10? Any help in looking into this would be welcome because I'm a noob on PHP. Thanks,
Phil

@ghost
Copy link

ghost commented Apr 28, 2017

There are differences between your webserver (running phpmyadmin and owncloud via browser) and the php cli (which is called by occ). Your webserver module has loaded the correct db driver, your php cli on command line not.

If you need further support with this please contact the PHP support community as already advised.

@montanaviking
Copy link
Author

Hi Again,
My problem appears to be similar to that posted in: #23130
and from this post I noticed:
#########################
I had the same problem concerning what you've cited above: "exception 'Doctrine\DBAL\DBALException' with message 'Failed to connect to the database: An exception occured in driver: could not find driver' in /var/www/owncloud/lib/private/db/connection.php:54"

I solved it. The problem (in my case) was caused by different php version for 'the command line' and for the serving side via 'apache'. occ needs to use the same php version.

check the php version at the command line 'php -v' for example PHP7.0.2
check the php version which the serving-side is using via e.g. creating a info.php with the content: ""
this gives as output e.g. PHP 5.6.17

So the difference is PHP7.0.2 and PHP5.6.17. Btw the occ command is php based also.

I solved the problem by installing PHP5.6.17 at the 'command line' side as well so it is the same as at 'serving side'.

But we're not there yet in case you have multiple php versions on your system. If the 'php -v' doesn't give PHP5.6.17 you have to create a new alias for php (assuming the correct version is also stored in the file system, otherwise install it). Locate the correct php version with 'whereis php'. Change the alias to the correct path until the 'php -v' gives the same version as the 'serving side' php version.
############################################
Perhaps my phpMyAdmin installation uses a different version of php than OC or is indicating the wrong version?
I think my root cause is similar to other recent posters' issues with Ubuntu 14.04 and OC 9x->10 upgrade. Apparently, this required upgrading PHP from 5.5.9 to 5.6.x and Ubuntu 14.04 uses PHP 5.5.9.
So, it appears that I need to upgrade my PHP to at least 5.6.x but I have two questions namely:

  1. will ownCloud 10 work with PHP 7.x?
  2. Could someone kindly point me in the proper direction as how to properly migrate from PHP 5.5.9 to 5.6.x or 7.x? Last time, I tried using a ppa (see my original post) but that apparently gave problems.
    Apparently there's a command line invoked PHP and other PHP which is called by the http server. I'm thinking that my installation has these different? Any idea how to tell what PHP that Apache is using? Apparently it isn't the one I get via the command php -v.
    By the way, I retain copies of my old OS configuration, so I can recover from failed installations. Right now, I'm back to my original PHP and OC 9.x.
    Thanks so much, Phil

@montanaviking
Copy link
Author

Sorry, I didn't see your latest post. I'm going to check my PHP installation and try to correct it. thanks, Phil

@VicDeo
Copy link
Member

VicDeo commented Apr 28, 2017

@montanaviking According to your report

sudo apt-get install php5.6 php5.6-mbstring php5.6-mcrypt php5.6-mysql php5.6-xml
php5.6-apcu php5.6-zip php5.6-gd php5.6-curl
sudo a2dismod php5
sudo a2enmod php5.6
...
php -v
PHP 7.1.4-1

  1. your webserver uses PHP5.6 (with php5.6-mysql ) - any database related code requested via web from the server (owncloud, phpmyadmin, etc) will work

  2. your CLI uses PHP 7 (most likely without php7.0-mysql) will not work
    to check this please run php -m from CLI and look for MySQL in the list of enabled modules

Install php5.6-cli package additionally

@VicDeo
Copy link
Member

VicDeo commented Apr 28, 2017

@montanaviking as I see from your last post you already solved that.

  1. will ownCloud 10 work with PHP 7.x?

yes.

  1. sudo a2dismod php5
    sudo a2enmod php5.6

these lines mean
Hey, apache webserver, stop using php5 module
and
Hey, apache webserver, start using php5.6 module

As you see PHP can be packed as Apache module. These packages are usually called libapache2-mod-phpX.Y
CLI version of PHP is inside the package phpX.Y-cli

Packages like phpX.Y-something are modules of PHP itself. They are used both for Apache PHP module and PHP CLI given that they are compatible. 5.6 and 7.0 are not compatible from the point of modules. Which means that e.g. php5.6-mysql package is needed for 5.6 and php7.0-mysql is need for 7.0

IIRC It is possible to have 5.6 and 7.0 installed simultaneously and use it as follows
sudo -u www-data php5.6 occ upgrade
sudo -u www-data php7.0 occ upgrade
php is just a symlink to either php5.6 or php7.0 in this case

@montanaviking
Copy link
Author

Hi,
In order to solve my owncloud 9.1.5 to 10.x upgrade problem, I would like to upgrade my php from 5.5.9 to php 7.0.15, Apache 2.4.7 to Apache 2.4.18, and MySQL 5.5.55 to MySQL 5.7.18. I'm currently running Ubuntu 14.04 and will eventually upgrade to Ubuntu 16.04, but before that, I'd like to put my PHP, Apache, and MySQL at the 16.04 versions (as above), run my present OC 9.1.5 now, and eventually upgrade OC from 9.1.5 to OC 10.0 or 10.1 (later). I like the idea of having 16.04's versions of the above working prior to migrating to 16.04.

My questions are:

  1. How do I upgrade Apache, PHP, and MySQL in a way that doesn't break my current OC 9.1.5?
    Are there settings in OC 9.1.5 configurations which need to be adjusted to the new Apache, PHP, and/or MySQL as above? I have looked at my owncloud/config/config.php file and didn't see anything regarding versions of the above (PHP, Apache, MySQL). Is the OC 9.1.5 agnostic regarding this or do I need to inform it as to my changes/upgrades?

  2. Also, if anyone here knows, should I do the above, can I migrate back to my former Apache, MySQL,PHP versions should other things break or will that break my OC database? Of course, I will back up my OC database.
    Thanks so much,
    Phil

@montanaviking
Copy link
Author

I will probably not bother upgrading MySQL since OC 10.x will likely work with my present MySQL 5.5.55 and I'd like to let "sleeping dogs lie".
Thanks

@ghost
Copy link

ghost commented May 7, 2017

@montanaviking Please note this is a bugtracker for ownCloud where (as the name is saying) bugs for ownCloud are tracked / handled. Support questions like yours needs to go to:

  1. To https://central.owncloud.org/ if they are specific to ownCloud
  2. To https://secure.php.net/support.php if they are specific to PHP (like your initial report)
  3. To a support community dedicated to your used linux distro (In your case https://community.ubuntu.com/contribute/support). Especially your question 1 is completely unrelated to ownCloud and should be asked there.

@VicDeo Why keeping this open as this is clearly an environmental issue?

@montanaviking
Copy link
Author

I have posted this question in https://central.owncloud.org/
and closed this thread.

@lock
Copy link

lock bot commented Aug 1, 2019

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked as resolved and limited conversation to collaborators Aug 1, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants