Server debug
Moderator: Klaus
Server debug
I am finding that not being able to debug scripts running on the server is the biggest impediment I face these days. I am currently developing stuff on the desktop, then porting (which usually requires rewriting/commenting in/out lines), then copying and pasting into .lc files to run things on the server.
Frequently I am finding that the behavior on the server is different from the desktop (usually inexplicable things like a database query returning a response that has a space at the end of it on the server while the exact same query on the desktop doesn't - probably not Livecode's fault, but hard to find without the debugger). Without the ability to step through the script it's almost imposssible to find this stuff and it's destroying any productivity gains I would have over another server development environment.
So, feature request - Server debugger. Since all of the stuff I have ever done for server requires access to internal network resources (LDAP directories etc) I have never been able to use the editor that was made available for On-Rev ages ago, so I don't know if this is just an update and expansion to that tool, making it available for non-On-Rev servers, or if it's something completely different but without this developing for server is a huge hassle. I would even be fine if it required a local server instance running on the machine you develop on (that's how I work anyway), but there needs to be something.
Frequently I am finding that the behavior on the server is different from the desktop (usually inexplicable things like a database query returning a response that has a space at the end of it on the server while the exact same query on the desktop doesn't - probably not Livecode's fault, but hard to find without the debugger). Without the ability to step through the script it's almost imposssible to find this stuff and it's destroying any productivity gains I would have over another server development environment.
So, feature request - Server debugger. Since all of the stuff I have ever done for server requires access to internal network resources (LDAP directories etc) I have never been able to use the editor that was made available for On-Rev ages ago, so I don't know if this is just an update and expansion to that tool, making it available for non-On-Rev servers, or if it's something completely different but without this developing for server is a huge hassle. I would even be fine if it required a local server instance running on the machine you develop on (that's how I work anyway), but there needs to be something.
Re: Server debug
I second that !
Me too i use the regular TextPad and upload via FTP and copy/paste inside the script editor of LiveCode desktop to debug. It's tedious sometimes.
The special On-Rev editor/debugger was good.
Me too i use the regular TextPad and upload via FTP and copy/paste inside the script editor of LiveCode desktop to debug. It's tedious sometimes.
The special On-Rev editor/debugger was good.
-
- VIP Livecode Opensource Backer
- Posts: 10043
- Joined: Sat Apr 08, 2006 7:05 am
- Contact:
Re: Server debug
Which PHP debuggers have you found especially useful? Perhaps there's something we could learn from those to make a nice one for LC.edgore wrote:Without the ability to step through the script it's almost imposssible to find this stuff and it's destroying any productivity gains I would have over another server development environment.
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
Re: Server debug
Actually, what I am *supposed* to be using is Java and Eclipse....
-
- VIP Livecode Opensource Backer
- Posts: 10043
- Joined: Sat Apr 08, 2006 7:05 am
- Contact:
Re: Server debug
I haven't worked with Java in many years. How does it handle interacting with debugging sessions through a web client?
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
Re: Server debug
As I understand it, it isn't - it's using a desktop client to do the debugging.
-
- VIP Livecode Opensource Backer
- Posts: 10043
- Joined: Sat Apr 08, 2006 7:05 am
- Contact:
Re: Server debug
Ah, I see. Thanks.
If testing the code outside of Apache is suitable, you could write your scripts in a stack for testing and copy them into your irev templates after they're debugged. This won't help with server-specific interactions, of course, but it sounds like the system you're "supposed" to be using doesn't either, so at least it's no loss for relative productivity.
If testing the code outside of Apache is suitable, you could write your scripts in a stack for testing and copy them into your irev templates after they're debugged. This won't help with server-specific interactions, of course, but it sounds like the system you're "supposed" to be using doesn't either, so at least it's no loss for relative productivity.
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
Re: Server debug
That's what I am doing today. The problem is that the exact same script copied and pasted from the desktop IDE into a .lc file gives me completely different results (both the server and the IDE are running on the same machine).
So, I am having to go through the .lc file and add debugging code to make it spit out the values of variables while the script executes (and remember to put in labels and </br>s so what comes out is readable) to figure out where the server engine is behaving differently than the desktop engine.
I would love to be able to provide an example, but everything that I am working on right now relies on internal databases and LDAP services to work (so it won't work at all in the wild) and even the output is filled with data I am not able to share...
Here is something though...I am processing a query from a database that has ID info, then using that info to perform a lookup against an LDAP directory to get info about the users associated with the IDs. In the desktop the results looks like this (before being HTMLified for display):
Desktop (the not found line ios the correct output for an ID that is not found in the system)
CORRECTNAME,USERID,TITLE,PHONE #,EMAIL,MANAGERNAME,MANAGERUSERID,MGRTITLE,MGRPHONE,MGREMAIL,ORIGINALIDSEARCHED
CORRECTNAME,USERID,TITLE,PHONE #,EMAIL,MANAGERNAME,MANAGERUSERID,MGRTITLE,MGRPHONE,MGREMAIL,ORIGINALIDSEARCHED
Not Found,USERID,Not Found, Not Found, Not Found,Not Found,Not Found,Not Found,Not Found,Not Found,Not Found,Not Found,ORIGINALIDSEARCHED
CORRECTNAME,USERID,TITLE,PHONE #,EMAIL,MANAGERNAME,MANAGERUSERID,MGRTITLE,MGRPHONE,MGREMAIL,ORIGINALIDSEARCHED
Server: (the 0ORIGINALIDSEARCHEDis just that - the original userid search on, prefixed with a 0)
CORRECTNAME,USERID,TITLE,PHONE #,EMAIL,MANAGERNAME,MANAGERUSERID,MGRTITLE,MGRPHONE,MGREMAIL,ORIGINALIDSEARCHED
0ORIGINALIDSEARCHED,,,,,,,,,ORIGINALIDSEARCHED
0ORIGINALIDSEARCHED,,,,,,,,,ORIGINALIDSEARCHED
0ORIGINALIDSEARCHED,,,,,,,,,ORIGINALIDSEARCHED
The code that does all this is an include, so it's exactly the same code in both environments, but with the <?lc ?> surrounding the server side version. I am sure that the issue has something to do with stray characters showing up in either the db query results or the shell results between the server and desktop engines (because I have seen that regularly before and I am usually able to address it in a way that fixes the server version without breaking the desktop code). But finding these things requires a lot of work and is frustrating, since the desktop code works just fine. This is happening with something that I am doing right now....
With Eclipse (at least as I understand it) the code is running on the server-side virtual machine and the server-side virtual machine is running the debugger and spitting status data out to the desktop client. Which, I believe, is similar to how the old On-Rev debugger worked. Of course, I have not actually *used* Eclipse or the On-Rev debugger, so I have no idea what I am talking about.
So, I am having to go through the .lc file and add debugging code to make it spit out the values of variables while the script executes (and remember to put in labels and </br>s so what comes out is readable) to figure out where the server engine is behaving differently than the desktop engine.
I would love to be able to provide an example, but everything that I am working on right now relies on internal databases and LDAP services to work (so it won't work at all in the wild) and even the output is filled with data I am not able to share...
Here is something though...I am processing a query from a database that has ID info, then using that info to perform a lookup against an LDAP directory to get info about the users associated with the IDs. In the desktop the results looks like this (before being HTMLified for display):
Desktop (the not found line ios the correct output for an ID that is not found in the system)
CORRECTNAME,USERID,TITLE,PHONE #,EMAIL,MANAGERNAME,MANAGERUSERID,MGRTITLE,MGRPHONE,MGREMAIL,ORIGINALIDSEARCHED
CORRECTNAME,USERID,TITLE,PHONE #,EMAIL,MANAGERNAME,MANAGERUSERID,MGRTITLE,MGRPHONE,MGREMAIL,ORIGINALIDSEARCHED
Not Found,USERID,Not Found, Not Found, Not Found,Not Found,Not Found,Not Found,Not Found,Not Found,Not Found,Not Found,ORIGINALIDSEARCHED
CORRECTNAME,USERID,TITLE,PHONE #,EMAIL,MANAGERNAME,MANAGERUSERID,MGRTITLE,MGRPHONE,MGREMAIL,ORIGINALIDSEARCHED
Server: (the 0ORIGINALIDSEARCHEDis just that - the original userid search on, prefixed with a 0)
CORRECTNAME,USERID,TITLE,PHONE #,EMAIL,MANAGERNAME,MANAGERUSERID,MGRTITLE,MGRPHONE,MGREMAIL,ORIGINALIDSEARCHED
0ORIGINALIDSEARCHED,,,,,,,,,ORIGINALIDSEARCHED
0ORIGINALIDSEARCHED,,,,,,,,,ORIGINALIDSEARCHED
0ORIGINALIDSEARCHED,,,,,,,,,ORIGINALIDSEARCHED
The code that does all this is an include, so it's exactly the same code in both environments, but with the <?lc ?> surrounding the server side version. I am sure that the issue has something to do with stray characters showing up in either the db query results or the shell results between the server and desktop engines (because I have seen that regularly before and I am usually able to address it in a way that fixes the server version without breaking the desktop code). But finding these things requires a lot of work and is frustrating, since the desktop code works just fine. This is happening with something that I am doing right now....
With Eclipse (at least as I understand it) the code is running on the server-side virtual machine and the server-side virtual machine is running the debugger and spitting status data out to the desktop client. Which, I believe, is similar to how the old On-Rev debugger worked. Of course, I have not actually *used* Eclipse or the On-Rev debugger, so I have no idea what I am talking about.
-
- VIP Livecode Opensource Backer
- Posts: 10043
- Joined: Sat Apr 08, 2006 7:05 am
- Contact:
Re: Server debug
Pardon the really basic question, but just to make sure we're covering all the bases: are you using the same version of the LC engine in both your desktop and server tests?
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
Re: Server debug
Yep - the only difference is that the server is 6.1 community, while the desktop is commercial.
EDIT: So,I guess that my feature request could also just be "Make the server engine and the desktop engine work identically", that would work for me too technically. Although, it would be far more convenient to be able to just develop and debug directly on server, since the presentation stuff is different between platforms and adds development overhead, you need to comment it out/not copy it over, etc.
EDIT 2: I have also just installed community 6.1 desktop just to see if that made a difference, and it doesn't - same results. Most of the problems I run into seem to come down to stray characters appearing in DB query results and shell command results on server that do not appear on the desktop, though I have not tracked in down to that in this instance yet. I do have the newest (and the same) versions of the DB libraries and extensions on both platforms as well, and as I said they are both running on the same machine. I have noticed that the server engine doesn't automatically carry over environment variables from the desktop (which caused havoc with the DB2 ODBC drivers), but I have an include that I use with all my stuff that populates the server environment with the same variables as the desktop).
EDIT: So,I guess that my feature request could also just be "Make the server engine and the desktop engine work identically", that would work for me too technically. Although, it would be far more convenient to be able to just develop and debug directly on server, since the presentation stuff is different between platforms and adds development overhead, you need to comment it out/not copy it over, etc.
EDIT 2: I have also just installed community 6.1 desktop just to see if that made a difference, and it doesn't - same results. Most of the problems I run into seem to come down to stray characters appearing in DB query results and shell command results on server that do not appear on the desktop, though I have not tracked in down to that in this instance yet. I do have the newest (and the same) versions of the DB libraries and extensions on both platforms as well, and as I said they are both running on the same machine. I have noticed that the server engine doesn't automatically carry over environment variables from the desktop (which caused havoc with the DB2 ODBC drivers), but I have an include that I use with all my stuff that populates the server environment with the same variables as the desktop).