Module Loader: File outside basedir

Hello,

I am getting a blank screen when I try to upload a package using module loader and am a bit stuck. Looking in the sugarcrm.log I am finding this: 

Thu Sep 15 10:16:27 2016 [53959][1][FATAL] Exception in Controller: exception 'RuntimeException' with message 'File name violation: file outside basedir' in /Library/Server/Web/Data/Sites/CustomSitesDefault/sugarcrm/src/Util/Files/FileLoader.php:65

Stack trace:

#0 /Library/Server/Web/Data/Sites/CustomSitesDefault/sugarcrm/ModuleInstall/ModuleScanner.php(863): Sugarcrm\Sugarcrm\Util\Files\FileLoader::validateFilePath('/private/var/tm...', true)

#1 /Library/Server/Web/Data/Sites/CustomSitesDefault/sugarcrm/modules/Administration/UpgradeWizard.php(134): MSLoadManifest('/private/var/tm...')

#2 /Library/Server/Web/Data/Sites/CustomSitesDefault/sugarcrm/include/MVC/View/SugarView.php(526): require_once('/Library/Server...')

#3 /Library/Server/Web/Data/Sites/CustomSitesDefault/sugarcrm/include/MVC/View/views/view.classic.php(45): SugarView->includeClassicFile('modules/Adminis...')

#4 /Library/Server/Web/Data/Sites/CustomSitesDefault/sugarcrm/include/MVC/View/SugarView.php(160): ViewClassic->display(Array)

#5 /Library/Server/Web/Data/Sites/CustomSitesDefault/sugarcrm/include/MVC/Controller/SugarController.php(362): SugarView->process(Array)

#6 /Library/Server/Web/Data/Sites/CustomSitesDefault/sugarcrm/include/MVC/Controller/SugarController.php(310): SugarController->processView()

#7 /Library/Server/Web/Data/Sites/CustomSitesDefault/sugarcrm/include/MVC/SugarApplication.php(185): SugarController->execute()

#8 /Library/Server/Web/Data/Sites/CustomSitesDefault/sugarcrm/index.php(27): SugarApplication->execute()

#9 {main}

 

I added a log in UpgardeWizard.php to see where the file in question was located:

Thu Sep 15 10:16:27 2016 [53959][1][FATAL] File : /private/var/tmp/nNoCnH/manifest.php

 

My first thought was permissions and I have reset those with no luck.

 

This is 7.7.1.1 on a MAMP environment. 

Parents Reply
  • I recently had this problem with 7.7.2.0. Interesting 7.7.0.0 on the same laptop did not have the problem.

    Platform: OSX Sierra, MAMP 4.0.6

    Sugar: Developed Ed, 7.7.2.0

    I ended up dumping variables from /src/Util/Files/FileLoader.php and found this:

     

    • PHP Temp folder from php.ini = /Applications/MAMP/tmp/php
    • Where Sugar was extracting the package = /private/var/tmp/eDEE6R/manifest.php
      (After much research I could not find where or why this folder was being used. CLI (ie passthru('php -i') from a script) and Apache reported with same expected path of  /Applications/MAMP/tmp/php)
    • Sugar's allowed upload folders: 

          [0] => /Users/garysmart/Documents/Projects/CRM/SugarEnt-Full-7.7.2.0

          [1] => /Applications/MAMP/tmp/php

     

    The solution was to update php.ini to use /private/var/tmp. Then 7.7.2.0 let me upload packages.

     

    upload_tmp_dir = /private/var/tmp

     

    Gary.

     

Children
No Data