Visualization Issue - Cannot read properties of undefined (reading 'getBBox')

Hi there,

I am trying to run some queries and the visualization doesn't appear to be working. When I load the query, the error is: Cannot read properties of undefined (reading 'getBBox')

If I switch to table/chart view, the query loads normally. This is a query that we've been loading weekly for the past 1.5 years, and was last edited 6 months ago.

In the logs, I see this warning repeating over and over, and then it tells me the sync is finished:

[201c2d5c-4f50-4e99-86d2-8d5ef51edbe5] 2021-10-31T22:42:22-04:00 WARN metabase.driver.sql-jdbc.sync.describe-table Don't know how to map column type 'string' to a Field base_type, falling back to :type/*.

...

[201c2d5c-4f50-4e99-86d2-8d5ef51edbe5] 2021-10-31T22:48:57-04:00 INFO metabase.sync.util FINISHED: step 'sync-fields' for redshift Database 7 'Redshift Cluster - Legacy' (3.7 hours)

We recently upgraded Metabase, and I'm wondering if that broke anything. It seems like there may be some field mapping issue like in this issue, but I'm not sure what table or field is actually the issue here, as this troubleshooting log isn't too descriptive. Any pointers on next steps would be appreciated there to see if I can find the bad data. The query in question joins two tables, but I'm worried multiple tables are affected and I just haven't had to load a visualization with them yet.

Please let me know if there is any additional information I can provide. Thank you!

Diagnostic info:

{
  "browser-info": {
    "language": "en-US",
    "platform": "MacIntel",
    "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36",
    "vendor": "Google Inc."
  },
  "system-info": {
    "file.encoding": "UTF-8",
    "java.runtime.name": "OpenJDK Runtime Environment",
    "java.runtime.version": "1.8.0_312-heroku-b05",
    "java.vendor": "Oracle Corporation",
    "java.vendor.url": "http://java.oracle.com/",
    "java.version": "1.8.0_312-heroku",
    "java.vm.name": "OpenJDK 64-Bit Server VM",
    "java.vm.version": "25.312-b05",
    "os.name": "Linux",
    "os.version": "4.4.0-1097-aws",
    "user.language": "en",
    "user.timezone": "Etc/UTC"
  },
  "metabase-info": {
    "databases": [
      "postgres",
      "redshift"
    ],
    "hosting-env": "heroku",
    "application-database": "postgres",
    "application-database-details": {
      "database": {
        "name": "PostgreSQL",
        "version": "11.13 (Ubuntu 11.13-2.heroku1+1)"
      },
      "jdbc-driver": {
        "name": "PostgreSQL JDBC Driver",
        "version": "42.2.23"
      }
    },
    "run-mode": "prod",
    "version": {
      "tag": "v0.41.1",
      "date": "2021-10-21",
      "branch": "release-x.41.x",
      "hash": "76aa4a5"
    },
    "settings": {
      "report-timezone": "US/Eastern"
    }
  }
}

Hi @viborja
Have you just upgraded Redshift? If yes, then you're seeing this issue:
https://github.com/metabase/metabase/issues/18652 - upvote by clicking :+1: on the first post

Hi @flamber, thanks for investigating. I have not recently upgraded Redshift. Here's what I'm running:

PostgreSQL 8.0.2 on i686-pc-linux-gnu, compiled by GCC gcc (GCC) 3.4.2 20041017 (Red Hat 3.4.2-6.fc3), Redshift 1.0.31651

@viborja Okay, so if the problem only started after you upgraded, then that could be the cause, but it's difficult to say.
Which version did you upgrade from?
Can you provide the metadata output by going to the URL /api/card/123, where 123 is the question ID?

It's most likely not a problem with sync, so let's not go down that path for now.

@flamber We last upgraded on July 29th to the latest, which I believe was v1.40.1, but not sure where to confirm this.

Here is the metadata output for the question ID 1259:

