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
  • Have you verified that the from/to values in your manifest's copy array are all correct? Make sure that the from starts with <basepath>/ and that there is no slash at the start of the to.

  • Hello Shad,

    This parameter is governed by the upload_tmp_dir setting in your php.ini file. If it's not explicitly set it will use the system default, which Sugar can't access. Try this: 

    1.) Go to Terminal
    2.) Run
    echo $TMPDIR
    3.) Copy path
    4.) Open your php.ini
    5.) Replace upload_tmp_dir with the copied path

    6) Restart Apache

    Thank you,
    Elizabeth Cromwell
    SugarCRM Support

    Learning Resources: http://support.sugarcrm.com | http://university.sugarcrm.com | http://community.sugarcrm.com

  • Hello All,

    I am also facing same issue on my production server. Elizabeth  Cromwell I have tried to execute echo $TMPDIR in terminal but it returns me blank value. 

    At same server SugarCRM 7.6.* version is working fine. we for Sugar 7.7.12 I can't upload my package.

    Could you please assist any one?

    Thanks in advance,

  • I have the same issue on xamp.

    I did following steps to got it working.

    1. Open C:\xampp\htdocs\crm\ModuleInstall\ModuleScanner.php in the function 

    function MSLoadManifest($manifest_file) add the line
    $GLOBALS['log']->fatal("manifest_file: $manifest_file"); in start of function.
    Now try to upload package from module loader.
    It gave me the path of the tmp directory where manifest of package is unzipped in the sugarcrm log file.
    e.g. path is:
    C:\Users\userabc\AppData\Local\Temp\11111.tmp/manifest.php
    2. Now copy the path "C:\Users\userabc\AppData\Local\Temp" and put/change it in php.ini e.g
    upload_tmp_dir="C:\Users\userabc\AppData\Local\Temp"

    Restarted the xamp server. 

    Now try to upload the package.

    And all got working.

    In case some body have this issue on windows.

    Regards,

    Usman

Reply
  • I have the same issue on xamp.

    I did following steps to got it working.

    1. Open C:\xampp\htdocs\crm\ModuleInstall\ModuleScanner.php in the function 

    function MSLoadManifest($manifest_file) add the line
    $GLOBALS['log']->fatal("manifest_file: $manifest_file"); in start of function.
    Now try to upload package from module loader.
    It gave me the path of the tmp directory where manifest of package is unzipped in the sugarcrm log file.
    e.g. path is:
    C:\Users\userabc\AppData\Local\Temp\11111.tmp/manifest.php
    2. Now copy the path "C:\Users\userabc\AppData\Local\Temp" and put/change it in php.ini e.g
    upload_tmp_dir="C:\Users\userabc\AppData\Local\Temp"

    Restarted the xamp server. 

    Now try to upload the package.

    And all got working.

    In case some body have this issue on windows.

    Regards,

    Usman

Children
No Data