Cannot redefine property: 1

  • What Grafana version and what operating system are you using?

  • Grafana v8.1.3 (a61f38238c)

  • What are you trying to achieve?
    I want to solve the problem.

  • How are you trying to achieve it?
    Tested using different types of columns.

  • What happened?
    If the metric is specified as the problematic column, the following error occurs.
    “Cannot redefine property: 1”

But I can see this table

If I select another column of the same data type, it operates normally.

  • What did you expect to happen?
    The graph is displayed normally.

  • Can you copy/paste the configuration(s) that you are having problems with?
    For reference, gender_code and age_code are the same string type.

This is the panel JSON where the problem occurs

{
  "id": 23763571993,
  "gridPos": {
    "h": 10,
    "w": 6,
    "x": 12,
    "y": 22
  },
  "type": "piechart",
  "title": "Panel Title",
  "fieldConfig": {
    "defaults": {
      "custom": {
        "hideFrom": {
          "tooltip": false,
          "viz": false,
          "legend": false
        }
      },
      "color": {
        "mode": "palette-classic"
      },
      "mappings": []
    },
    "overrides": []
  },
  "options": {
    "reduceOptions": {
      "values": false,
      "calcs": [
        "lastNotNull"
      ],
      "fields": ""
    },
    "pieType": "pie",
    "tooltip": {
      "mode": "single"
    },
    "legend": {
      "displayMode": "list",
      "placement": "bottom"
    }
  },
  "targets": [
    {
      "format": "time_series",
      "group": [
        {
          "type": "column",
          "params": [
            "gender_code"
          ]
        }
      ],
      "metricColumn": "gender_code",
      "rawQuery": false,
      "rawSql": "SELECT\n  stat_timestamp AS \"time\",\n  gender_code AS metric,\n  sum(sum_play_view) AS \"sum_play_view\"\nFROM main_demo_play_view_day\nWHERE\n  $__timeFilter(stat_timestamp)\nGROUP BY gender_code,2\nORDER BY stat_timestamp",
      "refId": "A",
      "select": [
        [
          {
            "type": "column",
            "params": [
              "sum_play_view"
            ]
          },
          {
            "type": "aggregate",
            "params": [
              "sum"
            ]
          },
          {
            "type": "alias",
            "params": [
              "sum_play_view"
            ]
          }
        ]
      ],
      "table": "main_demo_play_view_day",
      "timeColumn": "stat_timestamp",
      "timeColumnType": "timestamp",
      "where": [
        {
          "type": "macro",
          "name": "$__timeFilter",
          "params": []
        }
      ]
    }
  ],
  "datasource": null
}

This is the panel JSON which doesn’t cause any problems

{
  "id": 23763571993,
  "gridPos": {
    "h": 10,
    "w": 6,
    "x": 6,
    "y": 22
  },
  "type": "piechart",
  "title": "Demo-Age",
  "pluginVersion": "8.1.3",
  "links": [],
  "cacheTimeout": null,
  "fieldConfig": {
    "defaults": {
      "custom": {
        "hideFrom": {
          "tooltip": false,
          "viz": false,
          "legend": false
        }
      },
      "color": {
        "mode": "palette-classic"
      },
      "mappings": []
    },
    "overrides": [
      {
        "matcher": {
          "id": "byName",
          "options": "0"
        },
        "properties": [
          {
            "id": "displayName",
            "value": "-14"
          }
        ]
      },
      {
        "matcher": {
          "id": "byName",
          "options": "1"
        },
        "properties": [
          {
            "id": "displayName",
            "value": "15-19"
          }
        ]
      },
      {
        "matcher": {
          "id": "byName",
          "options": "2"
        },
        "properties": [
          {
            "id": "displayName",
            "value": "20-24"
          }
        ]
      },
      {
        "matcher": {
          "id": "byName",
          "options": "3"
        },
        "properties": [
          {
            "id": "displayName",
            "value": "25-29"
          }
        ]
      },
      {
        "matcher": {
          "id": "byName",
          "options": "4"
        },
        "properties": [
          {
            "id": "displayName",
            "value": "30-34"
          }
        ]
      },
      {
        "matcher": {
          "id": "byName",
          "options": "5"
        },
        "properties": [
          {
            "id": "displayName",
            "value": "35-39"
          }
        ]
      },
      {
        "matcher": {
          "id": "byName",
          "options": "6"
        },
        "properties": [
          {
            "id": "displayName",
            "value": "40-44"
          }
        ]
      },
      {
        "matcher": {
          "id": "byName",
          "options": "7"
        },
        "properties": [
          {
            "id": "displayName",
            "value": "45-49"
          }
        ]
      },
      {
        "matcher": {
          "id": "byName",
          "options": "8"
        },
        "properties": [
          {
            "id": "displayName",
            "value": "50-"
          }
        ]
      },
      {
        "matcher": {
          "id": "byName",
          "options": "9"
        },
        "properties": [
          {
            "id": "displayName",
            "value": "UNKNOWN"
          }
        ]
      }
    ]
  },
  "options": {
    "reduceOptions": {
      "values": false,
      "calcs": [
        "lastNotNull"
      ],
      "fields": ""
    },
    "pieType": "donut",
    "displayLabels": [
      "name",
      "value"
    ],
    "tooltip": {
      "mode": "single"
    },
    "legend": {
      "displayMode": "table",
      "placement": "bottom",
      "values": [
        "value"
      ]
    }
  },
  "targets": [
    {
      "format": "time_series",
      "group": [
        {
          "params": [
            "age_code"
          ],
          "type": "column"
        }
      ],
      "hide": false,
      "metricColumn": "age_code",
      "rawQuery": false,
      "rawSql": "SELECT\n  stat_timestamp AS \"time\",\n  age_code AS metric,\n  sum(sum_play_view) AS \"sum_play_view\"\nFROM main_demo_play_view_day\nWHERE\n  $__timeFilter(stat_timestamp)\nGROUP BY age_code,2\nORDER BY stat_timestamp",
      "refId": "B",
      "select": [
        [
          {
            "params": [
              "sum_play_view"
            ],
            "type": "column"
          },
          {
            "params": [
              "sum"
            ],
            "type": "aggregate"
          },
          {
            "params": [
              "sum_play_view"
            ],
            "type": "alias"
          }
        ]
      ],
      "table": "main_demo_play_view_day",
      "timeColumn": "stat_timestamp",
      "where": [
        {
          "name": "$__timeFilter",
          "params": [],
          "type": "macro"
        }
      ]
    }
  ],
  "datasource": null
}
  • Did you receive any errors in the Grafana UI or in related logs? If so, please tell us exactly what they were.

  • Did you follow any online instructions? If so, what is the URL?

For reference, it seems like this may be an instance of this bug.

1 Like

This topic was automatically closed after 365 days. New replies are no longer allowed.