Skip to content

Database error when migrating from 6.0 to 6.0.1 #6915

Closed

Description

@Mittlebenskrise

I tried to update OC to 6.0.1 and get the following error:

Unknown database type enum requested, Doctrine\DBAL\Platforms\MySqlPlatform may not support it.

Any ideas how to fix this?

Thanks!

Activity

  1. DeepDiver1975 commented on Jan 23, 2014

    @DeepDiver1975
    Contributor

    @Mittlebenskrise Thanks a lot for reporting issues back to us!

    We need some more information to properly support you with your issue!

    Can I ask you to follow our guidelines for submitting bugs as described here: https://github.com/owncloud/core/blob/master/CONTRIBUTING.md

    Thanks a lot!

  2. Mittlebenskrise commented on Jan 23, 2014

    @Mittlebenskrise
    Author

    Ups, sorry. Here's the information

    Server configuration

    Operating system: Windows
    Web server: not sure (hostet at 1und1.de)
    Database: MySQL 5
    PHP version: 5.4
    ownCloud version: before 6.0, now 6.0.1 (even so error occured)
    Updated from an older ownCloud or fresh install: Update
    List of activated app: Activities, Bookmarks, Calendar, Contacts, Deleted Files, Documents, External storage support, First Run Wizard, Full Text Search, PDF Viewer, Pictures, Share Files, Tasks, Text Editor, Updater, Versions
    The content of config/config.php:

    'ocfb7711e93b', 'passwordsalt' => '', 'datadirectory' => '/homepages/3/d173767322/htdocs/owncloud/data', 'dbtype' => 'mysql', 'version' => '6.0.0.15', 'dbname' => 'db355930358', 'dbhost' => 'db3021.1und1.de', 'dbtableprefix' => 'oc_', 'dbuser' => 'dbo355930358', 'dbpassword' => '', 'installed' => true, 'theme' => '', 'maintenance' => false, 'loglevel' => '2', ); Are you using external storage, if yes which one: none ### Client configuration Browser: Google Chrome 32.0.1700.76 m Operating system:Windows 7 (64 bit) ### Logs #### Web server error log n/a #### ownCloud log (data/owncloud.log) {"app":"core","message":"Failed to update database structure (exception 'Doctrine\DBAL\DBALException' with message 'Unknown database type enum requested, Doctrine\DBAL\Platforms\MySqlPlatform may not support it.' in \/homepages\/3\/d173767322\/htdocs\/owncloud\/3rdparty\/doctrine\/dbal\/lib\/Doctrine\/DBAL\/Platforms\/AbstractPlatform.php:321\nStack trace:\n#0 \/homepages\/3\/d173767322\/htdocs\/owncloud\/3rdparty\/doctrine\/dbal\/lib\/Doctrine\/DBAL\/Schema\/MySqlSchemaManager.php(112): Doctrine\DBAL\Platforms\AbstractPlatform->getDoctrineTypeMapping('enum')\n#1 \/homepages\/3\/d173767322\/htdocs\/owncloud\/3rdparty\/doctrine\/dbal\/lib\/Doctrine\/DBAL\/Schema\/AbstractSchemaManager.php(672): Doctrine\DBAL\Schema\MySqlSchemaManager->_getPortableTableColumnDefinition(Array)\n#2 \/homepages\/3\/d173767322\/htdocs\/owncloud\/3rdparty\/doctrine\/dbal\/lib\/Doctrine\/DBAL\/Schema\/AbstractSchemaManager.php(159): Doctrine\DBAL\Schema\AbstractSchemaManager->_getPortableTableColumnList('apple_wiki_comm...', 'db355930358', Array)\n#3 \/homepages\/3\/d173767322\/htdocs\/owncloud\/3rdparty\/doctrine\/dbal\/lib\/Doctrine\/DBAL\/Schema\/AbstractSchemaManager.php(254): Doctrine\DBAL\Schema\AbstractSchemaManager->listTableColumns('apple_wiki_comm...')\n#4 \/homepages\/3\/d173767322\/htdocs\/owncloud\/3rdparty\/doctrine\/dbal\/lib\/Doctrine\/DBAL\/Schema\/AbstractSchemaManager.php(242): Doctrine\DBAL\Schema\AbstractSchemaManager->listTableDetails('apple_wiki_comm...')\n#5 \/homepages\/3\/d173767322\/htdocs\/owncloud\/3rdparty\/doctrine\/dbal\/lib\/Doctrine\/DBAL\/Schema\/AbstractSchemaManager.php(831): Doctrine\DBAL\Schema\AbstractSchemaManager->listTables()\n#6 \/homepages\/3\/d173767322\/htdocs\/owncloud\/lib\/private\/db\/mdb2schemamanager.php(60): Doctrine\DBAL\Schema\AbstractSchemaManager->createSchema()\n#7 \/homepages\/3\/d173767322\/htdocs\/owncloud\/lib\/private\/db.php(376): OC\DB\MDB2SchemaManager->updateDbFromStructure('\/homepages\/3\/d1...')\n#8 \/homepages\/3\/d173767322\/htdocs\/owncloud\/lib\/private\/updater.php(106): OC_DB::updateDbFromStructure('\/homepages\/3\/d1...')\n#9 \/homepages\/3\/d173767322\/htdocs\/owncloud\/core\/ajax\/update.php(34): OC\Updater->upgrade()\n#10 {main})","level":4,"time":"2014-01-23T14:14:51+00:00"} #### Browser log n/a
  3. PVince81 commented on Jan 23, 2014

    @PVince81
    Contributor

    Table apple_wiki_comm... what could that be ?

    I tried grepping the code and couldn't find it, neither in the source code nor in the packaged OC 6.0.1.

    @Mittlebenskrise can you double check that you don't have any 3rd party app running before the upgrade ? I didn't see any mentionned in the list above but the log seems to imply that it might be the case.

  4. Mittlebenskrise commented on Jan 24, 2014

    @Mittlebenskrise
    Author

    Hi, well there are other tables in the database as well that are not OC tables. I assume that a list of all tables in the database is collected in listTables and then passed on to listTableDetails. And maybe there lies the problem. Shouldn't OC ignore all tables that are not its own? I.e. all tables with a name not starting with the "dbtableprefix" from the config file?

  5. Mittlebenskrise commented on Jan 24, 2014

    @Mittlebenskrise
    Author

    OK, I got it to work by changing the function listTables in 3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Schema/AbstractSchemaManager.php. The changes might not be the perfect way to implement this, but I assume you guys can get that fix in in a better way. I marked the modified lines with comments.

    public function listTables()
    {
        $tableprefix = Config::getSystemValue( "dbtableprefix", "" );  // NEW
        $tableNames = $this->listTableNames();
    
        $tables = array();
        foreach ($tableNames as $tableName) {
            if( substr( $tableName, 0, strlen( $tableprefix )) == $tableprefix ) {  // NEW
                $tables[] = $this->listTableDetails($tableName);
            }  // NEW
        }
    
        return $tables;
    }
    

    Now only those tables are added to the list that have the OC prefix, not other tables from other web applications. No clue if that might cause other side effects, but it seems to work.

  6. DeepDiver1975 commented on Jan 24, 2014

    @DeepDiver1975
    Contributor

    Shouldn't OC ignore all tables that are not its own?

    Yes it should ignore them - we had a similar issue in the past.
    @VicDeo you fixed that - right? Can you please double check once more? THX

  7. VicDeo commented on Jan 24, 2014

    @VicDeo
    Contributor

    @DeepDiver1975 It was in times of MDB2. The code I changed was refactored in stable6/master
    cc @bartv2

  8. added a commit that references this issue on Mar 21, 2014
    00a8dc7
  9. PVince81 commented on May 6, 2014

    @PVince81
    Contributor

    @VicDeo @bartv2 any update ? (for the table listing issue)

  10. DeepDiver1975 commented on Jul 24, 2014

    @DeepDiver1975
    Contributor

    will be fixed with 7.0.1

  11. as4565683 commented on Feb 5, 2015

    @as4565683

    The documentation says that we should upgrade from 5 to 6 to 7 by first upgrading to 5.0.18, then to 6.0.6 and then to 7.0.4.

    Trying to upgrade from 5.0.18 to 6.0.6 resulted in the error described above. I too had to change the file 3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Schema/AbstractSchemaManager.php but got the error that the Config object was not available, so I had to write like this:

    public function listTables()
    {
        $tableprefix = "oc_";  // NEW / look up what you configured for tableprefix in your config.php
        $tableNames = $this->listTableNames();
    
        $tables = array();
        foreach ($tableNames as $tableName) {
            if( substr( $tableName, 0, strlen( $tableprefix )) == $tableprefix ) {  // NEW
                $tables[] = $this->listTableDetails($tableName);
            }  // NEW
        }
    
        return $tables;
    }

    After this was done, I was able to upgrade from 6.0.6 to 7.0.4.

  12. locked as resolved and limited conversation to collaborators on Aug 13, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions