My Blog List

Sunday, December 13, 2009

• 'ViewAttachment failed' pop-up error when viewing attachments in CRM Application

On the user side:

•'ViewAttachment failed' pop-up error when viewing attachments in CRM Application
•'An error has occurred' error when uploading attachments, subsequently logging the user out.
•'File not found or file received has length zero' when using Download Grid to Excel feature

In the Application Server log:
Service FileAttach FAILED due to missing SQL commit
Service FileAttach failed

The issue described here is specific to if Terminal Services/Remote Desktop is used to start/stop the Application Server domains. To confirm if the problem is being described here is experienced, check that:

•Administrators are using Remote Desktop/Terminal Services to administer the application servers

•Subfolders indicating Session IDs are being created in the Temp folder, e.g. C:\Temp\1, C:\Temp\2, etc.

If Remote Desktop is not involved here, please see Notes 654129.1 and 660252.1 as the issues described there can cause the same errors.

The root cause of the problem is that the PSFTP folder cannot be found under the TEMP folder on the Application Server(s). Normally, PeopleTools use the TEMP or TMP environment variable defined for the user who starts the Application Server domain, locates that path and uses the PSFTP subfolder inside.
For example, if TEMP=C:\Temp, then PSFTP is expected to be in that folder, i.e.C:\Temp\PSFTP.

Remote Desktop administration complicates the issue in that it adds the Remote Desktop Session ID as a subfolder under TEMP and dynamically changes the TEMP and TMP environment variables to point to that folder instead.
For example, if TEMP=C:\Temp originally and the user logins to the server using Remote Desktop, their TEMP environment variable may now point to C:\Temp\1 instead if their Remote Desktop Session ID is 1. If the Application Server domain is started from this session, the PSFTP folder is now expected to be C:\Temp\1\PSFTP, which may not be the case, and the errors in PeopleSoft File Attachment result.
The PSFTP folder is used by the Tools File Attachment functions to store files temporarily in both database storage or FTP File Server storage scenarios. If PSFTP does not exist, the errors mentioned will occur.


There are a few solutions available:

1. Microsoft's Support website has a KB article that teaches how to disable the multiple Temp directory functionality and make use of a "flat" Temp directory instead. This would ensure Session ID's will not be added as a subfolder to the Temp directory. Please see http://support.microsoft.com/kb/243555 . Note that the KB article is for Windows Server 2000. The same solution can be applied to Windows Server 2003, but if there are any questions, please contact Microsoft's Support for assistance.

2. Use a batch file to start the App Server domain (through psadmin.exe) and set the TEMP and TMP environment variables in the batch file before calling psadmin. For example:
•Create a batch file called psadmin.bat in your PS_HOME/appserv directory
•Batch file contains contents:

SET TEMP=C:\Temp
SET TMP=C:\Temp
psadmin.exe

•Instead of running psadmin.exe directly from now on, run psadmin.bat. This ensures that the TEMP and TMP environment variable are set to C:\Temp when psadmin is launched.