pgadmin4 icon indicating copy to clipboard operation
pgadmin4 copied to clipboard

pgadmin4 dashboard display bug

Open Lhy-ao opened this issue 1 year ago • 21 comments

pgadmin4 connect to postgreSQL14 service, check it dashboard, then check logs,it appears.

To Reproduce

Steps to reproduce the behavior:

  1. connect to postgreSQL service
  2. Click on dashboard
  3. Click on logs
  4. See the error

Expected behavior

no error

Screenshots

log record: Failed to execute query (execute_dict) for the server #1-DB:postgres (query-id:####): Error Message: Invalid "UTF8" encoding byte order:0xc8 0xd5

Desktop (please complete the following information):

  • OS: [Windows 11, 23H2]
  • Version: [pgadmin4 6.14]
  • Mode: [Desktop]

Lhy-ao avatar Dec 17 '24 01:12 Lhy-ao

Hi @Lhy-ao, please provide the pgAdmin logs.

khushboovashi avatar Dec 17 '24 05:12 khushboovashi

Hi @Lhy-ao, please provide the pgAdmin logs.

I had a problem uploading the image,but the log message I provided was complete: "2024-12-16 23:00:12 :ERROR pgadmin: Failed to execute query (execute_dict) for the server # 1-DB:postgres (query-id:5202787): Error Message: Invalid "UTF8" encoding byte order:0xc8 0xd5".
This is the complete error message.

Lhy-ao avatar Dec 17 '24 07:12 Lhy-ao

Hi @Lhy-ao,

I am not able to reproduce the issue. Which logs are you talking about pgAdmin or Postgres? Also, It will be helpful if you provide the screenshots of the issue.

pravesh-sharma avatar Dec 20 '24 11:12 pravesh-sharma

Hi @pravesh-sharma,

I am not able to reproduce the issue. Which logs are you talking about pgAdmin or Postgres? Also, It will be helpful if you provide the screenshots of the issue.

Hi @pravesh-sharma, Here is some useful info. This is the steps to reproduce the issue. image

This is pgadmin4 log. image

This is about pgadmin4. image

This is developer tools console screenshot. image

Lhy-ao avatar Dec 21 '24 02:12 Lhy-ao

Hi @Lhy-ao, what is your database encoding?

khushboovashi avatar Dec 23 '24 03:12 khushboovashi

Hi, @khushboovashi, where can I find this setting or this parameter configuration? Please take a screenshot to remind me.

Lhy-ao avatar Dec 23 '24 06:12 Lhy-ao

Hi, @khushboovashi, this is I can find. image

Lhy-ao avatar Dec 23 '24 12:12 Lhy-ao

@Lhy-ao

Can you please provide the value of "lc_messages" from the configuration? After checking the screenshot, it seems you are running pgAdmin with the English language, but messages that come from the PostgreSQL server have a different encoding/language.

akshay-joshi avatar Apr 16 '25 10:04 akshay-joshi

@Lhy-ao

Can you please provide the value of "lc_messages" from the configuration? After checking the screenshot, it seems you are running pgAdmin with the English language, but messages that come from the PostgreSQL server have a different encoding/language.

I'm pretty sure the lang of his SQL is chinese base on other screenshot. I'm experiencing the same problem when I select use default lang in sql and my default lang is also chinese I believe, after I reinstall sql and choose english as the lang in sql , this problem goes away.

tjc0726 avatar Apr 16 '25 11:04 tjc0726

@akshay-joshi @tjc0726

Image

it's Chinese (Simplified)_China.936

Lhy-ao avatar Apr 16 '25 12:04 Lhy-ao

Hi @Lhy-ao, @tjc0726

I attempted to reproduce the issue related to the Chinese language on Windows 11 using pgAdmin 4 versions 8.14 and 9.2. I installed Chinese (Simplified) on my Windows 11 system and then installed PostgreSQL 17 with the default locale settings.

Afterward, I launched pgAdmin in both English and Chinese (Simplified), and tried to reproduce the issue, but with no success.

Image Image

I believe the error in pgAdmin is caused by a specific query or special characters present in the PostgreSQL log files. Can you please identify that and let us know, or if possible, provide the postgresql log file.

akshay-joshi avatar Apr 17 '25 07:04 akshay-joshi

Hi @akshay-joshi Where can find the PostgreSQL log files, I installed postgresql 14 on Windows 11

Lhy-ao avatar Apr 17 '25 08:04 Lhy-ao

@Lhy-ao

The log files should be located in the data\log directory within your PostgreSQL installation path. For example, on my machine, the path is: C:\Program Files\PostgreSQL\16\data\log

You may have a large number of log files, so you’ll need to identify the specific query or data entry that is causing pgAdmin to throw the error, if possible.

akshay-joshi avatar Apr 17 '25 10:04 akshay-joshi

Hi @akshay-joshi, Here is the log files, it's seem sure has problems with the log files, where some garbled text appears in the log file.

postgresql-2025-04-16_200836.log

postgresql-2025-04-17_213119.log

Lhy-ao avatar Apr 17 '25 13:04 Lhy-ao

@Lhy-ao,

I have tested the log files you provided and was able to reproduce the issue. To read the PostgreSQL logs, we use the command SELECT pg_read_file(pg_current_logfile());, but the database server returns an error when this is executed. We will investigate the root cause and try to resolve it if feasible.

akshay-joshi avatar Apr 18 '25 09:04 akshay-joshi

@Lhy-ao

I attempted to use the following query: SELECT convert_from(pg_read_binary_file(pg_current_logfile()), 'UTF8');

However, it was unsuccessful. Since the error originates from the PostgreSQL server itself, there’s little pgAdmin can do in this case. I also tried the same operation using psql and encountered the same error.

To resolve this, I recommend either removing the problematic log file or restarting the PostgreSQL server, which will generate a new log file.

akshay-joshi avatar Apr 18 '25 11:04 akshay-joshi

Hi @akshay-joshi

Image Why is the same error displayed differently in different windows?

Lhy-ao avatar Apr 20 '25 01:04 Lhy-ao

@Lhy-ao PostgreSQL logs are written by PostgreSQL and not pgadmin hence PostgreSQL development team will be the better option to answer the query.

yogeshmahajan-1903 avatar Apr 25 '25 11:04 yogeshmahajan-1903

This problem is indeed not caused by pgadmin. When I set lc_messages=UTF8 for postgresql, the problem was solved.

Lhy-ao avatar Apr 26 '25 01:04 Lhy-ao

@yogeshmahajan-1903

Lhy-ao avatar Apr 26 '25 02:04 Lhy-ao

@yogeshmahajan-1903

Lhy-ao avatar Apr 26 '25 02:04 Lhy-ao

This is not a pgAdmin issue, hence closing it.

anilsahoo20 avatar May 02 '25 11:05 anilsahoo20