# Cannot read property 'length' of null exception

**URL:** <https://forum.genieacs.com/t/cannot-read-property-length-of-null-exception/298>\
**Category:** Uncategorized\
**Created:** [September 16, 2019, 4:45pm UTC](https://forum.genieacs.com/t/cannot-read-property-length-of-null-exception/298 "2019-09-16T16:45:56Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![ko2fan](https://avatars.discourse-cdn.com/v4/letter/k/eb8c5e/32.png) [@ko2fan](https://forum.genieacs.com/u/ko2fan)\
**Post date:** [September 16, 2019, 4:45pm UTC](https://forum.genieacs.com/t/cannot-read-property-length-of-null-exception/298/1 "2019-09-16T16:45:56Z")

</div>

I have added a Zyxel VMG8825 to genieacs 1.1.3 and it seems to be causing crashes in cwmp. Other devices I have tested work fine.

I have one script that runs on 0 BOOTSTRAP and one that runs on 1 BOOT, I have removed all the code from them and I still get the error. The error seems to be inside the session handling anyway.

2019-09-16T16:16:51.863Z [INFO] _snip_ 54833A-VMG8825%2DB50B-_snip_: Inform; cpeRequestId=“_snip_” informEvent=“0 BOOTSTRAP,1 BOOT,4 VALUE CHANGE” informRetryCount=10  
2019-09-16T16:16:52.059Z [ERROR] Uncaught exception; pid=87013 exceptionName=“TypeError” exceptionMessage=“Cannot read property ‘length’ of null” exceptionStack=“TypeError: Cannot read property ‘length’ of null\n at /usr/local/genieacs/lib/cwmp.js:549:33\n at Object.rpcRequest (/usr/local/genieacs/lib/session.js:744:12)\n at nextRpc (/usr/local/genieacs/lib/cwmp.js:468:18)\n at /usr/local/genieacs/lib/cwmp.js:978:14\n at Object.timeoutOperations (/usr/local/genieacs/lib/session.js:371:12)\n at processRequest (/usr/local/genieacs/lib/cwmp.js:964:20)\n at parsedRpc (/usr/local/genieacs/lib/cwmp.js:1063:14)\n at /usr/local/genieacs/lib/cwmp.js:1128:16\n at getSession (/usr/local/genieacs/lib/cwmp.js:748:12)\n at IncomingMessage. (/usr/local/genieacs/lib/cwmp.js:1065:12)”

---

<div class="post-metadata">

**Author:** ![ko2fan](https://avatars.discourse-cdn.com/v4/letter/k/eb8c5e/32.png) [@ko2fan](https://forum.genieacs.com/u/ko2fan)\
**Post date:** [September 17, 2019, 10:58am UTC](https://forum.genieacs.com/t/cannot-read-property-length-of-null-exception/298/2 "2019-09-17T10:58:35Z")

</div>

I have tried resetting the Zyxel and restarting genieacs. Still getting the same error.

Below are the soap packets (added spaces so the \< and \> show.

POST / HTTP/1.1  
Content-Length: 2892  
Content-Type: text/xml  
HOST: _snip_  
User-Agent: CyberGarage-HTTP/1.0

\<SOAP-ENV:Envelope xmlns:SOAP-ENV=“_snip_” xmlns:SOAP-ENC=“_snip_” xmlns:cwmp=“urn:dslforum-org:cwmp-1-0” xmlns:xsi=“_snip_” xmlns:xsd=“_snip_”\>  
\< SOAP-ENV:Header\>  
\<cwmp:ID SOAP-ENV:mustUnderstand=“1”\>_snip_\</cwmp:ID\>  
\</SOAP-ENV:Header\>  
\< SOAP-ENV:Body\>  
\< cwmp:Inform\>  
\< DeviceId\>  
\< Manufacturer\>ZYXEL\< /Manufacturer\>  
\< OUI\>54833A\< /OUI\>  
\< ProductClass\>VMG8825-B50B\< /ProductClass\>  
\< SerialNumber\>_snip_\< /SerialNumber\>  
\</ DeviceId\>  
\< Event SOAP-ENC:arrayType=“cwmp:EventStruct[3]”\>  
\< EventStruct\>  
\< EventCode\>0 BOOTSTRAP\< /EventCode\>  
\< CommandKey\>  
\< /EventStruct\>  
\< EventStruct\>  
\< EventCode\>1 BOOT\< /EventCode\>  
\< CommandKey\>\< /CommandKey\>  
\< /EventStruct\>  
\< EventStruct\>  
\< EventCode\>4 VALUE CHANGE\< /EventCode\>  
\< CommandKey\>\< /CommandKey\>  
\< /EventStruct\>  
\< /Event\>  
\< MaxEnvelopes\>1\< /MaxEnvelopes\>  
\< CurrentTime\>2019-09-17T12:19:44\< /CurrentTime\>  
\< RetryCount\>26  
\< ParameterList SOAP-ENC:arrayType=“cwmp:ParameterValueStruct[8]”\>  
\< ParameterValueStruct\>  
\< Name\>InternetGatewayDevice.DeviceSummary\< /Name\>  
\< Value xsi:type=“xsd:string”\>InternetGatewayDevice:1.4,VoiceService:1\< /Value\>  
\< /ParameterValueStruct\>  
\< ParameterValueStruct\>  
\< Name\>InternetGatewayDevice.DeviceInfo.SpecVersion\< /Name\>  
\< Value xsi:type=“xsd:string”\>1.0\< /Value\>  
\< /ParameterValueStruct\>  
\< ParameterValueStruct\>  
\< Name\>InternetGatewayDevice.DeviceInfo.HardwareVersion\< /Name\>  
\< Value xsi:type=“xsd:string”\>VMG8825-B50B\< /Value\>  
\< /ParameterValueStruct\>  
\< ParameterValueStruct\>  
\< Name\>InternetGatewayDevice.DeviceInfo.SoftwareVersion\< /Name\>  
\< Value xsi:type=“xsd:string”\>V5.13(ABNY.2)C0\< /Value\>  
\< /ParameterValueStruct\>  
\< ParameterValueStruct\>  
\< Name\>InternetGatewayDevice.DeviceInfo.ProvisioningCode\< /Name\>  
\< Value xsi:type=“xsd:string”\>\< /Value\>  
\< /ParameterValueStruct\>  
\< ParameterValueStruct\>  
\< Name\>InternetGatewayDevice.ManagementServer.ConnectionRequestURL\< /Name\>  
\< Value xsi:type=“xsd:string”\>_snip_\< /Value\>  
\< /ParameterValueStruct\>  
\< ParameterValueStruct\>  
\< Name\>InternetGatewayDevice.ManagementServer.ParameterKey\< /Name\>  
\< Value xsi:type=“xsd:string”\>\< /Value\>  
\< /ParameterValueStruct\>  
\< ParameterValueStruct\>  
\< Name\>InternetGatewayDevice.WANDevice.1.WANConnectionDevice.1.WANIPConnection.1.ExternalIPAddress\< /Name\>  
\< Value xsi:type=“xsd:string”\>_snip_\< /Value\>  
\< /ParameterValueStruct\>  
\< /ParameterList\>  
\< /cwmp:Inform\>  
\< /SOAP-ENV:Body\>  
\< /SOAP-ENV:Envelope\>

HTTP/1.1 200 OK  
Server: GenieACS/1.1.3  
SOAPServer: GenieACS/1.1.3  
Content-Type: text/xml; charset=“utf-8”  
Set-Cookie: session=743665a3925bceda  
Content-Length: 534  
Date: Tue, 17 Sep 2019 10:19:44 GMT  
Connection: keep-alive

\< ?xml version=“1.0” encoding=“UTF-8”?\>  
\< soap-env:Envelope xmlns:soap-enc=“_snip_” xmlns:soap-env=“_snip_” xmlns:xsd=“_snip_” xmlns:xsi=“_snip_” xmlns:cwmp=“urn:dslforum-org:cwmp-1-0”\>\< soap-env:Header\>\<cwmp:ID soap-env:mustUnderstand=“1”\>_snip_\</cwmp:ID\>\</soap-env:Header\>\< soap-env:Body\>\< cwmp:InformResponse\>1\</cwmp:InformResponse\>\</soap-env:Body\>\< /soap-env:Envelope\>

---

<div class="post-metadata">

**Author:** ![ko2fan](https://avatars.discourse-cdn.com/v4/letter/k/eb8c5e/32.png) [@ko2fan](https://forum.genieacs.com/u/ko2fan)\
**Post date:** [September 18, 2019, 3:25pm UTC](https://forum.genieacs.com/t/cannot-read-property-length-of-null-exception/298/3 "2019-09-18T15:25:38Z")

</div>

I looked at the code and noticed it was crashing when trying to run a task. I looked at the tasks list, and despite removing the device there was still an outstanding task that for some reason had a parameterValue of null.

{"\_id":“5d7b9e8984f74dbd96f24091”,“parameterValues”:null,“name”:“setParameterValues”,“device”:“54833A-VMG8825%2DB50B-_snip_”,“timestamp”:“2019-09-13T13:50:01.169Z”}

I have deleted the task, and now it’s working as expected.