{
  "description": null,
  "archived": false,
  "collection_position": null,
  "table_id": null,
  "result_metadata": [
    {
      "name": "signup_cohort",
      "display_name": "signup_cohort",
      "base_type": "type/DateTime",
      "effective_type": "type/DateTime",
      "field_ref": [
        "field",
        "signup_cohort",
        {
          "base-type": "type/DateTime"
        }
      ],
      "semantic_type": null,
      "fingerprint": {
        "global": {
          "distinct-count": 95,
          "nil%": 0
        },
        "type": {
          "type/DateTime": {
            "earliest": "2020-01-06T00:00:00-05:00",
            "latest": "2021-10-25T00:00:00-04:00"
          }
        }
      }
    },
    {
      "name": "mp_user",
      "display_name": "mp_user",
      "base_type": "type/BigInteger",
      "effective_type": "type/BigInteger",
      "field_ref": [
        "field",
        "mp_user",
        {
          "base-type": "type/BigInteger"
        }
      ],
      "semantic_type": null,
      "fingerprint": {
        "global": {
          "distinct-count": 93,
          "nil%": 0
        },
        "type": {
          "type/Number": {
            "min": 221,
            "q1": 1344.6032644217105,
            "q3": 2627.8308679579936,
            "max": 4044,
            "sd": 812.874513748986,
            "avg": 1966.7157894736843
          }
        }
      }
    },
    {
      "name": "mp_cust_count_7d",
      "display_name": "mp_cust_count_7d",
      "base_type": "type/BigInteger",
      "effective_type": "type/BigInteger",
      "field_ref": [
        "field",
        "mp_cust_count_7d",
        {
          "base-type": "type/BigInteger"
        }
      ],
      "semantic_type": null,
      "fingerprint": {
        "global": {
          "distinct-count": 64,
          "nil%": 0
        },
        "type": {
          "type/Number": {
            "min": 34,
            "q1": 73.25,
            "q3": 115.125,
            "max": 244,
            "sd": 32.005616108520734,
            "avg": 95.21052631578948
          }
        }
      }
    },
    {
      "name": "cvr_7d",
      "display_name": "cvr_7d",
      "base_type": "type/Float",
      "effective_type": "type/Float",
      "field_ref": [
        "field",
        "cvr_7d",
        {
          "base-type": "type/Float"
        }
      ],
      "semantic_type": null,
      "fingerprint": {
        "global": {
          "distinct-count": 95,
          "nil%": 0
        },
        "type": {
          "type/Number": {
            "min": 0.024337866857551897,
            "q1": 0.039542381506115484,
            "q3": 0.05956485433842267,
            "max": 0.3393665158371041,
            "sd": 0.036794936066354804,
            "avg": 0.05598785818867797
          }
        }
      }
    },
    {
      "name": "mp_cust_count",
      "display_name": "mp_cust_count",
      "base_type": "type/BigInteger",
      "effective_type": "type/BigInteger",
      "field_ref": [
        "field",
        "mp_cust_count",
        {
          "base-type": "type/BigInteger"
        }
      ],
      "semantic_type": "type/Quantity",
      "fingerprint": {
        "global": {
          "distinct-count": 76,
          "nil%": 0
        },
        "type": {
          "type/Number": {
            "min": 69,
            "q1": 127.87040346813399,
            "q3": 195.4267859002589,
            "max": 364,
            "sd": 49.24663838588949,
            "avg": 160.27368421052634
          }
        }
      }
    },
    {
      "name": "cvr",
      "display_name": "cvr",
      "base_type": "type/Float",
      "effective_type": "type/Float",
      "field_ref": [
        "field",
        "cvr",
        {
          "base-type": "type/Float"
        }
      ],
      "semantic_type": null,
      "fingerprint": {
        "global": {
          "distinct-count": 95,
          "nil%": 0
        },
        "type": {
          "type/Number": {
            "min": 0.03114334470989761,
            "q1": 0.06363653967348634,
            "q3": 0.10955005914566589,
            "max": 0.4253393665158371,
            "sd": 0.05068097128886551,
            "avg": 0.0949511330508036
          }
        }
      }
    }
  ],
  "can_write": true,
  "database_id": 44,
  "enable_embedding": false,
  "collection_id": 322,
  "query_type": "native",
  "name": "Widget User MP Conversion - All Time + 7 Day Save",
  "last_query_start": "2021-11-01T14:08:47.587Z",
  "dashboard_count": 0,
  "average_query_time": 967.2647058823529,
  "creator_id": 46,
  "moderation_reviews": [],
  "updated_at": "2021-11-01T14:08:47.929886Z",
  "made_public_by_id": null,
  "embedding_params": null,
  "cache_ttl": null,
  "dataset_query": {
    "database": 44,
    "type": "native",
    "native": {
      "query": "\nwith order_event_summary as (\n  \n  select\n    users.signup_source,\n    users.user_id,\n    case \n      when users.signup_source = 'marketplace'\n        then users.user_created_at_et\n      when users.marketable_at_et is not null\n        then users.marketable_at_et\n      else null end as signup_at_et,\n    count(distinct date_trunc('day', orders.order_created_at_et)) as order_week_count,\n    count(distinct \n        case when orders.order_created_at_et < signup_at_et + interval '7 days' \n            then date_trunc('day', orders.order_created_at_et) end) as order_week_count_7d,\n    min(orders.order_created_at_et) as first_order_at_et\n  from analytics.users\n  left join analytics.orders on users.user_id = orders.user_id\n    and orders.order_source = 'marketplace'\n    and orders.order_id not in ( --exclude Miss Kim's on 2/29, sent traffic to mp instead of widget\n        select\n          order_id\n        from analytics.orders \n        where provider_id = 2744\n        and order_source = 'marketplace'\n        and date(order_created_at_et) = '2020-02-29'\n    )\n  where\n    users.signup_source <> 'marketplace'\n  group by 1,2,3\n  \n)\nselect\n  date_trunc('week', signup_at_et) as signup_cohort,\n  count(distinct user_id) as mp_user,\n  count(distinct case when signup_source <> 'marketplace' and order_week_count_7d > 0 then user_id end) as mp_cust_count_7d,\n  mp_cust_count_7d::float / mp_user as cvr_7d,\n  count(distinct case when signup_source <> 'marketplace' and order_week_count > 0 then user_id end) as mp_cust_count,\n  mp_cust_count::float / mp_user as cvr\nfrom order_event_summary\nwhere \n  signup_at_et >= '2020-01-06'\n  and signup_at_et < date_trunc('week', getdate())\ngroup by 1\norder by 1",
      "template-tags": {}
    }
  },
  "id": 1259,
  "display": "combo",
  "visualization_settings": {
    "graph.show_values": false,
    "table.cell_column": "mp_user",
    "graph.y_axis.auto_split": false,
    "graph.metrics": [
      "cvr_7d",
      "cvr"
    ],
    "table.pivot_column": "mp_cust_count_7d",
    "column_settings": {
      "[\"name\",\"customer conv - marketplace signup\"]": {
        "number_style": "percent"
      },
      "[\"name\",\"widget_repeat_rate\"]": {
        "number_style": "percent"
      },
      "[\"name\",\"repeat customer - marketplace signup\"]": {
        "number_style": "percent"
      },
      "[\"name\",\"mp_cust_rate\"]": {
        "number_style": "percent"
      },
      "[\"name\",\"cvr\"]": {
        "number_style": "percent"
      },
      "[\"name\",\"mp_repeat_rate\"]": {
        "number_style": "percent"
      },
      "[\"name\",\"widget_cust_rate\"]": {
        "number_style": "percent"
      },
      "[\"name\",\"mp_user\"]": {
        "number_style": "decimal"
      },
      "[\"name\",\"signup_cohort\"]": {
        "time_enabled": null,
        "date_style": "M/D/YYYY"
      },
      "[\"name\",\"cvr_7d\"]": {
        "number_style": "percent"
      }
    },
    "series_settings": {
      "cvr_7d": {
        "axis": "right"
      },
      "cvr": {
        "axis": "right",
        "display": "line"
      },
      "mp_user": {
        "axis": "left",
        "show_series_values": false
      }
    },
    "graph.x_axis.scale": "ordinal",
    "graph.dimensions": [
      "signup_cohort"
    ]
  },
  "collection": {
    "authority_level": null,
    "description": null,
    "archived": false,
    "slug": "covid",
    "color": "#509EE3",
    "name": "COVID",
    "personal_owner_id": null,
    "id": 322,
    "location": "/81/",
    "namespace": null
  },
  "created_at": "2020-04-08T20:21:47.499Z",
  "public_uuid": null
}

@viborja
When was the last time the question worked?
When did you upgrade to 0.41.1?
Have you tried reverting to your backup to see if the problem has something to do with the data results rather than it having something to do with the Metabase upgrade?
I cannot reproduce on 0.41.1:

A post was split to a new topic: Cannot read properties of undefined (reading 'rows')