Skip to content

Cannot open a table with 25k rows #1490

@blizzz

Description

@blizzz

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": []
      }
    ],
    
}

Metadata

Metadata

Assignees

Labels

1. to developAccepted and waiting to be taken care ofbugSomething isn't working

Type

No type

Projects

Status

📄 To do (~10 entries)

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions