Skip to main content

Notifications

Announcements

No record found.

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

Posted on by 28,021 Super User 2024 Season 1

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:
  • Suggested answer
    RE: GP Utilities error "Unhandled script exception: Index -6 of local array is out of range in script 'addFileKeysForDictionnary'. Script Terminated

    The Account_Framework_Validation script more looks at just the number of segments and length of each segment, per the SY003001/SY00302 tables, and then looks at a handful of tables to validate their structure based on this information, that we've seen cause upgrades to fail in the past.

    You are correct in that it doesn't check each and every table that is configured to have a specific structure based on the account framework maximums in the SY003001/SY00302 tables, it also doesn't look at sorting setups either, so it wouldn't have helped in this case.

    Thanks

  • Beat Bucher  GP Geek  GPUG All Star Profile Picture
    Beat Bucher GP Gee... 28,021 Super User 2024 Season 1 on at
    RE: GP Utilities error "Unhandled script exception: Index -6 of local array is out of range in script 'addFileKeysForDictionnary'. Script Terminated

    Thank you Derek for the insights.

    As you can see from my OP, the last captured line was about the call for the SP on SY00302 table, which was the one causing the issue..

    I honestly have no idea how those 2 first segments received the values 1 & 2 in the USDFSGKY field, and would never have thought about this being the actual issue, wouldn't have been David that pointed out promptly on that one..

    I figured out that the involved tables after a COA framework change are far more than I'd have initially thought, anywhere between 40 to 60 tables, depending on the installed modules.

    After the upgrade completed successfully I was still found tables where the Account fields have the wrong format on the segment length based on the SY00302 table.. Apparently not all tables are rebuilt during an upgrade from 18.2.1036 to 18.3.1245..

    I started with your script about Account Verify, but I realize that it only covers a dozen tables or so, I guess the most important ones, but it's far from all.  I'll see if I can improve that script to get a more complete validation of impacted tables after a COA change.

    Have a great week all. My week-end was short ;-)

  • Richard Wheeler Profile Picture
    Richard Wheeler 75,730 on at
    RE: GP Utilities error "Unhandled script exception: Index -6 of local array is out of range in script 'addFileKeysForDictionnary'. Script Terminated

    Thank you for mentioning Pervasive. I think I will go and pull out my Dynamics GP floppies and reminisce now. Long Live DOS!!!

  • Lisa at AonC.com Profile Picture
    Lisa at AonC.com 3,141 on at
    RE: GP Utilities error "Unhandled script exception: Index -6 of local array is out of range in script 'addFileKeysForDictionnary'. Script Terminated

    Richard -

    You may recall way back when they first introduced Account Framework (GP 3?) that we could sort by any segment.  I think it was version 6 when we "lost" the ability to include the first segment.  (I think the issue was that GP was already including the first segment so we were creating duplicate indexes by also inserting the first segment.  I ran into the issue with a very large - by GP 6 standards - database that was making the Pervasive database engine very unhappy.)

  • Richard Wheeler Profile Picture
    Richard Wheeler 75,730 on at
    RE: GP Utilities error "Unhandled script exception: Index -6 of local array is out of range in script 'addFileKeysForDictionnary'. Script Terminated

    I have always wondered where the settings were stored when you first run Utilities and it asked about how many segments and 'Do you want to sort on these segments'. Now I know and I can sleep tonight.

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

    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

  • Suggested answer
    Beat Bucher  GP Geek  GPUG All Star Profile Picture
    Beat Bucher GP Gee... 28,021 Super User 2024 Season 1 on at
    RE: GP Utilities error "Unhandled script exception: Index -6 of local array is out of range in script 'addFileKeysForDictionnary'. Script Terminated

    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. 

  • Beat Bucher  GP Geek  GPUG All Star Profile Picture
    Beat Bucher GP Gee... 28,021 Super User 2024 Season 1 on at
    RE: GP Utilities error "Unhandled script exception: Index -6 of local array is out of range in script 'addFileKeysForDictionnary'. Script Terminated

    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

  • Beat Bucher  GP Geek  GPUG All Star Profile Picture
    Beat Bucher GP Gee... 28,021 Super User 2024 Season 1 on at
    RE: GP Utilities error "Unhandled script exception: Index -6 of local array is out of range in script 'addFileKeysForDictionnary'. Script Terminated

    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.

  • Richard Wheeler Profile Picture
    Richard Wheeler 75,730 on at
    RE: GP Utilities error "Unhandled script exception: Index -6 of local array is out of range in script 'addFileKeysForDictionnary'. Script Terminated

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

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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,280 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,235 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Product updates

Dynamics 365 release plans