Bug description

When selecting "SQL" and then "SQL Lab" a big red popup appears with the words "Unexpected error" and a "See more " link to the right. Screenshot_20240704_152504

How to reproduce the bug

  1. Select "SQL" from the top bar menu.
  2. Select "SQL Lab" from the dropdown menu

Screenshots/recordings

Screenshot_20240704_152504 Screenshot_20240704_153215

Superset version

4.0.1

Python version

3.9

Node version

16

Browser

Firefox

Additional context

It's actually version 4.0.2 Docker from hub.docker.com (treating this as an "official" version. The container is: image: apache/superset:linux-arm64-4.0.2 The old V2 container (home brew) was working quite well. Most things in 4.0.2 seem to be working correctly. Right now I can't create a virtual dataset without SQL Lab's assistance. It may be a client side issue?

The container logs don't seem to show anything unusual: 10.255.1.229 - - [04/Jul/2024:05:18:13 +0000] "GET /api/v1/me/ HTTP/1.1" 200 168 "http://host1.localdomain:8088/sqllab/" "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:127.0) Gecko/20100101 Firefox/127.0" 10.255.1.229 - - [04/Jul/2024:05:18:18 +0000] "GET / HTTP/1.1" 302 223 "-" "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:127.0) Gecko/20100101 Firefox/127.0" 10.255.1.229 - - [04/Jul/2024:05:18:21 +0000] "GET /superset/welcome/ HTTP/1.1" 200 52908 "-" "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:127.0) Gecko/20100101 Firefox/127.0" 10.255.1.229 - - [04/Jul/2024:05:18:21 +0000] "GET /static/assets/spa.4e7739271dd8345f5f63.entry.css HTTP/1.1" 200 1626 "http://host1.localdomain:8088/superset/welcome/" "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:127.0) Gecko/20100101 Firefox/127.0" 10.255.1.229 - - [04/Jul/2024:05:18:21 +0000] "GET /static/assets/5331.c74eed074876a45d97cc.entry.js HTTP/1.1" 200 11732 "http://host1.localdomain:8088/superset/welcome/" "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:127.0) Gecko/20100101 Firefox/127.0" 10.255.1.229 - - [04/Jul/2024:05:18:21 +0000] "GET /static/assets/4717.3efd9c3826292836dba0.entry.js HTTP/1.1" 200 13774 "http://host1.localdomain:8088/superset/welcome/" "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:127.0) Gecko/20100101 Firefox/127.0" 10.255.1.229 - - [04/Jul/2024:05:18:21 +0000] "GET /static/assets/8047.faccc427ae53a7d09647.entry.js HTTP/1.1" 200 18624 "http://host1.localdomain:8088/superset/welcome/" "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:127.0) Gecko/20100101 Firefox/127.0" 10.255.1.229 - - [04/Jul/2024:05:18:21 +0000] "GET /static/assets/7130.862c10081382ebf099ef.entry.js HTTP/1.1" 200 85613 "http://host1.localdomain:8088/superset/welcome/" "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:127.0) Gecko/20100101 Firefox/127.0" 10.255.1.229 - - [04/Jul/2024:05:18:21 +0000] "GET /static/assets/spa.4e7739271dd8345f5f63.entry.js HTTP/1.1" 200 86985 "http://host1.localdomain:8088/superset/welcome/" "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:127.0) Gecko/20100101 Firefox/127.0" 10.255.1.229 - - [04/Jul/2024:05:18:21 +0000] "GET /static/assets/4725.2259718d2a884521d48e.entry.js HTTP/1.1" 200 100108 "http://host1.localdomain:8088/superset/welcome/" "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:127.0) Gecko/20100101 Firefox/127.0" 10.255.1.229 - - [04/Jul/2024:05:18:22 +0000] "GET /static/assets/a9d8a6af8e900907c2e3.chunk.js HTTP/1.1" 200 518 "http://host1.localdomain:8088/superset/welcome/" "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:127.0) Gecko/20100101 Firefox/127.0" 10.255.1.229 - - [04/Jul/2024:05:18:22 +0000] "GET /static/assets/f8a10326828318d2245e.woff2 HTTP/1.1" 200 0 "http://host1.localdomain:8088/static/assets/theme.cfbde93523febd60f894.entry.css" "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:127.0) Gecko/20100101 Firefox/127.0" 2024-07-04 05:18:22,276:DEBUG:urllib3.connectionpool:Starting new HTTPS connection (1): json-schema.org:443 2024-07-04 05:18:22,284:DEBUG:urllib3.connectionpool:Starting new HTTPS connection (1): json-schema.org:443 2024-07-04 05:18:22,935:DEBUG:urllib3.connectionpool:https://json-schema.org:443 "GET /draft/2020-12/meta/core HTTP/1.1" 200 1471 2024-07-04 05:18:22,986:DEBUG:urllib3.connectionpool:https://json-schema.org:443 "GET /draft/2020-12/meta/core HTTP/1.1" 200 1471 2024-07-04 05:18:23,016:DEBUG:urllib3.connectionpool:Starting new HTTPS connection (1): json-schema.org:443 2024-07-04 05:18:23,128:DEBUG:urllib3.connectionpool:Starting new HTTPS connection (1): json-schema.org:443 10.255.1.229 - - [04/Jul/2024:05:18:23 +0000] "GET /api/v1/log/recent_activity/?q=(page_size:6) HTTP/1.1" 200 224 "http://host1.localdomain:8088/superset/welcome/" "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:127.0) Gecko/20100101 Firefox/127.0" 2024-07-04 05:18:23,630:DEBUG:urllib3.connectionpool:https://json-schema.org:443 "GET /draft/2020-12/meta/applicator HTTP/1.1" 200 1560 2024-07-04 05:18:23,676:DEBUG:urllib3.connectionpool:https://json-schema.org:443 "GET /draft/2020-12/meta/applicator HTTP/1.1" 200 1560 2024-07-04 05:18:23,707:DEBUG:urllib3.connectionpool:Starting new HTTPS connection (1): json-schema.org:443 2024-07-04 05:18:23,744:DEBUG:urllib3.connectionpool:Starting new HTTPS connection (1): json-schema.org:443 10.255.1.229 - - [04/Jul/2024:05:18:23 +0000] "GET /api/v1/database/?q=(filters:!((col:allow_file_upload,opr:upload_is_enabled,value:!t))) HTTP/1.1" 200 536 "http://host1.localdomain:8088/superset/welcome/" "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:127.0) Gecko/20100101 Firefox/127.0" 10.255.1.229 - - [04/Jul/2024:05:18:23 +0000] "POST /superset/log/?explode=events HTTP/1.1" 200 20 "http://host1.localdomain:8088/superset/welcome/" "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:127.0) Gecko/20100101 Firefox/127.0" 2024-07-04 05:18:24,271:DEBUG:urllib3.connectionpool:https://json-schema.org:443 "GET /draft/2020-12/meta/unevaluated HTTP/1.1" 200 406 2024-07-04 05:18:24,331:DEBUG:urllib3.connectionpool:https://json-schema.org:443 "GET /draft/2020-12/meta/unevaluated HTTP/1.1" 200 406 2024-07-04 05:18:24,340:DEBUG:urllib3.connectionpool:Starting new HTTPS connection (1): json-schema.org:443 2024-07-04 05:18:24,388:DEBUG:urllib3.connectionpool:Starting new HTTPS connection (1): json-schema.org:443 10.255.1.229 - - [04/Jul/2024:05:18:24 +0000] "GET /api/v1/dashboard/?q=(filters:!((col:owners,opr:rel_m_m,value:%271%27)),order_column:changed_on_delta_humanized,order_direction:desc,page:0,page_size:5) HTTP/1.1" 200 2520 "http://host1.localdomain:8088/superset/welcome/" "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:127.0) Gecko/20100101 Firefox/127.0" 2024-07-04 05:18:24,891:DEBUG:urllib3.connectionpool:https://json-schema.org:443 "GET /draft/2020-12/meta/validation HTTP/1.1" 200 2735 2024-07-04 05:18:24,918:DEBUG:urllib3.connectionpool:https://json-schema.org:443 "GET /draft/2020-12/meta/validation HTTP/1.1" 200 2735 2024-07-04 05:18:24,967:DEBUG:urllib3.connectionpool:Starting new HTTPS connection (1): json-schema.org:443 2024-07-04 05:18:24,997:DEBUG:urllib3.connectionpool:Starting new HTTPS connection (1): json-schema.org:443 127.0.0.1 - - [04/Jul/2024:05:18:25 +0000] "GET /health HTTP/1.1" 200 2 "-" "curl/7.88.1" 2024-07-04 05:18:25,607:DEBUG:urllib3.connectionpool:https://json-schema.org:443 "GET /draft/2020-12/meta/meta-data HTTP/1.1" 200 794 2024-07-04 05:18:25,609:DEBUG:urllib3.connectionpool:https://json-schema.org:443 "GET /draft/2020-12/meta/meta-data HTTP/1.1" 200 794 2024-07-04 05:18:25,637:DEBUG:urllib3.connectionpool:Starting new HTTPS connection (1): json-schema.org:443 2024-07-04 05:18:25,666:DEBUG:urllib3.connectionpool:Starting new HTTPS connection (1): json-schema.org:443 10.255.1.229 - - [04/Jul/2024:05:18:25 +0000] "GET /api/v1/dashboard/?q=(filters:!(),order_column:changed_on_delta_humanized,order_direction:desc,page:0,page_size:5) HTTP/1.1" 200 2881 "http://host1.localdomain:8088/superset/welcome/" "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:127.0) Gecko/20100101 Firefox/127.0" 10.255.1.229 - - [04/Jul/2024:05:18:26 +0000] "GET /api/v1/chart/?q=(filters:!(),order_column:changed_on_delta_humanized,order_direction:desc,page:0,page_size:5) HTTP/1.1" 200 4210 "http://host1.localdomain:8088/superset/welcome/" "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:127.0) Gecko/20100101 Firefox/127.0" 2024-07-04 05:18:26,177:DEBUG:urllib3.connectionpool:https://json-schema.org:443 "GET /draft/2020-12/meta/format-annotation HTTP/1.1" 200 342 10.255.1.229 - - [04/Jul/2024:05:18:26 +0000] "GET /static/assets/f98f64307512531e8640.chunk.js HTTP/1.1" 200 611 "http://host1.localdomain:8088/superset/welcome/" "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:127.0) Gecko/20100101 Firefox/127.0" 2024-07-04 05:18:26,208:DEBUG:urllib3.connectionpool:https://json-schema.org:443 "GET /draft/2020-12/meta/format-annotation HTTP/1.1" 200 342 2024-07-04 05:18:26,237:DEBUG:urllib3.connectionpool:Starting new HTTPS connection (1): json-schema.org:443 10.255.1.229 - - [04/Jul/2024:05:18:26 +0000] "GET /static/assets/e148d4cb3c9558ddda49.chunk.js HTTP/1.1" 200 480 "http://host1.localdomain:8088/superset/welcome/" "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:127.0) Gecko/20100101 Firefox/127.0" 2024-07-04 05:18:26,242:DEBUG:urllib3.connectionpool:Starting new HTTPS connection (1): json-schema.org:443 10.255.1.229 - - [04/Jul/2024:05:18:26 +0000] "GET /api/v1/database/?q=(filters:!((col:database_name,opr:neq,value:examples))) HTTP/1.1" 200 840 "http://host1.localdomain:8088/superset/welcome/" "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:127.0) Gecko/20100101 Firefox/127.0" 10.255.1.229 - - [04/Jul/2024:05:18:26 +0000] "GET /static/assets/8108d408953fa205f1b0.chunk.js HTTP/1.1" 200 724 "http://host1.localdomain:8088/superset/welcome/" "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:127.0) Gecko/20100101 Firefox/127.0" 10.255.1.229 - - [04/Jul/2024:05:18:26 +0000] "GET /api/v1/dashboard/_info?q=(keys:!(permissions)) HTTP/1.1" 200 114 "http://host1.localdomain:8088/superset/welcome/" "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:127.0) Gecko/20100101 Firefox/127.0" 10.255.1.229 - - [04/Jul/2024:05:18:26 +0000] "GET /api/v1/dashboard/favorite_status/?q=!(3,4,2,1) HTTP/1.1" 200 104 "http://host1.localdomain:8088/superset/welcome/" "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:127.0) Gecko/20100101 Firefox/127.0" 10.255.1.229 - - [04/Jul/2024:05:18:26 +0000] "GET /static/assets/0938beca1d50c37aed00.chunk.js HTTP/1.1" 200 642 "http://host1.localdomain:8088/superset/welcome/" "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:127.0) Gecko/20100101 Firefox/127.0" 2024-07-04 05:18:26,713:DEBUG:urllib3.connectionpool:https://json-schema.org:443 "GET /draft/2020-12/meta/content HTTP/1.1" 200 423 2024-07-04 05:18:26,739:DEBUG:urllib3.connectionpool:https://json-schema.org:443 "GET /draft/2020-12/meta/content HTTP/1.1" 200 423 10.255.1.229 - - [04/Jul/2024:05:18:27 +0000] "GET /api/v1/saved_query/?q=(filters:!((col:created_by,opr:rel_o_m,value:%271%27)),order_column:changed_on_delta_humanized,order_direction:desc,page:0,page_size:5) HTTP/1.1" 200 1397 "http://host1.localdomain:8088/superset/welcome/" "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:127.0) Gecko/20100101 Firefox/127.0" 10.255.1.229 - - [04/Jul/2024:05:18:27 +0000] "GET /api/v1/chart/?q=(filters:!((col:owners,opr:rel_m_m,value:%271%27)),order_column:changed_on_delta_humanized,order_direction:desc,page:0,page_size:5) HTTP/1.1" 200 4210 "http://host1.localdomain:8088/superset/welcome/" "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:127.0) Gecko/20100101 Firefox/127.0" 10.255.1.229 - - [04/Jul/2024:05:18:28 +0000] "GET /api/v1/chart/_info?q=(keys:!(permissions)) HTTP/1.1" 200 54 "http://host1.localdomain:8088/superset/welcome/" "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:127.0) Gecko/20100101 Firefox/127.0" 10.255.1.229 - - [04/Jul/2024:05:18:28 +0000] "GET /api/v1/chart/favorite_status/?q=!(10,9,8,7,3) HTTP/1.1" 200 129 "http://host1.localdomain:8088/superset/welcome/" "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:127.0) Gecko/20100101 Firefox/127.0" 10.255.1.229 - - [04/Jul/2024:05:18:34 +0000] "GET /static/assets/b49176009f8cc1c2c054.chunk.js HTTP/1.1" 200 3664 "http://host1.localdomain:8088/sqllab/" "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:127.0) Gecko/20100101 Firefox/127.0" 10.255.1.229 - - [04/Jul/2024:05:18:35 +0000] "GET /static/assets/3c56f87e288c0177dcd6.chunk.js HTTP/1.1" 200 123518 "http://host1.localdomain:8088/sqllab/" "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:127.0) Gecko/20100101 Firefox/127.0" 10.255.1.229 - - [04/Jul/2024:05:18:35 +0000] "GET /api/v1/sqllab/ HTTP/1.1" 403 24 "http://host1.localdomain:8088/sqllab/" "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:127.0) Gecko/20100101 Firefox/127.0" 10.255.1.229 - - [04/Jul/2024:05:18:36 +0000] "POST /superset/log/?explode=events HTTP/1.1" 200 20 "http://host1.localdomain:8088/sqllab/" "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:127.0) Gecko/20100101 Firefox/127.0" 127.0.0.1 - - [04/Jul/2024:05:18:55 +0000] "GET /health HTTP/1.1" 200 2 "-" "curl/7.88.1" 127.0.0.1 - - [04/Jul/2024:05:19:25 +0000] "GET /health HTTP/1.1" 200 2 "-" "curl/7.88.1" 127.0.0.1 - - [04/Jul/2024:05:19:56 +0000] "GET /health HTTP/1.1" 200 2 "-" "curl/7.88.1" 127.0.0.1 - - [04/Jul/2024:05:20:26 +0000] "GET /health HTTP/1.1" 200 2 "-" "curl/7.88.1" 127.0.0.1 - - [04/Jul/2024:05:20:56 +0000] "GET /health HTTP/1.1" 200 2 "-" "curl/7.88.1" 127.0.0.1 - - [04/Jul/2024:05:21:26 +0000] "GET /health HTTP/1.1" 200 2 "-" "curl/7.88.1" 10.255.1.229 - - [04/Jul/2024:05:21:44 +0000] "GET /api/v1/me/ HTTP/1.1" 200 168 "http://host1.localdomain:8088/sqllab/" "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:127.0) Gecko/20100101 Firefox/127.0" 127.0.0.1 - - [04/Jul/2024:05:21:56 +0000] "GET /health HTTP/1.1" 200 2 "-" "curl/7.88.1" 127.0.0.1 - - [04/Jul/2024:05:22:26 +0000] "GET /health HTTP/1.1" 200 2 "-" "curl/7.88.1" 10.255.1.229 - - [04/Jul/2024:05:22:41 +0000] "GET /api/v1/me/ HTTP/1.1" 200 168 "http://host1.localdomain:8088/sqllab/" "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:127.0) Gecko/20100101 Firefox/127.0" 127.0.0.1 - - [04/Jul/2024:05:22:56 +0000] "GET /health HTTP/1.1" 200 2 "-" "curl/7.88.1" 10.255.1.229 - - [04/Jul/2024:05:23:24 +0000] "GET /api/v1/me/ HTTP/1.1" 200 168 "http://host1.localdomain:8088/sqllab/" "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:127.0) Gecko/20100101 Firefox/127.0" 127.0.0.1 - - [04/Jul/2024:05:23:27 +0000] "GET /health HTTP/1.1" 200 2 "-" "curl/7.88.1" 127.0.0.1 - - [04/Jul/2024:05:23:57 +0000] "GET /health HTTP/1.1" 200 2 "-" "curl/7.88.1" 10.255.1.229 - - [04/Jul/2024:05:24:07 +0000] "GET /api/v1/me/ HTTP/1.1" 200 168 "http://host1.localdomain:8088/sqllab/" "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:127.0) Gecko/20100101 Firefox/127.0" 10.255.1.229 - - [04/Jul/2024:05:24:21 +0000] "GET /api/v1/me/ HTTP/1.1" 200 168 "http://host1.localdomain:8088/sqllab/" "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:127.0) Gecko/20100101 Firefox/127.0" 127.0.0.1 - - [04/Jul/2024:05:24:27 +0000] "GET /health HTTP/1.1" 200 2 "-" "curl/7.88.1" 10.255.1.229 - - [04/Jul/2024:05:24:43 +0000] "GET /api/v1/me/ HTTP/1.1" 200 168 "http://host1.localdomain:8088/sqllab/" "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:127.0) Gecko/20100101 Firefox/127.0" 127.0.0.1 - - [04/Jul/2024:05:24:57 +0000] "GET /health HTTP/1.1" 200 2 "-" "curl/7.88.1" 127.0.0.1 - - [04/Jul/2024:05:25:27 +0000] "GET /health HTTP/1.1" 200 2 "-" "curl/7.88.1" 127.0.0.1 - - [04/Jul/2024:05:25:57 +0000] "GET /health HTTP/1.1" 200 2 "-" "curl/7.88.1" 127.0.0.1 - - [04/Jul/2024:05:26:28 +0000] "GET /health HTTP/1.1" 200 2 "-" "curl/7.88.1" 127.0.0.1 - - [04/Jul/2024:05:26:58 +0000] "GET /health HTTP/1.1" 200 2 "-" "curl/7.88.1" 127.0.0.1 - - [04/Jul/2024:05:27:28 +0000] "GET /health HTTP/1.1" 200 2 "-" "curl/7.88.1" 127.0.0.1 - - [04/Jul/2024:05:27:58 +0000] "GET /health HTTP/1.1" 200 2 "-" "curl/7.88.1" 127.0.0.1 - - [04/Jul/2024:05:28:28 +0000] "GET /health HTTP/1.1" 200 2 "-" "curl/7.88.1" 127.0.0.1 - - [04/Jul/2024:05:28:58 +0000] "GET /health HTTP/1.1" 200 2 "-" "curl/7.88.1" 127.0.0.1 - - [04/Jul/2024:05:29:29 +0000] "GET /health HTTP/1.1" 200 2 "-" "curl/7.88.1" 127.0.0.1 - - [04/Jul/2024:05:29:59 +0000] "GET /health HTTP/1.1" 200 2 "-" "curl/7.88.1" 127.0.0.1 - - [04/Jul/2024:05:30:29 +0000] "GET /health HTTP/1.1" 200 2 "-" "curl/7.88.1" 127.0.0.1 - - [04/Jul/2024:05:30:59 +0000] "GET /health HTTP/1.1" 200 2 "-" "curl/7.88.1" 127.0.0.1 - - [04/Jul/2024:05:31:29 +0000] "GET /health HTTP/1.1" 200 2 "-" "curl/7.88.1" 127.0.0.1 - - [04/Jul/2024:05:31:59 +0000] "GET /health HTTP/1.1" 200 2 "-" "curl/7.88.1" 127.0.0.1 - - [04/Jul/2024:05:32:30 +0000] "GET /health HTTP/1.1" 200 2 "-" "curl/7.88.1" 127.0.0.1 - - [04/Jul/2024:05:33:00 +0000] "GET /health HTTP/1.1" 200 2 "-" "curl/7.88.1" 127.0.0.1 - - [04/Jul/2024:05:33:30 +0000] "GET /health HTTP/1.1" 200 2 "-" "curl/7.88.1" 127.0.0.1 - - [04/Jul/2024:05:34:00 +0000] "GET /health HTTP/1.1" 200 2 "-" "curl/7.88.1" 127.0.0.1 - - [04/Jul/2024:05:34:30 +0000] "GET /health HTTP/1.1" 200 2 "-" "curl/7.88.1"

