# String length limit on context view?

**URL:** <https://discourse.nodered.org/t/string-length-limit-on-context-view/2582>\
**Category:** General\
**Created:** [26 August 2018 19:04 UTC](https://discourse.nodered.org/t/string-length-limit-on-context-view/2582 "2018-08-26T19:04:55Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![TotallyInformation](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/totallyinformation/32/31_2.png) [@TotallyInformation](https://discourse.nodered.org/u/TotallyInformation)\
**Post date:** [26 August 2018 19:04 UTC](https://discourse.nodered.org/t/string-length-limit-on-context-view/2582/1 "2018-08-26T19:04:55Z")

</div>

Hi, having upgraded my live HA system to 0.19.2 and starting to look at some enhancements made possible due to newer features, I've discovered a slight oddity in the context sidebar.

The following flow shows details about the process that is running the Node-RED service.

````auto
[{"id":"ce28f3d0.94287","type":"comment","z":"396e6d9.614e192","name":"Get details of NR process","info":"See:\n\nhttps://www.kernel.org/doc/Documentation/filesystems/proc.txt\n\nFor this to work, you need to set the PID\n(Process ID) for Node-Red. The easiest way\nto do this is to define it in your settings.js\n\nAdd the following to settings.js:\n```javascript\n ...\n functionGlobalContext: {\n \t 'pid': process.pid\n },\n ...\n```\n\nYou may need to increase the size of your debug\noutput as well:\n\n```javascript\n ...\n debugMaxLength: 1000,\n ...\n```","x":170,"y":200,"wires":[]},{"id":"f84babe9.6be5a8","type":"inject","z":"396e6d9.614e192","name":"","topic":"process/status","payload":"pid","payloadType":"global","repeat":"","crontab":"","once":false,"x":120,"y":240,"wires":[["d886326d.f7dcf"]]},{"id":"ed767c92.a5711","type":"exec","z":"396e6d9.614e192","command":"cat","addpay":true,"append":"","useSpawn":"false","timer":"","oldrc":false,"name":"cat /proc/<pid>/status","x":480,"y":240,"wires":[["641c6115.b322e","62dc3d08.d7b2b4"],[],[]]},{"id":"d886326d.f7dcf","type":"change","z":"396e6d9.614e192","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"'/proc/' & payload & '/status'","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":280,"y":240,"wires":[["ed767c92.a5711"]]},{"id":"641c6115.b322e","type":"change","z":"396e6d9.614e192","name":"","rules":[{"t":"set","p":"debugProcDetails","pt":"flow","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":710,"y":240,"wires":[[]]},{"id":"62dc3d08.d7b2b4","type":"debug","z":"396e6d9.614e192","name":"","active":true,"console":"false","complete":"false","x":690,"y":280,"wires":[]}]

````

I've changed the `debugMaxLength` setting to be `2048` and so the debug output shows the whole string. However, the context sidebar truncates the end of the string (which is 1062 characters):

![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/2X/0/0b9bbd0ee43f740d4493bf2df57e76a7cb9e1cc4.png)

It should look like:

![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/2X/9/97ebffb756c70b4d6becd5ebeb4c88e1d7794b08.png)

Also weirdly, the exec node I was using had nothing selected for the "output" mode - presumably because it was copied from an older version of Node-RED which didn't set that parameter. It seems to have defaulted to spawn mode though since when I deliberately set it to spawn mode, I get an even stranger output. I only get 1061 characters output when in spawn mode though I can't see any visible difference in the debug output. There is a slight difference in the context output though:

![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/2X/8/8d6e04f8c1aac83842b38aa8e9c3862e134a112e.png)

Not sure if this is all expected behaviour or just an edge case?
