Error on testing IDE

Q&A's, tips, howto's
Locked
HPW
Posts: 1390
Joined: Thu Sep 26, 2002 9:15 am
Location: Germany
Contact:

Error on testing IDE

Post by HPW »

I get the following error when I try the latest IDE:
C:\newlisp>newlisp httpd 80 ide
Server started listening on port: 80
Root directory: ide
Tue May 04 07:44:30 2004 127.0.0.1 GET / HTTP/1.1
Tue May 04 07:44:30 2004 127.0.0.1 GET /file-frame.cgi?name=data/ HTTP/1.1
Das System kann den angegebenen Pfad nicht finden.

list or string expected in function replace : HTTPD:buffer
called from user defined function execute-file
called from user defined function process-GET-request
called from user defined function process-http-request
called from user defined function net-server-accept
called from user defined function startServer

C:\newlisp>
And the browser shows the ide titletext and a framed-window which both shows the error that the page could not be displayed.
Hans-Peter

Lutz
Posts: 5289
Joined: Thu Sep 26, 2002 4:45 pm
Location: Pasadena, California
Contact:

Post by Lutz »

cannot repeat:

C:\newlisp>newlisp httpd 80 ide
Server started listening on port: 80
Root directory: ide
Tue May 04 08:16:18 2004 127.0.0.1 GET / HTTP/1.1
Tue May 04 08:16:19 2004 127.0.0.1 GET /file-frame.cgi?name=data/ HTTP/1.1
Tue May 04 08:16:19 2004 127.0.0.1 GET /content-frame.cgi?method=new HTTP/1.1
Tue May 04 08:16:19 2004 127.0.0.1 GET /folder.gif HTTP/1.1
Tue May 04 08:16:19 2004 127.0.0.1 GET /text.gif HTTP/1.1
Tue May 04 08:16:26 2004 127.0.0.1 GET /file-frame.cgi?dir=data/ HTTP/1.1
Tue May 04 08:16:26 2004 127.0.0.1 GET /folder.gif HTTP/1.1
Tue May 04 08:16:26 2004 127.0.0.1 GET /text.gif HTTP/1.1
Tue May 04 08:16:27 2004 127.0.0.1 GET /content-frame.cgi?method=open&name=READM
E&dir=data/ HTTP/1.1

Are you sure you are using the Ide 2.2 and httpd 3.5 ?

Lutz

HPW
Posts: 1390
Joined: Thu Sep 26, 2002 9:15 am
Location: Germany
Contact:

Post by HPW »

Lutz wrote: Are you sure you are using the Ide 2.2 and httpd 3.5 ?
Lutz
Yes using both from fresh download.

What does this mean in README from IDE:

In the file 'httpd' line 140/41 should be changed.

And how must the first line from the CGI-files looks like:
(When newLISP is in C:\newlisp under Windows)

Instead of:

#!/usr/bin/newlisp

should it be:

#!/newlisp

Anything other what can be wrong?
Hans-Peter

Lutz
Posts: 5289
Joined: Thu Sep 26, 2002 4:45 pm
Location: Pasadena, California
Contact:

Post by Lutz »

The README file in newlisp-IDE-22.tgz is out of date there, are no changes in httpd 3.5 required. The old 140/141 change was required for Win32 versus Unix. Now the code in line 174 does automatic detection.

Make also sure that the directory where newlisp.exe lisves, is in the Win32 path environment.

Lutz

HPW
Posts: 1390
Joined: Thu Sep 26, 2002 9:15 am
Location: Germany
Contact:

Post by HPW »

I managed to get it run at home. But I get a Debug window with this:
Es ist ein Laufzeitfehler aufgetreten.
Soll der Deug-Modus gestartet werdenß

Zeile: 6
Fehler: 'parent.frames.1.document.forms.0.Directory' ist Null oder kein Objekt
I can not use the New and Evaluate button, because I get a 'No page possible display'.
What should happen when Evaluate is pressed?


Wiki 2.6 runs with no problems.

(WIN XP IE 6.0 2600)
Hans-Peter

Lutz
Posts: 5289
Joined: Thu Sep 26, 2002 4:45 pm
Location: Pasadena, California
Contact:

Post by Lutz »

Reading the German error message, the problem seems to be executing the left frame (I think left frame is 1, right frame is 2), but I just have no luck trying to repeat this problem. I tried with newlisp 8.0.2 IDE 2.2 and httpd 3.5 and IE 6 or Mozilla 1.7 on XP-Home.