Checklist

  • [X] I have searched Superset docs and Slack and didn't find a solution to my problem.
  • [X] I have searched the GitHub issue tracker and didn't find a similar bug report.
  • [X] I have checked Superset's logs for errors and if I found a relevant Python stacktrace, I included it here as text in the "additional context" section.

Comment From: dosubot[bot]

Hello @electricbrain-code! I'm here to help you with any bugs, questions, or contributions you have for the repository. Let's work together to resolve any issues you're experiencing.

To resolve the TypeError: can't convert undefined to object error in Superset 4.0.2 when selecting "SQL Lab", you can refer to the fix implemented in the pull request #19664. The fix addresses the issue by ensuring that an undefined schema is not replaced with an empty object.

Here is the relevant change from the pull request:

fix(sql-lab): do not replace undefined schema with empty object (@villebro)

This fix ensures that the schema remains undefined instead of being converted to an empty object, which should resolve the TypeError you are encountering [1].

Additionally, there are known compatibility issues with Firefox 127.0.2, as the browserslist configuration specifies support for the last 3 versions of Firefox. Since Firefox 127.0.2 is not within the last 3 versions, there may be compatibility issues [2].

To continue talking to Dosu, mention @dosu.

Comment From: electricbrain-code

Thanks for that @dosu. That fix appears to be dated 2022. Should I expect that to be included in version 4.0.2? Here is a more or less identical screen grab from Windows Edge browser (It may not be the browser doing this): Screenshot_20240704_163230

