-
Notifications
You must be signed in to change notification settings - Fork 5
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
"unexpected EOF" error when using concatenated text on net_dns_record table #40
Comments
Hi @massyn, thanks for trying out the Net plugin! -- list domains from domains.csv
with domain_list as (
select
concat('_dmarc.', domain) as domain
from
domains
order by
domain
)
select
domain,
value
from
net_dns_record
where
domain in (
select domain from domain_list
) |
The workaround script you've provided is working correctly. I'll use this in the mean time while you're working on the bugfix. |
The same bug exists in the net_http_request module too. |
'This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 30 days.' |
'This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 30 days.' |
Associated FDW issue - turbot/steampipe-postgres-fdw#220 |
Hi, i tried using the net_http_request table and I got a simular error as mentioned above, but even with the workouround I got the exact same error with service_url_list as (
SELECT concat('http://url?name=', name) as service_url FROM kubernetes_deployment
)
select
k.name,
k.namespace,
r.url,
i -> 'field' ->> 'name' as "Name",
from
kubernetes_deployment as k,
net_http_request as r,
jsonb_array_elements(r.response_body::jsonb -> 'items') as i
where
r.url in (select service_url::text from service_url_list);
PS.: URLs are normalized because they're internal but the request works just fine Also, the Is there any other way that i could get this working before the patch? |
The main "workaround" is trying to trick the postgres planner into do the subquery first rather than magically collapsing your query to combine them together. This will prevent it attempting a full table scan of the steampipe table that requires a qual. One trick that sometimes works (and is used above) is to put an
Any chance that helps? You can also better understand the plans by using Sorry we don't have a better answer for now, hoping the workaround nails it! |
@e-gineer thanks for the advice, it really worked I didn't really understood the workaround before your explanation as I am not a real SQL person (just getting my feet wet) Thanks for the help |
'This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 30 days.' |
'This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 30 days.' |
'This issue was closed because it has been stalled for 90 days with no activity.' |
Describe the bug
Using a LEFT JOIN on the net_dns_record table (from the net plugin), while doing a csv-based lookup on a text file results in an "unexpcted EOF" error
Warning: executeQueries: query 1 of 1 failed: unexpected EOF
Steampipe version (
steampipe -v
)steampipe version 0.15.2
To reproduce
Expected behavior
I am expecting the LEFT JOIN to respect the concatenation statement, and do a lookup of the TXT record in DNS of
_dmarc.steampipe.io
(as per the CSV file).Additional context
In another example, I was able to pass a simple
SELET 'steampipe.io' as domain
query, which worked fine. It would appear the combination of usingnet_dns_record
andcsv
in the join with the concatenation is a problem. A direct join without the concatenation works fine.The text was updated successfully, but these errors were encountered: