Announcement

Collapse
No announcement yet.

Permission denied when installing real estate extension

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Permission denied when installing real estate extension

    Hello,

    I installed with success the real estate extension on the espocrm stack OS X installer but when I try to install it on my Bitnami Google Cloud Platform I get this message :

    "Error 500: Permission denied for " ... a lot of folders and files

    Any idea how to fix this ?

    I guess I need to modify some files permissions maybe by connecting by SSH on the server at this address ? :

    https://cloudssh.developers.google.com/projects/

    As I do not know how and where to do this, I would much appreciate your help and thank you in advance, I have not managed to find a tutorial.

    Regards,

  • #2
    Hello,

    I managed to fix this issue.

    I connected by SSH in the Google Cloud Console
    I went in the folder ~/apps/espocrm/htdocs
    and applied these 2 commands :
    - chmod 775 application/Espo/Modules
    - chmod 775 client/modules

    Then I managed to install the real estate extension with no more the permission denied error.

    Maybe this information could help someone ?

    Comment


    • espcrm
      espcrm commented
      Editing a comment
      Thank you. Will give this a try tomorrow.

      --- Edit: both my of folder contain these permission but no luck either.
      Last edited by espcrm; 01-15-2020, 12:28 PM.

  • #3
    Trying it today and having no luck with it, all those folder is already the right permission for me. Can't find some of the folder you were referring to (maybe cause your version was quite old considering you posted this in 2016).

    Getting an "Error 406" from the Console (F12 in your web browser). Research showing that it got to do with ModSecurity. I tried to disable it using .htaccess in

    Tried installing v1.3.5 and 1.3.4

    Code:
    ¬/espoCRM/.htaccess; and
    ¬/espoCRM/api/v1/.htaccess; and
    ¬/espoCRM/api/v1/portal-access/.htaccess
    But all three method don't work.

    This is the error:
    Code:
    "Failed to load resource: the server responded with a status of 406 ()"
    the path: /api/v1/Extension/action/upload
    
    This is the server response: Not Acceptable!
    
    
    An appropriate representation of the requested resource could not be found on this server. This error was generated by Mod_Security.
    I also looked through ¬espoCRM/data/logs/
    But got no useful information either. There is an invalid filepath of "/api/v1/Extension/action/upload", however it note this other file on Line 47:

    Code:
    EspoCRM-5.7.11\application\Espo\Controllers/Extension.php
    Which read:

    Code:
    " throw new Forbidden(); "
    
    Reading through this file I see this part here: $manager = new \Espo\Core\ExtensionManager($this->getContainer());
    Maybe this mean that I can manually install this extension then do a upgrade somehow? Not sure.

    I read this to learn how to disable ModSecurity and added the code to .htacess

    https://bloggingbar.com/error-406-not-acceptable/
    <IfModule mod_security.c> SecFilterEngine Off SecFilterScanPOST Off </IfModule>

    Now I'm learning how to use SSH and maybe can do it like that; see this post: https://forum.espocrm.com/forum/exte...1162#post51162 SSH: https://forum.espocrm.com/forum/exte...file-not-found

    Anyone with tip on anything I missed or alternative method, would appreciate your feedback. Thank you
    Last edited by espcrm; 01-13-2020, 09:39 PM.

    Comment


    • #4
      Hello,
      if you are using a host solution and faced with this issue, a better way is to contact a host support service. This issue as you mentioned above is up to the server configs.

      Comment


      • #5
        That a bit odd, EspoCRM installed fine but why is the Extension designed in a way that it require additional permission.

        Is there no way to do a manual "extract" to folder method?

        Comment


        • espcrm
          espcrm commented
          Editing a comment
          It a free extension by EspoCRM developer. Can grab it here: https://www.espocrm.com/extensions/real-estate/

        • tothewine
          tothewine commented
          Editing a comment
          Well in that case you extract the content of files directory to the espocrm directory. Then put the content of the scripts/afterinstall.php run method in an entrypoint and run it once. Then remove the entrypoint. Do this in a test environment with backups.

        • espcrm
          espcrm commented
          Editing a comment
          Thank you tothewine. Bit confused with the "Entrypoint" and run it once, how do I do that?

          Also, do you know where to extract the manifest.json file to?

          Not sure where to put the "scripts" folder either. There two file in there.
          Last edited by espcrm; 01-13-2020, 09:22 PM.

      • #6
        Your EspoCRM instance should have permissions as provided here https://www.espocrm.com/documentatio...nt-permissions. If the permissions are ok, there shouldn't be any problem with the extension installation process.
        Please set permissions with the command scripts provided in the manual and try to install the extension again. If you will get some error, please provide the error description from the log file in the data/logs directory. Describe the steps you did to make extension installation.
        Also, all .htaccess files should be with default configs.

        Comment


        • #7
          Originally posted by Maximus View Post
          Your EspoCRM instance should have permissions as provided here https://www.espocrm.com/documentatio...nt-permissions. If the permissions are ok, there shouldn't be any problem with the extension installation process.
          Please set permissions with the command scripts provided in the manual and try to install the extension again. If you will get some error, please provide the error description from the log file in the data/logs directory. Describe the steps you did to make extension installation.
          Also, all .htaccess files should be with default configs.
          Already describe what I can here: https://forum.espocrm.com/forum/exte...4645#post54645

          I can post the log but like I said, nothing useful information in there but I might have misread.

          Permission is OK based on during installation, administration panel and manual check for File Permission #.

          Default htaccess is being use, just testing way to be able to temporary install the extension or "fix the error" but it didn't work so I revert back the changes.

          Will post the log sometime tomorrow.

          ---

          data\logs\
          Code:
           Espo.ERROR: (403) GET /api/v1/Extension/action/upload; line: 47, file: /home4/{filter}/public_html/crm.{filter}.com/application/Espo/Controllers/Extension.php [] []
          Here is the system environment:


          Click image for larger version  Name:	Screenshot_2020-01-14 Server Requirements filter.jpg Views:	0 Size:	61.9 KB ID:	54815
          Last edited by espcrm; 01-13-2020, 09:32 PM.

          Comment


          • espcrm
            espcrm commented
            Editing a comment
            Downloaded the extension enhanced-dynamic-logic-for-espocrm to see if it every file that have issue or just the real estate one. I still got the error so it is due to my server.

            Looking at the file structure it look simply enough. Will just extracting the file manually to those folder and if require edit the permission work?

            The manifest file is also very simple with pretty much text description and no coding at all. I will give it a try and pray my luck.

            My guess, somehow it can't extract the zip file and require modsecurity to do that. But I have access via FTP and Cpanel & file manager so I can make change through that way.

        • #8
          You can refer to github documentation on how to use entrypoints, basically it's some code that gets run over http requests to index.php ?entryPoint=<name> : a way to run code in a very similar environment that may expected during extension install (within espo app context). The manifest is not to be copied anywhere. You only copy the content of the 'files' directory of the zip over espo directory.
          Then run the entrypoint and you should have simulated extension install. From a quick glance most of the install script can be done within the GUI except dome dashboard modding.
          Do rebuild in the end

          Comment


          • #9
            Originally posted by tothewine View Post
            You can refer to github documentation on how to use entrypoints, basically it's some code that gets run over http requests to index.php ?entryPoint=<name> : a way to run code in a very similar environment that may expected during extension install (within espo app context). The manifest is not to be copied anywhere. You only copy the content of the 'files' directory of the zip over espo directory.
            Then run the entrypoint and you should have simulated extension install. From a quick glance most of the install script can be done within the GUI except dome dashboard modding.
            Do rebuild in the end
            Thank you. I tried searching for it but couldn't find anything about "entry" "entrypoint" "point": https://github.com/espocrm/documentation

            I tried to install it on the demo and see if I can figure it out but Demo (https://demo.espocrm.com/?lang=en_US#Admin/extensions) disabled installation.

            The extension documents doesn't mention anything: https://github.com/espocrm/documenta.../extensions.md

            Can you give a specific example? I did tried opening the file (note the domain is an example)

            https://demo.espocrm.com/script.php

            script.php being the file I extracted from the Real Estate extension but all I get is a 403 error.

            Is the entrypoint something like this?

            https://demo.espocrm.com/?lang=en_US#Admin/extensions/?entryPoint=<scripts.php>
            or maybe
            https://demo.espocrm.com/?lang=en_US...int=realestate

            ---

            I already extract all the files, rebuild my file. And it seem to be available to be use on my EspoCRM, but I don't dare to touch it yet because it might break the whole system and I have to restart again (haven't learn how to make backup yet).

            But those "script.php" installation is what worries me, I need it to run before I start using it.

            Comment


            • espcrm
              espcrm commented
              Editing a comment
              Just noticed this when my tab browser crashed:

              https://espocrm.com/?entryPoint=download&id=

              Which point to a PDF file I was download from an attachment. So that how the ?entrypoint command work, but how do I get it to activate the extension installation? Maybe like this?

              https://espocrm.com/?entryPoint=extensions&id={extensionname?}

              Just bunch page 404 pages as I tested.

            • espcrm
              espcrm commented
              Editing a comment
              Rejoice! I decided to do a little more research into this issue and finally manage to resolve it.

              As my host is shared hosting they enable this feature to protect your website and their server. I talked to my Host and asked them about it and at the end of the day they add a doamin Whitelist rules to it. Basically now I don't get that error anymore.

              Installation finally worked and I can now start to use it without fear.

              The issue right now is, since it is whitelist, I no longer receive the protection of mod_security so that post a risk to my server.

          • #10
            Sorry for the delay I am full of notifications I was thinking there would be apage on github about that. Glad you solved... mod_security is always a PITA.

            For info on entrypoints see this post, it has an example: https://forum.espocrm.com/forum/deve...2652#post22652
            Only thing to do different is you don't need to create a module so you can put the file in custom/Espo/Custom/EntryPoints/<your class name>.php (example name)

            What I was saying is to copy the run() code from the install script and put it as the body of youe entrypoint class's run method, then visit the entrypoint once and to do further (die-based) debugging in case of errors.

            Actually I just figured now that you could probably have taken the extension zip file, change the script, remove all files and edit manifest accordingly to do a quick retry if the install code...
            Last edited by tothewine; 01-22-2020, 02:22 PM.

            Comment


            • espcrm
              espcrm commented
              Editing a comment
              Let hopes that I don't have to rely on this workaround but other may not be lucky as me. They might not be able to Whitelist it like I did.

              Thanks.
          Working...
          X