Comment From: dosubot[bot]

Yes, the fix from 2022 should be included in version 4.0.2. However, the error you're encountering might be due to a different issue.

To address the "TypeError: Cannot convert undefined or null to object" error in Superset 4.0.2 when selecting "SQL Lab", you can add a check to ensure activeTab is defined before accessing its properties. Here is the modified code snippet for the getInitialState function:

export default function getInitialState({
  common,
  active_tab: activeTab,
  tab_state_ids: tabStateIds = [],
  databases,
  queries: queries_,
  ...otherBootstrapData
}: BootstrapData & Partial<InitialState>) {
  let queryEditors: Record<string, QueryEditor> = {};
  const defaultQueryEditor = {
    version: LatestQueryEditorVersion,
    loaded: true,
    name: t('Untitled query'),
    sql: '',
    latestQueryId: null,
    autorun: false,
    dbId: common.conf.SQLLAB_DEFAULT_DBID,
    queryLimit: common.conf.DEFAULT_SQLLAB_LIMIT,
    hideLeftBar: false,
    remoteId: null,
    cursorPosition: { row: 0, column: 0 },
  };
  let unsavedQueryEditor: UnsavedQueryEditor = {};

  tabStateIds.forEach(({ id, label }) => {
    let queryEditor: QueryEditor;
    if (activeTab && activeTab.id === id) {
      queryEditor = {
        version: activeTab.extra_json?.version ?? QueryEditorVersion.V1,
        id: id.toString(),
        loaded: true,
        name: activeTab.label,
        sql: activeTab.sql || '',
        selectedText: undefined,
        latestQueryId: activeTab.latest_query
          ? activeTab.latest_query.id
          : null,
        remoteId: activeTab.saved_query?.id || null,
        autorun: Boolean(activeTab.autorun),
        templateParams: activeTab.template_params || undefined,
        dbId: activeTab.database_id,
        catalog: activeTab.catalog,
        schema: activeTab.schema,
        queryLimit: activeTab.query_limit,
        hideLeftBar: activeTab.hide_left_bar,
        updatedAt: activeTab.extra_json?.updatedAt,
      };
    } else {
      queryEditor = {
        ...defaultQueryEditor,
        id: id.toString(),
        loaded: false,
        name: label,
        dbId: undefined,
      };
    }
    queryEditors = {
      ...queryEditors,
      [queryEditor.id]: queryEditor,
    };
  });

  const tabHistory = activeTab ? [activeTab.id.toString()] : [];
  let lastUpdatedActiveTab = activeTab ? activeTab.id.toString() : '';
  let tables = {} as Record<string, Table>;
  let editorTabLastUpdatedAt = Date.now();
  if (activeTab) {
    editorTabLastUpdatedAt =
      activeTab.extra_json?.updatedAt || editorTabLastUpdatedAt;
    activeTab.table_schemas
      .filter(tableSchema => tableSchema.description !== null)
      .forEach(tableSchema => {
        const { dataPreviewQueryId, ...persistData } = tableSchema.description;
        const table = {
          dbId: tableSchema.database_id,
          queryEditorId: tableSchema.tab_state_id.toString(),
          catalog: tableSchema.catalog,
          schema: tableSchema.schema,
          name: tableSchema.table,
          expanded: tableSchema.expanded,
          id: tableSchema.id,
          dataPreviewQueryId,
          persistData,
          initialized: true,
        };
        tables = {
          ...tables,
          [table.id]: table,
        };
      });
  }

  const queries = {
    ...queries_,
    ...(activeTab?.latest_query && {
      [activeTab.latest_query.id]: activeTab.latest_query,
    }),
  };

  const destroyedQueryEditors = {};

  try {
    const localStorageData = localStorage.getItem('redux');
    const sqlLabCacheData = localStorageData
      ? (JSON.parse(localStorageData) as Pick<SqlLabRootState, 'sqlLab'>)
      : undefined;
    if (localStorageData && sqlLabCacheData?.sqlLab) {
      const { sqlLab } = sqlLabCacheData;
      if (sqlLab.queryEditors.length === 0) {
        localStorage.removeItem('redux');
      } else {
        unsavedQueryEditor = sqlLab.unsavedQueryEditor || unsavedQueryEditor;
        sqlLab.queryEditors.forEach(qe => {
          const hasConflictFromBackend = Boolean(queryEditors[qe.id]);
          const unsavedUpdatedAt = queryEditors[qe.id]?.updatedAt;
          const hasUnsavedUpdateSinceLastSave =
            qe.updatedAt &&
            (!unsavedUpdatedAt || qe.updatedAt > unsavedUpdatedAt);
          const cachedQueryEditor: UnsavedQueryEditor =
            !hasConflictFromBackend || hasUnsavedUpdateSinceLastSave ? qe : {};
          queryEditors = {
            ...queryEditors,
            [qe.id]: {
              ...queryEditors[qe.id],
              ...cachedQueryEditor,
              name:
                cachedQueryEditor.title ||
                cachedQueryEditor.name ||
                queryEditors[qe.id]?.name,
              ...(cachedQueryEditor.id &&
                unsavedQueryEditor.id === qe.id &&
                unsavedQueryEditor),
              inLocalStorage: !hasConflictFromBackend,
              loaded: true,
            },
          };
        });
        const expandedTables = new Set();
        if (sqlLab.tables) {
          tables = sqlLab.tables.reduce((merged, table) => {
            const expanded = !expandedTables.has(table.queryEditorId);
            if (expanded) {
              expandedTables.add(table.queryEditorId);
            }
            return {
              ...merged,
              [table.id]: {
                ...tables[table.id],
                ...table,
                expanded,
                inLocalStorage: true,
              },
            };
          }, tables);
        }
        if (sqlLab.queries) {
          Object.values(sqlLab.queries).forEach(query => {
            queries[query.id] = { ...query, inLocalStorage: true };
          });
        }
        if (sqlLab.tabHistory) {
          tabHistory.push(...sqlLab.tabHistory);
        }
        lastUpdatedActiveTab = tabHistory.slice(tabHistory.length - 1)[0] || '';

        if (sqlLab.destroyedQueryEditors) {
          Object.entries(sqlLab.destroyedQueryEditors).forEach(([id, ts]) => {
            if (queryEditors[id]) {
              destroyedQueryEditors[id] = ts;
              delete queryEditors[id];
            }
          });
        }
      }
    }
  } catch (error) {
    // continue regardless of error
  }

  return {
    sqlLab: {
      activeSouthPaneTab: 'Results',
      alerts: [],
      databases,
      offline: false,
      queries: Object.fromEntries(
        Object.entries(queries).map(([queryId, query]) => [
          queryId,
          {
            ...query,
            ...(query.startDttm && {
              startDttm: Number(query.startDttm),
            }),
            ...(query.endDttm && {
              endDttm: Number(query.endDttm),
            }),
          },
        ]),
      ),
      queryEditors: Object.values(queryEditors),
      tabHistory: dedupeTabHistory(tabHistory),
      tables: Object.values(tables),
      queriesLastUpdate: Date.now(),
      editorTabLastUpdatedAt,
      queryCostEstimates: {},
      unsavedQueryEditor,
      lastUpdatedActiveTab,
      destroyedQueryEditors,
    },
    localStorageUsageInKilobytes: 0,
    common,
    ...otherBootstrapData,
  };
}

