Skip to content

Impossible to delete more than 30 rows (50/100) at one time @ Exception Reporter (500 Internal Server Error) #7

@NickCoolii

Description

@NickCoolii

@z-song hi!

Laravel admin 1.5.19

Reason is:
Data too long for column 'path' @ table admin_operation_log (at my DB field path is varchar(255))

As I can see possible workarounds:

  1. Bad: change at table schema varchar to text
  2. Better: truncate path variable
  3. The best: put ids from path to input attribute (send ids not as $_GET param, but as $_POST)

Full SQL error:

SQLSTATE[22001]: String data, right truncated: 1406 Data too long for column 'path' at row 1 
(SQL: insert into `admin_operation_log` (`user_id`, `path`, `method`, `ip`, `input`, `updated_at`, `created_at`) values 
(1, admin/exceptions/391,390,389,388,387,386,385,384,383,382,381,380,379,378,377,376,375,374,373,372,371,370,369,368,367,366,365,364,363,362,361,360,359,358,357,356,355,354,353,352,351,350,349,348,347,346,345,344,343,342,341,340,319,318,317,316,315,314,313,31, DELETE, 127.0.0.1, {"_method":"delete","_token":"MkNXt6V30KhIlPHfwSOt1Sxr1GLSeb9crLUoSmFu"}, 2019-03-05 17:40:22, 2019-03-05 17:40:22))

UPD: at my production DB path was VARCHAR(191), but when I changed its length to 255, than DELETE request for big number of rows started to work and just truncate row to 255 characters (path field).
path.admin_operation_log at DB for 100 entries looks like:
admin/exceptions/867,866,865,864,863,862,861,860,859,858,857,856,855,854,853,852,851,850,849,848,847,846,845,844,843,842,841,840,839,838,837,836,835,834,833,832,831,830,829,828,827,826,825,824,823,822,821,820,819,818,817,816,815,814,813,812,811,810,809,80

This much better, than just nothing. Dunno about such effects of varchar's length.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions