-
Notifications
You must be signed in to change notification settings - Fork 13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
JSON data with \u0000 errors in Postgres with "unsupported Unicode escape sequence" #118
Comments
branch to reproduce issue https://github.com/turbot/steampipe-plugin-chaos/compare/json_issue?diff=unified
|
@binaek Any updates on this? I believe we're hitting up against it still in the LDAP plugin, e.g., turbot/steampipe-plugin-ldap#3 |
Hmm we'll need to dig into this - there was a fix which covered at least some cases but not all it seems |
@kaidaguerre Any update on this? Thanks! |
Accidentally closed, re-opening |
There is code in the FDW which attempts to strip out non-escaped unicode nulls, but to leave in place escaped unicode nulls The original code was:
However in response to this issue this code was changed to try to leave nulls which were escaped, as follows:
This error is caused by this JSON field:
Current version of code (trying to handle escaped null) modifies this to:
which fails. The old code (replacing all unicode nulls) keeps this as:
which works. So it looks like the regex needs updating to handle this case |
@kaidaguerre - A user, christianherweg0807, is reporting he's still seeing issues - turbot/steampipe-plugin-ldap#3 (comment). The LDAP plugin's latest version is built off of Steampipe SDK v3.1.0. Is there something else we should look into from the plugin side, or is more information needed to debug this issue? Thanks! |
Hi, sorry for the delay...
Here an example with latest ldap plugin running against an Microsoft AD LDAP:
|
Still seeing this. LDAP server is AD. > select dn from ldap_user;
Error: unsupported Unicode escape sequence (SQLSTATE 22P05) (about a dozen results are returned, omitted them) CentOS 7.9 $ steampipe plugin list
+--------------------------------------------------+---------+-------------+
| Installed Plugin | Version | Connections |
+--------------------------------------------------+---------+-------------+
| hub.steampipe.io/plugins/turbot/ldap@latest | 0.2.0 | ldap |
| hub.steampipe.io/plugins/turbot/steampipe@latest | 0.6.0 | steampipe |
+--------------------------------------------------+---------+-------------+
$ steampipe -v
steampipe version 0.17.4 There is a link to an old slack thread in the #3 but it appears to be outside the retention window for messages. |
I faced the same issue when using the LDAP plugin, and came up with the following changes to the FDW component:
Edit: we probably want to keep the regex replace, I only gave attention to the comment that said removing, and did not realize it was intended to escape the nulls. An alternative may be to base64 encode the whole string if it contains nulls as does ldapsearch by default. There's no need to check whether the null unicode character is escaped or not as the following:
returns:
https://go.dev/play/p/8RjKYbSUNOC And I also applied these changes to the LDAP plugin to drop values for attributes like
@kaidaguerre would you accept PRs proposing such changes? |
any updates on this, I met the same issue? |
Sorry for the radio silence on this one @pdecat |
hello, any news? I still have the error (I have just udated steampipe and ldap plugin to teh latest releases)
|
Describe the bug
Running this query
Seems to return some JSON data with
\u0000
, leading to the error:Steampipe version (
steampipe -v
)Example: v0.9.1
logs
Can refer here Data which causing this error
Expected behavior
I'd expect the JSON column handler to either strip the null field
\u0000
out to fix the parsing or to replace the JSON with error content.Additional context
N/A
The text was updated successfully, but these errors were encountered: