Skip to content

Exception when updating storage availability #18420

Closed

Description

@PVince81

Steps

  1. Enable external storage
  2. Configure a SMB mount with invalid values (I used my usual local SMB storage's settings but have shut down smbd before adding this)

Expected result

No errors in log

Actual result

{"reqId":"F5ovzkrcLYIpYvTyG+JF","remoteAddr":"192.168.177.239","app":"files_external","message":"Exception: {\"Exception\":\"Doctrine\\\\DBAL\\\\Exception\\\\DriverException\",\"Message\":\"An exception occurred while executing 'UPDATE `oc_storages` SET `available` = ?, `last_checked` = ? WHERE `id` = ?' with params [false, 1439975924, \\\"smb::vincent@localhost\\\\\\\/\\\\\\\/shared\\\\\\\/\\\\\\\/\\\"]:\\n\\nSQLSTATE[22007]: Invalid datetime format: 1366 Incorrect integer value: '' for column 'available' at row 1\",\"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\\\/Statement.php(172): Doctrine\\\\DBAL\\\\DBALException::driverExceptionDuringQuery(Object(Doctrine\\\\DBAL\\\\Driver\\\\PDOMySql\\\\Driver), Object(Doctrine\\\\DBAL\\\\Driver\\\\PDOException), 'UPDATE `oc_stor...', Array)\\n
#2 \\\/srv\\\/www\\\/htdocs\\\/owncloud\\\/lib\\\/private\\\/db\\\/statementwrapper.php(73): Doctrine\\\\DBAL\\\\Statement->execute(Array)\\n
#3 \\\/srv\\\/www\\\/htdocs\\\/owncloud\\\/lib\\\/private\\\/db.php(147): OC_DB_StatementWrapper->execute(Array)\\n
#4 \\\/srv\\\/www\\\/htdocs\\\/owncloud\\\/lib\\\/private\\\/files\\\/cache\\\/storage.php(157): OC_DB::executeAudited('UPDATE `*PREFIX...', Array)\\n
#5 \\\/srv\\\/www\\\/htdocs\\\/owncloud\\\/lib\\\/private\\\/files\\\/storage\\\/common.php(670): OC\\\\Files\\\\Cache\\\\Storage->setAvailability(false)\\n
#6 \\\/srv\\\/www\\\/htdocs\\\/owncloud\\\/apps\\\/files_external\\\/lib\\\/config.php(507): OC\\\\Files\\\\Storage\\\\Common->setAvailability(false)\\n
#7 \\\/srv\\\/www\\\/htdocs\\\/owncloud\\\/apps\\\/files_external\\\/controller\\\/storagescontroller.php(123): OC_Mount_Config::getBackendStatus('\\\\\\\\OC\\\\\\\\Files\\\\\\\\Stora...', Array, false)\\n
#8 \\\/srv\\\/www\\\/htdocs\\\/owncloud\\\/apps\\\/files_external\\\/controller\\\/globalstoragescontroller.php(100): OCA\\\\Files_External\\\\Controller\\\\StoragesController->updateStorageStatus(Object(OCA\\\\Files_external\\\\Lib\\\\StorageConfig))\\n
#9 [internal function]: OCA\\\\Files_External\\\\Controller\\\\GlobalStoragesController->create('smb', '\\\\\\\\OC\\\\\\\\Files\\\\\\\\Stora...', Array, NULL, Array, Array, 100)\\n
#10 \\\/srv\\\/www\\\/htdocs\\\/owncloud\\\/lib\\\/private\\\/appframework\\\/http\\\/dispatcher.php(159): call_user_func_array(Array, Array)\\n
#11 \\\/srv\\\/www\\\/htdocs\\\/owncloud\\\/lib\\\/private\\\/appframework\\\/http\\\/dispatcher.php(89): OC\\\\AppFramework\\\\Http\\\\Dispatcher->executeController(Object(OCA\\\\Files_External\\\\Controller\\\\GlobalStoragesController), 'create')\\n
#12 \\\/srv\\\/www\\\/htdocs\\\/owncloud\\\/lib\\\/private\\\/appframework\\\/app.php(108): OC\\\\AppFramework\\\\Http\\\\Dispatcher->dispatch(Object(OCA\\\\Files_External\\\\Controller\\\\GlobalStoragesController), 'create')\\n
#13 \\\/srv\\\/www\\\/htdocs\\\/owncloud\\\/lib\\\/private\\\/appframework\\\/routing\\\/routeactionhandler.php(45): OC\\\\AppFramework\\\\App::main('GlobalStoragesC...', 'create', Object(OC\\\\AppFramework\\\\DependencyInjection\\\\DIContainer), Array)\\n
#14 [internal function]: OC\\\\AppFramework\\\\routing\\\\RouteActionHandler->__invoke(Array)\\n
#15 \\\/srv\\\/www\\\/htdocs\\\/owncloud\\\/lib\\\/private\\\/route\\\/router.php(280): call_user_func(Object(OC\\\\AppFramework\\\\routing\\\\RouteActionHandler), Array)\\n
#16 \\\/srv\\\/www\\\/htdocs\\\/owncloud\\\/lib\\\/base.php(879): OC\\\\Route\\\\Router->match('\\\/apps\\\/files_ext...')\\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\":115}","level":4,"time":"2015-08-19T09:18:44+00:00","method":"POST","url":"\/owncloud\/index.php\/apps\/files_external\/globalstorages"}

Versions

ownCloud 8.2 pre-alpha git master 0b37004

@Xenopathic please have a look.
Note that I also observed this on your branch #15914 during testing

Activity

  1. added this to the milestone on Aug 19, 2015
  2. RobinMcCorkell commented on Aug 19, 2015

    @RobinMcCorkell
    Contributor

    What DB type are you using? I am unable to reproduce this on MariaDB

  3. PVince81 commented on Aug 19, 2015

    @PVince81
    ContributorAuthor

    mariadb-10.0.20-1.1.x86_64

    The strange thing is that if I input the query manually it works. Maybe something fishy is happening with type mappings.

  4. PVince81 commented on Aug 19, 2015

    @PVince81
    ContributorAuthor

    php5-5.6.12-1.1.x86_64

  5. PVince81 commented on Aug 19, 2015

    @PVince81
    ContributorAuthor

    Maybe we should use integers instead of boolean ?

    It seems that so far we never really used the bool data type before, this is the clue: #17674

  6. PVince81 commented on Aug 19, 2015

    @PVince81
    ContributorAuthor

    @DeepDiver1975 @icewind1991 any idea why a bool would fail like this ?

  7. locked as resolved and limited conversation to collaborators on Aug 9, 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