Wednesday, October 29, 2014

Unable to launch Published Application through Citrix_Error: Failed to Start

Today, i have encountered an issue with one of the critical application. I have installed all dependencies related to application on citrix server, installed actual application and published all application icons (total of 39) through citrix app center. When i logged into citrix URL and tried to launch any of the 39 published applications, i was getting the following error.



Went through Citrix blogs and found the following solution. - http://support.citrix.com/article/CTX132243

As per Citrix Article, Logged into each citrix server and changed the environment variable PATH and made %systemroot% frist and the third party software last.

Thanks alot Citrix for helping us solution this problem.
Kesava

(P.S: if the link is not working, copied the contents in that citrix article below)

Application Launch Error: "The Citrix server is unable to process your request to start this published application at this time."
  • CTX132243
  • Created onMar 26, 2014
  • Updated onSep 10, 2014
Article TopicPerformance



Symptoms or Error


When a user tries to launch any published application hosted on their XenApp or XenDesktop 7 App Edition server, the following error occurs:
“The Citrix server is unable to process your request to start this published application at this time. Please try again later. If the problem persists, contact your administrator.”
The Citrix server is unable to process your request to start this published application at this time. Please try again later. If the problem persists, contact your administrator

Background Information

CtxHide.exe is responsible for hiding the DOS window in which UsrLogon.cmd is running. Cmstart.exe is the initial process that is run when an ICA session is launched, it is called by winlogon. Cmstart.exe is responsible for starting Wfshell.exe which loads the virtual channels and Cltmgr.exe which is the client manager. It is also associated with Icast.exe. If CMSTART is missing from the AppSetup Registry key, then Wfshell.exe is not launched and Icast.exe times.

Solution


Following are the possible solutions to troubleshoot the error:

Solution 1

Move the variable of the location of the third party software after the XenApp variables. After the change, XenApp locates the correct version of cmstart.exe.
“%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;%SYSTEMROOT%\System32
\WindowsPowerShell\v1.0\;C:\Program Files (x86)\Citrix\system32\;C:\Program Files (x86)
\Citrix\System32\Citrix\IMA;C:\Program Files (x86)\Citrix\System32\Citrix\IMA\Subsystems;
%SystemRoot%\System32\Citrix\IMA;C:\Program Files (x86)\Citrix\system32;C:\Program Files (x86)
\Common Files\Citrix\System32\;C:\Program Files (x86)\ThirdParty\Bin\;C:\Program Files (x86)
\Microsoft SQL Server\100\Tools\Binn\;C:\Program Files (x86)\Microsoft SQL Server\100\DTS\Binn\;”

Solution 2

Complete the following steps to add values to the AppSetup String Value and resolve the issue:
Caution! Refer to the Disclaimer at the end of this article before using Registry Editor.
  1. Open the Registry Editor and go to the following registry key:
    HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon
  2. Double-click the AppSetup value.
  3. Add the data value cmstart.exe after Cmd separated by a comma.
  4. Add the data value CtxHide.exe before the data value UsrLogon.Cmd. There are no commas placed between CtxHide.exe and UsrLogon.Cmd.
    Note: In a XenDesktop 7 App Edition scenario on Windows Server 2012, CtxHide.exe will not be present on the system, and does not need to be included in this registry update.
Following is an example of the AppSetup Value Data: CtxHide.exe UsrLogon.Cmd,cmstart.exe.AppSetup Value Data: CtxHide.exe UsrLogon.Cmd,cmstart.exe

Problem Cause


Following are two causes for this error to occur:

Cause 1

One of the possible causes for this issue is that the third party software installation utilizes an executable file named cmstart.exe and modifies the environment variables to point to that executable. Because XenApp uses an executable named cmstart.exe for the launch of published applications, it might confuse and locate the cmstart.exe of the third party software instead. By using the wrong version of cmstart.exe the launch process breaks. One common reason for XenApp to locate the wrong cmstart.exe is because the third party software might have modified the environment path variables to point to its own cmstart.exe. XenApp does the same to locate cmstart.exe for published application launch process. So the variables provided by the third party software get the priority.

Example

This is the default environment path variable before the third party software installation on a XenApp 6.0 server. The location of cmstart.exe of XenApp 6.0 is “C:\Program Files (x86)\Citrix\system32\cmstart.exe”.
“%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;%SYSTEMROOT%\System32\
WindowsPowerShell\v1.0\;C:\Program Files (x86)\Citrix\system32\;C:\Program Files (x86)\
Citrix\System32\Citrix\IMA;C:\Program Files (x86)\Citrix\System32\Citrix\IMA\Subsystems;
%SystemRoot%\System32\Citrix\IMA;C:\Program Files (x86)\Citrix\system32;C:\Program Files 
(x86)\Common Files\Citrix\System32\;C:\Program Files (x86)\Microsoft SQL Server\100\Tools\
Binn\;C:\Program Files (x86)\Microsoft SQL Server\100\DTS\Binn\;”
This is the modified environment path variable after the third party software installation on a XenApp 6.0 server. The location of cmstart.exe of the third party software is “C:\Program Files (x86)\ThirdParty\Bin\cmstart.exe”.
C:\Program Files (x86)\ThirdParty\Bin\;“%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\
System32\Wbem;%SYSTEMROOT%\System32\WindowsPowerShell\v1.0\;C:\Program Files (x86)\
Citrix\system32\;C:\Program Files (x86)\Citrix\System32\Citrix\IMA;C:\Program Files (x86)\
Citrix\System32\Citrix\IMA\Subsystems;%SystemRoot%\System32\Citrix\IMA;C:\
Program Files (x86)\Citrix\system32;C:\Program Files (x86)\Common Files\Citrix\System32\;C:\
Program Files (x86)\Microsoft SQL Server\100\Tools\Binn\;C:\Program Files (x86)\
Microsoft SQL Server\100\DTS\Binn\;”

Cause 2

The Cmstart.exe and/or Ctxhide.exe are not listed under the AppSetup registry key on the XenApp Server:
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon\AppSetup
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon\AppSetup

Monday, October 20, 2014

Unable to launch the published application

Working on an issue today. When user tries to launch published citrix application, they are getting the error - requested resource can not be launched.' Troubleshooting should be as follows.

1. Checked the published application path/ Location in the citrix app center - see whether there are any comma's, spaces missing in the published application path. Like for example, I was trying to publish Remote Desktop Tool to general users. You need to make sure the command line and working directory are published correctly.

Command Line: C:\Windows\System32\mstsc.exe "C:\RDP\rmstools1.svr.us.jpmchase.net.RDP"
Working Directory: C:\Windows\System32\

2. Login to Citrix server where this icons are published and run qfarm/load,  If you see the server name and the load as 10,000, even though there are no actual users connected to the server, then please implement the following method to resolve the issue.

3.
The specific issue with this server was because the Windows performance counter was corrupt / damaged.

The below message was displayed when I launched PerfMon.

 Performance Monitor Control - Unable to add these counters

I took the following steps to resolve the issue:
-       Run the command lodctr.exe /r at a command prompt
-       Restarted the IMA service
 While this fixed the problem and the server now reports the correct load.

Wednesday, October 15, 2014

Citrix Session Host and Controller

Citrix Session Host - Worker
Citrix Controller - Zone Data Collector

XenApp 6.5 offers new roles, including a worker role (session host only) and a controller role. The default role for a XenApp server is a controller role. The controller server is responsible for farm management tasks while the only task of the session-only servers or workers is to host user sessions.
A farm requires at least one server to act as a controller, which can host the XML and Zone Data Collector roles. A worker cannot perform the role of a data collector, nor can it trigger elections.
There might be times when you need to determine the role of a particular XenApp server in the farm.
To detect if a XenApp 6.5 server is a worker or a controller, complete the following procedure:
  1. Open the AppCenter Console.
  2. Navigate to the Servers section.
  3. Click the server you want to check.
  4. In the Information tab note the value for the Session-host Mode field. Following are the values for this field:
    • Disabled: Indicates that this server is a controller.
    • Enabled: Indicates that this server is a worker.

You are correct: Session Host Mode: Disabled means the server is a "Controller"
Your second statement is not correct........ 
Controller = can do anything.. can be a dedicated XML Broker or Zone Data Collector or Host apps and the first server in the farm
has to be a controller (think: if you only have a 1 server farm - it must be an XML Broker, Zone Data Collector as well as host apps for your users). 
Worker (Session Host Mode: Enabled) = Only works to server user by hosting apps.  Cannot be used for controller functions (XML/ZDC) without remove/re-add to farm and specifying new role. 
By default ... XenApp server are all controllers when you build them ...unless you specify Session Host Only. If your farm of (any number of) XenApp servers are default installs then they are all controllers and can perform any function (XML/ZDC/App host) - doesnt affect anything other than maybe a slight performance hit.

The  second method to detect if a XenApp 6.5 server is a worker or a controller is to check the server registry in the following location:
HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Citrix\IMA\RUNTIME
For the DWORD named WorkerRole, a value of 0 (zero) indicates that the server is a controller and a value of 1 indicates that the server is a worker.

Switching Between a Worker or a Controller

You can switch between a worker or controller with the XenApp Server Role Manager:
To  switch between a worker or a controller, complete the following procedure:
  1. Start the XenApp Server Role Manager.
  2. Remove the server from the farm.
  3. From the XenApp Server Role Manager click Configure.
  4. Click Add this server to an existing server farm to add the farm:
  5. Select the appropriate database and shadowing options.
  6. On the XenApp Server Configuration, enable the Data Collections Options, as shown in the following screen shot:
  7. User-added image
    1. Note the session host only dialog. Session-host indicates that the server is a worker.
    User-added image

Source: I took this information from support.citrix.com

Tuesday, October 7, 2014

Adding Users to published application through Power Shell

Hello Team,

You may be already know this power shell script. But I just want to share my script; it will be helpful for you in future, if you encounter this kind of scenario.

Scenario: Some team wants to test the published icons in the some environment and want me to add one user to those icons. There are 161 icons. So, in order to add one user to 161 icons will take lot of time. So in order to achieve this, I have followed the steps below.

1.       Log in to Citrix Pre prod environment.
2.       Open Power shell script.
3.       Run the command.
    • Add-PSSnapin Citrix*
·         $application=Get-XAApplication -FolderPath "applications\Business Objects\Non-HRT\SUNECDCXA104" (where Applications\ Business Objects\Non-HRT\SUNECDCXA104 is the folder structure in our farm)
·         $displayname=$application|select Adobe (I have selected the first published application in that folder structure “SUNECDCXA104”)
·         foreach ($app in $application){
        Add-XAApplicationAccount -BrowserName $app.browsername -Accounts "NAEAST\R054234" |select accounts, BrowserName, Folderpath
        }

Result:  User account will be added to all published applications under that folder. Ran the same command from different folder structures.

Accounts                                BrowserName                             FolderPath
--------                                -----------                             ----------
{NAEAST\U150189, NAEAST\W348222, NAE... XA104                                   Applications/Business Objects/Non-HR.