Page 1 of 1

the variableNames errors on Windows server 6.1.1?

Posted: Mon Oct 14, 2013 5:36 pm
by edgore
Can anybody duplicate this?

the script is just

Code: Select all

<?lc
put 1 into aNumber
put the variableNames
?>
It reliably results in 500 internal server error with Windows server engine 6.1.1. with the entry below in the Apache error log:

[Mon Oct 14 10:31:47 2013] [error] [client 127.0.0.1] Premature end of script headers: livecode-server.exe
[Mon Oct 14 10:31:47 2013] [error] [client 127.0.0.1] livecode-server exited due to fatal signal 11

This is on an installation that is known to be working.

Just wondering if anyone else is seeing this before I report it as a bug.

Edited - I changed the script to ensure that there is a variable - same result

Re: the variableNames errors on Windows server 6.1.1?

Posted: Thu Oct 17, 2013 8:07 am
by samuel.vannesteBUSGvXT
Hello,
My guess: the variableNames is empty. Perhaps should you try

Code: Select all

<?lc
put ""
put the variableNames
?>

Re: the variableNames errors on Windows server 6.1.1?

Posted: Thu Oct 17, 2013 4:07 pm
by edgore
The variable names function should not error out, even if there are no variables - it should return four blank lines (which would all show up in one line in a browser) as it does on the desktop. Getting an error 500 is bad, since it doesn't mean there was no response or output from the server, it means , generally, that there is an error in a script or the engine halted.

Did you try it on a windows server and have it crash for you too? just curious to see if you saw the same behavior.

Also, it should not be empty - when running on server there are automatically several environmental arrays that should be showing up (which are actually what I am interested in displaying and monitoring). I have also tried it in situations where I know there are variables - for example:

Code: Select all

<?lc
put 5 into aNumber
put the variableNames
?>
Same 500 error.

I've gone ahead and filed a bug report about it.

Re: the variableNames errors on Windows server 6.1.1?

Posted: Thu Oct 17, 2013 6:30 pm
by edgore
This also give the same 500 error:

Code: Select all

<?lc
put 1 into aNumber
put the variableNames into aVariable
put "<html><body>This is a test -" && aVariable && "</body></html>"
?>
It works fine if you comment out line 3, so I definitely think that the variableNames is broken on windows server 6.1.1

Re: the variableNames errors on Windows server 6.1.1?

Posted: Thu Oct 17, 2013 6:33 pm
by jacque
edgore wrote: Also, it should not be empty - when running on server there are automatically several environmental arrays that should be showing up (which are actually what I am interested in displaying and monitoring).
The environment variables are global:

put the globals

Re: the variableNames errors on Windows server 6.1.1?

Posted: Thu Oct 17, 2013 7:28 pm
by edgore
That means they should show up on line 4 of the output from the VariableNames:

From the dictionary:
The variableNames function returns a value consisting of four lines:
1. Parameters passed to the current handler (including leading '@' for parameters passed by-reference)
2. Local variables created in the current handler
3. Local variables created in the current script but outside all handlers
4. Global variables

Even if there were somehow no variables at all the last example I posted should never fail - it should always output at least <html><body>This is a test - </body></html>. Instead it returns a 500 error if you call the variableNames() function. So, pretty sure this is a bug in the windows server engine, since everything works right on desktop.

Re: the variableNames errors on Windows server 6.1.1?

Posted: Thu Oct 17, 2013 10:48 pm
by samuel.vannesteBUSGvXT
So, pretty sure this is a bug in the windows server engine
If it is a bug, it is on Linux too. Sorry to reply so lately but I did not have time to test before. Experiencing the same issue.

But I would like to point that my livecode server on Linux always produces error 500 when nothing is sent (reason why I suggested to put "" before anything else).