Task #12969 (closed)
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
comment:3 Changed 9 years ago by atarkowska
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
'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',
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.
comment:12 Changed 9 years ago by spli
Can't you check it yourself, config should be under /etc/httpd/
comment:13 Changed 9 years ago by atarkowska
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)?
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
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