Jira (PDB-5064) Handle \0x00 byte error and return a generic error message

20 views
Skip to first unread message

Austin Blatt (Jira)

unread,
Mar 16, 2021, 7:19:03 PM3/16/21
to puppe...@googlegroups.com
Austin Blatt created an issue
 
PuppetDB / Task PDB-5064
Handle \0x00 byte error and return a generic error message
Issue Type: Task Task
Assignee: Unassigned
Created: 2021/03/16 4:18 PM
Priority: Normal Normal
Reporter: Austin Blatt
Add Comment Add Comment
 
This message was sent by Atlassian Jira (v8.5.2#805002-sha1:a66f935)
Atlassian logo

Austin Blatt (Jira)

unread,
Mar 16, 2021, 7:27:04 PM3/16/21
to puppe...@googlegroups.com
Austin Blatt updated an issue
Change By: Austin Blatt
You can reproduce the error in with
{code}
curl -G 'http://localhost:8080/pdb/query/v4?query=nodes\{certname="foo%00"\}' --output -
{code}
curl needs the {{--output -}} flag to allow printing the null byte to the terminal.

Austin Blatt (Jira)

unread,
Mar 16, 2021, 7:28:03 PM3/16/21
to puppe...@googlegroups.com
Austin Blatt updated an issue
Change By: Austin Blatt
Acceptance Criteria: - Catch the error and ensure the error message is just {{ERROR: invalid byte sequence for encoding "UTF8": 0x00}}

Zachary Kent (Jira)

unread,
Mar 17, 2021, 2:38:03 PM3/17/21
to puppe...@googlegroups.com

Austin Blatt (Jira)

unread,
Mar 18, 2021, 4:58:03 PM3/18/21
to puppe...@googlegroups.com
Austin Blatt updated an issue
Change By: Austin Blatt
You can reproduce the error in with
{code}
curl -G 'http://localhost:8080/pdb/query/v4?query=nodes\{certname="foo%00"\}' --output -
{code}
curl needs the {{--output -}} flag to allow printing the null byte to the terminal.

Austin Blatt (Jira)

unread,
Mar 18, 2021, 5:00:03 PM3/18/21
to puppe...@googlegroups.com
Austin Blatt updated an issue
In addition to removing the stack trace (PDB-5063) we want to omit java/postgresql related information from this error message. Specifically, the existing response includes {{javax.servlet.ServletException}} and {{org.postgresql.util.PSQLException}}, both of which we want to ensure do not get returned (but they can still be in the logs).

You can reproduce the error with

{code}
curl -G 'http://localhost:8080/pdb/query/v4?query=nodes\{certname="foo%00"\}' --output -
{code}
curl needs the {{--output -}} flag to allow printing the null byte to the terminal.

Austin Blatt (Jira)

unread,
Mar 18, 2021, 5:00:05 PM3/18/21
to puppe...@googlegroups.com
Austin Blatt updated an issue
In addition to removing the stack trace (PDB-5063) we want to omit java/postgresql related information from this error message. Specifically, the existing response includes {{javax.servlet.ServletException}} and {{org.postgresql.util.PSQLException}}, both of which we want to ensure do not get returned by the API endpoint (but they can still be in the logs).


You can reproduce the error with
{code}
curl -G 'http://localhost:8080/pdb/query/v4?query=nodes\{certname="foo%00"\}' --output -
{code}
curl needs the {{--output -}} flag to allow printing the null byte to the terminal.

Bogdan Irimie (Jira)

unread,
Mar 26, 2021, 5:20:03 AM3/26/21
to puppe...@googlegroups.com

Bogdan Irimie (Jira)

unread,
Mar 26, 2021, 5:28:03 AM3/26/21
to puppe...@googlegroups.com
Bogdan Irimie updated an issue
Change By: Bogdan Irimie
Sprint: ghost-7.04.2021
Story Points: 3

Bogdan Irimie (Jira)

unread,
Mar 30, 2021, 3:03:03 AM3/30/21
to puppe...@googlegroups.com

Mihai Buzgau (Jira)

unread,
Mar 31, 2021, 9:43:04 AM3/31/21
to puppe...@googlegroups.com
Mihai Buzgau updated an issue
Change By: Mihai Buzgau
Labels: 2021-o1-kr2 c1 tsr-pdb-backlog

Oana Tanasoiu (Jira)

unread,
Apr 5, 2021, 3:56:03 AM4/5/21
to puppe...@googlegroups.com
Oana Tanasoiu updated an issue
Change By: Oana Tanasoiu
Release Notes Summary: Description of the problem: When a \0x00 byte error is raised the existing response includes javax.servlet.ServletException and org.postgresql.util.PSQLException.
Description of the fix: Only show the error message without the stacktrace and
without the exception type class . (This was solved by the changes introduced for https://tickets.puppetlabs.com/browse/PDB-5063 )
This message was sent by Atlassian Jira (v8.13.2#813002-sha1:c495a97)
Atlassian logo
Reply all
Reply to author
Forward
0 new messages