Problem Description:


While importing the source JSON, sometimes you might see the internal server error in the UI like below.



The actual error will be logged in the apricot log and one type of error looks like below.


{"level":"error","message":"[SERVER]  { '0': '[SERVER]',\n  '1': \n   { error: \n      [ 'Exception while invoking method \\'getMappingsFromImportedConfiguration\\'',\n        'Cannot read property \\'toHexString\\' of undefined\\nTypeError: Cannot read property \\'toHexString\\' of undefined\\n    at clusterTemplateSelected.find.mapping (server/methods/sources.js:1135:49)\\n    at Array.find (native)\\n    at server/methods/sources.js:1132:39\\n    at Function.each (/opt/infoworks/apricot-meteor/apricot/programs/server/npm/node_modules/underscore/underscore.js:188:9)\\n    at MethodInvocation.importSourceConfigurationWithMappings (server/methods/sources.js:1099:6)\\n    at MethodInvocation.<anonymous> (server/hooks/hooks_lib.js:123:21)\\n    at maybeAuditArgumentChecks (packages/ddp-server/livedata_server.js:1767:12)\\n    at DDP._CurrentMethodInvocation.withValue (packages/ddp-server/livedata_server.js:1685:15)\\n    at Meteor.EnvironmentVariable.EVp.withValue (packages/meteor.js:1304:12)\\n    at resolve (packages/ddp-server/livedata_server.js:1683:36)\\n    at new Promise (<anonymous>)\\n    at Server.applyAsync (packages/ddp-server/livedata_server.js:1682:12)\\n    at Server.apply (packages/ddp-server/livedata_server.js:1621:26)\\n    at Server.call (packages/ddp-server/livedata_server.js:1603:17)\\n    at MethodInvocation.getMappingsFromImportedConfiguration (server/methods/configuration_migration.js:161:21)\\n    at MethodInvocation.<anonymous> (server/hooks/hooks_lib.js:123:21)\\n => awaited here:\\n    at Promise.await (/opt/infoworks/apricot-meteor/apricot/programs/server/npm/node_modules/meteor/promise/node_modules/meteor-promise/promise_server.js:60:12)\\n    at Server.apply (packages/ddp-server/livedata_server.js:1634:14)\\n    at Server.call (packages/ddp-server/livedata_server.js:1603:17)\\n    at MethodInvocation.getMappingsFromImportedConfiguration (server/methods/configuration_migration.js:161:21)\\n    at MethodInvocation.<anonymous> (server/hooks/hooks_lib.js:123:21)\\n    at maybeAuditArgumentChecks (packages/ddp-server/livedata_server.js:1767:12)\\n    at DDP._CurrentMethodInvocation.withValue (packages/ddp-server/livedata_server.js:719:19)\\n    at Meteor.EnvironmentVariable.EVp.withValue (packages/meteor.js:1304:12)\\n    at DDPServer._CurrentWriteFence.withValue (packages/ddp-server/livedata_server.js:717:46)\\n    at Meteor.EnvironmentVariable.EVp.withValue (packages/meteor.js:1304:12)\\n    at Promise (packages/ddp-server/livedata_server.js:715:46)\\n    at new Promise (<anonymous>)\\n    at Session.method (packages/ddp-server/livedata_server.js:689:23)\\n    at packages/ddp-server/livedata_server.js:559:43' ] } }","timestamp":"2020-12-03T09:28:20.816Z"}


Root Cause:


This happens if there are any table groups without a cluster template attached in the JSON.


Solution:


This is a bug and we have taken care of this in version 4.4 onwards. As a workaround one needs to remove those table groups or attach the cluster templates to those table groups in the source end and export the JSON and import it in the destination source.


Applicable versions:

IWX 3.2,4.0,4.2.