File Not Found or File Received Has Length Zero

A common problem with production application server configurations that have load balancing/failover with more than one machine, is that file attachments and exporting the contents of a grid to excel no longer work, giving the following error message:

"File not found or file received has length zero".

The common advice in this situation is to disable jolt pooling as mentioned these Oracle support documents:

However, disabling Jolt Pooling is hardly an ideal solution. In earlier documents, Oracle states that the issue was resolved in later versions of PeopleTools 8.48 and 8.49. However, as indicated by document ID 1162742, the problem is back in PeopleTools 8.50.

This wiki article explains two issues related to this problem and proposed solutions for both of them. The issue is around the location of the PSFTP folder which is created in a temporary directory on the application server and the files in this folder must be shared across all application server domains and servers for file attachments/grid exports to work correctly.

Remove Desktop Access

The first issue is related to Microsoft Windows servers and administrators using terminal services/remote desktop. By default, Windows servers uses a separate temporary folder directory for each remote desktop user session. This alters where the %TMP% and %TEMP% environment variables (for the temporary folder location) will be. For instance, it will create a folder structure like this:

  • C:\Temp\1\… for user 1
  • C:\Temp\2\… for user 2
  • C:\Temp\3\… for user 3

It will then dynamically change the temporary folder location for each user. This causes havoc with the application server which might expect the temporary directory to exist under C:\Temp only.

To fix this situation, disable the use of temporary folders per session in the terminal service configuration settings as shown:

use-temporary-folders-per-session.png

This requires a restart of all application servers.

Symbolic Links for PSFTP Folder

The second issue is that all application server domains must point to the same location across application servers. For instance, if you have 2 application server machines, each with 2 application server domains (4 domains in total), they might use the following locations for the PSFTP attachment folder:

Application server 1:

  • C:\Temp\PSFTP\APP01_11111\ for application server domain 1
  • C:\Temp\PSFTP\APP02_22222\ for application server domain 2

Application server 2:

  • C:\Temp\PSFTP\APP03_33333\ for application server domain 3
  • C:\Temp\PSFTP\APP04_44444\ for application server domain 4

However, all domains need to point to a single location. Notice the 5 digits after the domain name (e.g. 11111 in APP01_11111). I'm not sure what these numbers mean, but they seem to stay consistent, so you can (as far as I know) assume that the folder name will remain consistent. That is, you won't suddenly get a folder called APP01_54321. Well that's the theory anyway.

The solution involves creating a common folder on one server, and then pointing all application server domains to it from each application server machine. For instance, on application server 1, create a folder called C:\Temp\PSFTP\Common. Then point the individual application server domain folders to it using a symbolic link. Repeat the same thing on application server 2. You can use the mklink command in Windows to do this like so (assuming %TEMP% is pointing to C:\Temp) - this will vary.

On the first application server machine:

C:\Temp\PSFTP>mkdir Common
C:\Temp\PSFTP>mklink APP01_11111 \\appserver01\C$\Temp\PSFTP\Common /d
C:\Temp\PSFTP>mklink APP01_22222 \\appserver01\C$\Temp\PSFTP\Common /d
C:\Temp\PSFTP>mklink APP01_33333 \\appserver01\C$\Temp\PSFTP\Common /d
C:\Temp\PSFTP>mklink APP01_44444 \\appserver01\C$\Temp\PSFTP\Common /d

On the second application server machine (note these point back to application server 1).

C:\Temp\PSFTP>mklink APP01_11111 \\appserver01\C$\Temp\PSFTP\Common /d
C:\Temp\PSFTP>mklink APP01_22222 \\appserver01\C$\Temp\PSFTP\Common /d
C:\Temp\PSFTP>mklink APP01_33333 \\appserver01\C$\Temp\PSFTP\Common /d
C:\Temp\PSFTP>mklink APP01_44444 \\appserver01\C$\Temp\PSFTP\Common /d

What this effectively does is create symbolic links for all 4 application server domains, on both application server machines that all point to one folder, C:\Temp\PSFTP\Common\ on application server 1. There's an obvious limitation with this in terms of failover - file attachments/grid exports will stop working if application server 1 (and therefore the C:\Temp\PSFTP\Common\ folder is unavailable. However, this beats having to disable jolt pooling. Once this has been put into place, file attachments/grid exports should hopefully start working.

Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License