You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
shareAccessByID.feature return codes for invalid shares are different with Oracle and Postgresql #39651
runsh: Total unexpected failed scenarios throughout the test run:
apiShareOperationsToShares2/shareAccessByID.feature:50
apiShareOperationsToShares2/shareAccessByID.feature:51
apiShareOperationsToShares2/shareAccessByID.feature:52
apiShareOperationsToShares2/shareAccessByID.feature:53
Scenario Outline: Get a share with an invalid share id # /drone/src/tests/acceptance/features/apiShareOperationsToShares2/shareAccessByID.feature:40
Given using OCS API version "<ocs_api_version>" # FeatureContext::usingOcsApiVersion()
When user "Alice" gets share with id "<share_id>" using the sharing API # FeatureContext::userGetsTheLastShareWithTheShareIdUsingTheSharingApi()
Then the OCS status code should be "404" # OCSContext::theOCSStatusCodeShouldBe()
And the HTTP status code should be "<http_status_code>" # FeatureContext::thenTheHTTPStatusCodeShouldBe()
And the API should not return any data # FeatureContext::theApiShouldNotReturnAnyData()
Examples:
| ocs_api_version | share_id | http_status_code |
| 1 | 2333311 | 200 |
| 2 | 2333311 | 404 |
| 1 | helloshare | 200 |
OCS status code is not any of the expected values 404 got 996
Failed asserting that an array contains '996'.
| 2 | helloshare | 404 |
OCS status code is not any of the expected values 404 got 500
Failed asserting that an array contains '500'.
| 1 | $#@r3 | 200 |
OCS status code is not any of the expected values 404 got 996
Failed asserting that an array contains '996'.
| 2 | $#@r3 | 404 |
OCS status code is not any of the expected values 404 got 500
Failed asserting that an array contains '500'.
| 1 | 0 | 200 |
| 2 | 0 | 404 |
Other tests for accessing share by valid share id are passing. So the happy-path is OK.
When trying to access an invalid/non-existent share id, with MariaDb/MySQL, we get the expected 404 "not found". But with Oracle we get various 996 and 500 codes. So something different is going wrong in this case.
changed the title [-]shareAccessByID.feature return codes for invalid shares are different with Oracle[/-][+]shareAccessByID.feature return codes for invalid shares are different with Oracle and Postgresql[/+]on Jan 7, 2022
🤖 Automated issue triage by Claude Code review agent.
This looks fixed — closing as resolved.
The reported failure was that apiShareOperationsToShares2/shareAccessByID.feature ("Get a share with an invalid share id") returned OCS 996 / HTTP 500 instead of 404 on Oracle and PostgreSQL for non-numeric share IDs such as helloshare and $#@r3. The numeric-but-nonexistent IDs (2333311, 0) already returned 404 everywhere; only the non-numeric values blew up, because the string was passed into a query against the integer share.id column and Oracle/Postgres raise an invalid input syntax for type integer DB error (caught generically → 996/500), whereas MySQL/MariaDB silently match no rows → ShareNotFound → 404.
This root cause was fixed by PR #39873 ("throw ShareNotFound when share id is not an integer", merged 2022-03-14, commit 8705f94), which adds a ctype_digit() guard to both share providers so a non-integer id throws ShareNotFoundbefore touching the database:
if (\!ctype_digit((string)$id)) {
// share id is defined as a field of type integer ...// depending on the database, the query may throw an exception// with a message like "invalid input syntax for type integer"// So throw ShareNotFound now.thrownewShareNotFound();
}
ShareNotFound is mapped to a 404 in Share20OcsController::getShare(), so invalid/non-numeric share IDs now consistently return OCS 404 across all databases — matching the feature expectations, which still assert 404 and currently carry no skip/expected-failure entry.
If this still reproduces on a current release, please reopen with a fresh CI link and DB details — thank you!
Activity
phil-davis commentedon Jan 7, 2022
Other tests for accessing share by valid share id are passing. So the happy-path is OK.
When trying to access an invalid/non-existent share id, with MariaDb/MySQL, we get the expected 404 "not found". But with Oracle we get various 996 and 500 codes. So something different is going wrong in this case.
phil-davis commentedon Jan 7, 2022
PR #39637 demonstrates the failure.
[-]shareAccessByID.feature return codes for invalid shares are different with Oracle[/-][+]shareAccessByID.feature return codes for invalid shares are different with Oracle and Postgresql[/+]phil-davis commentedon Jan 7, 2022
The same happens with Postgresql 9.4
https://drone.owncloud.com/owncloud/core/34194/70/13
PR #39659
And fails with Postgresql 10.3
https://drone.owncloud.com/owncloud/core/34195/70/13
PR #39660
phil-davis commentedon Feb 7, 2022
This still happens, see #39755 (comment)
DeepDiver1975 commentedon Jun 23, 2026
🤖 Automated issue triage by Claude Code review agent.
This looks fixed — closing as resolved.
The reported failure was that
apiShareOperationsToShares2/shareAccessByID.feature("Get a share with an invalid share id") returned OCS996/ HTTP500instead of404on Oracle and PostgreSQL for non-numeric share IDs such ashelloshareand$#@r3. The numeric-but-nonexistent IDs (2333311,0) already returned 404 everywhere; only the non-numeric values blew up, because the string was passed into a query against the integershare.idcolumn and Oracle/Postgres raise aninvalid input syntax for type integerDB error (caught generically → 996/500), whereas MySQL/MariaDB silently match no rows →ShareNotFound→ 404.This root cause was fixed by PR #39873 ("throw ShareNotFound when share id is not an integer", merged 2022-03-14, commit
8705f94), which adds actype_digit()guard to both share providers so a non-integer id throwsShareNotFoundbefore touching the database:lib/private/Share20/DefaultShareProvider.php–getShareById()apps/federatedfilesharing/lib/FederatedShareProvider.php–getShareById()ShareNotFoundis mapped to a 404 inShare20OcsController::getShare(), so invalid/non-numeric share IDs now consistently return OCS 404 across all databases — matching the feature expectations, which still assert404and currently carry no skip/expected-failure entry.If this still reproduces on a current release, please reopen with a fresh CI link and DB details — thank you!