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

getAnnotationCounts Acquisition #299

Closed
will-moore opened this issue Jun 14, 2021 · 2 comments
Closed

getAnnotationCounts Acquisition #299

will-moore opened this issue Jun 14, 2021 · 2 comments

Comments

@will-moore
Copy link
Member

See https://www.openmicroscopy.org/qa2/qa/feedback/30270/

If you select multiple Runs (Acquisitions) in the webclient tree, the right panel loading fails with

conn.getAnnotationCounts()

File "/opt/omero/web/venv3/lib64/python3.6/site-packages/omeroweb/webclient/views.py", line 2288, in batch_annotate
getObjects(request, conn)

File "/opt/omero/web/venv3/lib64/python3.6/site-packages/omeroweb/webclient/controller/container.py", line 243, in getBatchAnnotationCounts
return self.conn.getAnnotationCounts(objDict)

File "/opt/omero/web/venv3/lib64/python3.6/site-packages/omero/gateway/__init__.py", line 3728, in getAnnotationCounts
return self.countAnnotations(obj_type, obj_ids)

File "/opt/omero/web/venv3/lib64/python3.6/site-packages/omero/gateway/__init__.py", line 3606, in countAnnotations
queryResult = self.getQueryService().projection(q, params, ctx)

omero.QueryException: exception ::omero::QueryException
{
serverStackTrace = ome.services.query.QueryException: Illegal query:
select sum( case when an.ns = :ratingns
and an.class = LongAnnotation
then 1 else 0 end),
sum( case when (an.ns is null or an.ns != :ratingns)
and an.class = LongAnnotation
then 1 else 0 end),
sum( case when an.class != LongAnnotation
then 1 else 0 end ), type(an.class)
from Annotation an where an.id in
(select distinct(ann.id) from AcquisitionAnnotationLink ial
join ial.child as ann
join ial.parent as i
where i.id in (:ids))
group by an.class

AcquisitionAnnotationLink is not mapped [
@Tom-TBT
Copy link
Contributor

Tom-TBT commented Dec 5, 2023

I just saw the error on my server. Never had more than one Run before until now (microscope data from a lab next to us, though wasn't supposed to be. Something wrong with the ome.xml).

So tracing back what happens:
omeroweb.webclient.views.batch_annotate calls getObjects(), returning a dictionary.
The key for the PlateAcquisition is "acquisition"

def getObjects(request, conn=None):

The dictionary is passed until reaching omero.gateway.countAnnotations where it fails.

Some checks are happening in omero.gateway.getAnnotationCounts, replacing the key "plateacquisition" with "PlateAcquisition". That's where we could add one more condition to replace "acquisition" with "PlateAcquisition". Then the HQL shouldn't fail:
https://github.com/ome/omero-py/blob/0958d2ba30f92990d6dea077fa359356577c6275/src/omero/gateway/__init__.py#L3724

Another solution would be to fix the key in the dictionary passed to getBatchAnnotationCounts, but maybe the error happens in other places (so I prefer the first option)

snoopycrimecop added a commit to snoopycrimecop/omero-web that referenced this issue Dec 6, 2023
Repository: ome/omero-web
Excluded PRs:
  - PR 518 Tom-TBT 'Fix getAnnotationCounts Acquisition ome#299' (user: Tom-TBT)
  - PR 511 pre-commit-ci[bot] '[pre-commit.ci] pre-commit autoupdate' (user: pre-commit-ci[bot])
  - PR 399 will-moore 'Handle chgrp dry-run LogicalChannel[ID] to show images' (stage: draft)
  - PR 225 will-moore 'Query string ids' (exclude comment)
  - PR 17 will-moore 'Right panel performance fixes' (exclude comment)
Already up-to-date.

Merged PRs:
  - PR 508 Tom-TBT 'Inherit annotation support'
  - PR 509 jburel 'set Python to 3.9'
  - PR 512 sbesson 'Add Python 3.11 to the testing matrix'
  - PR 513 chris-allan 'Allow plugins to use settings utilities'
  - PR 514 will-moore 'Add support for ?show=fileset-123'
  - PR 516 sbesson 'Handle sudo connection in the account view'

Conflicting PRs (not included):
  - PR 168 stick 'Changes to nginx @maintenance handler'

Generated by OMERO-python-superbuild-push#376 (https://snoopycrimecop-ci.openmicroscopy.org/jenkins/job/OMERO-python-superbuild-push/376/)
snoopycrimecop added a commit to snoopycrimecop/omero-web that referenced this issue Dec 6, 2023
Repository: ome/omero-web
Excluded PRs:
  - PR 518 Tom-TBT 'Fix getAnnotationCounts Acquisition ome#299' (user: Tom-TBT)
  - PR 511 pre-commit-ci[bot] '[pre-commit.ci] pre-commit autoupdate' (user: pre-commit-ci[bot])
  - PR 399 will-moore 'Handle chgrp dry-run LogicalChannel[ID] to show images' (stage: draft)
  - PR 225 will-moore 'Query string ids' (exclude comment)
  - PR 17 will-moore 'Right panel performance fixes' (exclude comment)
Already up-to-date.

Merged PRs:
  - PR 508 Tom-TBT 'Inherit annotation support'
  - PR 509 jburel 'set Python to 3.9'
  - PR 512 sbesson 'Add Python 3.11 to the testing matrix'
  - PR 513 chris-allan 'Allow plugins to use settings utilities'
  - PR 514 will-moore 'Add support for ?show=fileset-123'
  - PR 516 sbesson 'Handle sudo connection in the account view'

Conflicting PRs (not included):
  - PR 168 stick 'Changes to nginx @maintenance handler'

Generated by OMERO-python-superbuild-push#377 (https://snoopycrimecop-ci.openmicroscopy.org/jenkins/job/OMERO-python-superbuild-push/377/)
snoopycrimecop added a commit to snoopycrimecop/omero-web that referenced this issue Dec 7, 2023
Repository: ome/omero-web
Excluded PRs:
  - PR 518 Tom-TBT 'Fix getAnnotationCounts Acquisition ome#299' (user: Tom-TBT)
  - PR 511 pre-commit-ci[bot] '[pre-commit.ci] pre-commit autoupdate' (user: pre-commit-ci[bot])
  - PR 399 will-moore 'Handle chgrp dry-run LogicalChannel[ID] to show images' (stage: draft)
  - PR 225 will-moore 'Query string ids' (exclude comment)
  - PR 17 will-moore 'Right panel performance fixes' (exclude comment)
Already up-to-date.

Merged PRs:
  - PR 508 Tom-TBT 'Inherit annotation support'
  - PR 509 jburel 'set Python to 3.9'
  - PR 512 sbesson 'Add Python 3.11 to the testing matrix'
  - PR 513 chris-allan 'Allow plugins to use settings utilities'
  - PR 514 will-moore 'Add support for ?show=fileset-123'
  - PR 516 sbesson 'Handle sudo connection in the account view'

Conflicting PRs (not included):
  - PR 168 stick 'Changes to nginx @maintenance handler'

Generated by OMERO-python-superbuild-push#378 (https://snoopycrimecop-ci.openmicroscopy.org/jenkins/job/OMERO-python-superbuild-push/378/)
snoopycrimecop added a commit to snoopycrimecop/omero-web that referenced this issue Dec 8, 2023
Repository: ome/omero-web
Excluded PRs:
  - PR 518 Tom-TBT 'Fix getAnnotationCounts Acquisition ome#299' (user: Tom-TBT)
  - PR 511 pre-commit-ci[bot] '[pre-commit.ci] pre-commit autoupdate' (user: pre-commit-ci[bot])
  - PR 399 will-moore 'Handle chgrp dry-run LogicalChannel[ID] to show images' (stage: draft)
  - PR 225 will-moore 'Query string ids' (exclude comment)
  - PR 17 will-moore 'Right panel performance fixes' (exclude comment)
Already up-to-date.

Merged PRs:
  - PR 508 Tom-TBT 'Inherit annotation support'
  - PR 509 jburel 'set Python to 3.9'
  - PR 512 sbesson 'Add Python 3.11 to the testing matrix'
  - PR 513 chris-allan 'Allow plugins to use settings utilities'
  - PR 514 will-moore 'Add support for ?show=fileset-123'
  - PR 516 sbesson 'Handle sudo connection in the account view'

Conflicting PRs (not included):
  - PR 168 stick 'Changes to nginx @maintenance handler'

Generated by OMERO-python-superbuild-push#379 (https://snoopycrimecop-ci.openmicroscopy.org/jenkins/job/OMERO-python-superbuild-push/379/)
snoopycrimecop added a commit to snoopycrimecop/omero-web that referenced this issue Dec 9, 2023
Repository: ome/omero-web
Excluded PRs:
  - PR 518 Tom-TBT 'Fix getAnnotationCounts Acquisition ome#299' (user: Tom-TBT)
  - PR 511 pre-commit-ci[bot] '[pre-commit.ci] pre-commit autoupdate' (user: pre-commit-ci[bot])
  - PR 399 will-moore 'Handle chgrp dry-run LogicalChannel[ID] to show images' (stage: draft)
  - PR 225 will-moore 'Query string ids' (exclude comment)
  - PR 17 will-moore 'Right panel performance fixes' (exclude comment)
Already up-to-date.

Merged PRs:
  - PR 508 Tom-TBT 'Inherit annotation support'
  - PR 509 jburel 'set Python to 3.9'
  - PR 512 sbesson 'Add Python 3.11 to the testing matrix'
  - PR 513 chris-allan 'Allow plugins to use settings utilities'
  - PR 514 will-moore 'Add support for ?show=fileset-123'
  - PR 516 sbesson 'Handle sudo connection in the account view'
  - PR 519 knabar 'Limit number of FileAnnotations retrieved for OMERO.web UI'

Conflicting PRs (not included):
  - PR 168 stick 'Changes to nginx @maintenance handler'

Generated by OMERO-python-superbuild-push#380 (https://snoopycrimecop-ci.openmicroscopy.org/jenkins/job/OMERO-python-superbuild-push/380/)
snoopycrimecop added a commit to snoopycrimecop/omero-web that referenced this issue Dec 12, 2023
Repository: ome/omero-web
Excluded PRs:
  - PR 518 Tom-TBT 'Fix getAnnotationCounts Acquisition ome#299' (user: Tom-TBT)
  - PR 511 pre-commit-ci[bot] '[pre-commit.ci] pre-commit autoupdate' (user: pre-commit-ci[bot])
  - PR 399 will-moore 'Handle chgrp dry-run LogicalChannel[ID] to show images' (stage: draft)
  - PR 225 will-moore 'Query string ids' (exclude comment)
  - PR 17 will-moore 'Right panel performance fixes' (exclude comment)
Already up-to-date.

Merged PRs:
  - PR 508 Tom-TBT 'Inherit annotation support'
  - PR 509 jburel 'set Python to 3.9'
  - PR 512 sbesson 'Add Python 3.11 to the testing matrix'
  - PR 513 chris-allan 'Allow plugins to use settings utilities'
  - PR 514 will-moore 'Add support for ?show=fileset-123'
  - PR 516 sbesson 'Handle sudo connection in the account view'
  - PR 519 knabar 'Limit number of FileAnnotations retrieved for OMERO.web UI'

Conflicting PRs (not included):
  - PR 168 stick 'Changes to nginx @maintenance handler'

Generated by OMERO-python-superbuild-push#381 (https://snoopycrimecop-ci.openmicroscopy.org/jenkins/job/OMERO-python-superbuild-push/381/)
snoopycrimecop added a commit to snoopycrimecop/omero-web that referenced this issue Dec 13, 2023
Repository: ome/omero-web
Excluded PRs:
  - PR 518 Tom-TBT 'Fix getAnnotationCounts Acquisition ome#299' (user: Tom-TBT)
  - PR 399 will-moore 'Handle chgrp dry-run LogicalChannel[ID] to show images' (stage: draft)
  - PR 225 will-moore 'Query string ids' (exclude comment)
  - PR 17 will-moore 'Right panel performance fixes' (exclude comment)
Updating 604d527..8bcbf20
Previously merged:
  - PR 513 chris-allan 'Allow plugins to use settings utilities'
  - PR 512 sbesson 'Add Python 3.11 to the testing matrix'
  - PR 511 pre-commit-ci[bot] '[pre-commit.ci] pre-commit autoupdate'
  - PR 509 jburel 'set Python to 3.9'

Merged PRs:
  - PR 508 Tom-TBT 'Inherit annotation support'
  - PR 514 will-moore 'Add support for ?show=fileset-123'
  - PR 516 sbesson 'Handle sudo connection in the account view'
  - PR 519 knabar 'Limit number of FileAnnotations retrieved for OMERO.web UI'
  - PR 520 knabar 'Add changelog 5.24.0 release'

Conflicting PRs (not included):
  - PR 168 stick 'Changes to nginx @maintenance handler'

Generated by OMERO-python-superbuild-push#382 (https://snoopycrimecop-ci.openmicroscopy.org/jenkins/job/OMERO-python-superbuild-push/382/)
snoopycrimecop added a commit to snoopycrimecop/omero-web that referenced this issue Dec 14, 2023
Repository: ome/omero-web
Excluded PRs:
  - PR 518 Tom-TBT 'Fix getAnnotationCounts Acquisition ome#299' (user: Tom-TBT)
  - PR 399 will-moore 'Handle chgrp dry-run LogicalChannel[ID] to show images' (stage: draft)
  - PR 225 will-moore 'Query string ids' (exclude comment)
  - PR 17 will-moore 'Right panel performance fixes' (exclude comment)
Already up-to-date.

Merged PRs:
  - PR 508 Tom-TBT 'Inherit annotation support'
  - PR 514 will-moore 'Add support for ?show=fileset-123'
  - PR 516 sbesson 'Handle sudo connection in the account view'
  - PR 519 knabar 'Limit number of FileAnnotations retrieved for OMERO.web UI'
  - PR 520 knabar 'Add changelog 5.24.0 release'

Conflicting PRs (not included):
  - PR 168 stick 'Changes to nginx @maintenance handler'

Generated by OMERO-python-superbuild-push#383 (https://snoopycrimecop-ci.openmicroscopy.org/jenkins/job/OMERO-python-superbuild-push/383/)
snoopycrimecop added a commit to snoopycrimecop/omero-web that referenced this issue Dec 15, 2023
Repository: ome/omero-web
Excluded PRs:
  - PR 518 Tom-TBT 'Fix getAnnotationCounts Acquisition ome#299' (user: Tom-TBT)
  - PR 399 will-moore 'Handle chgrp dry-run LogicalChannel[ID] to show images' (stage: draft)
  - PR 225 will-moore 'Query string ids' (exclude comment)
  - PR 17 will-moore 'Right panel performance fixes' (exclude comment)
Already up-to-date.

Merged PRs:
  - PR 508 Tom-TBT 'Inherit annotation support'
  - PR 514 will-moore 'Add support for ?show=fileset-123'
  - PR 516 sbesson 'Handle sudo connection in the account view'
  - PR 519 knabar 'Limit number of FileAnnotations retrieved for OMERO.web UI'
  - PR 520 knabar 'Add changelog 5.24.0 release'

Conflicting PRs (not included):
  - PR 168 stick 'Changes to nginx @maintenance handler'

Generated by OMERO-python-superbuild-push#384 (https://snoopycrimecop-ci.openmicroscopy.org/jenkins/job/OMERO-python-superbuild-push/384/)
snoopycrimecop added a commit to snoopycrimecop/omero-web that referenced this issue Dec 15, 2023
snoopycrimecop added a commit to snoopycrimecop/omero-web that referenced this issue Dec 15, 2023
Repository: ome/omero-web
Excluded PRs:
  - PR 508 Tom-TBT 'Inherit annotation support' (status: action_required)
  - PR 399 will-moore 'Handle chgrp dry-run LogicalChannel[ID] to show images' (stage: draft)
  - PR 225 will-moore 'Query string ids' (exclude comment)
  - PR 17 will-moore 'Right panel performance fixes' (exclude comment)
Already up-to-date.

Merged PRs:
  - PR 514 will-moore 'Add support for ?show=fileset-123'
  - PR 516 sbesson 'Handle sudo connection in the account view'
  - PR 518 Tom-TBT 'Fix getAnnotationCounts Acquisition ome#299'
  - PR 519 knabar 'Limit number of FileAnnotations retrieved for OMERO.web UI'
  - PR 520 knabar 'Add changelog 5.24.0 release'

Conflicting PRs (not included):
  - PR 168 stick 'Changes to nginx @maintenance handler'

Generated by OMERO-python-superbuild-push#385 (https://snoopycrimecop-ci.openmicroscopy.org/jenkins/job/OMERO-python-superbuild-push/385/)
snoopycrimecop added a commit to snoopycrimecop/omero-web that referenced this issue Dec 15, 2023
snoopycrimecop added a commit to snoopycrimecop/omero-web that referenced this issue Dec 15, 2023
Repository: ome/omero-web
Excluded PRs:
  - PR 399 will-moore 'Handle chgrp dry-run LogicalChannel[ID] to show images' (stage: draft)
  - PR 225 will-moore 'Query string ids' (exclude comment)
  - PR 17 will-moore 'Right panel performance fixes' (exclude comment)
Already up-to-date.

Merged PRs:
  - PR 508 Tom-TBT 'Inherit annotation support'
  - PR 514 will-moore 'Add support for ?show=fileset-123'
  - PR 516 sbesson 'Handle sudo connection in the account view'
  - PR 518 Tom-TBT 'Fix getAnnotationCounts Acquisition ome#299'
  - PR 519 knabar 'Limit number of FileAnnotations retrieved for OMERO.web UI'
  - PR 520 knabar 'Add changelog 5.24.0 release'

Conflicting PRs (not included):
  - PR 168 stick 'Changes to nginx @maintenance handler'

Generated by OMERO-python-superbuild-push#386 (https://snoopycrimecop-ci.openmicroscopy.org/jenkins/job/OMERO-python-superbuild-push/386/)
snoopycrimecop added a commit to snoopycrimecop/omero-web that referenced this issue Dec 16, 2023
snoopycrimecop added a commit to snoopycrimecop/omero-web that referenced this issue Dec 16, 2023
Repository: ome/omero-web
Excluded PRs:
  - PR 399 will-moore 'Handle chgrp dry-run LogicalChannel[ID] to show images' (stage: draft)
  - PR 225 will-moore 'Query string ids' (exclude comment)
  - PR 17 will-moore 'Right panel performance fixes' (exclude comment)
Already up-to-date.

Merged PRs:
  - PR 508 Tom-TBT 'Inherit annotation support'
  - PR 514 will-moore 'Add support for ?show=fileset-123'
  - PR 516 sbesson 'Handle sudo connection in the account view'
  - PR 518 Tom-TBT 'Fix getAnnotationCounts Acquisition ome#299'
  - PR 519 knabar 'Limit number of FileAnnotations retrieved for OMERO.web UI'
  - PR 520 knabar 'Add changelog 5.24.0 release'

Conflicting PRs (not included):
  - PR 168 stick 'Changes to nginx @maintenance handler'

Generated by OMERO-python-superbuild-push#387 (https://snoopycrimecop-ci.openmicroscopy.org/jenkins/job/OMERO-python-superbuild-push/387/)
snoopycrimecop added a commit to snoopycrimecop/omero-web that referenced this issue Dec 17, 2023
snoopycrimecop added a commit to snoopycrimecop/omero-web that referenced this issue Dec 17, 2023
Repository: ome/omero-web
Excluded PRs:
  - PR 399 will-moore 'Handle chgrp dry-run LogicalChannel[ID] to show images' (stage: draft)
  - PR 225 will-moore 'Query string ids' (exclude comment)
  - PR 17 will-moore 'Right panel performance fixes' (exclude comment)
Already up-to-date.

Merged PRs:
  - PR 508 Tom-TBT 'Inherit annotation support'
  - PR 514 will-moore 'Add support for ?show=fileset-123'
  - PR 516 sbesson 'Handle sudo connection in the account view'
  - PR 518 Tom-TBT 'Fix getAnnotationCounts Acquisition ome#299'
  - PR 519 knabar 'Limit number of FileAnnotations retrieved for OMERO.web UI'
  - PR 520 knabar 'Add changelog 5.24.0 release'

Conflicting PRs (not included):
  - PR 168 stick 'Changes to nginx @maintenance handler'

Generated by OMERO-python-superbuild-push#388 (https://snoopycrimecop-ci.openmicroscopy.org/jenkins/job/OMERO-python-superbuild-push/388/)
snoopycrimecop added a commit to snoopycrimecop/omero-web that referenced this issue Dec 18, 2023
snoopycrimecop added a commit to snoopycrimecop/omero-web that referenced this issue Dec 18, 2023
Repository: ome/omero-web
Excluded PRs:
  - PR 399 will-moore 'Handle chgrp dry-run LogicalChannel[ID] to show images' (stage: draft)
  - PR 225 will-moore 'Query string ids' (exclude comment)
  - PR 17 will-moore 'Right panel performance fixes' (exclude comment)
Already up-to-date.

Merged PRs:
  - PR 508 Tom-TBT 'Inherit annotation support'
  - PR 514 will-moore 'Add support for ?show=fileset-123'
  - PR 516 sbesson 'Handle sudo connection in the account view'
  - PR 518 Tom-TBT 'Fix getAnnotationCounts Acquisition ome#299'
  - PR 519 knabar 'Limit number of FileAnnotations retrieved for OMERO.web UI'
  - PR 520 knabar 'Add changelog 5.24.0 release'

Conflicting PRs (not included):
  - PR 168 stick 'Changes to nginx @maintenance handler'

Generated by OMERO-python-superbuild-push#389 (https://snoopycrimecop-ci.openmicroscopy.org/jenkins/job/OMERO-python-superbuild-push/389/)
knabar added a commit that referenced this issue Dec 19, 2023
Fix getAnnotationCounts Acquisition #299
snoopycrimecop added a commit to snoopycrimecop/omero-web that referenced this issue Dec 20, 2023
Repository: ome/omero-web
Excluded PRs:
  - PR 399 will-moore 'Handle chgrp dry-run LogicalChannel[ID] to show images' (stage: draft)
  - PR 225 will-moore 'Query string ids' (exclude comment)
  - PR 17 will-moore 'Right panel performance fixes' (exclude comment)
Updating 3700865..a2af391
Previously merged:
  - PR 520 knabar 'Add changelog 5.24.0 release'
  - PR 514 will-moore 'Add support for ?show=fileset-123'
  - PR 519 knabar 'Limit number of FileAnnotations retrieved for OMERO.web UI'
  - PR 508 Tom-TBT 'Inherit annotation support'
  - PR 516 sbesson 'Handle sudo connection in the account view'
  - PR 518 Tom-TBT 'Fix getAnnotationCounts Acquisition ome#299'

Conflicting PRs (not included):
  - PR 168 stick 'Changes to nginx @maintenance handler'

Generated by OMERO-python-superbuild-push#390 (https://snoopycrimecop-ci.openmicroscopy.org/jenkins/job/OMERO-python-superbuild-push/390/)
@will-moore
Copy link
Member Author

With #518 merged, this can be closed.

NB @Tom-TBT If you'd used the exact words "Fixes #299" on the PR, then merging it would have closed this issue (instead of "Fix of #299".

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

No branches or pull requests

2 participants