Show memcache statistics at the bottom of each page creates a conflict with the IMCE upload generating the following...
SyntaxError: JSON.parse: unexpected non-whitespace character after JSON data
http://localhost/sites/all/modules/jquery_update/replace/jquery/1.7/jque...
Line 565
uncaught exception: Invalid JSON: {"data":{"added":[{"name":"ob-beach-
cam.png","size":3708,"width":265,"height":37,"date":1379374435,"fsize":"3.62
KB","fdate":"09\/16\/2013 - 4:33pm","id":"133"}],"dirsize":"8.92 KB"},"messages":
{"status":["\u003Cem class=\u0022placeholder\u0022\u003Eob-beach-cam.png\u003C\/em
\u003E has been uploaded."]}}<div id="memcache-devel"><h2>Memcache
statistics</h2><table class="table table-striped sticky-enabled">
<thead><tr><th>Operation</th><th>Bin</th><th>Key</th><th>Hit</th> </tr></thead>
<tbody> <tr class="odd"><td>get</td><td>cache_bootstrap</td><td>obma2-
cache_bootstrap-variables</td><td>1</td> </tr> <tr
class="even"><td>get</td><td>cache_bootstrap</td><td>obma2-cache_bootstrap-
bootstrap_modules</td><td>1</td> </tr> <tr
class="odd"><td>get</td><td>cache_bootstrap</td><td>obma2-cache_bootstrap-
lookup_cache</td><td>1</td> </tr> <tr
class="even"><td>get</td><td>cache_bootstrap</td><td>obma2-cache_bootstrap-
system_list</td><td>1</td> </tr> <tr
class="odd"><td>get</td><td>cache_bootstrap</td><td>obma2-cache_bootstrap-
module_implements</td><td>1</td> </tr> <tr
class="even"><td>get</td><td>cache_path</td><td>obma2-cache_path-imce</td><td></td>
</tr> <tr class="odd"><td>get</td><td>cache</td><td>obma2-cache-
views_ui_basic_paths</td><td>1</td> </tr> <tr
class="even"><td>get</td><td>cache</td><td>obma2-cache-context</td><td>1</td> </tr>
<tr class="odd"><td>getMulti</td><td>cache</td><td>obma2-cache-.wildcard-
context</td><td>1</td> </tr> <tr class="even"><td>get</td><td>cache</td><td>obma2-
cache-context</td><td>1</td> </tr> <tr
class="odd"><td>set</td><td>cache</td><td>obma2-cache-context</td><td></td> </tr> <tr
class="even"><td>get</td><td>cache</td><td>obma2-cache-
ctools_plugin_type_info</td><td>1</td> </tr> <tr
class="odd"><td>getMulti</td><td>cache</td><td>obma2-cache-.wildcard-
ctools_plugin_type_i</td><td>0</td> </tr> <tr
class="even"><td>get</td><td>cache</td><td>obma2-cache-plugins%3Acontext
%3Aplugins</td><td>1</td> </tr> <tr
class="odd"><td>getMulti</td><td>cache</td><td>obma2-cache-.wildcard-plugins
%3Acontext</td><td>1</td> </tr> <tr class="even"><td>get</td><td>cache</td><td>obma2-
cache-schema%3Aruntime%3A</td><td>1</td> </tr> <tr
class="odd"><td>getMulti</td><td>cache</td><td>obma2-cache-.wildcard-schema
%3A</td><td>1</td> </tr> <tr class="even"><td>get</td><td>cache</td><td>obma2-cache-
schema</td><td>1</td> </tr> <tr class="odd"><td>get</td><td>cache</td><td>obma2-
cache-context</td><td>1</td> </tr> <tr
class="even"><td>set</td><td>cache</td><td>obma2-cache-context</td><td></td> </tr> <tr
class="odd"><td>get</td><td>cache</td><td>obma2-cache-context</td><td>1</td> </tr> <tr
class="even"><td>set</td><td>cache</td><td>obma2-cache-context</td><td></td> </tr> <tr
class="odd"><td>get</td><td>cache_bootstrap</td><td>obma2-cache_bootstrap-
hook_info</td><td>1</td> </tr> <tr class="even"><td>get</td><td>cache</td><td>obma2-
cache-mollom_form_cache</td><td>1</td> </tr> <tr
class="odd"><td>get</td><td>cache</td><td>obma2-cache-entity_info%3Aen</td><td>1</td>
</tr> <tr class="even"><td>getMulti</td><td>cache</td><td>obma2-cache-.wildcard-
entity_info%3A</td><td>1</td> </tr> <tr
class="odd"><td>get</td><td>cache_field</td><td>obma2-cache_field-field_info%3Abundle
%3Afile%3Aundefined</td><td>1</td> </tr> <tr
class="even"><td>getMulti</td><td>cache_field</td><td>obma2-cache_field-.wildcard-
field_info%3A</td><td>1</td> </tr> <tr
class="odd"><td>getMulti</td><td>cache_field</td><td>obma2-cache_field-field%3Afile
%3A133</td><td>0</td> </tr> <tr
class="even"><td>set</td><td>cache_field</td><td>obma2-cache_field-field%3Afile
%3A133</td><td></td> </tr> <tr
class="odd"><td>delete</td><td>cache_field</td><td>obma2-cache_field-field%3Afile
%3A133</td><td></td> </tr> <tr class="even"><td>get</td><td>cache</td><td>obma2-
cache-theme_registry%3Aintrepidnetwork</td><td>1</td> </tr> <tr
class="odd"><td>getMulti</td><td>cache</td><td>obma2-cache-.wildcard-
theme_registry</td><td>1</td> </tr> </tbody> </table> </div>
The solution was to uncheck the box for this option on the Memcache Admin page.
Comments
Comment #1
ben_chad commentedI see this error, too. Looking at memcache_admin_shutdown, it seems that the module does a reasonable job at trying to prevent this. I have two comments:
1) memcache_admin_shutdown could probably afford to be a more conservative as to when it displays statistics. It currently shows them ``unless it can find a compelling reason otherwise". Perhaps it should only show them if it can positively confirm that the content is HTML. A more flexible solution, alongside this change, would be to implement black/white lists, but I don't expect the maintainers to take that on. I'd be happy to do it if the maintainers are interested in the feature.
2) The IMCE code is not setting it's content-type headers correctly. I'll raise an issue with them (if one doesn't already exist) and submit a patch.
B
Comment #2
ben_chad commentedIt seems that the IMCE folk are aware of the issue with headers, but they have their hands tied because of technology. Gotta love it :)
See https://drupal.org/node/2074447
B
Comment #3
jeremy commentedno recent complaints, closing