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

API Endpoint clearMetricsCache : column "metricname" does not exist #9346

Closed
luddaniel opened this issue Jan 30, 2023 · 1 comment · Fixed by #9569
Closed

API Endpoint clearMetricsCache : column "metricname" does not exist #9346

luddaniel opened this issue Jan 30, 2023 · 1 comment · Fixed by #9569
Labels
Feature: Metrics + Reports Size: 3 A percentage of a sprint. 2.1 hours. Type: Bug a defect
Milestone

Comments

@luddaniel
Copy link
Contributor

Hello Dataverse Team,

We wanted to share a discovered bug using this API :

curl -X DELETE http://localhost:8080/api/admin/clearMetricsCache/downloadsToMonth_2022-10

Log output says Caused by: org.postgresql.util.PSQLException: ERROR: column "metricname" does not exist
Java code is https://github.com/IQSS/dataverse/blob/develop/src/main/java/edu/harvard/iq/dataverse/api/Admin.java#L1971
SQL Query is :

DELETE FROM metric where metricname = ?

metricname column has be renammed in upgrade_v4.10.1_to_v4.11.sql

ALTER TABLE metric RENAME COLUMN metricName TO name;

Maybe there are some other uses of the previous column name.
Regards :)

@pdurbin
Copy link
Member

pdurbin commented Jan 30, 2023

@luddaniel thanks for the bug report and for tracking down where we renamed the database column!

I'm going to give this a size of 3 since it's straightforward:

  • it's just changing metricname to name in that query. It's the only instance I can find with the old name.
  • add a test to MetricsIT to exercise the delete endpoint

@pdurbin pdurbin added Type: Bug a defect Feature: Metrics + Reports Size: 3 A percentage of a sprint. 2.1 hours. labels Jan 30, 2023
qqmyers added a commit to QualitativeDataRepository/dataverse that referenced this issue May 1, 2023
qqmyers added a commit to QualitativeDataRepository/dataverse that referenced this issue May 5, 2023
kcondon added a commit that referenced this issue Jul 12, 2023
…-clear-single-metric-api

Fix #9346 clear single metrics api
@pdurbin pdurbin added this to the 5.14 milestone Jul 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature: Metrics + Reports Size: 3 A percentage of a sprint. 2.1 hours. Type: Bug a defect
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

2 participants