Warning: Can't synchronize with repository "(default)" (/home/git/ome.git does not appear to be a Git repository.). Look in the Trac log for more information.
Notice: In order to edit this ticket you need to be either: a Product Owner, The owner or the reporter of the ticket, or, in case of a Task not yet assigned, a team_member"

Task #12969 (closed)

Opened 9 years ago

Closed 9 years ago

Last modified 9 years ago

TypeError: not enough arguments for format string

Reported by: atarkowska Owned by: atarkowska
Priority: major Milestone: OMERO-5.1.4
Component: Web Version: 5.1.2
Keywords: n.a. Cc: khgillen, spli, sbesson
Resources: n.a. Referenced By: n.a.
References: n.a. Remaining Time: n.a.
Sprint: n.a.

Description (last modified by atarkowska)

Accessing /webgateway/render_image/3925542/35/0/
cause

2015-06-30 18:53:53,645 ERROR [
django.request] (proc.14808) handle_uncaught_exception:226 Internal Server Error: /webgateway/render_image/3925542/35/0/
Traceback (most recent call last):
  File "/opt/omero/omero/OMERO-CURRENT/lib/python/django/core/handlers/base.py",
line 114, in get_response
    response = wrapped_callback(request, *callback_args, **callback_kwargs)
  File "/opt/omero/omero/OMERO-CURRENT/lib/python/omeroweb/decorators.py",
line 471, in wrapped
    retval = f(request, *args, **kwargs)
  File "/opt/omero/omero/OMERO.server-5.1.2-ice35-b45/lib/python/omeroweb/webgateway/views.py",
line 845, in render_image
    jpeg_data = webgateway_cache.getImage(request, server_id, img, z, t)
  File "/opt/omero/omero/OMERO.server-5.1.2-ice35-b45/lib/python/omeroweb/webgateway/webgateway_cache.py",
line 670, in getImage
    k = self._imageKey(r, client_base, img, z, t) + ctx
  File "/opt/omero/omero/OMERO.server-5.1.2-ice35-b45/lib/python/omeroweb/webgateway/webgateway_cache.py",
line 636, in _imageKey
    return rv % ('%sx%s' % (str(z), str(t)))
TypeError: not enough arguments for format string
2015-06-30 21:03:28,085 ERROR [
django.request] (proc.29798) handle_uncaught_exception:226 Internal
Server Error: /webgateway/render_image/3925542/35/0/
Traceback (most recent call last):
  File "/opt/omero/omero/OMERO-CURRENT/lib/python/django/core/handlers/base.py",
line 114, in get_response
    response = wrapped_callback(request, *callback_args, **callback_kwargs)
  File "/opt/omero/omero/OMERO-CURRENT/lib/python/omeroweb/decorators.py",
line 471, in wrapped
    retval = f(request, *args, **kwargs)
  File "/opt/omero/omero/OMERO.server-5.1.2-ice35-b45/lib/python/omeroweb/webgateway/views.py",
line 845, in render_image
    jpeg_data = webgateway_cache.getImage(request, server_id, img, z, t)
  File "/opt/omero/omero/OMERO.server-5.1.2-ice35-b45/lib/python/omeroweb/webgateway/webgateway_cache.py",
line 670, in getImage
    k = self._imageKey(r, client_base, img, z, t) + ctx
  File "/opt/omero/omero/OMERO.server-5.1.2-ice35-b45/lib/python/omeroweb/webgateway/webgateway_cache.py",
line 636, in _imageKey
    return rv % ('%sx%s' % (str(z), str(t)))
TypeError: not enough arguments for format string

Change History (19)

comment:1 Changed 9 years ago by atarkowska

  • Description modified (diff)

comment:2 Changed 9 years ago by atarkowska

Looks like something is wrong with escaping %s in https://github.com/openmicroscopy/openmicroscopy/blob/develop/components/tools/OmeroWeb/omeroweb/webgateway/webgateway_cache.py#L631 as x and t are present

