pgadmin4 dashboard display bug
pgadmin4 connect to postgreSQL14 service, check it dashboard, then check logs,it appears.
To Reproduce
Steps to reproduce the behavior:
- connect to postgreSQL service
- Click on dashboard
- Click on logs
- 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]
Hi @Lhy-ao, please provide the pgAdmin logs.
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.
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.
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.
This is pgadmin4 log.
This is about pgadmin4.
This is developer tools console screenshot.
Hi @Lhy-ao, what is your database encoding?
Hi, @khushboovashi, where can I find this setting or this parameter configuration? Please take a screenshot to remind me.
Hi, @khushboovashi, this is I can find.
@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.
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.
@akshay-joshi @tjc0726
it's Chinese (Simplified)_China.936
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.
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.
Hi @akshay-joshi Where can find the PostgreSQL log files, I installed postgresql 14 on Windows 11
@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.
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.
@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.
@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.
Hi @akshay-joshi
Why is the same error displayed differently in different windows?
@Lhy-ao PostgreSQL logs are written by PostgreSQL and not pgadmin hence PostgreSQL development team will be the better option to answer the query.
This problem is indeed not caused by pgadmin. When I set lc_messages=UTF8 for postgresql, the problem was solved.
@yogeshmahajan-1903
@yogeshmahajan-1903
This is not a pgAdmin issue, hence closing it.