Piston Breaking in Webcore


#1

I’m having webcore problems with the following piston. It’s called every 20 mins from another piston, and all it does is check whether my windows server is running. The url returns a simple “test page” message if the IIS server is up.

I recently noticed it wasn’t working, and when I tried to edit/test it wouldn’t load in the IDE, so I had to recreate it.

When the server was down it worked fine when I clicked “test”, however when the server was up, I noticed the web call waiting 20 secs before returning (as it did when the server was down), it then returns the “test page” message and works, but then it runs again repeatedly.

I wondered if the problem was the web page, it was created using MS word and saved as htm, and just contains the test “test page” although word puts much more around it.

I tried changing the web content, but now the piston will not test. It just says "testing for about 10 secs, but nothing happens. I’ve tried pausing and it wont pause either.

I have a similar piston for my NAS which works fine. However the response from the NAS when its running is an error 302 error message. This is returned instantly and indicates the NAS is running.

I suspect something has gone wrong and the piston is running continuously and I can’t get control of it (ctrl c , break etc)


#2

On runaway loops, I have had to pull the power to the hub for a minute to get it to stop looping.


#3

Although edits to the piston failed (it took a long time and then just returned to the edit screen) I did manage to delete it. I suspect if its left for long enough it goes into the fail to load state. I have been wondering why this particular piston keeps breaking and I have to delete from the IDE and recreate it.

My own post led me to a solution, just make a get call to a non existent page. If it times out “[:]” response, the server is down, if its a 404 error, its up.

This leads to the question, how do you perform a get request to a web page containing simple static data? The above piston does seem to retrieve the page, but it seems to be waiting for more data. It then seems to restart and makes the call again.


#4

Exactly like you did:

pic

(My only difference is I typically make the {variable} a string, instead of dynamic)


Although to be fair, the key word in your question was ‘simple’. Most pages nowadays have 20-30 external references. (meaning even if your data has loaded, it does not mean every last bit of data has transferred)

I think webCoRE’s normal behavior with HTTP GET, is to set a wakeup for 20 sec… but the real data usually comes in long before then. (although ad-riddled or heavily scripted pages can take awhile)


Edit:

I just noticed your double curlies…

pic

My code only has single curlies.

pic

Which means I use no curlies or quotes in an Expression box:

pic

Not sure if that makes a difference.


#5

I suspect the problem is either the web page produced by word or maybe a config on my IIS server.

The web page is just the text “test page” typed into word and then saved as html. The IIS settings are defaulted, I’m no IIS expert!

The page works fine in a browser, webcore also successfully receives the content, but the timeout counter keeps running as if its expecting more data. And then it keeps rerunning.

I had a similar issue to this with a node.js app I wrote, again a web page returned finein the browser, but webcore kept waiting. The following finally worked
res.writeHead(200, {‘Content-Type’: ‘text/html’});
res.write(reply);
res.end();
I think the key part was setting the content type.

So, I’m wondering if webcore is more fussy and word does not produce a page webcore can read correctly.