CSP application weird behaviour
Working with CSP applications, I've noticed behaviour that does not seem to be documented anywhere.
When you create a new application, Cache seems to create a virtual folder and populate it with everything that is in the physical path you set for that application.
This leads to some weird issues regarding compilation of the CSP pages that exist in both physical folder and virtual folder. Specifically, despite the content being synced, it seems possible to compile the CSP file in a physical folder and the CSP file in a virtual folder separately, leading to an error when you try to access that page through application. And, despite the error page saying the error was logged, it is not, so I can't even determine the true cause of the error.
Has anyone encountered this behaviour and know of a solution?
Apparently, you have autocompile enabled for the CSP application: Automatic and Manual Page Compilation
And also check the parameter Recurse
There are no subfolders, so it has nothing to do with recursion.
Disabling automatic compilation did not change anything.
If you use Studio to edit/compile *.csp files, check the following parameters:
And also see Caché Launcher (Cube) settings : Web Server IP Address / CSP Server Instance
I tried to simply edit the file in Studio (csp/samples/redirect.csp) and with an external editor FAR Manager ([CACHEROOT]\CSP\samples\redirect.csp)
For simplicity, I changed the comment in the header. I tested everything both locally and remotely.
So, I change it in Studio - the changes are immediately visible in FAR, I change it in FAR - the changes are immediately visible in Studio.
Or in another way: I change it locally - the changes are immediately visible on the remote machine, I change it on the remote machine - the changes are immediately visible locally.
In other words, there is no and cannot be any desynchronization, since the work is always done with the same file on the server, see Saving a CSP File.
I tried following your advice, but it still behaves... weirdly.
Today I've opened and changed a CSP file that is in a physical folder. When I tried to access it through the CSP application, I've got an error saying no such page was found on the server. After that, I also compiled this same file, but in the virual folder (the one created for the application). And it loaded normally.
There's clearly something wrong with the settings here.
What web server do you use, did you configure something in the CSP Gateway?
Is the error reproduced when accessing (edit&compile) pages from USER/SAMPLES (of course, if you have them installed)?
Since CSP does not actually write errors, is it possible to catch them somehow?
I.E. there are custom error pages (for individual pages and whole applications) - would I be able to display the error on a page?
a) Try setting error page as %CSP.Error.cls for this web application, then errors are shown on the page itself, instead of being logged
b) Reproduce the error with ^%ISCLOG enabled:
kill ^%ISCLOG set ^%ISCLOG = 3
Reproduce the error quickly.
Disable ^%ISCLOG
set ^%ISCLOG = 0
Check for errors in ^%ISCLOG:
zwrite ^%ISCLOG
Just wanted to give an update on option "b" in this comment, in case anyone reads this going forward.
I think at one time
^%ISCLOG
was used to both set the log level and store the log data. Now^%ISCLOG
is only used to set the log level. The log data is stored in^ISCLOG
(no "%") in the %SYS namespace. So instead of doing:zwrite ^%ISCLOG // This is no longer the log global!!
You would instead do:
zwrite ^ISCLOG
In the %SYS namespace. (Or look at it in the Management Portal, I find it much easier to read that way.)
I couldn't find anything in the docs on ISCLOG specifically, but it is mentioned in the context of other subjects, for example:
https://docs.intersystems.com/iris20212/csp/docbook/DocBook.UI.Page.cls?...
This change seems to be applicable to IRIS only.
In Cache log data is still in ^%ISCLOG("Data"); just checked in Cache 2018.1.6.