darold / pgbadger

A fast PostgreSQL Log Analyzer

Home Page:http://pgbadger.darold.net/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Page crashes when application name has "<some text>"

fabiogeiss opened this issue · comments

For a long time I had problems seeing the report. When I tried to access any statistics, such as "top time comsuming queries", the page would break. So I decided to open the browser's development console and it showed an error in specific positions of two lines. I then realized that the broken data was the application_name and that it contained some peculiar information. The DBeaver client set the value to be: "app + version + a text between '<>' " . Something like: "DBeaver 12.3.7 <Some script.sql>".
I edited the index.html removing the value "" and the page reopened.

Steps to simulate the problem:

1 - Connect to database
2 - set application_name = 'test <some script.sql>';
3 - set log_min_duration_statement= '1s';
4 - select pg_sleep(2);
5 - generate pgBadger report;
6 - try to open a statistic page;

Commit 853eedf fixes this issue.