Announcement

Collapse
No announcement yet.

Problem with email attachments after moving to the new server

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

  • Problem with email attachments after moving to the new server

    Hello guys,

    this weekend we moved our application to another server (Apache).

    Everything seems to be working properly, except for some email attachments.

    Some of the attachments cannot be displayed and instead, we are getting a little icon of the image. I double-checked that the attachment with the related ID was successfully transferred to the directory Upload as well as the thumb for that attachment. However, it still does not work as expected. Do you by any chance have an idea what could be causing this?

    I am suspecting that some of the important files have not been moved. I just need to know which one handles displaying of the image(
    ?entryPoint=image&id=643675357903c190e)

    Thanks a lot for the help.

    Sorry about the screen quality, colleague sent me this
    Attached Files
    Last edited by Jakub Grufik; 04-17-2023, 01:41 PM.

  • #2
    i think that means attachment is deleted. i have experienced such thing in past. check out the atachement and verify if the file is there.

    Comment


    • #3
      File is there I mentioned it, it must be something missing in the system.. I also discovered another bug that some documents are not being displayed properly with weird bots instead of text
      Attached Files

      Comment


      • #4
        getting also errors in console Click image for larger version

Name:	image.png
Views:	223
Size:	16.5 KB
ID:	91068

        Comment


        • #5
          Some excel documents uploaded to the system are broken as well

          Comment


          • #6
            Check your webserver logs. Might be a file permission issue.

            Comment


            • #7
              Hello, I checked webserver logs and it says that some of the files do not exist even when everything was transfered correctly and I can find all the attachments in the Upload folder.. Another problem we discovered is that some PDFs are being displayed as corrupted or smth (screen)
              Attached Files

              Comment


              • #8
                I set the file permissions to be as expected. One thing I am not able to set is ownership by using:
                Code:
                cd <PATH-TO-ESPOCRM-DIRECTORY> chown -R <OWNER>:<GROUP-OWNER> .;
                I am not sure which user should I use.. I am using apache but I am not able to find the name of web-user.. Could the ownership be causing the problems? I set the file permissions as it is recommended in the docs

                Comment


                • #9
                  Click image for larger version

Name:	image.png
Views:	216
Size:	18.8 KB
ID:	91097Here is the webserver I am using​

                  Comment


                  • #10
                    In Espo error logs I am getting an error
                    Code:
                    [2023-04-18 08:11:36] ERROR: (403) GET /; line: 69, file: /data/0/f/0f6e82d6-07b5-42f8-803a-fad2758ce077/esmerozz.eu/web/application/Espo/EntryPoints/Attachment.php [] []
                    [2023-04-18 08:11:45] ERROR: (403) GET /; line: 69, file: /data/0/f/0f6e82d6-07b5-42f8-803a-fad2758ce077/esmerozz.eu/web/application/Espo/EntryPoints/Attachment.php [] []
                    [2023-04-18 08:11:51] ERROR: (403) GET /; line: 69, file: /data/0/f/0f6e82d6-07b5-42f8-803a-fad2758ce077/esmerozz.eu/web/application/Espo/EntryPoints/Attachment.php [] []
                    [2023-04-18 08:11:56] ERROR: (403) GET /; line: 69, file: /data/0/f/0f6e82d6-07b5-42f8-803a-fad2758ce077/esmerozz.eu/web/application/Espo/EntryPoints/Attachment.php [] []​
                    In the file Attachment.php on the line 69 I found this:
                    Code:
                    if (!$this->acl->checkEntity($attachment)) {
                                throw new Forbidden();
                            }​

                    Comment


                    • yuri
                      yuri commented
                      Editing a comment
                      This means that attachment record is not allowed for the current user. Is it from a non-admin user?

                    • Jakub Grufik
                      Jakub Grufik commented
                      Editing a comment
                      it is probably for the non-admin user, I am posting here every error related to attachments I am able to find hoping some of them will be related to the issue I am currently dealing with.. There is a lot of errors currently going on..

                      The biggest problem is corrupted PDFs displayed incorrectly with weird colors and with dots instead of the text.. I really need to resolve this issue if possible

                    • Jakub Grufik
                      Jakub Grufik commented
                      Editing a comment
                      Same for excell files, it allows me to download it without any problem from documents, but cannot be opened because it says it is corrupted.

                  • #11
                    Click image for larger version

Name:	image.png
Views:	280
Size:	485.4 KB
ID:	91100
                    Click image for larger version

Name:	image.png
Views:	210
Size:	372.0 KB
ID:	91101

                    These are PDFs in the email attachments.. Both corrupted​​

                    Comment


                    • #12
                      Please help, I am clueless how to fix this and I am being spammed by all my colleagues across the company that they are facing issues with corrupted/not working attachments and documents.

                      Comment


                      • #13
                        Seems like ownership is being set correctly
                        Click image for larger version

Name:	image.png
Views:	205
Size:	55.1 KB
ID:	91115

                        Comment


                        • #14
                          Another error caught in espo logs
                          Code:
                          [2023-04-18 09:49:02] ERROR: Uncaught Exception TypeError: "imagecopyresampled(): Argument #2 ($src_image) must be of type GdImage, bool given" at /data/0/f/0f6e82d6-07b5-42f8-803a-fad2758ce077/esmerozz.eu/web/application/Espo/EntryPoints/Image.php line 279 {"exception":"[object] (TypeError(code: 0): imagecopyresampled(): Argument #2 ($src_image) must be of type GdImage, bool given at /data/0/f/0f6e82d6-07b5-42f8-803a-fad2758ce077/esmerozz.eu/web/application/Espo/EntryPoints/Image.php:279)"} []

                          Comment


                          • #15
                            Can you try to copy all attachments again?

                            Try to zip the folder from the source hoster and unzip it in your new hosting.

                            Comment


                            • Kharg
                              Kharg commented
                              Editing a comment
                              Also I think the problem may be filezilla, it hasn't been reliable for me. Don't you have any other way of uploading file apart from FTP?

                            • Jakub Grufik
                              Jakub Grufik commented
                              Editing a comment
                              I definitely can use other FTP client, I am using FileZilla because I am used to it and it has been recommended by webhosting provider I am using atm. Do you have any recomendations for the other FTP client, please? I am going to try to check original pdf if its broken or not. Thanks

                            • Jakub Grufik
                              Jakub Grufik commented
                              Editing a comment
                              I just checked original PDF by adding .pdf and everything seems to be working properly. PDF is displayed without any problem. I tried to upload it manualy to Upload folder, but in the system it is still being corrupted
                          Working...
                          X