web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Answered

GP Utilities error "Unhandled script exception: Index -6 of local array is out of range in script 'addFileKeysForDictionnary'. Script Terminated

(0) ShareShare
ReportReport
Posted on by 28,058 Moderator

This happens to me currently when trying to upgrade a customer site from GP 18.3.1036 to the latest February hotfix 18.3.1245 after GP Utilities ran thru a couple of objects for a few minutes: 

pastedimage1616797038796v1.png

Scrolling down the error message provide not much more details.. the usual out of range message.

pastedimage1616797067563v2.png

I had to kill GPU as it freezes there and then enabled the DEXSQL tracing in the DEX.ini

That confirmed to me that the issue is somewhat related to the CoA framework, as the last few lines from the DEXSQL.log file where related to the SY00302 & SY03001 SP's. 

/* Date: 03/26/2021 Time: 18:02:41
stmt(54978752):*/
{CALL DYNAMICS.dbo.zDP_SY003001F_1(NULL,NULL)}

/* Date: 03/26/2021 Time: 18:02:41
stmt(54978752):*/
{CALL DYNAMICS.dbo.zDP_SY00302F_1(NULL,NULL)}

/* Date: 03/26/2021 Time: 18:02:41
stmt(54978752):*/
{CALL DYNAMICS.dbo.zDP_SY003001F_1(NULL,NULL)}

/* Date: 03/26/2021 Time: 18:02:41
stmt(54978752):*/
{CALL DYNAMICS.dbo.zDP_SY003001F_1(NULL,NULL)}

/* Date: 03/26/2021 Time: 18:02:41
stmt(54978752):*/
{CALL DYNAMICS.dbo.zDP_SY00302F_1(NULL,NULL)}

/* Date: 03/26/2021 Time: 18:02:41
stmt(54978752):*/
{ CALL DYNAMICS.dbo.zDP_SY00302SS_1 ( 1 ) }

However, it doesn't provide much hint on what's wrong, nor does the SP's above when executed in SQL return any errors.. they execute just fine. 

My guess is that it could be something with the GP client itself ? 

Categories:
I have the same question (0)
  • Bill Campbell Profile Picture
    12 on at

    Hi Beat,

    You are running the Utilities on a user workstation after the server update is done?  or is this at the server when doing the first part of the update?

    Are there any 3rd party solutions that might be interfering or that might cause the CoA to appear different, in use or other wise impaired?

    Look forward to the solution as I have not see this type of error in the past.

  • Suggested answer
    Beat Bucher  GP Geek  GPUG All Star Profile Picture
    28,058 Moderator on at

    Hi Bill,

    No 3rd-parties involved here and it's the 1st run on the SQL server side..

    But digging into the list of possible culprits when doing a GP upgrade, I found a serious hint from Microsoft's blog and this led me to this page here:

    community.dynamics.com/.../the-account-framework-validation-script-returned-records-how-do-we-resolve-this

    Though it's not really new stuff, it makes completely sense, as I know for a fact that this client site was tampered with the COA framework last year to accommodate some changes..

    The SQL script Account_FrameWork_Validation returned over 300 records of bad segment defs.

  • Bill Campbell Profile Picture
    12 on at

    Must say that when Derek writes up a solution it is pretty solid.  There are a lot of steps to manage, but I think you will make it work.  Does make sense that if the client was 'working on the CoA' that there might be some issues at the update.  But at least this points you in a good direction.

    Good luck.

  • Beat Bucher  GP Geek  GPUG All Star Profile Picture
    28,058 Moderator on at

    Absolutely..

    I wish the customer would have purchased GPPT when I recommended it last year, because the Database Validation tool could have managed that in a matter of a few minutes..

    I've gone thru the PSTL process for 1 company and re-ran the COA validation, and I've 14 records less now. Still 16 companies to go thru the whole process, which is going to take the good part of the evening.

    I initially had planned to be done by 7-8pm the latest, but alas, you can't plan for the unforeseen..

  • Beat Bucher  GP Geek  GPUG All Star Profile Picture
    28,058 Moderator on at

    ok,

    That was a shot in the dark, and I still have no clue why this is coming back.. I've gone thru all the companies and recreated the tables that had issues, and then I restarted the GP Utilities.. it went until the Account Framework sync came up and BOOM ! same error again.

    At this point I'm a little lost and don't know what the problem might be.

  • Richard Wheeler Profile Picture
    75,848 Moderator on at

    Have you tried setting SYNCHRONIZE=TRUE in your DEX.INI before launching GP Utilities?

  • Beat Bucher  GP Geek  GPUG All Star Profile Picture
    28,058 Moderator on at

    Yes,

    I even tried to remove and re-install the original GP client 18.2.1036 and that's when the GPU bombs out as well the first time when it tries to sync the CoA framework.. which means there is some inconsistency between the data and the client which it can fix by itself.

  • Beat Bucher  GP Geek  GPUG All Star Profile Picture
    28,058 Moderator on at

    For god's sakes, I stumbled across that exact same issue a year ago during an upgrade and can't remember how I fixed it :-(

    community.dynamics.com/.../1019797

  • Suggested answer
    Beat Bucher  GP Geek  GPUG All Star Profile Picture
    28,058 Moderator on at

    SOLUTIION:

    Thanks to a tip from David Musgrave the issue was resolved by setting back the value of the DYNAMICS..SY00302  account sorting index field which for the 2 first segments had been set originally during the initial setup of GP by the accountant. No idea why this was causing this, but setting the value back from 1 & 2 to 0 in both fields allowed to sync the CoA framework with GP Utilities. This somehow seems to be an old heritage from the days GP was running on ctree btrieve files.

    I'm going to check post- upgrade if those values can be set again and if GPU will be able to sync the framework. 

  • Verified answer
    Derek Albaugh Profile Picture
    on at

    This is one we don't see much of at all.....looking at my case history, I think I've seen it maybe 2-3x in about 13+ years......to add information to it, which you've already found and resolved, but in case any others run into it down the road:

    In the 2-3 support cases where we've seen this error during an upgrade, it normally steps from the USDFSGKY column in the SY00302 table being accidently changed, for some reason, to have invalid values, such as all 1's or 2's, etc., which it cannot be, because you cannot sort my multiple segments at the same time. If there is no sorting setup on the account framework segments, then the USDFSGKY table can show all 0's (zeroes) and that will also work fine.

    If we look at the dexsql.log of what is causing this error, we should see something like this:

    { CALL DYNAMICS.dbo.zDP_SY00302SS_1 ( 1 ) }

    The SY00302 and SY003001 tables hold your account framework information. Looking at the SY00302 table the USDFSGKYcolumn is populated with the account segment sorting information that you specified when you created the DYNAMICS database.

    The way this column should work is that any column you chose not to sort by would have a value a 0. Columns that you do want to sort by would start with a value of 8 for the first sorted column, 9 for the second, 10 for the third and so on.

    The first segment is sorted by default, so starting with the 2nd segment, you could potentially have an 8 in the USDFSGKY if that is the first segment being sorted.

    Glad you were able to get it resolved........thanks

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > Finance | Project Operations, Human Resources, AX, GP, SL

#1
Martin Dráb Profile Picture

Martin Dráb 660 Most Valuable Professional

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 549 Super User 2025 Season 2

#3
Sohaib Cheema Profile Picture

Sohaib Cheema 307 User Group Leader

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans