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

Cannot open a table with 25k rows #1490

Open
blizzz opened this issue Dec 4, 2024 · 0 comments
Open

Cannot open a table with 25k rows #1490

blizzz opened this issue Dec 4, 2024 · 0 comments
Assignees
Labels
1. to develop Accepted and waiting to be taken care of bug Something isn't working

Comments

@blizzz
Copy link
Member

blizzz commented Dec 4, 2024

Steps to reproduce

  1. Have a table with 25k rows (e.g. via CSV import)
  2. Go to tables app
  3. Open this table

Expected behavior

The table is being loaded and values are being shown. Pagination is available.

Actual behavior

Could not load rows. Unknown error. appears as error popup.

On the backend, an Exception is thrown: An exception occurred while executing a query: SQLSTATE[HY000]: General error: 7 number of parameters must be between 0 and 65535

Tables app version

main

Browser

No response

Client operating system

No response

Operating system

No response

Web server

None

PHP engine version

None

Database

PostgreSQL

Additional info

Actually the number of parameters is smaller, actually 25k row ids, plus ten column ids. However the query contains UNIONS and the row IDs are inserted 5 times in the total query – this would make sense again.

Excerpt from the log (omitting the 25k ids…):

{
  "reqId": "jgnUNqgUUWi2A9hU5S7d",
  "level": 3,
  "time": "2024-12-04T16:39:10+00:00",
  "remoteAddr": "127.0.0.1",
  "user": "master",
  "app": "tables",
  "method": "GET",
  "url": "/master/index.php/apps/tables/row/table/830",
  "message": "An exception occurred while executing a query: SQLSTATE[HY000]: General error: 7 number of parameters must be between 0 and 65535",
  "userAgent": "Mozilla/5.0 (X11; Linux x86_64; rv:133.0) Gecko/20100101 Firefox/133.0",
  "version": "31.0.0.5",
  "exception": {
    "Exception": "OC\\DB\\Exceptions\\DbalException",
    "Message": "An exception occurred while executing a query: SQLSTATE[HY000]: General error: 7 number of parameters must be between 0 and 65535",
    "Code": 7,
    "Trace": [
      {
        "file": "/srv/http/nextcloud/master/lib/private/DB/ConnectionAdapter.php",
        "line": 53,
        "function": "wrap",
        "class": "OC\\DB\\Exceptions\\DbalException",
        "type": "::",
        "args": [
          {
            "__class__": "Doctrine\\DBAL\\Exception\\DriverException"
          }
        ]
      },
      {
        "file": "/srv/http/nextcloud/master/apps-repos/tables/lib/Db/Row2Mapper.php",
        "line": 227,
        "function": "executeQuery",
        "class": "OC\\DB\\ConnectionAdapter",
        "type": "->",
        "args": [
          "SELECT `row_id`, `column_id`, `created_by`, `created_at`, `t1`.`last_edit_by`, `t1`.`last_edit_at`, `value`, `table_id`, `value_type` FROM (SELECT `row_id`, `column_id`, `last_edit_at`, `last_edit_by`, CAST(`value` AS TEXT) AS `value`, NULL AS `value_type` FROM `*PREFIX*tables_row_cells_text` WHERE (`column_id` IN (:columnIds)) AND (`row_id` IN (:rowsIds)) UNION ALL SELECT `row_id`, `column_id`, `last_edit_at`, `last_edit_by`, CAST(`value` AS TEXT) AS `value`, NULL AS `value_type` FROM `*PREFIX*tables_row_cells_number` WHERE (`column_id` IN (:columnIds)) AND (`row_id` IN (:rowsIds))  UNION ALL SELECT `row_id`, `column_id`, `last_edit_at`, `last_edit_by`, CAST(`value` AS TEXT) AS `value`, NULL AS `value_type` FROM `*PREFIX*tables_row_cells_datetime` WHERE (`column_id` IN (:columnIds)) AND (`row_id` IN (:rowsIds))  UNION ALL SELECT `row_id`, `column_id`, `last_edit_at`, `last_edit_by`, CAST(`value` AS TEXT) AS `value`, NULL AS `value_type` FROM `*PREFIX*tables_row_cells_selection` WHERE (`column_id` IN (:columnIds)) AND (`row_id` IN (:rowsIds))  UNION ALL SELECT `row_id`, `column_id`, `last_edit_at`, `last_edit_by`, CAST(`value` AS TEXT) AS `value`, CAST(`value_type` AS TEXT) AS `value_type` FROM `*PREFIX*tables_row_cells_usergroup` WHERE (`column_id` IN (:columnIds)) AND (`row_id` IN (:rowsIds)) ) `t1` INNER JOIN `*PREFIX*tables_row_sleeves` `rs` ON rs.id = t1.row_id",
          {
            "columnIds": [
              
            ],
            "rowsIds": [
              
            ]
          },
          {
            "columnIds": 101,
            "rowsIds": 101
          }
        ]
      },
      {
        "file": "/srv/http/nextcloud/master/apps-repos/tables/lib/Db/Row2Mapper.php",
        "line": 180,
        "function": "getRows",
        "class": "OCA\\Tables\\Db\\Row2Mapper",
        "type": "->",
        "args": [
          [
            
          ],
          [
            
          ]
        ]
      },
      {
        "file": "/srv/http/nextcloud/master/apps-repos/tables/lib/Service/RowService.php",
        "line": 86,
        "function": "findAll",
        "class": "OCA\\Tables\\Db\\Row2Mapper",
        "type": "->",
        "args": [
          [
            
          ]
      },
      {
        "file": "/srv/http/nextcloud/master/apps-repos/tables/lib/Controller/RowController.php",
        "line": 45,
        "function": "findAllByTable",
        "class": "OCA\\Tables\\Service\\RowService",
        "type": "->",
        "args": [
          830,
          "master"
        ]
      },
      {
        "file": "/srv/http/nextcloud/master/apps-repos/tables/lib/Controller/Errors.php",
        "line": 22,
        "function": "OCA\\Tables\\Controller\\{closure}",
        "class": "OCA\\Tables\\Controller\\RowController",
        "type": "->",
        "args": [
          "*** sensitive parameters replaced ***"
        ]
      },
      {
        "file": "/srv/http/nextcloud/master/apps-repos/tables/lib/Controller/RowController.php",
        "line": 44,
        "function": "handleError",
        "class": "OCA\\Tables\\Controller\\RowController",
        "type": "->",
        "args": [
          {
            "__class__": "Closure"
          }
        ]
      },
      {
        "file": "/srv/http/nextcloud/master/lib/private/AppFramework/Http/Dispatcher.php",
        "line": 208,
        "function": "index",
        "class": "OCA\\Tables\\Controller\\RowController",
        "type": "->",
        "args": [
          830
        ]
      },
      {
        "file": "/srv/http/nextcloud/master/lib/private/AppFramework/Http/Dispatcher.php",
        "line": 114,
        "function": "executeController",
        "class": "OC\\AppFramework\\Http\\Dispatcher",
        "type": "->",
        "args": [
          {
            "__class__": "OCA\\Tables\\Controller\\RowController"
          },
          "index"
        ]
      },
      {
        "file": "/srv/http/nextcloud/master/lib/private/AppFramework/App.php",
        "line": 161,
        "function": "dispatch",
        "class": "OC\\AppFramework\\Http\\Dispatcher",
        "type": "->",
        "args": [
          {
            "__class__": "OCA\\Tables\\Controller\\RowController"
          },
          "index"
        ]
      },
      {
        "file": "/srv/http/nextcloud/master/lib/private/Route/Router.php",
        "line": 306,
        "function": "main",
        "class": "OC\\AppFramework\\App",
        "type": "::",
        "args": [
          "OCA\\Tables\\Controller\\RowController",
          "index",
          {
            "__class__": "OC\\AppFramework\\DependencyInjection\\DIContainer"
          },
          {
            "tableId": "830",
            "_route": "tables.row.index"
          }
        ]
      },
      {
        "file": "/srv/http/nextcloud/master/lib/base.php",
        "line": 1012,
        "function": "match",
        "class": "OC\\Route\\Router",
        "type": "->",
        "args": [
          "/apps/tables/row/table/830"
        ]
      },
      {
        "file": "/srv/http/nextcloud/master/index.php",
        "line": 24,
        "function": "handleRequest",
        "class": "OC",
        "type": "::",
        "args": []
      }
    ],
    
}
@blizzz blizzz added 0. Needs triage Pending approval or rejection. This issue is pending approval. bug Something isn't working 1. to develop Accepted and waiting to be taken care of and removed 0. Needs triage Pending approval or rejection. This issue is pending approval. labels Dec 4, 2024
@github-project-automation github-project-automation bot moved this to 🧭 Planning evaluation (don't pick) in 📝 Office team Dec 4, 2024
@blizzz blizzz moved this from 🧭 Planning evaluation (don't pick) to 📄 To do (~10 entries) in 📝 Office team Dec 4, 2024
@blizzz blizzz self-assigned this Dec 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
1. to develop Accepted and waiting to be taken care of bug Something isn't working
Projects
Status: 📄 To do (~10 entries)
Development

No branches or pull requests

1 participant