CGI scripts fail when vovserver seems to have the wrong working directory

Very rarely, vovserver will seem to have an incorrect notion of its current working directory. 
This manfests itself as errors from some CGI scripts.

The normal working directory for vovserver is the parent of the <project>.swd; for example, when accepting the default for NC, this might be

On Linux, you can find information about the cwd of a process by
   % ls -l /proc/<pid>/cwd
Usually, this is a symbolic link that refers to the path of the directory, though rarely the link is resolved and the directory contents are shown.

You can find the vovserver processID by using the 'ps' command, or by examining the file <project>.swd/serverinfo.tcl, which will contain the host name, port number and processID.

Stopping and re-starting the vovserver will correct this issue.  However, this can be disruptive for a production instance, and there is a step you can try instead.
There is a VTK API function that sets vovserver's working directory.  This should be used very sparingly and carefully, because if the wrong path is supplied, vovserver can malfunction.

Here are the steps:
+ get a shell on the vovserver host, as the project owner
% vovproject enable <project>
% vovsh -x 'puts [vtk_server_config chdir path-to-parent-of-SWD]'

The result of the above should be 'ok', and the CGI errors should abate.

An example of the error for the 'Daemons' page /cgi/daemons.cgi is shown below:

couldn't change working directory to 'vnc': no such file or directorycouldn't change working directory to "vnc": no such file or directory
while executing
"cd $savewd"
(procedure "indir" line 37)
invoked from within
"indir $swd {
foreach config [glob -nocomplain vov*d/config.tcl] {
set dir [file dirname $config]
if { $dir == "vovperi..."
(procedure "VovDaemonMgrGetConfiguredList" line 7)
invoked from within
(procedure "VovDaemonMgrGetAll" line 23)
invoked from within
("uplevel" body line 9)
invoked from within
"uplevel $body_script"

Did you find this article helpful?