Announcement

Collapse
No announcement yet.

403 Access Denied when uploading document

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

  • 403 Access Denied when uploading document

    I have been using EspoCRM for 2 months just fine and now I'm getting a 403 error when uploading any document to in any module.

    I have duplicated the steps in initial permissions configuration for the files and folders.

    I have also made sure the webserver is the owner where needed.

    I'm getting SyntaxErrors in the logs. Here is the output of my data/log:

    [2017-08-05 16:07:39] Espo.ERROR: Json::decode():Syntax error [] []
    [2017-08-05 16:07:39] Espo.EMERGENCY: Syntax error in application/Espo/Modules/Crm/Resources/metadata/clientDefs/Project.json [] []
    [2017-08-05 16:07:39] Espo.ERROR: Json::decode():Syntax error [] []
    [2017-08-05 16:07:39] Espo.EMERGENCY: Syntax error in application/Espo/Modules/Crm/Resources/metadata/clientDefs/ProjectTask.json [] []
    [2017-08-05 16:07:39] Espo.ERROR: Json::decode():Syntax error [] []
    [2017-08-05 16:07:39] Espo.EMERGENCY: Syntax error in application/Espo/Modules/Crm/Resources/metadata/entityDefs/Project.json [] []
    [2017-08-05 16:07:39] Espo.ERROR: Json::decode():Syntax error [] []
    [2017-08-05 16:07:39] Espo.EMERGENCY: Syntax error in application/Espo/Modules/Crm/Resources/metadata/entityDefs/ProjectTask.json [] []
    [2017-08-05 16:07:39] Espo.ERROR: Json::decode():Syntax error [] []
    [2017-08-05 16:07:39] Espo.EMERGENCY: Syntax error in application/Espo/Modules/Crm/Resources/metadata/scopes/Project.json [] []
    [2017-08-05 16:07:39] Espo.ERROR: Json::decode():Syntax error [] []
    [2017-08-05 16:07:39] Espo.EMERGENCY: Syntax error in application/Espo/Modules/Crm/Resources/metadata/scopes/ProjectTask.json [] []
    [2017-08-05 16:10:01] Espo.ERROR: Json::decode():Syntax error [] []
    [2017-08-05 16:10:01] Espo.EMERGENCY: Syntax error in application/Espo/Modules/Crm/Resources/i18n/en_US/Project.json [] []
    [2017-08-05 16:10:01] Espo.ERROR: Json::decode():Syntax error [] []
    [2017-08-05 16:10:01] Espo.EMERGENCY: Syntax error in application/Espo/Modules/Crm/Resources/i18n/en_US/ProjectTask.json [] []


    I hope somebody could help. Thank you.


  • #2
    Hello
    This error means, your json files aren't valid.

    Comment


    • #3
      Thanks for your reply.

      I am currently the only user with administrative access my CRM or the server for that matter. Can you tell me what could have occurred to cause this error to avoid it in the future?

      Also, do you have any recommendations to correct this problem?

      Comment


      • #4
        You have path of your invalid files in the log. open they and check on json lint

        Comment


        • #5
          Those json files that showed up in the error appeared to be unrelated. Nothing had changed in the syntax since they were created. I've removed those json files as they were unrelated to any entity in use. I am still getting the 403 Access Denied error when attempting to upload any documents to any section of the CRM. I've reapplied the proper permissions via SSH. The logs now show no errors reported.

          When inspecting the actions in developer console, these are the details that are showing:

          Failed to load resource: the server responded with a status of 401 (Unauthorized) /api/v1/App/user
          Failed to load resource: the server responded with a status of 403 (Forbidden) /api/v1/Attachment/action/upload

          POST http://crm.XXXXXXXXXX.com/api/v1/Att.../action/upload 403 (Forbidden)
          send @ espo.min.js?r=1502148465:4
          ajax @ espo.min.js?r=1502148465:4
          (anonymous) @ VM261:330


          Could this have any relation to a restriction on the server itself? Any suggestions would be appreciated.

          Comment


          • #6
            go to your Profile, click Access button and check if you have permission to create Attachment. Also check if data/upload is writable.

            Comment


            • #7
              Everything appears normal checking on those.

              However, I normally access the CRM byy going to crm.xxxxxx.com. When I go to xxxxxx.com/crm (the natural directory for the espocrm install) I get a 404 error instead of a 403.

              espo.min.js?r=1502379037:4 POST http://xxxxxxxxxxxxxx.com/crm/api/v1/.../action/upload 404 (Not Found)

              Comment


              • #8
                Try double checking your permissions in
                data/config.php

                'defaultPermissions' => [
                'user' => 505,
                'group' => 506
                ],

                These digits may need to be changed to your CRM username.
                Last edited by joy11; 08-10-2017, 07:52 PM.

                Comment


                • #9
                  Originally posted by joy11 View Post
                  Try double checking your permissions in
                  data/config.php

                  'defaultPermissions' => [
                  'user' => 505,
                  'group' => 506
                  ],

                  These digits may need to be changed to your CRM username.
                  Indeed these digits read "99" for both user and group. I changed them to what you have shown, cleared and rebuilt cache but I'm still getting the error. Are there any other steps I should be taking?

                  Comment


                  • joy11
                    joy11 commented
                    Editing a comment
                    Just for kicks... In your data/config.php can you try to change this to:
                    'defaultPermissions' => [
                    'user' => 'nobody',
                    'group' => 'nobody'
                    ],

                    If it doesn't work you can change it back. It might not be the best way, but when I changed mine to my CRM server username it worked for me in a similar situation.
                    Last edited by joy11; 08-29-2017, 03:58 PM.

                • #10
                  Try changing the digits to your CRM username that was set up for the server, like the one you set in the beginning before installation. I had to change the digits (505 and 506) to the text username for both of them and that seemed to work for me.

                  Comment


                  • #11
                    Making these changes flooded my error logs with more errors. I'm baffled as to why this even happened in the first place. I do not think it is a configuration issue within espocrm, but maybe a webserver problem. Unfortunately, I have tried everything I could think of. Nobody that was using the CRM had administrative access. And I am also the only person with any access to the web server. I just cannot figure out what I may have done to cause this problem.

                    If anybody has any other suggestions I would greatly appreciate it.

                    Comment


                    • #12
                      You changed the default user and group. Set previous values. Change files and folders owner (user and group) to server user and server group. Set permission https://www.espocrm.com/blog/server-...n-for-espocrm/

                      Comment


                      • #13
                        This article solved my problem too. Thanks guys! Big <3

                        Comment


                        • #14
                          Originally posted by tanya View Post
                          You changed the default user and group. Set previous values. Change files and folders owner (user and group) to server user and server group. Set permission https://www.espocrm.com/blog/server-...n-for-espocrm/
                          I've doublechecked this since the beginning. "Nobody" is the webserver user. Here's a screenshot. Maybe there's something I'm over looking.

                          Comment


                          • #15
                            After trying everything I can think of, I am still not getting results.

                            I know for sure now that it has nothing to do with a setting within espo. I have strong reason to believe this is occuring due to a change on the server. I just have no idea what that change is.

                            Can anyone tell me what settings on the server can cause this type of malfunction?

                            Comment

                            Working...
                            X