focalboard icon indicating copy to clipboard operation
focalboard copied to clipboard

Bug: Can't delete board after import

Open omggga opened this issue 1 year ago • 0 comments

I am writing a modification of importTrello.ts(https://github.com/mattermost/focalboard/blob/main/import/trello/importTrello.ts) for more complete import (including comments, attachments and images). For now everything is ok there, but i had a lot of "broken" boards while were testing import. Some of them doesn't have connections between cards and attachments or images, and the problem is that i cant delete them even having and admin rights.

Steps to reproduce the behavior

  1. Import random card from trello with some wrong data
  2. Select "delete board"
  3. See error in the System console

Expected behaivor

The board is disappeared.

Error

{
  "caller": "app/plugin_api.go:980",
  "level": "error",
  "msg": "Http handler panic",
  "panic": "\"runtime error: slice bounds out of range [1:0]\"",
  "plugin_id": "focalboard",
  "stack": "\"goroutine 235210 [running]:\nruntime/debug.Stack()\n\truntime/debug/stack.go:24 +0x65\ngithub.com/mattermost/focalboard/server/api.(*API).panicHandler.func1.1()\n\tgithub.com/mattermost/focalboard/[email protected]/api/api.go:128 +0x125\npanic({0x1358280, 0xc000c873c8})\n\truntime/panic.go:884 +0x212\ngithub.com/mattermost/focalboard/server/services/store/sqlstore.retrieveFileIDFromBlockFieldStorage({0x0?, 0xc00106ec90?})\n\tgithub.com/mattermost/focalboard/[email protected]/services/store/sqlstore/blocks.go:361 +0x85\ngithub.com/mattermost/focalboard/server/services/store/sqlstore.(*SQLStore).deleteBlockChildren(0xc000324240, {0x1675628, 0xc00133c200}, {0xc00102db3f, 0x1b}, {0x0, 0x0}, {0xc00122ba60, 0x1a})\n\tgithub.com/mattermost/focalboard/[email protected]/services/store/sqlstore/blocks.go:977 +0x1045\ngithub.com/mattermost/focalboard/server/services/store/sqlstore.(*SQLStore).deleteBoardAndChildren(0xc000324240, {0x1675628, 0xc00133c200}, {0xc00102db3f, 0x1b}, {0xc00122ba60, 0x1a}, 0x0)\n\tgithub.com/mattermost/focalboard/[email protected]/services/store/sqlstore/board.go:478 +0xf92\ngithub.com/mattermost/focalboard/server/services/store/sqlstore.(*SQLStore).deleteBoard(...)\n\tgithub.com/mattermost/focalboard/[email protected]/services/store/sqlstore/board.go:415\ngithub.com/mattermost/focalboard/server/services/store/sqlstore.(*SQLStore).DeleteBoard(0xc000324240, {0xc00102db3f, 0x1b}, {0xc00122ba60, 0x1a})\n\tgithub.com/mattermost/focalboard/[email protected]/services/store/sqlstore/public_methods.go:183 +0x109\ngithub.com/mattermost/focalboard/server/app.(*App).DeleteBoard(0xc0002fe9a0, {0xc00102db3f, 0x1b}, {0xc00122ba60, 0x1a})\n\tgithub.com/mattermost/focalboard/[email protected]/app/boards.go:463 +0xa3\ngithub.com/mattermost/focalboard/server/api.(*API).handleDeleteBoard(0xc000a6ecc0, {0x1678bb8, 0xc001289a20}, 0x166d201?)\n\tgithub.com/mattermost/focalboard/[email protected]/api/boards.go:436 +0x24d\ngithub.com/mattermost/focalboard/server/api.(*API).attachSession.func1({0x1678bb8, 0xc001289a20}, 0xc001592d00)\n\tgithub.com/mattermost/focalboard/[email protected]/api/auth.go:369 +0x736\nnet/http.HandlerFunc.ServeHTTP(0xc001405800?, {0x1678bb8?, 0xc001289a20?}, 0x30?)\n\tnet/http/server.go:2109 +0x2f\ngithub.com/mattermost/focalboard/server/api.(*API).requireCSRFToken.func1({0x1678bb8, 0xc001289a20}, 0xc001592d00)\n\tgithub.com/mattermost/focalboard/[email protected]/api/api.go:147 +0xa5\nnet/http.HandlerFunc.ServeHTTP(0xc000e01498?, {0x1678bb8?, 0xc001289a20?}, 0x13b61e0?)\n\tnet/http/server.go:2109 +0x2f\ngithub.com/mattermost/focalboard/server/api.(*API).panicHandler.func1({0x1678bb8?, 0xc001289a20?}, 0xc0014058f0?)\n\tgithub.com/mattermost/focalboard/[email protected]/api/api.go:135 +0x92\nnet/http.HandlerFunc.ServeHTTP(0xc001592c00?, {0x1678bb8?, 0xc001289a20?}, 0xc000ef2608?)\n\tnet/http/server.go:2109 +0x2f\ngithub.com/gorilla/mux.(*Router).ServeHTTP(0xc000361080, {0x1678bb8, 0xc001289a20}, 0xc001592b00)\n\tgithub.com/gorilla/[email protected]/mux.go:210 +0x1cf\ngithub.com/mattermost/focalboard/mattermost-plugin/server/boards.(*BoardsApp).ServeHTTP(...)\n\tgithub.com/mattermost/focalboard/mattermost-plugin/server/boards/boardsapp.go:226\nmain.(*Plugin).ServeHTTP(0x7f0f2e5f6510?, 0x137b540?, {0x1678bb8?, 0xc001289a20?}, 0x3?)\n\tgithub.com/mattermost/focalboard/mattermost-plugin/server/plugin.go:110 +0x4f\ngithub.com/mattermost/mattermost-server/v6/plugin.(*hooksRPCServer).ServeHTTP(0xc0003171a0, 0xc000f92d20, 0x1?)\n\tgithub.com/mattermost/mattermost-server/[email protected]/plugin/client_rpc.go:453 +0x417\nreflect.Value.call({0xc000400a80?, 0xc0000a5788?, 0xc000570dd8?}, {0x13e3538, 0x4}, {0xc000570ef8, 0x3, 0xc00166f680?})\n\treflect/value.go:584 +0x8c5\nreflect.Value.Call({0xc000400a80?, 0xc0000a5788?, 0x11f1140?}, {0xc000570ef8?, 0xc000570fb8?, 0xc35cd4?})\n\treflect/value.go:368 +0xbc\nnet/rpc.(*service).call(0xc00041d380, 0xc001060e50?, 0xc?, 0xc0001075b0, 0xc000233a00, 0xc000570f48?, {0x11e2600?, 0xc000f92d20?, 0xc36926?}, {0x11f2d40, ...}, ...)\n\tnet/rpc/server.go:382 +0x226\ncreated by net/rpc.(*Server).ServeCodec\n\tnet/rpc/server.go:479 +0x3fe\n\"",
  "timestamp": "2023-10-16 13:43:28.317 Z",
  "uri": "/api/v2/boards/bub47qy9rb7rfjkghpnyrwd1xbr"
}

Edition and Platform

  • Edition: Mattermost Boards
  • Version: 7.11.3
  • Browser and OS: MacOS (mm hosted on linux server)

omggga avatar Oct 16 '23 13:10 omggga