TiDB Dashboard Panel to SQL Reports 502 Error in Version 7.1.1

Note:
This topic has been translated from a Chinese forum by GPT and might contain errors.

Original topic: 7.1.1系版本tidb dashboard面板tosql报502

| username: bryanz

[TiDB Usage Environment] Production Environment
[TiDB Version] v7.1.1
[Reproduction Path] None
[Encountered Problem: tidb dashboard panel tosql reports 502]
[Resource Configuration] No changes except for the custom exporter port
[Attachment: Screenshot/Log/Monitoring]


Does anyone know what this problem is? All other sections of the panel are normal.

| username: ffeenn | Original post link

Try turning off topsql and then turning it back on.

| username: bryanz | Original post link

Tried it. It’s still the same.

| username: bryanz | Original post link

It reports an error before opening.

| username: ffeenn | Original post link

The image is not visible. Please provide the text you need translated.

| username: bryanz | Original post link

It’s the same after enabling it.

| username: tidb狂热爱好者 | Original post link

Not enabled.

| username: bryanz | Original post link

It’s the same even after enabling it.

| username: Billmay表妹 | Original post link

Is it still the same after saving?

| username: Billmay表妹 | Original post link

Check the following issues one by one~

  1. TiDB Dashboard service is not started or abnormal. You can check the TiDB Dashboard log files to see if there is any abnormal information.
  2. TiDB Dashboard service configuration error. You can check the TiDB Dashboard configuration files to ensure that the parameters in the configuration files are set correctly.
  3. TiDB Dashboard service version is incompatible. You can try upgrading the TiDB Dashboard version or downgrading the TiDB Server version to resolve version incompatibility issues.
  4. TiDB Server service is abnormal. You can check the TiDB Server log files to see if there is any abnormal information.
  5. TiDB Server service configuration error. You can check the TiDB Server configuration files to ensure that the parameters in the configuration files are set correctly.
  6. TiDB Server service version is incompatible. You can try upgrading the TiDB Server version or downgrading the TiDB Dashboard version to resolve version incompatibility issues.
| username: ShawnYan | Original post link

Check the pd.log for any errors or warnings.

| username: ffeenn | Original post link

Print the cluster information and filter the error logs.

| username: bryanz | Original post link

The cluster did not report any error information.

| username: bryanz | Original post link

There is an error.

| username: bryanz | Original post link

The cluster status check is all normal.

| username: bryanz | Original post link

I see a warning in PD, it’s the UI’s pd-05.

| username: bryanz | Original post link

I have encountered the same problem. It seems that the tidb_enable_clustered_index parameter is not set to ON. You can try setting it to ON and see if it resolves the issue.

| username: xfworld | Original post link

05 happens to be a problematic PD, it is recommended to switch to another PD as the dashboard.


Switch another PD instance to provide TiDB Dashboard service

When using TiUP to deploy, for an already running cluster, you can use the tiup ctl:v<CLUSTER_VERSION> pd command to switch another PD instance to run TiDB Dashboard, or reassign a PD instance to run TiDB Dashboard when TiDB Dashboard is disabled:

tiup ctl:v<CLUSTER_VERSION> pd -u http://127.0.0.1:2379 config set dashboard-address http://9.9.9.9:2379

Refer to this to switch the PD instance providing data for the dashboard.


Reference documentation:

Additionally, it is better for PD nodes to be in odd numbers, this will be more optimal.

| username: bryanz | Original post link

Thank you for the explanation, but it still doesn’t work. Currently, I have reduced it to 3 nodes, and it still reports a 502 error.
The log has this prompt:

| username: bryanz | Original post link

This is the way to start PD. Both the port and hostname are accessible, and the firewall only opens these two ports.