2015-07-16 11:57:05,552  INFO [    omeroweb.webgateway.webgateway_cache] (proc.11534) _imageKey:636   rv: img_1/0/2717/%s-c1-166.75:2129.6875-0000FF-2-237.65:2489.0625-00FF00-3-605.6:1851.2000000000003-FF0000-mc-q0.9-r-t
2015-07-16 11:57:05,552  INFO [    omeroweb.webgateway.webgateway_cache] (proc.11534) _imageKey:637   z: 35
2015-07-16 11:57:05,552  INFO [    omeroweb.webgateway.webgateway_cache] (proc.11534) _imageKey:638   t: 0
Last edited 9 years ago by atarkowska (previous) (diff)

comment:4 Changed 9 years ago by atarkowska

  • Milestone changed from 5.2.0 to 5.1.3
  • Resolution set to worksforme
  • Status changed from new to closed

comment:5 Changed 9 years ago by jamoore

  • Milestone changed from 5.1.3 to 5.1.4
  • Resolution worksforme deleted
  • Status changed from closed to reopened

comment:6 Changed 9 years ago by Aleksandra Tarkowska <A.Tarkowska@…>

(In [7c41b68e1b5201f856e87063d1a1ed76f226c549/ome.git] on branch develop) updating string formatting to get more details, see #12969

comment:7 Changed 9 years ago by atarkowska

Adding admin notofication showed what exactly is causing that issue. Looks like robots cut off coma from

https://nightshade/webgateway/render_image/3933597/42/0/?c=1|175.1:1620.675$0000FF,2|291.3:2381.025$00FF00,3|471.7:2601.625$FF0000&m=c&p=normal&ia=0&q=0.9

'PATH_INFO': u'/webgateway/render_image/3925542/35/0/',
'QUERY_STRING': 'c=1%257C166:2129$0000FF',
'REQUEST_METHOD': 'GET',
'REQUEST_URI': '/webgateway/render_image/3925542/35/0/?c=1%257C166:2129$0000FF',
Last edited 9 years ago by atarkowska (previous) (diff)

comment:8 Changed 9 years ago by jamoore

  • Milestone changed from 5.1.4 to OMERO-5.1.4

Splitting 5.1.4 due to milestone decoupling

comment:9 Changed 9 years ago by atarkowska

  • Resolution set to invalid
  • Status changed from reopened to closed

There is no reason to wrap it with try catch block as we will loose potential errors if they appear in a different context

comment:10 Changed 9 years ago by jamoore

  • Resolution invalid deleted
  • Status changed from closed to reopened

Ola, sorry, I just don't agree. I don't see the need for our having a sysadmin-level ERROR because someone (a bot even) went to a wrong URL, right?

comment:11 Changed 9 years ago by atarkowska

  • Cc khgillen spli sbesson added

After closer investigation it looks like there maybe be rewrite rules on the server

| ==>%7C

%==> %25

%7C == %257C

Could we verify that? There is not really an easy way to decode that correctly.

Last edited 9 years ago by atarkowska (previous) (diff)

comment:12 Changed 9 years ago by spli

Can't you check it yourself, config should be under /etc/httpd/

comment:14 Changed 9 years ago by spli

Are you saying this is a bug in the generated apache omero config, or something else?

comment:15 Changed 9 years ago by atarkowska

Simon, I mean in general mode_rewrite and other modules doesn't handle pipe. It is not recommended to use it in URL. My thought was that maybe anyone else faced the same problem in the past and have some work around to force | with RewriteRules?.

comment:16 Changed 9 years ago by spli

OK, maybe we should fix it in OMERO.web then (as in replace | with something safer)?

Last edited 9 years ago by spli (previous) (diff)

comment:17 Changed 9 years ago by atarkowska

PR opened for 5.1 to prevent error https://github.com/openmicroscopy/openmicroscopy/pull/4181, just display black image.

For 5.2 we may just replace | with alternative character

comment:18 Changed 9 years ago by atarkowska

  • Resolution set to fixed
  • Status changed from reopened to closed

comment:19 Changed 9 years ago by Aleksandra Tarkowska <A.Tarkowska@…>

(In [a9dc3fa2e2fe470fa83fcdc2e6298c42d5a1f7fb/ome.git] on branch develop) prevent throwing an exception if query_string is incorrect, see #12969

Note: See TracTickets for help on using tickets. You may also have a look at Agilo extensions to the ticket.

1.3.13-PRO © 2008-2011 Agilo Software all rights reserved (this page was served in: 0.127817 sec.)

We're Hiring!