title: "No such index" error in ElasticSearch controller when loading custom module
body: <p>I had created a bunch of custom <code>modules</code> bundled in a single package on a SugarCRM 8.0.0 staging instance. In order to migrate these <code>modules</code> I decided to <code>publish</code> the package so that I could have an installable zip uploaded to another instance. Unfortunately when I try to upload the zip file on the receiving instance using module loader, the installation hangs at 80 percent gives an error in the sugarlog</p>
  
  <p>I am running <code>ElasticSearch 5.4</code> which is compatible with the instance of the Sugar I am running. This is the error that is shown in the logs:</p>
  
  <pre><code>Thu Mar 28 17:54:19 2019 [1786][1][FATAL] Elasticsearch request failure: no such index [index: ab164c0013004724c8eba5f5f6f3f646_shared]
  Thu Mar 28 17:54:19 2019 [1786][1][FATAL] Exception in Controller: Elastica\Exception\ResponseException: no such index [index: ab164c0013004724c8eba5f5f6f3f646_shared] in /var/www/html/SugarPro-Full-8/vendor/ruflin/elastica/lib/Elastica/Transport/Http.php:179
  Stack trace:
  #0 /var/www/html/SugarPro-Full-8/vendor/ruflin/elastica/lib/Elastica/Request.php(193): Elastica\Transport\Http-&gt;exec(Object(Elastica\Request), Array)
  #1 /var/www/html/SugarPro-Full-8/vendor/ruflin/elastica/lib/Elastica/Client.php(674): Elastica\Request-&gt;send()
  #2 /var/www/html/SugarPro-Full-8/src/Elasticsearch/Adapter/Client.php(355): Elastica\Client-&gt;request('ab164c001300472...', 'PUT', Array, Array)
  #3 /var/www/html/SugarPro-Full-8/vendor/ruflin/elastica/lib/Elastica/Client.php(706): Sugarcrm\Sugarcrm\Elasticsearch\Adapter\Client-&gt;request('ab164c001300472...', 'PUT', Array, Array)
  #4 /var/www/html/SugarPro-Full-8/vendor/ruflin/elastica/lib/Elastica/Index.php(562): Elastica\Client-&gt;requestEndpoint(Object(Elasticsearch\Endpoints\Indices\Mapping\Put))
  #5 /var/www/html/SugarPro-Full-8/vendor/ruflin/elastica/lib/Elastica/Type.php(523): Elastica\Index-&gt;requestEndpoint(Object(Elasticsearch\Endpoints\Indices\Mapping\Put))
  #6 /var/www/html/SugarPro-Full-8/vendor/ruflin/elastica/lib/Elastica/Type/Mapping.php(250): Elastica\Type-&gt;requestEndpoint(Object(Elasticsearch\Endpoints\Indices\Mapping\Put))
  #7 /var/www/html/SugarPro-Full-8/src/Elasticsearch/Index/IndexManager.php(486): Elastica\Type\Mapping-&gt;send()
  #8 /var/www/html/SugarPro-Full-8/src/Elasticsearch/Index/IndexManager.php(390): Sugarcrm\Sugarcrm\Elasticsearch\Index\IndexManager-&gt;sendMapping(Object(Elastica\Type\Mapping))
  #9 /var/www/html/SugarPro-Full-8/src/Elasticsearch/Index/IndexManager.php(285): Sugarcrm\Sugarcrm\Elasticsearch\Index\IndexManager-&gt;createIndices(Object(Sugarcrm\Sugarcrm\Elasticsearch\Index\IndexCollection), Object(Sugarcrm\Sugarcrm\Elasticsearch\Analysis\AnalysisBuilder), Object(Sugarcrm\Sugarcrm\Elasticsearch\Mapping\MappingCollection), false)
  #10 /var/www/html/SugarPro-Full-8/src/Elasticsearch/Index/IndexManager.php(200): Sugarcrm\Sugarcrm\Elasticsearch\Index\IndexManager-&gt;syncIndices(Array, false)
  #11 /var/www/html/SugarPro-Full-8/src/SearchEngine/Engine/Elastic.php(113): Sugarcrm\Sugarcrm\Elasticsearch\Index\IndexManager-&gt;addMappings(Array)
  #12 /var/www/html/SugarPro-Full-8/ModuleInstall/ModuleInstaller.php(3489): Sugarcrm\Sugarcrm\SearchEngine\Engine\Elastic-&gt;addMappings(Array)
  #13 /var/www/html/SugarPro-Full-8/ModuleInstall/ModuleInstaller.php(168): ModuleInstaller-&gt;setup_elastic_mapping()
  #14 /var/www/html/SugarPro-Full-8/modules/Administration/UpgradeWizard_commit.php(342): ModuleInstaller-&gt;install('cache/upgrades/...')
  #15 /var/www/html/SugarPro-Full-8/include/MVC/View/SugarView.php(489): require_once('/var/www/html/S...')
  #16 /var/www/html/SugarPro-Full-8/include/MVC/View/views/view.classic.php(43): SugarView-&gt;includeClassicFile('cache/upgrades/...')
  #17 /var/www/html/SugarPro-Full-8/include/MVC/View/SugarView.php(152): ViewClassic-&gt;display(Array)
  #18 /var/www/html/SugarPro-Full-8/include/MVC/Controller/SugarController.php(351): SugarView-&gt;process(Array)
  #19 /var/www/html/SugarPro-Full-8/include/MVC/Controller/SugarController.php(299): SugarController-&gt;processView()
  #20 /var/www/html/SugarPro-Full-8/include/MVC/SugarApplication.php(198): SugarController-&gt;execute()
  #21 /var/www/html/SugarPro-Full-8/index.php(27): SugarApplication-&gt;execute()
  #22 {main}
  Thu Mar 28 17:54:19 2019 [1786][1][FATAL] ERROR: rmdir_recursive(): argument cache/upgrades/temp/ICB8l3 is not a file or a dir.
  </code></pre>
  
  <p>I have tried to repair and rebuild several times, and have also tried to publish the package again to recheck if there were any errors I may have not noticed. I tried to use another instance for uploading in case my current instance may be corrupt, but the same was observed. I do not understand what may be causing the issue.</p>