The only thing you could do is insert (println ...) statements in the code of file-frame.cgi to see how far it gets. You would see those (println ...) in the file frame.

Lutz

HPW
Posts: 1390
Joined: Thu Sep 26, 2002 9:15 am
Location: Germany
Contact:

Post by HPW »

Found one bug!

You have a hardcoded path to \tmp inside httpd which does not exist
on my office PC. So then it does not show up here.

But New and Evaluate still bring up the DNS-error sreen.
But I noticed that the action is evaluated because the file c:\tmp\pcgi is written by the evaluated lisp-sorce.
Hans-Peter

Lutz
Posts: 5289
Joined: Thu Sep 26, 2002 4:45 pm
Location: Pasadena, California
Contact:

Post by Lutz »

I will put the requirement for the 'tmp' directory into header of httpd.

"But New and Evaluate still bring up the DNS-error sreen. "

Tha would be in the file content-fram.cgi:

(if (= (CGI:get "method") "open")
(begin
(set 'file-name (CGI:get "name"))
(set 'data-root (CGI:get "dir"))
(CGI:put-page "editor-frame.html")
(exit)))

and

(if (CGI:get "EvalSubmit")
(begin
(set 'source-txt (CGI:get "Source"))
(print (eval-string source-txt))
(print "<br><hr width=\"50%\">")))

Lutz

Lutz
Posts: 5289
Joined: Thu Sep 26, 2002 4:45 pm
Location: Pasadena, California
Contact:

Post by Lutz »

there Imwould check first if it sets 'file-ame' and 'data-root' correctly. All the (CGI:...) functions are cgi.lsp (version 1.4)

Lutz

HPW
Posts: 1390
Joined: Thu Sep 26, 2002 9:15 am
Location: Germany
Contact:

Post by HPW »

Still no success.

I saw some '(getenv "QUERY_STRING")' but no 'setenv' elsewhere.
Can it be something with this?


And now I test wicki:

http://localhost/index.cgi?author=Test& ... st+comment

answers with:

string expected : (getenv "REMOTE_ADDR")

:-(
Hans-Peter

Lutz
Posts: 5289
Joined: Thu Sep 26, 2002 4:45 pm
Location: Pasadena, California
Contact:

Post by Lutz »

The README file mentions that the wiki runs only on Apache or similar webservers (which supply the adequate environment variables)

What this statement does, is supply an IP signature to every comment post. You might be able to run if just just take it out.

Lutz

Lutz
Posts: 5289
Joined: Thu Sep 26, 2002 4:45 pm
Location: Pasadena, California
Contact:

Post by Lutz »

QUERY_STRING is set in httpd but REMOTE_ADDR is not (and will not)

Lutz

HPW
Posts: 1390
Joined: Thu Sep 26, 2002 9:15 am
Location: Germany
Contact:

Post by HPW »

I revisited my problem with the new IDE 3.0

On startup of IE/localhost I still get a error window:

Fehler: 'parent.frames[1].document.forms[0].Directory' ist Null oder kein Objekt

Starting the IE-debugger marks the line:

parent.frames[1].document.forms[0].Directory.value='data/';

Then it works on most actions.

But when I move to the win32-command and click exec, it show the directory, but when I use then the folder-up symbol I get the same error window. Without the exec it works correctly.
Hans-Peter

Lutz
Posts: 5289
Joined: Thu Sep 26, 2002 4:45 pm
Location: Pasadena, California
Contact:

Post by Lutz »

Cannot reproduce this. Perhaps you can give me the exact procedure where and how you start httpd, where newlisp.exe resides, the path, directory structure involved etc..

Also, do you have that bottom link in the left frame which says "C:\Documents and Settings\Hans Peter" ? And can you move up and down into the directory structure, specifically data/ in ide, from there?

The bug fix for HTTPD 3.6 post on IE introduced a problem with exec. Perhaps the data/ path and exec problem are related, we will see.

Lutz

HPW
Posts: 1390
Joined: Thu Sep 26, 2002 9:15 am
Location: Germany
Contact:

Post by HPW »

>Cannot reproduce this. Perhaps you can give me the exact procedure where and how you start
>httpd, where newlisp.exe resides, the path, directory structure involved etc..

newlisp in c:\newlisp

C:\newlisp\ide
C:\newlisp\ide\data

command window opened in c:\newlisp

Start with: newlisp httpd 80 ide

Response in command-window:
Server started listening on port: 80
Root directory: ide

Open IE and choose http://localhost

Then the error window appear, but then it works correctly.

>Also, do you have that bottom link in the left frame which says "C:\Documents and Settings\Hans Peter"

Yes, I can click on it and navigate from there back to the newlisp dir.

? And can you move up and down into the directory structure, specifically data/ in ide, from there?

Yes, no problem. I can go down and up and use 'home' and 'refresh'.
Also I can use 'cd' to navigate to root etc.

>The bug fix for HTTPD 3.6 post on IE introduced a problem with exec. Perhaps the data/ path and exec problem are related, we will see.

When I use the win-shell command once I can no more navigate without the error.

PS: WIKI runs nice now with newlisp HTTPD! Great!
Hans-Peter

Lutz
Posts: 5289
Joined: Thu Sep 26, 2002 4:45 pm
Location: Pasadena, California
Contact:

Post by Lutz »

Thanks for the detailed info. You start up httpd exactly the same way on Windows as I always do. But I think this is the statement in ide/file-frame.cgi where your IE is choking on:

(println {<SCRIPT LANGUAGE="JavaScript">})
(println {parent.frames[1].document.forms[0].Directory.value='} data-root {';})
(println {</SCRIPT>})

For some reasons it works fine on my IE v 6.0 but not on yours, must be some configuration issue of IE? I have one other (older Win2k) computer with I.E 5.0, which I can try this afternoon.

I found another fix for the IE/Mozilla incompatibilities formatting POST requests. The latest httpd-3-7 in http://newlisp.org/download takes care of this. Since httpd 3.0 I had only tested httpd on Mozilla thinking is wouldn't matter on a server, now I know better. IE and older Netscape send an extra CR-LF after POST requests even when the "content-length:" field is specified in the header not including these 2 extra bytes. This makes 2 additional bytes to drain from the socket.

Lutz

HPW
Posts: 1390
Joined: Thu Sep 26, 2002 9:15 am
Location: Germany
Contact:

Post by HPW »

I just test on my 2 office PC with WIN/XP and WIN/2K.
Both work fine now with 3.7. No error's and stable. Great!

2 Observations:

mandelbrot-short.lsp always produce black squares.
mandelbrot.lsp makes a nice colord one.

The navigation frame with the files is case-sensitive.
So folder with lowercase name like 'newlisp' get down the list.
Is this configurable?

Will test at home in the evening.
Hans-Peter

Lutz
Posts: 5289
Joined: Thu Sep 26, 2002 4:45 pm
Location: Pasadena, California
Contact:

Post by Lutz »

mandelbrot-short.lsp will be deleted in next version, I was trying the modern
color coding with three hex character, as used in CSS stylesheets, in a table.

About sorting the filenames: its just doing the default ASCII sorting, too much trouble to give this special treatment on Windows (too busywith other stuff). On LINUX/Unix filenames are case sensitive, on Windows not, this is why it mixes upper and lower case in a WindosXP listing but sorts in ide.

Lutz
Last edited by Lutz on Mon Jul 12, 2004 4:31 pm, edited 1 time in total.

HPW
Posts: 1390
Joined: Thu Sep 26, 2002 9:15 am
Location: Germany
Contact:

Post by HPW »

Just tested it at home.

But here no success. Still getting the same error.

Strange.

IE 6.0.2600 on german XP Pro (all patches)

Is it correct that the pcgi file in \tmp has '0D0D0A' at the
end of each line insted of '0D0A'.
Hans-Peter

Lutz
Posts: 5289
Joined: Thu Sep 26, 2002 4:45 pm
Location: Pasadena, California
Contact:

Post by Lutz »

thats correct, its an artifact of the piping process, these get filtered/replaced before sending to the browser (see line 188 in httpd).

Lutz

HPW
Posts: 1390
Joined: Thu Sep 26, 2002 9:15 am
Location: Germany
Contact:

Post by HPW »

I had reported that IDE works on my 2 office PC. I just try to check out the difference between my home PC and the PC here. So I found out that the error happens also here, but it is not displayed, because I disabled the option 'Show script error' in the IE extended options. So they only show up in the status bar in the left bottom corner.
Hans-Peter

Locked