# Gateway status script "ERROR: Unexpected end of file from server"

**URL:** <https://forum.inductiveautomation.com/t/gateway-status-script-error-unexpected-end-of-file-from-server/31824>\
**Category:** Ignition\
**Tags:** ignition80\
**Created:** [January 31, 2020, 4:52pm UTC](https://forum.inductiveautomation.com/t/gateway-status-script-error-unexpected-end-of-file-from-server/31824 "2020-01-31T16:52:19Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Faisal.Shibli](https://avatars.discourse-cdn.com/v4/letter/f/90db22/32.png) [@Faisal.Shibli](https://forum.inductiveautomation.com/u/Faisal.Shibli)\
**Post date:** [January 31, 2020, 4:52pm UTC](https://forum.inductiveautomation.com/t/gateway-status-script-error-unexpected-end-of-file-from-server/31824/1 "2020-01-31T16:52:19Z")

</div>

I am using Ignition 8.0.7 with SSL.

Under gateway network, I have forced the traffic to go through HTTPS. I have the certificate installed and am able to launch the client using client launcher.

I have a local computer which also has a project and acts as a fallback when it can’t connected to primary or secondary ignition server. As part of retarting the script from the local fallback, i check the gateway status and I use the following code.

primary\_gatewayadd = system.tag.read(“IP of the primary ignition Server in Memory type string”).value  
the value is like : ip:8043/main  
status = system.util.getGatewayStatus(primary\_gatewayadd)  
print status

when I print the status it returns ERROR: Unexpected end of file from server Also when i used ip:8088:8043 it returned with Unknown status.

Please note on the local computer I also have the firewall disabled. The certificates are installed under .ignition/clientlauncher-data/certificates folder.

Please advice

---

<div class="post-metadata">

**Author:** ![paul-griffith](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/paul-griffith/32/37249_2.png) [@paul-griffith](https://forum.inductiveautomation.com/u/paul-griffith)\
**Post date:** [January 31, 2020, 5:46pm UTC](https://forum.inductiveautomation.com/t/gateway-status-script-error-unexpected-end-of-file-from-server/31824/2 "2020-01-31T17:46:10Z")

</div>

Don’t use `/main` at the end of the URL, it’s no longer necessary in 8.0.

---

<div class="post-metadata">

**Author:** ![Faisal.Shibli](https://avatars.discourse-cdn.com/v4/letter/f/90db22/32.png) [@Faisal.Shibli](https://forum.inductiveautomation.com/u/Faisal.Shibli)\
**Post date:** [January 31, 2020, 6:41pm UTC](https://forum.inductiveautomation.com/t/gateway-status-script-error-unexpected-end-of-file-from-server/31824/3 "2020-01-31T18:41:53Z")

</div>

Thank you for your prompt reply. I still get the same error with or without main.

---

<div class="post-metadata">

**Author:** ![Faisal.Shibli](https://avatars.discourse-cdn.com/v4/letter/f/90db22/32.png) [@Faisal.Shibli](https://forum.inductiveautomation.com/u/Faisal.Shibli)\
**Post date:** [February 11, 2020, 8:50pm UTC](https://forum.inductiveautomation.com/t/gateway-status-script-error-unexpected-end-of-file-from-server/31824/4 "2020-02-11T20:50:10Z")

</div>

With the help of Ignition support, I was able to get the resolution. When the SSL is configured the “system.util.getGatewayStatus” looses the scope to see the gateway status.

Using the following command will get the status and additional details about the gateway  
“system.net.httpGet(ipaddr:8043)”

Now to parse the running status text from the previous systax use this  
.split(";")[0].split("=")[1]

ex:  
fullgatewaystatus = system.net.httpGet([abcd.com:8043](http://abcd.com:8043))  
runSTATUS = fullgatewaystatus.split(";")[0].split("=")[1]

please make sure to add error trap script because if the gateway is not connected then the httpGet syntax error’s out and terminates the entire script…