This code ensures that activeTab is checked for undefined or null before accessing its properties, preventing the "TypeError: Cannot convert undefined or null to object" error [1].

To continue talking to Dosu, mention @dosu.

Comment From: Habeeb556

@electricbrain-code run the below commands after restart the service:

export FLASK_APP=superset
superset db upgrade
superset init

Comment From: electricbrain-code

Completely fixed.

Thankyou and best regards

superset@ac2026f63635:/app$ export FLASK_APP=superset superset@ac2026f63635:/app$ superset db upgrade Loaded your LOCAL configuration at [/app/pythonpath/superset_config.py] logging was configured successfully 2024-07-04 15:34:46,145:INFO:superset.utils.logging_configurator:logging was configured successfully 2024-07-04 15:34:46,166:INFO:root:Configured event logger of type /usr/local/lib/python3.9/site-packages/flask_limiter/extension.py:293: UserWarning: Using the in-memory storage for tracking rate limits as no storage was explicitly specified. This is not recommended for production use. See: https://flask-limiter.readthedocs.io#configuring-a-storage-backend for documentation about configuring the storage backend. warnings.warn( WARNI [alembic.env] SQLite Database support for metadata databases will be removed in a future version of Superset. INFO [alembic.runtime.migration] Context impl SQLiteImpl. INFO [alembic.runtime.migration] Will assume transactional DDL. superset@ac2026f63635:/app$ superset init Loaded your LOCAL configuration at [/app/pythonpath/superset_config.py] logging was configured successfully 2024-07-04 15:36:37,176:INFO:superset.utils.logging_configurator:logging was configured successfully 2024-07-04 15:36:37,196:INFO:root:Configured event logger of type /usr/local/lib/python3.9/site-packages/flask_limiter/extension.py:293: UserWarning: Using the in-memory storage for tracking rate limits as no storage was explicitly specified. This is not recommended for production use. See: https://flask-limiter.readthedocs.io#configuring-a-storage-backend for documentation about configuring the storage backend. warnings.warn( Syncing role definition 2024-07-04 15:36:56,915:INFO:superset.security.manager:Syncing role definition Syncing Admin perms 2024-07-04 15:36:57,403:INFO:superset.security.manager:Syncing Admin perms Syncing Alpha perms 2024-07-04 15:36:57,484:INFO:superset.security.manager:Syncing Alpha perms Syncing Gamma perms 2024-07-04 15:36:59,576:INFO:superset.security.manager:Syncing Gamma perms Syncing sql_lab perms 2024-07-04 15:37:01,673:INFO:superset.security.manager:Syncing sql_lab perms Fetching a set of all perms to lookup which ones are missing 2024-07-04 15:37:03,749:INFO:superset.security.manager:Fetching a set of all perms to lookup which ones are missing Creating missing datasource permissions. 2024-07-04 15:37:03,811:INFO:superset.security.manager:Creating missing datasource permissions. Creating missing database permissions. 2024-07-04 15:37:03,864:INFO:superset.security.manager:Creating missing database permissions. Cleaning faulty perms 2024-07-04 15:37:03,895:INFO:superset.security.manager:Cleaning faulty perms

Comment From: electricbrain-code

Closing

Comment From: nicopace

@electricbrain-code run the below commands after restart the service:

export FLASK_APP=superset superset db upgrade superset init

The issue was closed, but the issue was not documented. I am going through this too, and I am open to do this to fix it, but why is this happening? Any guidance?