Skip to content

Cannot create user on master (1054 Unknown column 'available' in 'where clause) #18129

Closed

Description

@PVince81

@Xenopathic please fix the regression

{"reqId":"B1Lu92E5+PPzZTM9IF86","remoteAddr":"127.0.0.1","app":"index","message":"Exception: {\"Exception\":\"Doctrine\\\\DBAL\\\\Exception\\\\InvalidFieldNameException\",\"Message\":\"An exception occurred while executing 'INSERT INTO `oc_storages` (`id`,`available`) SELECT ?,? FROM `oc_storages` WHERE `id` = ? AND `available` = ? HAVING COUNT(*) = 0' with params [\\\"home::user1\\\", true, \\\"home::user1\\\", true]:\\n\\nSQLSTATE[42S22]: Column not found: 1054 Unknown column 'available' in 'where clause'\",\"Code\":0,\"Trace\":\"#0 \\\/srv\\\/www\\\/htdocs\\\/owncloud\\\/3rdparty\\\/doctrine\\\/dbal\\\/lib\\\/Doctrine\\\/DBAL\\\/DBALException.php(116): Doctrine\\\\DBAL\\\\Driver\\\\AbstractMySQLDriver->convertException('An exception oc...', Object(Doctrine\\\\DBAL\\\\Driver\\\\PDOException))\\n#1 \\\/srv\\\/www\\\/htdocs\\\/owncloud\\\/3rdparty\\\/doctrine\\\/dbal\\\/lib\\\/Doctrine\\\/DBAL\\\/Connection.php(996): Doctrine\\\\DBAL\\\\DBALException::driverExceptionDuringQuery(Object(Doctrine\\\\DBAL\\\\Driver\\\\PDOMySql\\\\Driver), Object(Doctrine\\\\DBAL\\\\Driver\\\\PDOException), 'INSERT INTO `oc...', Array)\\n#2 \\\/srv\\\/www\\\/htdocs\\\/owncloud\\\/lib\\\/private\\\/db\\\/connection.php(203): Doctrine\\\\DBAL\\\\Connection->executeUpdate('INSERT INTO `oc...', Array, Array)\\n#3 \\\/srv\\\/www\\\/htdocs\\\/owncloud\\\/lib\\\/private\\\/db\\\/adapter.php(93): OC\\\\DB\\\\Connection->executeUpdate('INSERT INTO `*P...', Array)\\n#4 \\\/srv\\\/www\\\/htdocs\\\/owncloud\\\/lib\\\/private\\\/db\\\/connection.php(242): OC\\\\DB\\\\Adapter->insertIfNotExist('*PREFIX*storage...', Array, NULL)\\n#5 \\\/srv\\\/www\\\/htdocs\\\/owncloud\\\/lib\\\/private\\\/files\\\/cache\\\/storage.php(61): OC\\\\DB\\\\Connection->insertIfNotExist('*PREFIX*storage...', Array)\\n#6 \\\/srv\\\/www\\\/htdocs\\\/owncloud\\\/lib\\\/private\\\/files\\\/cache\\\/cache.php(85): OC\\\\Files\\\\Cache\\\\Storage->__construct(Object(OCA\\\\Files_Trashbin\\\\Storage))\\n#7 \\\/srv\\\/www\\\/htdocs\\\/owncloud\\\/lib\\\/private\\\/files\\\/storage\\\/home.php(74): OC\\\\Files\\\\Cache\\\\Cache->__construct(Object(OCA\\\\Files_Trashbin\\\\Storage))\\n#8 \\\/srv\\\/www\\\/htdocs\\\/owncloud\\\/lib\\\/private\\\/files\\\/storage\\\/wrapper\\\/wrapper.php(390): OC\\\\Files\\\\Storage\\\\Home->getCache('files', Object(OCA\\\\Files_Trashbin\\\\Storage))\\n#9 \\\/srv\\\/www\\\/htdocs\\\/owncloud\\\/lib\\\/private\\\/files\\\/storage\\\/wrapper\\\/wrapper.php(390): OC\\\\Files\\\\Storage\\\\Wrapper\\\\Wrapper->getCache('files', Object(OCA\\\\Files_Trashbin\\\\Storage))\\n#10 \\\/srv\\\/www\\\/htdocs\\\/owncloud\\\/lib\\\/private\\\/files\\\/view.php(1166): OC\\\\Files\\\\Storage\\\\Wrapper\\\\Wrapper->getCache('files')\\n#11 \\\/srv\\\/www\\\/htdocs\\\/owncloud\\\/lib\\\/private\\\/files\\\/filesystem.php(861): OC\\\\Files\\\\View->getFileInfo('\\\/', false)\\n#12 \\\/srv\\\/www\\\/htdocs\\\/owncloud\\\/apps\\\/files\\\/index.php(83): OC\\\\Files\\\\Filesystem::getFileInfo('\\\/', false)\\n#13 \\\/srv\\\/www\\\/htdocs\\\/owncloud\\\/lib\\\/private\\\/route\\\/route.php(154) : runtime-created function(1): require_once('\\\/srv\\\/www\\\/htdocs...')\\n#14 [internal function]: __lambda_func(Array)\\n#15 \\\/srv\\\/www\\\/htdocs\\\/owncloud\\\/lib\\\/private\\\/route\\\/router.php(274): call_user_func('\\\\x00lambda_289', Array)\\n#16 \\\/srv\\\/www\\\/htdocs\\\/owncloud\\\/lib\\\/base.php(879): OC\\\\Route\\\\Router->match('\\\/apps\\\/files\\\/')\\n#17 \\\/srv\\\/www\\\/htdocs\\\/owncloud\\\/index.php(40): OC::handleRequest()\\n#18 {main}\",\"File\":\"\\\/srv\\\/www\\\/htdocs\\\/owncloud\\\/3rdparty\\\/doctrine\\\/dbal\\\/lib\\\/Doctrine\\\/DBAL\\\/Driver\\\/AbstractMySQLDriver.php\",\"Line\":71}","level":4,"time":"2015-08-07T15:51:10+00:00","method":"GET","url":"\/owncloud\/index.php\/apps\/files\/"}

Looks like all code paths related to oc_storages needs to be tested.

Activity

  1. PVince81 commented on Aug 7, 2015

    @PVince81
    ContributorAuthor

    Caused by #13641

  2. added this to the milestone on Aug 7, 2015
  3. PVince81 commented on Aug 7, 2015

    @PVince81
    ContributorAuthor

    Bug on my end.

  4. RobinMcCorkell commented on Aug 7, 2015

    @RobinMcCorkell
    Contributor

    Keyboard
    Problem <-------
    Chair

    😆

  5. PVince81 commented on Aug 7, 2015

    @PVince81
    ContributorAuthor

    There was no chair involved, only a sofa 😉

  6. reopened this on Aug 10, 2015
  7. oparoz commented on Aug 10, 2015

    @oparoz
    Contributor

    I have an acceptance test which says it's still a problem.
    Might not have been caused by #13641 only if it can't be reproduce by everybody.

    It was still working 3 hours ago, so there are not that many candidates.

  8. oparoz commented on Aug 10, 2015

    @oparoz
    Contributor

    This is the one breaking it for me @PVince81
    15e16d3

      #0 /3rdparty/doctrine/dbal/lib/Doctrine/DBAL/DBALException.php(116): Doctrine\DBAL\Driver\AbstractMySQLDriver->convertException('An exception oc...', Object(Doctrine\DBAL\Driver\PDOException))
      #1 /3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Connection.php(996): Doctrine\DBAL\DBALException::driverExceptionDuringQuery(Object(Doctrine\DBAL\Driver\PDOMySql\Driver), Object(Doctrine\DBAL\Driver\PDOException), 'INSERT INTO `oc...', Array)
      #2 /lib/private/db/connection.php(203): Doctrine\DBAL\Connection->executeUpdate('INSERT INTO `oc...', Array, Array)
      #3 /lib/private/db/adapter.php(93): OC\DB\Connection->executeUpdate('INSERT INTO `*P...', Array)
      #4 /lib/private/db/connection.php(242): OC\DB\Adapter->insertIfNotExist('*PREFIX*storage...', Array, NULL)
      #5 /lib/private/files/cache/storage.php(61): OC\DB\Connection->insertIfNotExist('*PREFIX*storage...', Array)
      #6 /lib/private/files/cache/cache.php(85): OC\Files\Cache\Storage->__construct(Object(OC\Files\Storage\Wrapper\Encryption))
      #7 /lib/private/files/storage/home.php(74): OC\Files\Cache\Cache->__construct(Object(OC\Files\Storage\Wrapper\Encryption))
      #8 /lib/private/files/storage/wrapper/wrapper.php(390): OC\Files\Storage\Home->getCache('files', Object(OC\Files\Storage\Wrapper\Encryption))
      #9 /lib/private/files/view.php(1166): OC\Files\Storage\Wrapper\Wrapper->getCache('files')
      #10 /lib/private/files/filesystem.php(861): OC\Files\View->getFileInfo('/', false)
      #11 /lib/private/helper.php(837): OC\Files\Filesystem::getFileInfo('/', false)
      #12 /apps/provisioning_api/lib/users.php(360): OC_Helper::getStorageInfo('/')
      #13 /apps/provisioning_api/lib/users.php(100): OCA\Provisioning_API\Users::fillStorageInfo('test', Array)
      #14 [internal function]: OCA\Provisioning_API\Users::getUser(Array)
      #15 /lib/private/api.php(145): call_user_func(Array, Array)
      #16 [internal function]: OC_API::call(Array)
      #17 /lib/private/route/router.php(280): call_user_func(Array, Array)
      #18 /ocs/v1.php(52): OC\Route\Router->match('/ocs/cloud/user...')
      #19 {main}
    
  9. PVince81 commented on Aug 11, 2015

    @PVince81
    ContributorAuthor

    @oparoz are you sure about the bisect ? There should be no connection with the sidebar and user creation.

    The problem I had is that I switched branches and the DB update didn't run as there was no difference of version in version.php.

  10. oparoz commented on Aug 11, 2015

    @oparoz
    Contributor

    I think it's wrong because I don't see the relationship, but if I checkout this commit and the one before, then the one before works and this one doesn't. I stayed on master.

    On a fresh install, as in in a Travis container, things are broken on master, so I don't think it's a DB update issue. Since scripts are used, I can't select a specific commit to see which one broke.

  11. PVince81 commented on Aug 11, 2015

    @PVince81
    ContributorAuthor

    Okay, that should be enough of a proof.
    What are the reproduction steps ? Just setup OC from scratch and try and create a user ?

  12. 6 remaining items

  13. changed the title [-]Cannot create user on master[/-] [+]Cannot create user on master (1054 Unknown column 'available' in 'where clause)[/+] on Aug 11, 2015
  14. oparoz commented on Aug 11, 2015

    @oparoz
    Contributor

    If somebody is brave enough, you can use @DeepDiver1975 's PR to check the API is working: #18105

    Or if you're familiar with codecption, you just need to generate an api suite and add this file: https://github.com/owncloud/gallery/blob/b84508a0b687b91b623c6f81ea99e5fe40daa846/tests/api/CreateUserCept.php

  15. DeepDiver1975 commented on Aug 11, 2015

    @DeepDiver1975
    Contributor

    Yes - master is 💥

    deepdiver@alien:~/Development/ownCloud/master/build/integration [ocs-api-integration-tests]$ ./run.sh 
    Loading composer repositories with package information
    Installing dependencies (including require-dev) from lock file
    Warning: The lock file is not up to date with the latest changes in composer.json. You may be getting outdated dependencies. Run update to update them.
    Nothing to install or update
    Generating autoload files
    8080
    13135
    PHP 7.0.0beta2 Development Server started at Tue Aug 11 15:02:37 2015
    Listening on http://localhost:8080
    Document root is /home/deepdiver/Development/ownCloud/master
    Press Ctrl-C to quit.
    PHP Warning:  Declaration of Behat\Behat\Console\Input\InputDefinition::getSynopsis() should be compatible with Symfony\Component\Console\Input\InputDefinition::getSynopsis($short = false) in /home/deepdiver/Development/ownCloud/master/build/integration/vendor/behat/behat/src/Behat/Behat/Console/Input/InputDefinition.php on line 157
    [Tue Aug 11 15:02:39 2015] ::1:54858 [200]: /ocs/v1.php/cloud/users/test
    [Tue Aug 11 15:02:39 2015] PHP Fatal error:  Uncaught PDOException: SQLSTATE[HY000]: General error: 1 table oc_storages has no column named available in /home/deepdiver/Development/ownCloud/master/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOConnection.php:77
    Stack trace:
    #0 /home/deepdiver/Development/ownCloud/master/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOConnection.php(77): PDO->prepare('INSERT INTO "oc...', Array)
    #1 /home/deepdiver/Development/ownCloud/master/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Connection.php(984): Doctrine\DBAL\Driver\PDOConnection->prepare('INSERT INTO "oc...')
    #2 /home/deepdiver/Development/ownCloud/master/lib/private/db/connection.php(203): Doctrine\DBAL\Connection->executeUpdate('INSERT INTO "oc...', Array, Array)
    #3 /home/deepdiver/Development/ownCloud/master/lib/private/db/adaptersqlite.php(71): OC\DB\Connection->executeUpdate('INSERT INTO "oc...', Array)
    #4 /home/deepdiver/Development/ownCloud/master/lib/private/db/connection.php(242): OC\DB\AdapterSqlite->insertIfNotExist('*PREFIX*storage...', Array,  in /home/deepdiver/Development/ownCloud/master/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Driver/AbstractSQLiteDriver.php on line 66
    [Tue Aug 11 15:02:39 2015] ::1:54860 [200]: /ocs/v1.php/cloud/users
    [Tue Aug 11 15:02:39 2015] ::1:54861 [200]: /ocs/v2.php/cloud/users/brand-new-user
    [Tue Aug 11 15:02:39 2015] ::1:54862 [200]: /ocs/v1.php/cloud/users
    [Tue Aug 11 15:02:40 2015] ::1:54863 [200]: /ocs/v2.php/cloud/users/brand-new-user
    [Tue Aug 11 15:02:40 2015] ::1:54864 [200]: /ocs/v2.php/cloud/users/test
    
  16. DeepDiver1975 commented on Aug 11, 2015

    @DeepDiver1975
    Contributor

    did we add a column to oc_storages and not increment the version? (bloody stone age schema-fu 💀 )

  17. PVince81 commented on Aug 11, 2015

    @PVince81
    ContributorAuthor

    @Xenopathic added a column but he did increase version.php, didn't you?

  18. RobinMcCorkell commented on Aug 11, 2015

    @RobinMcCorkell
    Contributor

    @PVince81 @DeepDiver1975 Yes, version.php was correctly modified. I remember always having to fix the merge conflicts every time there was a master change...

  19. oparoz commented on Aug 11, 2015

    @oparoz
    Contributor

    When I go to this commit it still works for me:
    # git checkout 5590d64612c9dfe59b50108a26621b4feb570d27

    Am I doing it wrong?
    If not, maybe some of the right-sidebar scripts have unexpected side effects?

  20. DeepDiver1975 commented on Aug 11, 2015

    @DeepDiver1975
    Contributor

    so something went wrong with one of the rebases ... solution: increment the version now

  21. oparoz commented on Aug 11, 2015

    @oparoz
    Contributor

    Yep, changing the version number fixes it for me.

  22. added a commit that references this issue on Aug 11, 2015
    fa8b107
  23. nickvergessen commented on Aug 11, 2015

    @nickvergessen
    Contributor

    so something went wrong with one of the rebases

    The change was already done by:
    20cf8ec#diff-5bbd3ccd25214f9956eea7e9f714bc08

    So a rebase afterwards should have made it .4, I guess it didn't conflict because it was the same change?

  24. added a commit that references this issue on Aug 11, 2015
    24e45d5
  25. locked as resolved and limited conversation to collaborators on Aug 10, 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

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions