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

Custom properties not working with Oracle #37027

Closed
phil-davis opened this issue Feb 27, 2020 · 3 comments · Fixed by #37314
Closed

Custom properties not working with Oracle #37027

phil-davis opened this issue Feb 27, 2020 · 3 comments · Fixed by #37314

Comments

@phil-davis
Copy link
Contributor

Run the acceptance tests with Oracle database. (see PR #37025 )
https://drone.owncloud.com/owncloud/core/23587/63/13

  Scenario: add multiple properties to files inside a folder and do a propfind of the parent folder        # /drone/src/tests/acceptance/features/apiWebdavProperties/getFileProperties.feature:215
    Given user "user0" has created folder "/TestFolder"                                                    # FeatureContext::userHasCreatedFolder()
    And user "user0" has uploaded file with content "test data one" to "/TestFolder/test1.txt"             # FeatureContext::userHasUploadedAFileWithContentTo()
    And user "user0" has uploaded file with content "test data two" to "/TestFolder/test2.txt"             # FeatureContext::userHasUploadedAFileWithContentTo()
    And user "user0" has set the following properties of file "/TestFolder/test1.txt" using the WebDav API # WebDavPropertiesContext::userHasSetFollowingPropertiesUsingProppatch()
      | property  | value |
      | testprop1 | AAAAA |
      | testprop2 | BBBBB |
    And user "user0" has set the following properties of file "/TestFolder/test2.txt" using the WebDav API # WebDavPropertiesContext::userHasSetFollowingPropertiesUsingProppatch()
      | property  | value |
      | testprop1 | CCCCC |
      | testprop2 | DDDDD |
    When user "user0" gets the following properties of folder "/TestFolder" using the WebDav PropFind API  # WebDavPropertiesContext::userGetsFollowingPropsWithNamespaceOfFileUsingWebDavAPI()
      | property  |
      | testprop1 |
      | testprop2 |
    Then the HTTP status code should be success                                                            # FeatureContext::theHTTPStatusCodeShouldBeSuccess()
    And as user "user0" the last response should have the following properties                             # WebDavPropertiesContext::theResponseShouldHavePropertyWithValue()
      | resource              | property  | value                  |
      | /TestFolder/test1.txt | testprop1 | CCCCC                  |
      | /TestFolder/test1.txt | testprop2 | BBBBB                  |
      | /TestFolder/test2.txt | testprop1 | CCCCC                  |
      | /TestFolder/test2.txt | testprop2 | DDDDD                  |
      | /TestFolder/          | status    | HTTP/1.1 404 Not Found |
      WebDavPropertiesContext::theResponseShouldHavePropertyWithValue Expected 'CCCCC' but got 'AAAAA'
      Failed asserting that SimpleXMLElement Object &0000000004dff26d000000000e2b1393 (
          0 => 'AAAAA'
      ) matches expected 'CCCCC'.
  Scenario Outline: Setting custom complex DAV property and reading it                                                                                             # /drone/src/tests/acceptance/features/apiWebdavProperties/setFileProperties.feature:24
    Given using <dav_version> DAV path                                                                                                                             # FeatureContext::usingOldOrNewDavPath()
    And user "user0" has uploaded file "filesForUpload/textfile.txt" to "/testcustomprop.txt"                                                                      # FeatureContext::userHasUploadedAFileTo()
    And user "user0" has set property "very-custom-prop" with namespace "x1='http://whatever.org/ns'" of file "/testcustomprop.txt" to "<foo xmlns='http://bar'/>" # WebDavPropertiesContext::userHasSetPropertyWithNamespaceOfEntryTo()
    When user "user0" gets a custom property "very-custom-prop" with namespace "x1='http://whatever.org/ns'" of file "/testcustomprop.txt"                         # WebDavPropertiesContext::userGetsPropertiesOfFile()
    Then the response should contain a custom "very-custom-prop" property with namespace "x1='http://whatever.org/ns'" and value "Object"                          # WebDavPropertiesContext::theResponseShouldContainACustomPropertyWithValue()

    Examples:
      | dav_version |
      | old         |
        The HTTP status code 500 is not between 200 and 299
        Failed asserting that 500 is equal to 299 or is less than 299.
      | new         |
        The HTTP status code 500 is not between 200 and 299
        Failed asserting that 500 is equal to 299 or is less than 299.
--- Failed scenarios:

    /drone/src/tests/acceptance/features/apiWebdavProperties/getFileProperties.feature:215
    /drone/src/tests/acceptance/features/apiWebdavProperties/setFileProperties.feature:33
    /drone/src/tests/acceptance/features/apiWebdavProperties/setFileProperties.feature:34

96 scenarios (93 passed, 3 failed)
697 steps (690 passed, 3 failed, 4 skipped)
@phil-davis
Copy link
Contributor Author

Log has:

{"reqId":"buRLXTsOueILvdkxUN7T","level":3,"time":"2020-02-27T04:47:29+00:00","remoteAddr":"172.20.0.5","user":"user0","app":"PHP","method":"PROPPATCH","url":"\/remote.php\/webdav\/testcustomprop.txt","message":"oci_bind_by_name(): Invalid variable used for bind at \/drone\/src\/lib\/composer\/doctrine\/dbal\/lib\/Doctrine\/DBAL\/Driver\/OCI8\/OCI8Statement.php#287"}
{"reqId":"buRLXTsOueILvdkxUN7T","level":4,"time":"2020-02-27T04:47:29+00:00","remoteAddr":"172.20.0.5","user":"user0","app":"webdav","method":"PROPPATCH","url":"\/remote.php\/webdav\/testcustomprop.txt","message":"Exception: An exception occurred while executing 'INSERT INTO \"oc_properties\" (\"fileid\",\"propertyname\",\"propertyvalue\") VALUES(?,?,?)' with params [2147485153, \"{http:\\\/\\\/whatever.org\\\/ns}very-custom-prop\", {}]:\n\nORA-01008: not all variables bound: {\"Exception\":\"Doctrine\\\\DBAL\\\\Exception\\\\DriverException\",\"Message\":\"An exception occurred while executing 'INSERT INTO \\\"oc_properties\\\" (\\\"fileid\\\",\\\"propertyname\\\",\\\"propertyvalue\\\") VALUES(?,?,?)' with params [2147485153, \\\"{http:\\\\\\\/\\\\\\\/whatever.org\\\\\\\/ns}very-custom-prop\\\", {}]:\\n\\nORA-01008: not all variables bound\",\"Code\":0,\"Trace\":\"#0 \\\/drone\\\/src\\\/lib\\\/composer\\\/doctrine\\\/dbal\\\/lib\\\/Doctrine\\\/DBAL\\\/DBALException.php(169): Doctrine\\\\DBAL\\\\Driver\\\\AbstractOracleDriver->convertException('An exception oc...', Object(Doctrine\\\\DBAL\\\\Driver\\\\OCI8\\\\OCI8Exception))\\n#1 \\\/drone\\\/src\\\/lib\\\/composer\\\/doctrine\\\/dbal\\\/lib\\\/Doctrine\\\/DBAL\\\/DBALException.php(145): Doctrine\\\\DBAL\\\\DBALException::wrapException(Object(Doctrine\\\\DBAL\\\\Driver\\\\OCI8\\\\Driver), Object(Doctrine\\\\DBAL\\\\Driver\\\\OCI8\\\\OCI8Exception), 'An exception oc...')\\n#2 \\\/drone\\\/src\\\/lib\\\/composer\\\/doctrine\\\/dbal\\\/lib\\\/Doctrine\\\/DBAL\\\/Connection.php(1065): Doctrine\\\\DBAL\\\\DBALException::driverExceptionDuringQuery(Object(Doctrine\\\\DBAL\\\\Driver\\\\OCI8\\\\Driver), Object(Doctrine\\\\DBAL\\\\Driver\\\\OCI8\\\\OCI8Exception), 'INSERT INTO \\\"oc...', Array)\\n#3 \\\/drone\\\/src\\\/lib\\\/private\\\/DB\\\/Connection.php(207): Doctrine\\\\DBAL\\\\Connection->executeUpdate('INSERT INTO \\\"oc...', Array, Array)\\n#4 \\\/drone\\\/src\\\/apps\\\/dav\\\/lib\\\/DAV\\\/FileCustomPropertiesBackend.php(193): OC\\\\DB\\\\Connection->executeUpdate('INSERT INTO \\\"oc...', Array)\\n#5 \\\/drone\\\/src\\\/apps\\\/dav\\\/lib\\\/DAV\\\/AbstractCustomPropertiesBackend.php(214): OCA\\\\DAV\\\\DAV\\\\FileCustomPropertiesBackend->updateProperties('testcustomprop....', Object(OCA\\\\DAV\\\\Connector\\\\Sabre\\\\File), Array)\\n#6 \\\/drone\\\/src\\\/lib\\\/composer\\\/sabre\\\/dav\\\/lib\\\/DAV\\\/PropPatch.php(295): OCA\\\\DAV\\\\DAV\\\\AbstractCustomPropertiesBackend->OCA\\\\DAV\\\\DAV\\\\{closure}(*** sensitive parameters replaced ***)\\n#7 \\\/drone\\\/src\\\/lib\\\/composer\\\/sabre\\\/dav\\\/lib\\\/DAV\\\/PropPatch.php(230): Sabre\\\\DAV\\\\PropPatch->doCallBackMultiProp(Array, Object(Closure))\\n#8 \\\/drone\\\/src\\\/lib\\\/composer\\\/sabre\\\/dav\\\/lib\\\/DAV\\\/Server.php(1271): Sabre\\\\DAV\\\\PropPatch->commit()\\n#9 \\\/drone\\\/src\\\/lib\\\/composer\\\/sabre\\\/dav\\\/lib\\\/DAV\\\/CorePlugin.php(393): Sabre\\\\DAV\\\\Server->updateProperties('testcustomprop....', Array)\\n#10 \\\/drone\\\/src\\\/lib\\\/composer\\\/sabre\\\/event\\\/lib\\\/WildcardEmitterTrait.php(89): Sabre\\\\DAV\\\\CorePlugin->httpPropPatch(Object(Sabre\\\\HTTP\\\\Request), Object(Sabre\\\\HTTP\\\\Response))\\n#11 \\\/drone\\\/src\\\/lib\\\/composer\\\/sabre\\\/dav\\\/lib\\\/DAV\\\/Server.php(474): Sabre\\\\DAV\\\\Server->emit('method:PROPPATC...', Array)\\n#12 \\\/drone\\\/src\\\/lib\\\/composer\\\/sabre\\\/dav\\\/lib\\\/DAV\\\/Server.php(251): Sabre\\\\DAV\\\\Server->invokeMethod(Object(Sabre\\\\HTTP\\\\Request), Object(Sabre\\\\HTTP\\\\Response))\\n#13 \\\/drone\\\/src\\\/lib\\\/composer\\\/sabre\\\/dav\\\/lib\\\/DAV\\\/Server.php(319): Sabre\\\\DAV\\\\Server->start()\\n#14 \\\/drone\\\/src\\\/apps\\\/dav\\\/appinfo\\\/v1\\\/webdav.php(65): Sabre\\\\DAV\\\\Server->exec()\\n#15 \\\/drone\\\/src\\\/remote.php(165): require_once('\\\/drone\\\/src\\\/apps...')\\n#16 {main}\",\"File\":\"\\\/drone\\\/src\\\/lib\\\/composer\\\/doctrine\\\/dbal\\\/lib\\\/Doctrine\\\/DBAL\\\/Driver\\\/AbstractOracleDriver.php\",\"Line\":57}"}
{"reqId":"buRLXTsOueILvdkxUN7T","level":3,"time":"2020-02-27T04:47:29+00:00","remoteAddr":"172.20.0.5","user":"user0","app":"webdav","method":"PROPPATCH","url":"\/remote.php\/webdav\/testcustomprop.txt","message":"Caused by: {\"Exception\":\"Doctrine\\\\DBAL\\\\Driver\\\\OCI8\\\\OCI8Exception\",\"Message\":\"ORA-01008: not all variables bound\",\"Code\":0,\"Trace\":\"#0 \\\/drone\\\/src\\\/lib\\\/composer\\\/doctrine\\\/dbal\\\/lib\\\/Doctrine\\\/DBAL\\\/Driver\\\/OCI8\\\/OCI8Statement.php(372): Doctrine\\\\DBAL\\\\Driver\\\\OCI8\\\\OCI8Exception::fromErrorInfo(Array)\\n#1 \\\/drone\\\/src\\\/lib\\\/composer\\\/doctrine\\\/dbal\\\/lib\\\/Doctrine\\\/DBAL\\\/Connection.php(1058): Doctrine\\\\DBAL\\\\Driver\\\\OCI8\\\\OCI8Statement->execute(Array)\\n#2 \\\/drone\\\/src\\\/lib\\\/private\\\/DB\\\/Connection.php(207): Doctrine\\\\DBAL\\\\Connection->executeUpdate('INSERT INTO \\\"oc...', Array, Array)\\n#3 \\\/drone\\\/src\\\/apps\\\/dav\\\/lib\\\/DAV\\\/FileCustomPropertiesBackend.php(193): OC\\\\DB\\\\Connection->executeUpdate('INSERT INTO \\\"oc...', Array)\\n#4 \\\/drone\\\/src\\\/apps\\\/dav\\\/lib\\\/DAV\\\/AbstractCustomPropertiesBackend.php(214): OCA\\\\DAV\\\\DAV\\\\FileCustomPropertiesBackend->updateProperties('testcustomprop....', Object(OCA\\\\DAV\\\\Connector\\\\Sabre\\\\File), Array)\\n#5 \\\/drone\\\/src\\\/lib\\\/composer\\\/sabre\\\/dav\\\/lib\\\/DAV\\\/PropPatch.php(295): OCA\\\\DAV\\\\DAV\\\\AbstractCustomPropertiesBackend->OCA\\\\DAV\\\\DAV\\\\{closure}(*** sensitive parameters replaced ***)\\n#6 \\\/drone\\\/src\\\/lib\\\/composer\\\/sabre\\\/dav\\\/lib\\\/DAV\\\/PropPatch.php(230): Sabre\\\\DAV\\\\PropPatch->doCallBackMultiProp(Array, Object(Closure))\\n#7 \\\/drone\\\/src\\\/lib\\\/composer\\\/sabre\\\/dav\\\/lib\\\/DAV\\\/Server.php(1271): Sabre\\\\DAV\\\\PropPatch->commit()\\n#8 \\\/drone\\\/src\\\/lib\\\/composer\\\/sabre\\\/dav\\\/lib\\\/DAV\\\/CorePlugin.php(393): Sabre\\\\DAV\\\\Server->updateProperties('testcustomprop....', Array)\\n#9 \\\/drone\\\/src\\\/lib\\\/composer\\\/sabre\\\/event\\\/lib\\\/WildcardEmitterTrait.php(89): Sabre\\\\DAV\\\\CorePlugin->httpPropPatch(Object(Sabre\\\\HTTP\\\\Request), Object(Sabre\\\\HTTP\\\\Response))\\n#10 \\\/drone\\\/src\\\/lib\\\/composer\\\/sabre\\\/dav\\\/lib\\\/DAV\\\/Server.php(474): Sabre\\\\DAV\\\\Server->emit('method:PROPPATC...', Array)\\n#11 \\\/drone\\\/src\\\/lib\\\/composer\\\/sabre\\\/dav\\\/lib\\\/DAV\\\/Server.php(251): Sabre\\\\DAV\\\\Server->invokeMethod(Object(Sabre\\\\HTTP\\\\Request), Object(Sabre\\\\HTTP\\\\Response))\\n#12 \\\/drone\\\/src\\\/lib\\\/composer\\\/sabre\\\/dav\\\/lib\\\/DAV\\\/Server.php(319): Sabre\\\\DAV\\\\Server->start()\\n#13 \\\/drone\\\/src\\\/apps\\\/dav\\\/appinfo\\\/v1\\\/webdav.php(65): Sabre\\\\DAV\\\\Server->exec()\\n#14 \\\/drone\\\/src\\\/remote.php(165): require_once('\\\/drone\\\/src\\\/apps...')\\n#15 {main}\",\"File\":\"\\\/drone\\\/src\\\/lib\\\/composer\\\/doctrine\\\/dbal\\\/lib\\\/Doctrine\\\/DBAL\\\/Driver\\\/OCI8\\\/OCI8Exception.php\",\"Line\":20}"}

@phil-davis
Copy link
Contributor Author

Looks similar to #32670

@VicDeo
Copy link
Member

VicDeo commented Apr 22, 2020

...and we have to do something with it now as it is no longer Oracle-specific for PHP 7.4
🧯
https://drone.owncloud.com/owncloud/core/24402/73/12

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants