Citrix Director throws “Unexpected Server Error” while clicking on the Trends Tab
book
Article ID: CTX579023
calendar_today
Updated On:
Description
- Citrix Director throws “Unexpected Server Error” while clicking on the Trends Tab
- Event ID 5 is logged in Citrix Director, pointing to failure while connecting to data source.
- The CDF Traces captured from Director Server, show the exception "Unexpected character encountered while parsing value"
Dmc Service error
Citrix.Dmc.Common.ConnectorException: Unexpected character encountered while parsing value: <. Path '', line 0, position 0. ---> Newtonsoft.Json.JsonReaderException: Unexpected character encountered while parsing value: <. Path '', line 0, position 0.
at Newtonsoft.Json.JsonTextReader.ParseValue()
at Newtonsoft.Json.Linq.JObject.Load(JsonReader reader, JsonLoadSettings settings)
at Newtonsoft.Json.Linq.JObject.Parse(String json, JsonLoadSettings settings)
at Citrix.Dmc.Connector.MonitoringService.MonitoringServiceClient.CallMonitoringServiceData[T](Action`1 msQuery)
at Citrix.Dmc.Connector.MonitoringService.MonitoringServiceClient.RunODataQuery(String query)
Environment
The above mentioned sample code is provided to you as is with no representations, warranties or conditions of any kind. You may use, modify and distribute it at your own risk. CITRIX DISCLAIMS ALL WARRANTIES WHATSOEVER, EXPRESS, IMPLIED, WRITTEN, ORAL OR STATUTORY, INCLUDING WITHOUT LIMITATION WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NONINFRINGEMENT. Without limiting the generality of the foregoing, you acknowledge and agree that (a) the sample code may exhibit errors, design flaws or other problems, possibly resulting in loss of data or damage to property; (b) it may not be possible to make the sample code fully functional; and (c) Citrix may, without notice or liability to you, cease to make available the current version and/or any future versions of the sample code. In no event should the code be used to support ultra-hazardous activities, including but not limited to life support or blasting activities. NEITHER CITRIX NOR ITS AFFILIATES OR AGENTS WILL BE LIABLE, UNDER BREACH OF CONTRACT OR ANY OTHER THEORY OF LIABILITY, FOR ANY DAMAGES WHATSOEVER ARISING FROM USE OF THE SAMPLE CODE, INCLUDING WITHOUT LIMITATION DIRECT, SPECIAL, INCIDENTAL, PUNITIVE, CONSEQUENTIAL OR OTHER DAMAGES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. Although the copyright in the code belongs to Citrix, any distribution of the sample code should include only your own standard copyright attribution, and not that of Citrix. You agree to indemnify and defend Citrix against any and all claims arising from your use, modification or distribution of the sample code.
Resolution
Take a full backup of Citrix databases and a snapshot of Delivery Controllers.
Follow the below steps to fix the connection string for Monitor Service and Monitor data store.
1. Start PowerShell as an admin and run: asnp Citrix*
2. Stop the Citrix Monitor Service on all the controllers which have incorrect connection strings:
Get-Service CitrixMonitor | Stop-Service
3. Nullify the Monitor DB connection.
Set-MonitorDBConnection -DBConnection $Null
Set-MonitorDBConnection -DataStore Monitor $Null
4. Configure the correct Connection string with a semi-colon (;) after the SQL port Number for Citrix Monitor Service and DataStore by running the below PowerShell cmdlets.
$cs="Server=SQlServerName,Port;Initial Catalog=XenDesktopDB;Integrated Security=true;MultiSubnetFailover=True”
Set-MonitorDBConnection -DBConnection $cs
Set-MonitorDBConnection -Datastore Monitor -DBConnection $cs
Note: Replace the SQLServerName and Port with the actual SQL server/Instance name and Port for your environment.
5. Start the Monitoring Service on all of the Controllers by running:
Get-Service CitrixMonitor | Start-Service
Problem Cause
There was a comma instead of semi-colon after custom SQL port number in the Monitor Service and DataStore Connection Strings.
Example:
Working
Server=SQLSERVERNAME,51918;MultiSubnetFailover=True;Initial Catalog=DBName;Integrated Security=true
Non-Working
Server=SQLSERVERNAME,51918,MultiSubnetFailover=True;Initial Catalog=DBName;Integrated Security=true
Issue/Introduction
This article helps in troubleshooting “Unexpected Server Error” which is thrown when clicking the Trends Tab in Citrix Director.
Was this article helpful?
thumb_up
Yes
thumb_down
No