Skip to content
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

puppetdb 8.5.0 sql exception missing from clause for table certnames #3966

Closed
torstenfohrer opened this issue Apr 15, 2024 · 3 comments · Fixed by #3967 or voxpupuli/container-puppetdb#70
Labels

Comments

@torstenfohrer
Copy link

torstenfohrer commented Apr 15, 2024

Describe the Bug

Querying puppetdb 8.5.0 with following

[
"from", "node",
['extract', ['latest_report_status'],
['and',
['=', 'certname', 'SOMECERTNAME'],
]
]
]

Results now in a exception in puppetdb:

:cause ERROR: missing FROM-clause entry for table "certnames"
Position: 425
:via
[{:type org.postgresql.util.PSQLException
:message ERROR: missing FROM-clause entry for table "certnames"
Position: 425
:at [org.postgresql.core.v3.QueryExecutorImpl receiveErrorResponse QueryExecutorImpl.java 2725]}]
:trace
[[org.postgresql.core.v3.QueryExecutorImpl receiveErrorResponse QueryExecutorImpl.java 2725]
[org.postgresql.core.v3.QueryExecutorImpl processResults QueryExecutorImpl.java 2412]
[org.postgresql.core.v3.QueryExecutorImpl execute QueryExecutorImpl.java 371]
[org.postgresql.jdbc.PgStatement executeInternal PgStatement.java 502]
[org.postgresql.jdbc.PgStatement execute PgStatement.java 419]
[org.postgresql.jdbc.PgPreparedStatement executeWithFlags PgPreparedStatement.java 194]
[org.postgresql.jdbc.PgPreparedStatement executeQuery PgPreparedStatement.java 137]
[com.zaxxer.hikari.pool.ProxyPreparedStatement executeQuery ProxyPreparedStatement.java 52]
[com.zaxxer.hikari.pool.HikariProxyPreparedStatement executeQuery HikariProxyPreparedStatement.java -1]
[puppetlabs.puppetdb.jdbc$call_with_array_converted_query_rows$fn__21985 invoke jdbc.clj 330]
[clojure.java.jdbc$db_transaction_STAR_ invokeStatic jdbc.clj 860]
[clojure.java.jdbc$db_transaction_STAR_ invoke jdbc.clj 776]
[puppetlabs.puppetdb.jdbc$call_with_array_converted_query_rows invokeStatic jdbc.clj 322]
[puppetlabs.puppetdb.jdbc$call_with_array_converted_query_rows invoke jdbc.clj 304]
[puppetlabs.puppetdb.query_eng$body_stream$serialize_query_response__29427$fn__29477$fn__29494$fn__29495 invoke query_eng.clj 445]
[clojure.java.jdbc$db_transaction_STAR_ invokeStatic jdbc.clj 807]
[clojure.java.jdbc$db_transaction_STAR_ invoke jdbc.clj 776]
[puppetlabs.puppetdb.query_eng$body_stream$serialize_query_response__29427$fn__29477$fn__29494 invoke query_eng.clj 434]
[puppetlabs.puppetdb.query_eng$body_stream$serialize_query_response__29427$fn__29477 invoke query_eng.clj 433]
[puppetlabs.puppetdb.query_eng$body_stream$serialize_query_response__29427 invoke query_eng.clj 427]
[puppetlabs.puppetdb.query_eng$generated_stream$fn__29384 invoke query_eng.clj 334]
[ring.util.io$piped_input_stream$fn__20730 invoke io.clj 28]
[clojure.core$binding_conveyor_fn$fn__5823 invoke core.clj 2047]
[clojure.lang.AFn call AFn.java 18]
[java.util.concurrent.FutureTask run FutureTask.java 264]
[java.util.concurrent.ThreadPoolExecutor runWorker ThreadPoolExecutor.java 1136]
[java.util.concurrent.ThreadPoolExecutor$Worker run ThreadPoolExecutor.java 635]
[java.lang.Thread run Thread.java 840]]}

Expected Behavior

Returns last report status of certname

Environment

  • Latest puppetdb 8.5.0
  • Ubuntu 22.04
  • puppet-agent 8.6.0
@torstenfohrer torstenfohrer changed the title puppetdb 8.6.0 sql exception missing from clause for table certnames puppetdb 8.5.0 sql exception missing from clause for table certnames Apr 15, 2024
@austb
Copy link
Contributor

austb commented Apr 15, 2024

@torstenfohrer thanks for reporting this bug. We are able to reproduce it locally, and will work on a fix for it.

@austb austb added the triaged label Apr 15, 2024
Copy link

Migrated issue to PDB-5743

austb added a commit to austb/puppetdb that referenced this issue Apr 15, 2024
Without another reference to a field that depends on the certnames
table, a query for latest_report_status will fail with the error.

    ERROR: missing FROM-clause entry for table "certnames"

latest_report_status needs the certnames table in order to know the
latest_report_id that it needs to join against the reports table.

Fixes puppetlabs#3966
austb added a commit to austb/puppetdb that referenced this issue Apr 15, 2024
Without another reference to a field that depends on the certnames
table, a query for latest_report_status will fail with the error.

    ERROR: missing FROM-clause entry for table "certnames"

latest_report_status needs the certnames table in order to know the
latest_report_id that it needs to join against the reports table.

Fixes puppetlabs#3966
rbrw pushed a commit that referenced this issue Apr 15, 2024
Without another reference to a field that depends on the certnames
table, a query for latest_report_status will fail with the error.

    ERROR: missing FROM-clause entry for table "certnames"

latest_report_status needs the certnames table in order to know the
latest_report_id that it needs to join against the reports table.

Fixes #3966
@austb
Copy link
Contributor

austb commented Apr 24, 2024

PuppetDB 8.5.1 has been released with the fix for this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
2 participants