Question
Evgenii Ermolaev · Apr 11, 2021

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?

Product version: Caché 2018.1
00
2 0 7 123
Log in or sign up to continue

Replies

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:

  • Enable service status check (Recommended) (yes)
  • Studio is active application (2–60 sec) (5)
  • Studio is background application (30–600 sec) (60)
  • Automatically reload document when it is modified on the server and it has not been edited in Studio (yes)

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