Provisioning fails with Unable to execute sql

#1

On one of our tags (on any other one everything is fine), provisioning fails with the following error

Unable to execute sql SELECT location_r, region_r FROM c3_2_struct_locrgn WHERE location_r in

Here is the full error message;

Error: [tenant/tag] Server Errors: (2018-09-21T17:14:56.540+02:00)
{fileUrl:"meta://base/energy/src/org/energyStructure/AssetHierarchyTransition.c3typ",lineNum:1,colNum:1,severity:"ERROR",message:"Unable to execute sql SELECT location_r, region_r FROM c3_2_struct_locrgn WHERE location_r in ('LOCATION_s00313', 'LOCATION_s00313-b001', 'LOCATION_s00313-b001-gen001', 'LOCATION_s00313-b001-log001', 'LOCATION_s00313-b001-log002', 'LOCATION_s00313-b001-log003', 'LOCATION_s00313-b001-log004', 'LOCATION_s00313-b001-log005', 'LOCATION_s00313-b001-log006', 'LOCATION_s00313-b001-log007', 'LOCATION_s00313-b001-log008', 'LOCATION_s00313-b001-log009', 'LOCATION_s00313-b001-log010', 'LOCATION_s00313-b001-log011', 'LOCATION_s00313-b001-log012', 'LOCATION_s00313-b001-log013', 'LOCATION_s00313-b001-log014', 'LOCATION_s00313-b001-log015', 'LOCATION_s00313-b001-log016', 'LOCATION_s00313-b001-log017', 'LOCATION_s00313-b001-log018', 'LOCATION_s00313-b001-log019', 'LOCATION_s00313-b001-log020', 'LOCATION_s00313-b001-log021', 'LOCATION_s00313-b001-log022', 'LOCATION_s00313-b001-log023', 'LOCATION_s00313-b001-log024', 'LOCATION_s00313-b001-log025', 'LOCATION_s00313-b001-log026', 'LOCATION_s00313-b001-log027', 'LOCATION_s00313-b001-log028', 'LOCATION_s00313-b001-log029', 'LOCATION_s00313-b001-log030', 'LOCATION_s00313-b001-log031', 'LOCATION_s00313-b001-log032', 'LOCATION_s00313-b001-log033', 'LOCATION_s00313-b001-log034', 'LOCATION_s00313-b001-log035', 'LOCATION_s00313-b001-log036', 'LOCATION_s00313-b001-log037', 'LOCATION_s00313-b001-log038', 'LOCATION_s00313-b001-log039', 'LOCATION_s00313-b002', 'LOCATION_s00313-b002-log001', 'LOCATION_s00313-b002-log002', 'LOCATION_s00313-b002-log003', 'LOCATION_s00313-b002-log004', 'LOCATION_s00313-b002-log005', 'LOCATION_s00313-b002-log006', 'LOCATION_s00313-b002-log007', 'LOCATION_s00313-b002-log008', 'LOCATION_s00313-b002-log009', 'LOCATION_s00313-b002-log010', 'LOCATION_s00313-b002-log011', 'LOCATION_s00313-b002-log012', 'LOCATION_s00313-b002-log013', 'LOCATION_s00313-b002-log014', 'LOCATION_s00313-b002-log015', 'LOCATION_s00313-b002-log016', 'LOCATION_s00313-b002-log017', 'LOCATION_s00313-b002-log018', 'LOCATION_s00313-b002-log019', 'LOCATION_s00313-b002-log020', 'LOCATION_s00313-b002-log021', 'LOCATION_s00313-b002-log022', 'LOCATION_s00313-b002-log023', 'LOCATION_s00313-b002-log024', 'LOCATION_s00313-b002-log025', 'LOCATION_s00313-b002-log026', 'LOCATION_s00313-b002-log027', 'LOCATION_s00313-b002-log028', 'LOCATION_s00313-b002-log029', 'LOCATION_s00313-b002-log030', 'LOCATION_s00313-b002-log031', 'LOCATION_s00313-b002-log032', 'LOCATION_s00313-b002-log033', 'LOCATION_s00313', 'LOCATION_s00313-b001', 'LOCATION_s00313-b001', 'LOCATION_s00313-b001', 'LOCATION_s00313-b001', 'LOCATION_s00313-b001', 'LOCATION_s00313-b001', 'LOCATION_s00313-b001', 'LOCATION_s00313-b001', 'LOCATION_s00313-b001', 'LOCATION_s00313-b001', 'LOCATION_s00313-b001', 'LOCATION_s00313-b001', 'LOCATION_s00313-b001', 'LOCATION_s00313-b001', 'LOCATION_s00313-b001', 'LOCATION_s00313-b001', 'LOCATION_s00313-b001', 'LOCATION_s00313-b001', 'LOCATION_s00313-b001', 'LOCATION_s00313-b001', 'LOCATION_s00313-b001', 'LOCATION_s00313-b001', 'LOCATION_s00313-b001', 'LOCATION_s00313-b001', 'LOCATION_s00313-b001', 'LOCATION_s00313-b001', 'LOCATION_s00313-b001', 'LOCATION_s00313-b001', 'LOCATION_s00313-b001', 'LOCATION_s00313-b001', 'LOCATION_s00313-b001', 'LOCATION_s00313-b001', 'LOCATION_s00313-b001', 'LOCATION_s00313-b001', 'LOCATION_s00313-b001', 'LOCATION_s00313-b001', 'LOCATION_s00313-b001', 'LOCATION_s00313-b001', 'LOCATION_s00313-b001', 'LOCATION_s00313-b001', 'LOCATION_s00313', 'LOCATION_s00313-b002', 'LOCATION_s00313-b002', 'LOCATION_s00313-b002', 'LOCATION_s00313-b002', 'LOCATION_s00313-b002', 'LOCATION_s00313-b002', 'LOCATION_s00313-b002', 'LOCATION_s00313-b002', 'LOCATION_s00313-b002', 'LOCATION_s00313-b002', 'LOCATION_s00313-b002', 'LOCATION_s00313-b002', 'LOCATION_s00313-b002', 'LOCATION_s00313-b002', 'LOCATION_s00313-b002', 'LOCATION_s00313-b002', 'LOCATION_s00313-b002', 'LOCATION_s00313-b002', 'LOCATION_s00313-b002', 'LOCATION_s00313-b002', 'LOCATION_s00313-b002', 'LOCATION_s00313-b002', 'LOCATION_s00313-b002', 'LOCATION_s00313-b002', 'LOCATION_s00313-b002', 'LOCATION_s00313-b002', 'LOCATION_s00313-b002', 'LOCATION_s00313-b002', 'LOCATION_s00313-b002', 'LOCATION_s00313-b002', 'LOCATION_s00313-b002', 'LOCATION_s00313-b002', 'LOCATION_s00313-b002') AND tenant_tag_id = '226'\nERROR: relation \"c3_2_struct_locrgn\" does not exist\n  Position: 34\n\n  from action DbAdmin.executeQuery\n  from env_server.js, line 129\n    127    if (C3._context.locale)\n    128      options.language = C3._context.locale;\n  > 129    return c3CallAction(target, args, options);\n    130  }\n    131  \n  from typesys.js, line 1378\n    1376  \n    1377          // call the server to execute this function as an action\n  > 1378          response = c3Call(this, name, args);\n    1379        }\n    1380  \n  from AssetHierarchyTransition_transitionToAssetHierarchy_1.js, line 99\n     97  \n     98          // Get all location-region relationships\n  >  99          _.each(DbAdmin.executeQuery(\"SELECT location_r, regi...\n    100              _.map(_.flatten([locIds, _.compact(_.map(locatio...\n    101                  function(id) {return id.replace(/'/g, \"\\''\")...\n  from AssetHierarchyTransition_transitionToAssetHierarchy_1.js, line 181\n    179  })();\n    180  if (typeof $AssetHierarchyTransition$functions.transitionToA...\n  > 181    function transitionToAssetHierarchy_1() { return $AssetHie...\n    182  }\n    183  \n  from AssetHierarchyTransition_transitionToAssetHierarchy_1.js, line 187\n    185  if (typeof transitionToAssetHierarchy_1 != 'function') throw...\n    186  global$.call$AssetHierarchyTransition$transitionToAssetHiera...\n  > 187    transitionToAssetHierarchy_1.call(AssetHierarchyTransition);\n    188  };\n    189  })(this);\n  from action AssetHierarchyTransition.transitionToAssetHierarchy_1\n  from env_server.js, line 129\n    127    if (C3._context.locale)\n    128      options.language = C3._context.locale;\n  > 129    return c3CallAction(target, args, options);\n    130  }\n    131  \n  from typesys.js, line 1378\n    1376  \n    1377          // call the server to execute this function as an action\n  > 1378          response = c3Call(this, name, args);\n    1379        }\n    1380  \n  from AssetHierarchyTransition_transitionToAssetHierarchy_1.js, line 99\n     97  \n     98          // Get all location-region relationships\n  >  99          _.each(DbAdmin.executeQuery(\"SELECT location_r, regi...\n    100              _.map(_.flatten([locIds, _.compact(_.map(locatio...\n    101                  function(id) {return id.replace(/'/g, \"\\''\")...\n  from AssetHierarchyTransition_transitionToAssetHierarchy_1.js, line 181\n    179  })();\n    180  if (typeof $AssetHierarchyTransition$functions.transitionToA...\n  > 181    function transitionToAssetHierarchy_1() { return $AssetHie...\n    182  }\n    183  \n  from AssetHierarchyTransition_transitionToAssetHierarchy_1.js, line 187\n    185  if (typeof transitionToAssetHierarchy_1 != 'function') throw...\n    186  global$.call$AssetHierarchyTransition$transitionToAssetHiera...\n  > 187    transitionToAssetHierarchy_1.call(AssetHierarchyTransition);\n    188  };\n    189  })(this);\n  base action AssetHierarchyTransition.transitionToAssetHierarchy_1",targetType:"AssetHierarchyTransition"}
Results: 
[
  [
    [
      null,
      null
    ]
  ]
]
Time taken: 1m 37.05s
0 Likes

