Legacy Dev Forum Posts

 View Only

Sign Up

PCSD Stats Dispatcher Fatal error

  • 1.  PCSD Stats Dispatcher Fatal error

    Posted 06-05-2025 18:58

    emenard | 2018-08-16 19:00:29 UTC | #1

    Hi,

    I'm a BI developper working on dashboards in Power BI and I was asked to retrieve data from Purecloud, and import it to our SQL Server dw.

    So, I installed the stats dispatcher, configured an OAuth integration, as per the documentation but, I keep getting the following error when I run it:

    PS: First tried with SQL but ended up trying the csv output file as its easier to configure.

    08/16/2018 02:01:04 PM FATAL pcsd.Program - Application error System.AggregateException: One or more errors occurred. ---> System.Collections.Generic.KeyNotFoundException: The given key was not present in the dictionary. at System.Collections.Generic.Dictionary2.get_Item(TKey key) at pcsd.PureCloud.GetPresenceDefinition(Int32 page, Dictionary2 temp) in Z:\Bitbucket\purecloud-stats-dispatcher\src\pcsd\pcsd\PureCloud.cs:line 284 at pcsd.PureCloud.GetPresenceDefinition() in Z:\Bitbucket\purecloud-stats-dispatcher\src\pcsd\pcsd\PureCloud.cs:line 265 at pcsd.PureCloud.<LoadAllDictionaries>b__75_3() in Z:\Bitbucket\purecloud-stats-dispatcher\src\pcsd\pcsd\PureCloud.cs:line 554 at System.Threading.Tasks.Task.InnerInvoke() at System.Threading.Tasks.Task.Execute()


    End of inner exception stack trace ---

    I downloaded the source code to try and find what could be causing the problem but I haven't had any luck and there isn't much documentation online.

    Is the dispatcher out of date? (running version 1.7.0.0) Is there a configuration missing from within Purecloud?

    It does give me this output before the error: 08/16/2018 01:57:43 PM INFO pcsd.plugin.csv.CsvPlugin - Initializing 08/16/2018 01:57:43 PM INFO pcsd.plugin.csv.Continuity.OngoingConversationManager - Ongoing coversation list loaded: 0 items 08/16/2018 01:57:43 PM INFO pcsd.plugin.csv.Output.FileManager - File with this name did exist, renamed it to: e:\\output (renamed 20180816135743095).csv 08/16/2018 01:57:43 PM INFO pcsd.plugin.csv.Output.FileManager - Output file has been created: e:\output.csv 08/16/2018 01:57:43 PM INFO pcsd.plugins.PluginLoader - Plugin pcsd.plugin.csv.CsvPlugin loaded. 08/16/2018 01:57:43 PM INFO pcsd.PureCloud - Login successful 08/16/2018 01:57:43 PM INFO pcsd.PureCloud - Environment: mypurecloud.com 08/16/2018 01:57:43 PM INFO pcsd.PureCloud - Org id: ********** 08/16/2018 01:57:43 PM INFO pcsd.PureCloud - Org name: ********* 08/16/2018 01:57:43 PM INFO pcsd.PureCloud - All Queues retrieved 33 / 33 08/16/2018 01:57:43 PM INFO pcsd.PureCloud - All Languages retrieved 6 / 6 08/16/2018 01:57:43 PM INFO pcsd.PureCloud - All Skills retrieved 36 / 36 08/16/2018 01:57:43 PM INFO pcsd.PureCloud - All Wrap Up Codes retrieved 115 / 115 08/16/2018 01:57:44 PM INFO pcsd.PureCloud - All Contact Lists retrieved 16 08/16/2018 01:57:44 PM INFO pcsd.PureCloud - All Campaigns retrieved 7 08/16/2018 01:57:44 PM INFO pcsd.PureCloud - All Edge Servers retrieved 4 08/16/2018 01:57:44 PM INFO pcsd.PureCloud - All Users retrieved 149 / 149

    Thanks. Eric


    pierrick | 2018-08-17 07:09:37 UTC | #2

    Hi Eric,

    @Dariusz should be able to help. I have invited him to this topic.

    FWIW, I believe it's probably due to some PureCloud API changes and the library should be updated. One of the definitions probably changed.


    Dariusz | 2018-08-17 07:24:52 UTC | #3

    Hi Eric, I believe that you will be able to export the data correctly once you populated English translations of secondary statuses (Admin -> Organization Settings -> Status Management). PCSD assumes that organisation statuses always have English labels.


    emenard | 2018-08-17 10:44:16 UTC | #4

    Hi Dariusz,

    I've check the statuses and only one has activated secondary statuses (Away), two, and both of these have english translations (with french being second).

    All other statuses have a deactivated status, in english.


    Dariusz | 2018-08-17 11:01:37 UTC | #5

    I think you should fill the English translations also for deactivated statuses (to do this they have to be activated for a while).


    emenard | 2018-08-17 11:28:08 UTC | #6

    Ok, I've activated all secondary statuses to check if they had english translations which they do. Although some of them didn't have a french one so I added it just to make sure this wasn't the problem.

    Tried to export the data once more and got the same error.


    Eduardo_Solano | 2018-08-17 13:22:45 UTC | #7

    I had the same error before and was related to status translation as mentioned by Dariusz.

    Also check your API permissions.


    emenard | 2018-08-17 15:35:14 UTC | #8

    What do you mean by API permissions? I'm not very familiar with Purecloud.


    emenard | 2018-08-17 15:44:38 UTC | #9

    Found this in the OAuth client details... if this is what you mean. In the roles are the following permissions: Admin, Outbound admin and Engage Supervisor.

    Please let me know if this is correct.


    emenard | 2018-08-20 13:59:37 UTC | #10

    Hi, I've double checked all statuses and they all have an english translation. However, there are a few (On Queue, Meal, Meeting and Offline) that dont have any status created or allowed. Should there be at least one for each that are allowed?


    emenard | 2018-08-21 18:39:34 UTC | #11

    @Dariusz, @Eduardo_Solano Any other ideas?

    Thanks


    Dariusz | 2018-08-22 09:59:46 UTC | #12

    Hi @emenard , could you test it with the latest version of the utility - 1.8.0.0? https://bitbucket.org/GenesysCSP/purecloud-stats-dispatcher/downloads/

    Please notice that the db structure has changed in the latest version. You have to create a new database or use a migration script in order to upgrade the old one.


    emenard | 2018-08-22 13:26:56 UTC | #13

    @Dariusz Worked on the first try. Thanks a million for your help. A lot of people are going to be happy here!


    emenard | 2018-08-22 18:34:47 UTC | #14

    My first test was with a csv file, which worked fine. Although only one tab was created... I thought there would be more data than this. But that was only a test.

    So then I tried with the SQL server connection. I create a sql user named purecloud as per instructions but the PCSD dispactcher fails with a login failed error. I did gave the user sysadmin role and mapped it to all the system databases, just in case but no luck.

    We are using 2016 SQL Server enterprise.

    Anything special I need to configure?

    Thanks


    Dariusz | 2018-08-23 06:33:08 UTC | #15

    Hi, does your connection string work with other apps? It doesn’t look like a PCSD issue.


    emenard | 2018-08-23 12:58:14 UTC | #16

    Well, now I feel like an idiot. Server was only set to accept window authentication logins.

    Thanks a lot for your help and patience...


    Besim_Ismaili | 2018-09-10 10:43:38 UTC | #17

    Same here, I created a sql user named purecloud as per instructions but the PCSD dispactcher fails with a login failed error.


    emenard | 2018-09-10 15:26:27 UTC | #18

    Does your SQL instance is set to accept sql logins as well as windows authentications?


    system | 2018-10-11 15:26:27 UTC | #19

    This topic was automatically closed 31 days after the last reply. New replies are no longer allowed.


    This post was migrated from the old Developer Forum.

    ref: 3389