This site uses cookies. By continuing to browse the site, you agree to our use of cookies. Find out more about cookies.
Skip to main content
Metadecidim's official logo
  • English Triar la llengua Elegir el idioma Choose language
    • Català
    • Castellano
Sign Up Sign In
  • Home
  • Processes
  • Assemblies
  • Initiatives
  • Consultations
  • Conferences
  • Help

Report a Bug

#BugReportDecidim Let's test Decidim and report bugs together

  • The process
  • I found a Bug!
chevron-left Back to list

Broken metrics task: results (wrong SQL query)

Avatar: Participant deleted
13/02/2019 13:05  
Accepted

We have an application running Decidim 0.16.0, the task bundle exec rake decidim:metrics:one["results"] generates the following error:

ActiveRecord::StatementInvalid: PG::GroupingError: ERROR: column "decidim_accountability_results.id" must appear in the GROUP BY clause or be used in an aggregate function
LINE 1: ...ipatory_space_id", decidim_components.id ORDER BY "decidim_a...

I've been unable to replicate this in the development_app (there it does not happen). The closest I've get is pointing our application and the development_app both to a cloned Decidim repo on 0.16 and comparing the generated SQL queries (they differ in some points).

Here I've pasted both queries:

https://gist.github.com/amiedes/8318f5728da87ab5b7bbf223fe0d0220

I suspect of the extra ORDER BY "decidim_accountability_results"."id" ASC present in the erroneous query, but I can't guess where it comes from.

  • Filter results for category: 0.16.x 0.16.x

This proposal has been accepted because:

This incidence has been solved. Closed via #4979.

Thank you for contributing!

Endorsements count0
Broken metrics task: results (wrong SQL query) Comments 1

Reference: MDC-PROP-2019-02-14252
Version number 1 (of 1) see other versions
Check fingerprint

Fingerprint

The piece of text below is a shortened, hashed representation of this content. It's useful to ensure the content hasn't been tampered with, as a single modification would result in a totally different value.

Value: b5bb727d4251625b0af6c6ffe875942b2863095605d56d3bcc784f3d32175dfe

Source: {"body":{"en":"We have an application running Decidim 0.16.0, the task bundle exec rake decidim:metrics:one[\"results\"] generates the following error:\r\n\r\nActiveRecord::StatementInvalid: PG::GroupingError: ERROR: column \"decidim_accountability_results.id\" must appear in the GROUP BY clause or be used in an aggregate function\r\nLINE 1: ...ipatory_space_id\", decidim_components.id ORDER BY \"decidim_a...\r\n\r\nI've been unable to replicate this in the development_app (there it does not happen). The closest I've get is pointing our application and the development_app both to a cloned Decidim repo on 0.16 and comparing the generated SQL queries (they differ in some points).\r\n\r\nHere I've pasted both queries:\r\n\r\nhttps://gist.github.com/amiedes/8318f5728da87ab5b7bbf223fe0d0220\r\n\r\nI suspect of the extra ORDER BY \"decidim_accountability_results\".\"id\" ASC present in the erroneous query, but I can't guess where it comes from."},"title":{"en":"Broken metrics task: results (wrong SQL query)"}}

This fingerprint is calculated using a SHA256 hashing algorithm. In order to replicate it yourself, you can use an MD5 calculator online and copy-paste the source data.

Share:

link-intact Share link

Share link:

Please paste this code in your page:

<script src="https://meta.decidim.org/processes/bug-report/f/210/proposals/14252/embed.js"></script>
<noscript><iframe src="https://meta.decidim.org/processes/bug-report/f/210/proposals/14252/embed.html" frameborder="0" scrolling="vertical"></iframe></noscript>

Report inappropriate content

Is this content inappropriate?

Reason

1 comment

Order by:
  • Older
    • Best rated
    • Recent
    • Older
    • Most discussed
Avatar: Participant deleted
13/02/2019 13:08
  • Get link Get link

EDIT:

The decidim code that generates this query is located here: https://github.com/decidim/decidim/blob/master/decidim-accountability/app/queries/decidim/accountability/metrics/resultsmetricmanage.rb#L39-L45

Add your comment

Sign in with your account or sign up to add your comment.

Loading comments ...

  • Terms and conditions of use
  • About the community
  • Download Open Data files
  • Metadecidim at Twitter Twitter
  • Metadecidim at Instagram Instagram
  • Metadecidim at YouTube YouTube
  • Metadecidim at GitHub GitHub
Creative Commons License Website made with free software.
Decidim Logo

Confirm

OK Cancel

Please sign in

decidim Sign in with Decidim Barcelona
Or

Sign up

Forgot your password?