#2

It appears some schema upgrade script in base/energy pacakge is failing… the old table c3_2_struct_locrgn does not exist in that tag…

0 Likes

#3

Actually, at least two tags but not all. Perhaps we should have them removed and recreated.

0 Likes

#4

thanks @pavan.nandikonda for pointing to the issue, what would you suggest us to do?

0 Likes

#5

the upgrade script should handle that( @rileysiebel) … Not sure how that tag ended in that state. What is the version of apps and server it is upgraded from and to.
May be tag, does not need that upgrade, we can bypass that.

0 Likes

#6

We are not doing migration, still working on a base dependency 7.6.1+364.
The cluster seems to run c3-server-7.6.1.147-1.x86_64.rpm.

buildBranch: release/v7.6.1
 hostName: stage-engiegridops2-app-m-03.stage-04-euw1.internal
 buildCITag: 7.6.1.147-1
 buildRefSpec: bc38063e1826badc9a32be8704c9563ecc89cfe6
 buildDate: 2018-02-09T00:17:59Z
 buildMachine: 86f06fe928bc
0 Likes

#7

Is this a case where it’s appropriate to provision with the -r flag?

0 Likes

#8

@akatkinson you should not use -r When should you use the reset option when provisioning?

Also, with repetitive -r you will end up in this situation Provisioning error: No space left on device

0 Likes