[ https://issues.apache.org/jira/browse/TC-96?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15826334#comment-15826334 ]
ASF GitHub Bot commented on TC-96: ---------------------------------- Github user mitchell852 commented on a diff in the pull request: https://github.com/apache/incubator-trafficcontrol/pull/181#discussion_r96448937 --- Diff: traffic_ops/app/lib/API/Cdn.pm --- @@ -264,7 +264,8 @@ sub get_traffic_monitor_config { { 'cdn.name' => $cdn_name }, { prefetch => ['cdn', 'profile', 'type'], select => 'me.profile', - distinct => 1 + distinct => 1, --- End diff -- talk to @elsloo :) > api/{version}/cdns/:cdn_name/configs/monitoring.json returns 500 > ---------------------------------------------------------------- > > Key: TC-96 > URL: https://issues.apache.org/jira/browse/TC-96 > Project: Traffic Control > Issue Type: Bug > Components: Traffic Ops API > Reporter: Jeremy Mitchell > Assignee: Jeremy Mitchell > > I believe this is a postgres-specific error. Postgres seems to be a little > more strict than mysql on how queries are formed. > Error message: > Error at line 271 ( while ( my $row = $rs_pp->next ) {) > DBIx::Class::Storage::DBI::_dbh_execute(): DBI Exception: DBD::Pg::st execute > failed: ERROR: column "me.cdn_id" must appear in the GROUP BY clause or be > used in an aggregate function LINE 1: ...table, type.last_updated FROM > (SELECT me.profile, me.cdn_id,... ^ [for Statement "SELECT me.profile, > cdn.id, cdn.name, cdn.last_updated, cdn.dnssec_enabled, profile.id, > profile.name, profile.description, profile.last_updated, type.id, type.name, > type.description, type.use_in_table, type.last_updated FROM (SELECT > me.profile, me.cdn_id, me.type FROM server me JOIN cdn cdn ON cdn.id = > me.cdn_id JOIN profile profile ON profile.id = me.profile JOIN type type ON > type.id = me.type WHERE ( cdn.name = ? ) GROUP BY me.profile) me JOIN cdn cdn > ON cdn.id = me.cdn_id JOIN profile profile ON profile.id = me.profile JOIN > type type ON type.id = me.type WHERE ( cdn.name = ? )" with ParamValues: > 1='over-the-top', 2='over-the-top'] at /opt/traffic_ops/app/lib/API/Cdn.pm > line 271 -- This message was sent by Atlassian JIRA (v6.3.4#6332)