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

fix(cache): etag constraint violation #49420

Merged
merged 1 commit into from
Nov 21, 2024

Conversation

skjnldsv
Copy link
Member

@skjnldsv skjnldsv commented Nov 21, 2024

Fix etag ambiguous query

{
  "level": 3,
  "user": "admin",
  "app": "webdav",
  "method": "REPORT",
  "url": "/remote.php/dav/files/admin/",
  "message": "An exception occurred while executing a query: SQLSTATE[23000]: Integrity constraint violation: 1052 Column 'etag' in field list is ambiguous",
  "version": "31.0.0.5",
  "exception": {
    "Exception": "OC\\DB\\Exceptions\\DbalException",
    "Message": "An exception occurred while executing a query: SQLSTATE[23000]: Integrity constraint violation: 1052 Column 'etag' in field list is ambiguous",
    "Code": 1052,
    "Trace": [
      {
        "file": "/var/www/nextcloud/lib/private/DB/ConnectionAdapter.php",
        "line": 53,
        "function": "wrap",
        "class": "OC\\DB\\Exceptions\\DbalException",
        "type": "::",
        "args": [
          {
            "__class__": "Doctrine\\DBAL\\Exception\\NonUniqueFieldNameException"
          }
        ]
      },
      {
        "file": "/var/www/nextcloud/lib/private/DB/QueryBuilder/QueryBuilder.php",
        "line": 289,
        "function": "executeQuery",
        "class": "OC\\DB\\ConnectionAdapter",
        "type": "->",
        "args": [
          "SELECT `file`.`fileid`, `storage`, `path`, `path_hash`, `file`.`parent`, `file`.`name`, `mimetype`, `mimepart`, `size`, `mtime`, `storage_mtime`, `encrypted`, `etag`, `file`.`permissions`, `checksum`, `unencrypted_size`, `meta`.`json` AS `meta_json`, `meta`.`sync_token` AS `meta_sync_token` FROM `*PREFIX*filecache` `file` LEFT JOIN `*PREFIX*systemtag_object_mapping` `systemtagmap` ON (`file`.`fileid` = `systemtagmap`.`objectid`) AND (`systemtagmap`.`objecttype` = :dcValue1) LEFT JOIN `*PREFIX*files_metadata` `meta` ON `file`.`fileid` = `meta`.`file_id` LEFT JOIN `*PREFIX*systemtag` `systemtag` ON `systemtag`.`id` = `systemtagmap`.`systemtagid` WHERE (`systemtag`.`name` = :dcValue2) AND (`storage` = :dcValue3) AND ((`path` = :dcValue4) OR (`path` LIKE :dcValue5))",

@skjnldsv skjnldsv added this to the Nextcloud 31 milestone Nov 21, 2024
@skjnldsv skjnldsv self-assigned this Nov 21, 2024
@skjnldsv skjnldsv requested review from icewind1991, a team, nfebe and provokateurin and removed request for a team November 21, 2024 09:36
@skjnldsv skjnldsv merged commit e204098 into master Nov 21, 2024
187 checks passed
@skjnldsv skjnldsv deleted the fix/etag-constraint-search-query branch November 21, 2024 10:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants