Advertisement
Guest User

Untitled

a guest
Aug 18th, 2017
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 16.00 KB | None | 0 0
  1. The SQL query had a syntax error:
  2. ActiveRecord::StatementInvalid: PG::ConnectionBad: PQsocket() can't get socket descriptor: SELECT rundate, CAST(100 * (((SUM(CASE WHEN adx = 0 THEN test_rtb_rev END) + SUM(CASE WHEN adx = 1 THEN test_adx_rev END)) / NULLIF(SUM(test_impressions), 0) / ((SUM(CASE WHEN adx = 0 THEN control_rtb_rev END) + SUM(CASE WHEN adx = 1 THEN control_adx_rev END)) / NULLIF(SUM(control_impressions), 0))) - 1) AS decimal(20, 2)) || '%' AS lift, (SUM(CASE WHEN adx = 0 THEN test_rtb_rev END) + SUM(CASE WHEN adx = 1 THEN test_adx_rev END)) / NULLIF(SUM(test_impressions), 0) AS test_avg_cpm, (SUM(CASE WHEN adx = 0 THEN control_rtb_rev END) + SUM(CASE WHEN adx = 1 THEN control_adx_rev END)) / NULLIF(SUM(control_impressions), 0) AS control_avg_cpm, SUM(test_impressions) AS test_impressions, SUM(control_impressions) AS control_impressions, (SUM(CASE WHEN adx = 0 THEN test_rtb_rev END) + SUM(CASE WHEN adx = 1 THEN test_adx_rev END)) AS test_revenue, (SUM(CASE WHEN adx = 0 THEN control_rtb_rev END) + SUM(CASE WHEN adx = 1 THEN control_adx_rev END)) AS control_revenue, 100 * SUM(test_impressions)::float / NULLIF((SUM(control_impressions) + SUM(test_impressions)), 0) AS test_percentage, 100 * SUM(control_impressions)::float / NULLIF((SUM(control_impressions) + SUM(test_impressions)), 0) AS control_percentage, SUM(CASE WHEN adx = 1 THEN test_adx_rev END) / NULLIF(SUM(CASE WHEN adx = 1 THEN test_impressions END), 0) AS test_adx_cpm, SUM(CASE WHEN adx = 1 THEN control_adx_rev END) / NULLIF(SUM(CASE WHEN adx = 1 THEN control_impressions END), 0) AS control_adx_cpm, SUM(CASE WHEN adx = 0 THEN test_rtb_rev END) / NULLIF(SUM(CASE WHEN adx = 0 THEN test_impressions END), 0) AS test_rtb_cpm, SUM(CASE WHEN adx = 0 THEN control_rtb_rev END) / NULLIF(SUM(CASE WHEN adx = 0 THEN control_impressions END), 0) AS control_rtb_cpm, SUM(CASE WHEN adx = 1 THEN test_pl_rev END) / NULLIF(SUM(CASE WHEN adx = 1 THEN test_rtb_rev END), 0) AS test_adx_multiplier, SUM(CASE WHEN adx = 1 THEN control_pl_rev END) / NULLIF(SUM(CASE WHEN adx = 1 THEN control_rtb_rev END), 0) AS control_adx_multiplier, SUM(CASE WHEN adx = 0 THEN test_pl_rev END) / NULLIF(SUM(CASE WHEN adx = 0 THEN test_rtb_rev END), 0) AS test_rtb_multiplier, SUM(CASE WHEN adx = 0 THEN control_pl_rev END) / NULLIF(SUM(CASE WHEN adx = 0 THEN control_rtb_rev END), 0) AS control_rtb_multiplier, 100 * SUM(CASE WHEN adx = 1 THEN test_impressions END)::float / NULLIF((SUM(CASE WHEN adx = 1 THEN test_impressions END) + SUM(CASE WHEN adx = 0 THEN test_impressions END)), 0) AS test_adx_fill, 100 * SUM(CASE WHEN adx = 1 THEN control_impressions END)::float / NULLIF((SUM(CASE WHEN adx = 1 THEN control_impressions END) + SUM(CASE WHEN adx = 0 THEN control_impressions END)), 0) AS control_adx_fill FROM (SELECT rundate, CASE WHEN adxfill THEN 1 ELSE 0 END AS adx, SUM(CASE WHEN experimentids LIKE '%|10|%' THEN totalimpressions ELSE 0 END) AS test_impressions, SUM(CASE WHEN NOT experimentids LIKE '%|10|%' THEN totalimpressions ELSE 0 END) AS control_impressions, SUM(CASE WHEN experimentids LIKE '%|10|%' THEN adxprice ELSE 0 END) AS test_adx_rev, SUM(CASE WHEN NOT experimentids LIKE '%|10|%' THEN adxprice ELSE 0 END) AS control_adx_rev, SUM(CASE WHEN experimentids LIKE '%|10|%' THEN cpprice ELSE 0 END) AS test_rtb_rev, SUM(CASE WHEN NOT experimentids LIKE '%|10|%' THEN cpprice ELSE 0 END) AS control_rtb_rev, SUM(CASE WHEN experimentids LIKE '%|10|%' THEN plprice ELSE 0 END) AS test_pl_rev, SUM(CASE WHEN NOT experimentids LIKE '%|10|%' THEN plprice ELSE 0 END) AS control_pl_rev, ed.site AS site FROM ramp.experimentdaily ed INNER JOIN mdm.site s ON s.site = ed.site LEFT OUTER JOIN dfp105.order o ON o.id = ed.orderid WHERE ((o.type ILIKE '%programmatic%' OR o.name ILIKE '%ramp%') AND creativesize <> '') GROUP BY adx, ed.site, rundate ORDER BY 1, 2, 4 DESC) adx_reports WHERE (DATE(rundate) >= '2017-06-25' AND DATE(rundate) <= '2017-07-30') AND (site in ('ANAD')) GROUP BY rundate
  3. ["/var/www/html/ad-management-console/production/shared/bundle/ruby/2.4.0/bundler/gems/activerecord4-redshift-adapter-3715772157e8/lib/active_record/connection_adapters/redshift_adapter.rb:509:in `async_exec'", "/var/www/html/ad-management-console/production/shared/bundle/ruby/2.4.0/bundler/gems/activerecord4-redshift-adapter-3715772157e8/lib/active_record/connection_adapters/redshift_adapter.rb:509:in `block in exec_no_cache'", "/var/www/html/ad-management-console/production/shared/bundle/ruby/2.4.0/gems/activerecord-4.2.8/lib/active_record/connection_adapters/abstract_adapter.rb:484:in `block in log'", "/var/www/html/ad-management-console/production/shared/bundle/ruby/2.4.0/gems/activesupport-4.2.8/lib/active_support/notifications/instrumenter.rb:20:in `instrument'", "/var/www/html/ad-management-console/production/shared/bundle/ruby/2.4.0/gems/activerecord-4.2.8/lib/active_record/connection_adapters/abstract_adapter.rb:478:in `log'", "/var/www/html/ad-management-console/production/shared/bundle/ruby/2.4.0/bundler/gems/activerecord4-redshift-adapter-3715772157e8/lib/active_record/connection_adapters/redshift_adapter.rb:509:in `exec_no_cache'", "/var/www/html/ad-management-console/production/shared/bundle/ruby/2.4.0/bundler/gems/activerecord4-redshift-adapter-3715772157e8/lib/active_record/connection_adapters/redshift_adapter.rb:501:in `execute_and_clear'", "/var/www/html/ad-management-console/production/shared/bundle/ruby/2.4.0/bundler/gems/activerecord4-redshift-adapter-3715772157e8/lib/active_record/connection_adapters/redshift/database_statements.rb:160:in `exec_query'", "/var/www/html/ad-management-console/production/shared/bundle/ruby/2.4.0/gems/activerecord-4.2.8/lib/active_record/connection_adapters/abstract/database_statements.rb:356:in `select'", "/var/www/html/ad-management-console/production/shared/bundle/ruby/2.4.0/gems/activerecord-4.2.8/lib/active_record/connection_adapters/abstract/database_statements.rb:32:in `select_all'", "/var/www/html/ad-management-console/production/shared/bundle/ruby/2.4.0/gems/activerecord-4.2.8/lib/active_record/connection_adapters/abstract/query_cache.rb:70:in `select_all'", "/var/www/html/ad-management-console/production/shared/bundle/ruby/2.4.0/gems/activerecord-4.2.8/lib/active_record/querying.rb:39:in `find_by_sql'", "/var/www/html/ad-management-console/production/releases/20170817211421/app/models/report.rb:133:in `execute'", "/var/www/html/ad-management-console/production/releases/20170817211421/app/models/report.rb:139:in `rescue in execute'", "/var/www/html/ad-management-console/production/releases/20170817211421/app/models/report.rb:125:in `execute'", "/var/www/html/ad-management-console/production/releases/20170817211421/app/models/report_job.rb:50:in `process'", "/var/www/html/ad-management-console/production/shared/bundle/ruby/2.4.0/gems/delayed_job-4.1.2/lib/delayed/performable_method.rb:26:in `perform'", "/var/www/html/ad-management-console/production/shared/bundle/ruby/2.4.0/gems/delayed_job-4.1.2/lib/delayed/backend/base.rb:84:in `block in invoke_job'", "/var/www/html/ad-management-console/production/shared/bundle/ruby/2.4.0/gems/delayed_job-4.1.2/lib/delayed/lifecycle.rb:61:in `block in initialize'", "/var/www/html/ad-management-console/production/shared/bundle/ruby/2.4.0/gems/delayed_job-4.1.2/lib/delayed/lifecycle.rb:66:in `execute'", "/var/www/html/ad-management-console/production/shared/bundle/ruby/2.4.0/gems/delayed_job-4.1.2/lib/delayed/lifecycle.rb:40:in `run_callbacks'", "/var/www/html/ad-management-console/production/shared/bundle/ruby/2.4.0/gems/delayed_job-4.1.2/lib/delayed/backend/base.rb:81:in `invoke_job'", "/var/www/html/ad-management-console/production/shared/bundle/ruby/2.4.0/gems/newrelic_rpm-4.0.0.332/lib/new_relic/agent/instrumentation/delayed_job_instrumentation.rb:129:in `block in invoke_job'", "/var/www/html/ad-management-console/production/shared/bundle/ruby/2.4.0/gems/newrelic_rpm-4.0.0.332/lib/new_relic/agent/instrumentation/controller_instrumentation.rb:362:in `perform_action_with_newrelic_trace'", "/var/www/html/ad-management-console/production/shared/bundle/ruby/2.4.0/gems/newrelic_rpm-4.0.0.332/lib/new_relic/agent/instrumentation/delayed_job_instrumentation.rb:128:in `invoke_job'", "/var/www/html/ad-management-console/production/shared/bundle/ruby/2.4.0/gems/delayed_job-4.1.2/lib/delayed/worker.rb:230:in `block (2 levels) in run'", "/home/deployuser/.rvm/rubies/ruby-2.4.1/lib/ruby/2.4.0/timeout.rb:93:in `block in timeout'", "/home/deployuser/.rvm/rubies/ruby-2.4.1/lib/ruby/2.4.0/timeout.rb:103:in `timeout'", "/var/www/html/ad-management-console/production/shared/bundle/ruby/2.4.0/gems/delayed_job-4.1.2/lib/delayed/worker.rb:230:in `block in run'", "/home/deployuser/.rvm/rubies/ruby-2.4.1/lib/ruby/2.4.0/benchmark.rb:308:in `realtime'", "/var/www/html/ad-management-console/production/shared/bundle/ruby/2.4.0/gems/delayed_job-4.1.2/lib/delayed/worker.rb:229:in `run'", "/var/www/html/ad-management-console/production/shared/bundle/ruby/2.4.0/gems/delayed_job-4.1.2/lib/delayed/worker.rb:306:in `block in reserve_and_run_one_job'", "/var/www/html/ad-management-console/production/shared/bundle/ruby/2.4.0/gems/delayed_job-4.1.2/lib/delayed/lifecycle.rb:61:in `block in initialize'", "/var/www/html/ad-management-console/production/shared/bundle/ruby/2.4.0/gems/delayed_job-4.1.2/lib/delayed/lifecycle.rb:66:in `execute'", "/var/www/html/ad-management-console/production/shared/bundle/ruby/2.4.0/gems/delayed_job-4.1.2/lib/delayed/lifecycle.rb:40:in `run_callbacks'", "/var/www/html/ad-management-console/production/shared/bundle/ruby/2.4.0/gems/delayed_job-4.1.2/lib/delayed/worker.rb:306:in `reserve_and_run_one_job'", "/var/www/html/ad-management-console/production/shared/bundle/ruby/2.4.0/gems/delayed_job-4.1.2/lib/delayed/worker.rb:213:in `block in work_off'", "/var/www/html/ad-management-console/production/shared/bundle/ruby/2.4.0/gems/delayed_job-4.1.2/lib/delayed/worker.rb:212:in `times'", "/var/www/html/ad-management-console/production/shared/bundle/ruby/2.4.0/gems/delayed_job-4.1.2/lib/delayed/worker.rb:212:in `work_off'", "/var/www/html/ad-management-console/production/shared/bundle/ruby/2.4.0/gems/delayed_job-4.1.2/lib/delayed/worker.rb:175:in `block (4 levels) in start'", "/home/deployuser/.rvm/rubies/ruby-2.4.1/lib/ruby/2.4.0/benchmark.rb:308:in `realtime'", "/var/www/html/ad-management-console/production/shared/bundle/ruby/2.4.0/gems/delayed_job-4.1.2/lib/delayed/worker.rb:174:in `block (3 levels) in start'", "/var/www/html/ad-management-console/production/shared/bundle/ruby/2.4.0/gems/delayed_job-4.1.2/lib/delayed/lifecycle.rb:61:in `block in initialize'", "/var/www/html/ad-management-console/production/shared/bundle/ruby/2.4.0/gems/delayed_job-4.1.2/lib/delayed/lifecycle.rb:66:in `execute'", "/var/www/html/ad-management-console/production/shared/bundle/ruby/2.4.0/gems/delayed_job-4.1.2/lib/delayed/lifecycle.rb:40:in `run_callbacks'", "/var/www/html/ad-management-console/production/shared/bundle/ruby/2.4.0/gems/delayed_job-4.1.2/lib/delayed/worker.rb:173:in `block (2 levels) in start'", "/var/www/html/ad-management-console/production/shared/bundle/ruby/2.4.0/gems/delayed_job-4.1.2/lib/delayed/worker.rb:172:in `loop'", "/var/www/html/ad-management-console/production/shared/bundle/ruby/2.4.0/gems/delayed_job-4.1.2/lib/delayed/worker.rb:172:in `block in start'", "/var/www/html/ad-management-console/production/shared/bundle/ruby/2.4.0/gems/delayed_job-4.1.2/lib/delayed/plugins/clear_locks.rb:7:in `block (2 levels) in '", "/var/www/html/ad-management-console/production/shared/bundle/ruby/2.4.0/gems/delayed_job-4.1.2/lib/delayed/lifecycle.rb:79:in `block (2 levels) in add'", "/var/www/html/ad-management-console/production/shared/bundle/ruby/2.4.0/gems/delayed_job-4.1.2/lib/delayed/lifecycle.rb:61:in `block in initialize'", "/var/www/html/ad-management-console/production/shared/bundle/ruby/2.4.0/gems/delayed_job-4.1.2/lib/delayed/lifecycle.rb:79:in `block in add'", "/var/www/html/ad-management-console/production/shared/bundle/ruby/2.4.0/gems/delayed_job-4.1.2/lib/delayed/lifecycle.rb:66:in `execute'", "/var/www/html/ad-management-console/production/shared/bundle/ruby/2.4.0/gems/delayed_job-4.1.2/lib/delayed/lifecycle.rb:40:in `run_callbacks'", "/var/www/html/ad-management-console/production/shared/bundle/ruby/2.4.0/gems/delayed_job-4.1.2/lib/delayed/worker.rb:171:in `start'", "/var/www/html/ad-management-console/production/shared/bundle/ruby/2.4.0/gems/delayed_job-4.1.2/lib/delayed/command.rb:132:in `run'", "/var/www/html/ad-management-console/production/shared/bundle/ruby/2.4.0/gems/delayed_job-4.1.2/lib/delayed/command.rb:120:in `block in run_process'", "/var/www/html/ad-management-console/production/shared/bundle/ruby/2.4.0/gems/daemons-1.2.4/lib/daemons/application.rb:266:in `block in start_proc'", "/var/www/html/ad-management-console/production/shared/bundle/ruby/2.4.0/gems/daemons-1.2.4/lib/daemons/daemonize.rb:84:in `call_as_daemon'", "/var/www/html/ad-management-console/production/shared/bundle/ruby/2.4.0/gems/daemons-1.2.4/lib/daemons/application.rb:270:in `start_proc'", "/var/www/html/ad-management-console/production/shared/bundle/ruby/2.4.0/gems/daemons-1.2.4/lib/daemons/application.rb:296:in `start'", "/var/www/html/ad-management-console/production/shared/bundle/ruby/2.4.0/gems/daemons-1.2.4/lib/daemons/controller.rb:56:in `run'", "/var/www/html/ad-management-console/production/shared/bundle/ruby/2.4.0/gems/daemons-1.2.4/lib/daemons.rb:197:in `block in run_proc'", "/var/www/html/ad-management-console/production/shared/bundle/ruby/2.4.0/gems/daemons-1.2.4/lib/daemons/cmdline.rb:92:in `catch_exceptions'", "/var/www/html/ad-management-console/production/shared/bundle/ruby/2.4.0/gems/daemons-1.2.4/lib/daemons.rb:196:in `run_proc'", "/var/www/html/ad-management-console/production/shared/bundle/ruby/2.4.0/gems/delayed_job-4.1.2/lib/delayed/command.rb:118:in `run_process'", "/var/www/html/ad-management-console/production/shared/bundle/ruby/2.4.0/gems/delayed_job-4.1.2/lib/delayed/command.rb:99:in `block in daemonize'", "/var/www/html/ad-management-console/production/shared/bundle/ruby/2.4.0/gems/delayed_job-4.1.2/lib/delayed/command.rb:97:in `times'", "/var/www/html/ad-management-console/production/shared/bundle/ruby/2.4.0/gems/delayed_job-4.1.2/lib/delayed/command.rb:97:in `daemonize'", "bin/delayed_job:5:in `'", "/home/deployuser/.rvm/gems/ruby-2.4.1@ad_management_console/gems/bundler-1.15.1/lib/bundler/cli/exec.rb:74:in `load'", "/home/deployuser/.rvm/gems/ruby-2.4.1@ad_management_console/gems/bundler-1.15.1/lib/bundler/cli/exec.rb:74:in `kernel_load'", "/home/deployuser/.rvm/gems/ruby-2.4.1@ad_management_console/gems/bundler-1.15.1/lib/bundler/cli/exec.rb:27:in `run'", "/home/deployuser/.rvm/gems/ruby-2.4.1@ad_management_console/gems/bundler-1.15.1/lib/bundler/cli.rb:360:in `exec'", "/home/deployuser/.rvm/gems/ruby-2.4.1@ad_management_console/gems/bundler-1.15.1/lib/bundler/vendor/thor/lib/thor/command.rb:27:in `run'", "/home/deployuser/.rvm/gems/ruby-2.4.1@ad_management_console/gems/bundler-1.15.1/lib/bundler/vendor/thor/lib/thor/invocation.rb:126:in `invoke_command'", "/home/deployuser/.rvm/gems/ruby-2.4.1@ad_management_console/gems/bundler-1.15.1/lib/bundler/vendor/thor/lib/thor.rb:369:in `dispatch'", "/home/deployuser/.rvm/gems/ruby-2.4.1@ad_management_console/gems/bundler-1.15.1/lib/bundler/cli.rb:20:in `dispatch'", "/home/deployuser/.rvm/gems/ruby-2.4.1@ad_management_console/gems/bundler-1.15.1/lib/bundler/vendor/thor/lib/thor/base.rb:444:in `start'", "/home/deployuser/.rvm/gems/ruby-2.4.1@ad_management_console/gems/bundler-1.15.1/lib/bundler/cli.rb:10:in `start'", "/home/deployuser/.rvm/gems/ruby-2.4.1@ad_management_console/gems/bundler-1.15.1/exe/bundle:35:in `block in '", "/home/deployuser/.rvm/gems/ruby-2.4.1@ad_management_console/gems/bundler-1.15.1/lib/bundler/friendly_errors.rb:121:in `with_friendly_errors'", "/home/deployuser/.rvm/gems/ruby-2.4.1@ad_management_console/gems/bundler-1.15.1/exe/bundle:27:in `'", "/home/deployuser/.rvm/gems/ruby-2.4.1@ad_management_console/bin/bundle:23:in `load'", "/home/deployuser/.rvm/gems/ruby-2.4.1@ad_management_console/bin/bundle:23:in `
  4. '", "/home/deployuser/.rvm/gems/ruby-2.4.1@ad_management_console/bin/ruby_executable_hooks:15:in `eval'", "/home/deployuser/.rvm/gems/ruby-2.4.1@ad_management_console/bin/ruby_executable_hooks:15:in `
  5. '"]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement