Unable to create PDF Templates - 403 Error

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • TKopp
    Junior Member
    • Apr 2025
    • 17

    #1

    Unable to create PDF Templates - 403 Error

    Hello,

    we face difficulties to create pdf templates. If we navigate to administration > pdf templates, we receive an 403 error.

    We are running on 9.0.8 and have the advanced pack installed on version 3.9.0.

    I assumed this is a permission problem, but the admin user has all permission rights.

    Did we miss something, are there further actions needed to use the "print to pdf" than just installing the advanced pack?
  • lazovic
    Super Moderator
    • Jan 2022
    • 1109

    #2
    Hi TKopp,

    Please tell me if there is anything in the error logs of your instance?

    Please also note that Print to PDF is a default function of EspoCRM and does not depend on extensions installed.

    Comment

    • victor
      Active Community Member
      • Aug 2022
      • 952

      #3
      Advanced Pack is not related to this error.

      Please try again to grant the required Permissions: https://docs.espocrm.com/administrat...n/#permissions. For example:
      Code:
      sudo find . -type d -exec chmod 755 {} + && sudo find . -type f -exec chmod 644 {} +;
      sudo find data custom client/custom -type d -exec chmod 775 {} + && sudo find data custom client/custom -type f -exec chmod 664 {} +;
      sudo chmod 775 application/Espo/Modules client/modules;
      sudo chmod 754 bin/command;
      sudo chown -R www-data:www-data .;

      Comment

      • office
        Member
        • Jun 2025
        • 42

        #4
        Originally posted by TKopp
        Hello,

        we face difficulties to create pdf templates. If we navigate to administration > pdf templates, we receive an 403 error.

        We are running on 9.0.8 and have the advanced pack installed on version 3.9.0.

        I assumed this is a permission problem, but the admin user has all permission rights.

        Did we miss something, are there further actions needed to use the "print to pdf" than just installing the advanced pack?
        have you managed to find a solution?

        Comment

        • TKopp
          Junior Member
          • Apr 2025
          • 17

          #5
          Hey office, unfortunately not, I granted the permissions as described by Victor, but I still receive the same error.

          Comment

          • lazovic
            Super Moderator
            • Jan 2022
            • 1109

            #6
            TKopp,

            Please tell me if there is anything in the error logs of your instance?

            Comment

            • TKopp
              Junior Member
              • Apr 2025
              • 17

              #7
              Hey lazovic, unfortunately not, I already set the log level the debug, but nothing is logged.

              Comment

              • victor
                Active Community Member
                • Aug 2022
                • 952

                #8
                Originally posted by TKopp
                Hey lazovic, unfortunately not, I already set the log level the debug, but nothing is logged.
                While reproducing the issue, press F12 and take a screenshot of your browser console. The information from the console can help with analysis.

                Comment

                • TKopp
                  Junior Member
                  • Apr 2025
                  • 17

                  #9
                  Hey victor, please find attached the log file from my browser console.
                  Attached Files

                  Comment

                  • victor
                    Active Community Member
                    • Aug 2022
                    • 952

                    #10
                    Originally posted by TKopp
                    Hey victor, please find attached the log file from my browser console.

                    Data from your console:

                    Code:
                    espo-main.js:46235 Espo.Exceptions.AccessDeniedmessage: "Denied access to action 'Template#read'"stack: "AccessDenied\n at https://instance_name/client/lib/espo-main.js?r=1749718637:54:25409\n at Object._defineProceed (https://instance_name/client/lib/espo.js?r=1749718637:6:591)\n at https://instance_name/client/lib/espo.js?r=1749718637:6:497\n at Object._load (https://instance_name/client/lib/espo.js?r=1749718637:6:2321)\n at Object.require (https://instance_name/client/lib/espo.js?r=1749718637:6:964)\n at Object.define (https://instance_name/client/lib/espo.js?r=1749718637:6:473)\n at c.define.Espo.define (https://instance_name/client/lib/espo.js?r=1749718637:6:7430)\n at https://instance_name/client/lib/espo-main.js?r=1749718637:54:25139"[[Prototype]]: AccessDenied
                    at https://instance_name/client/lib/espo-main.js?r=1749718637:54:25409
                    at Object._defineProceed (https://instance_name/client/lib/espo.js?r=1749718637:6:591)
                    at https://instance_name/client/lib/espo.js?r=1749718637:6:497
                    at Object._load (https://instance_name/client/lib/espo.js?r=1749718637:6:2321)
                    at Object.require (https://instance_name/client/lib/espo.js?r=1749718637:6:964)
                    at Object.define (https://instance_name/client/lib/espo.js?r=1749718637:6:473)
                    at c.define.Espo.define (https://instance_name/client/lib/espo.js?r=1749718637:6:7430)
                    at https://instance_name/client/lib/espo-main.js?r=1749718637:54:25139name: "AccessDenied"stack: "AccessDenied\n at https://instance_name/client/lib/espo-main.js?r=1749718637:54:25409\n at Object._defineProceed (https://instance_name/client/lib/espo.js?r=1749718637:6:591)\n at https://instance_name/client/lib/espo.js?r=1749718637:6:497\n at Object._load (https://instance_name/client/lib/espo.js?r=1749718637:6:2321)\n at Object.require (https://instance_name/client/lib/espo.js?r=1749718637:6:964)\n at Object.define (https://instance_name/client/lib/espo.js?r=1749718637:6:473)\n at c.define.Espo.define (https://instance_name/client/lib/espo.js?r=1749718637:6:7430)\n at https://instance_name/client/lib/espo-main.js?r=1749718637:54:25139"[[Prototype]]: Objectconstructor: ƒ Error()stackTraceLimit: 10captureStackTrace: ƒ captureStackTrace()isError: ƒ isError()length: 1name: "Error"prototype: {name: 'Error', message: '', toString: ƒ}arguments: (...)caller: (...)[[Prototype]]: ƒ ()[[Scopes]]: Scopes[0]message: ""name: "Error"toString: ƒ toString()[[Prototype]]: Object
                    e @ espo-main.js:46235

                    After each step, try creating a PDF Template:

                    1. Re-grant the necessary Permissions and make Rebuild via CLI.
                    2. Create a new user with Admin type, who will not have any Roles specified in the profile.
                    3. What do you have specified in Administration > Settings > General > PDF Engine? By default, it is always Dompdf, unless you have installed a separate extension for Tcpdf. It is worth trying both.
                    4. Are you sure that you have correctly enabled DEBUG mode? Please send a screenshot. Such errors are usually logged in EspoCRM.
                    5. Remember after what actions you had this problem appeared? Did Print to PDF work correctly before? Maybe you made changes to EspoCRM files, especially those related to ACL?

                    Comment

                    • TKopp
                      Junior Member
                      • Apr 2025
                      • 17

                      #11
                      Hey victor, i did 1. and received the same error. Same with step 2. I have Dompdf as default, I did not install anything else and can't switch to Tcpdf. Unfortunately I am also not experienced enough to install a different engine in our environment. I am quite sure, please find below the screenshot of the config-internal.php.

                      Click image for larger version

Name:	image.png
Views:	63
Size:	31.6 KB
ID:	119085
                      I am unable to answer step 5, I inherited espocrm a few months ago and was tasked to just only do updates. I guess it never realy worked.

                      Comment

                      • lazovic
                        Super Moderator
                        • Jan 2022
                        • 1109

                        #12
                        TKopp,

                        Can you please provide a screenshot of what this error looks like in the browser, not in the browser console?

                        Comment

                        • TKopp
                          Junior Member
                          • Apr 2025
                          • 17

                          #13
                          Hey lazovic, sure: Click image for larger version

Name:	image.png
Views:	56
Size:	11.1 KB
ID:	119088

                          Comment

                          • victor
                            Active Community Member
                            • Aug 2022
                            • 952

                            #14
                            You can install a clean version of EspoCRM and try to see if Print to PDF works there. If so, I would simply move the /custom, /data folders and import the old database into the new instance.

                            You can read more about how to do this here: https://forum.espocrm.com/forum/inst...345#post105345

                            Comment

                            Working...