• Resolved acroundtree

    (@acroundtree)


    I’m working on a dev site on pantheon and I’ve been trying to import the media files. Media sync seems to allow me to scan all the files in the /wp-content/uploads folder, but it’s not working at all. I used filezilla to confirm that the folders and accompanying files are in place and they are. When I click on import it states that all files are being imported, but when I check the media library, it seems that the files are there, but the images themselves are blank.

    2 additional things
    1. When I disable the Dry Run, I do get an error [Media Sync] error E: Gateway Timeout
    2. I checked my browsers inspector and although the file location is correct (I can go to it on my server), the image will not load.

    I’m using wordpress 5.5.1, php 7.3
    Also, this is not happening on my local environment (I’m running a lando stack).

    Is there any additional information I can provide?

Viewing 10 replies - 1 through 10 (of 10 total)
  • Plugin Author erolsk8

    (@erolsk8)

    @acroundtree maybe you can try to go to Settings -> Media Sync and select “Turn on debugging”, then scan and import 1 file to test it out and see if you get some errors (maybe in Console or Network tab in Dev Tools).

    Also, I’m totally sure what’s the actual problem. You said it’s not working at all, but then you said you were able to scan the files and they showed up Media Library. So something is working ??

    And how do you mean images are blank? Could you maybe share some screenshots?

    Or it might be better to separate it in stages:
    1. Are files successfully found and listed when using “Scan Files” option?
    2. Is importing completed successfully, with imported rows being highlighted?
    3. Did those imported files show up as new items in Media Library?

    But thanks for the details, it’s just that it’s hard to imagine what’s happening.

    Thread Starter acroundtree

    (@acroundtree)

    No errors with debug mode on. Just displays the following:

    Debugging before uploads directory scan:
    Peak memory usage: 14 MB / 14336 KB
    Memory usage: 24 MB / 24685 KB (5% of the available memory: 512 MB / 524288 KB)
    Time since start: 0.14973711967468 seconds
    Debugging after uploads directory scan:
    Peak memory usage: 14 MB / 14336 KB
    Memory usage: 24 MB / 24686 KB (5% of the available memory: 512 MB / 524288 KB)
    Time since start: 0.14974999427795 seconds

    No individual files are listed while being imported. But it does report
    Imported 630 out of 630 selected items

    It seems that the files are being found, I can see the filename and the data associated with it, but the image itself is blank.

    Plugin Author erolsk8

    (@erolsk8)

    How do you mean blank?

    Thread Starter acroundtree

    (@acroundtree)

    Plugin Author erolsk8

    (@erolsk8)

    Oh so it seems to be imported, but URL is not pointing to the correct file.

    Could you find out what’s the actual path to the file (clicking on the file name in this plugin) and what also what Media Sync thinks where that file is (File URL on the right side)?

    For example:

    From Media Sync scan:
    https://your-website.com/wp-content/uploads/2020/09/file123.jpg

    From Media Library File URL:
    https://your-website.com/wp-content/uploads/2020/09/file123.jpg

    And if you switch to the list view in Media Library and select “Filter by missing file” -> “Without file”, are you seeing those same broken files, or are those filtered out?

    Also, did those blank items in Media Library exist before or those showed up after using this plugin?

    Thanks,
    Erol

    Thread Starter acroundtree

    (@acroundtree)

    After switching the view to list view I am noticing that files that are under my username are being displayed, but no one else. Even more weird is that I never uploaded these files. These were files that were part of a backup that I was importing from another site. The files that I see should not be under my name as the author and yet they are. The images that are blank items are files that are under the name of the original user.

    Regardless, I’m not sure why they are still not working since it’s not an issue on my local environment.

    Hello,

    I am also experiencing the same error reported here and on other posts.

    I debugged it and determined that it’s related to the usage of the wp_generate_attachment_metadata hook. When this hook gets called, an error occurs, which then causes the AJAX action request to return the 503 error.

    When I comment out these 2 lines of code related to the attachment metadata update, the import works successfully. See here: https://prnt.sc/uepr3f

    So what’s the issue? I tried disabling some plugins that could interfere with this hook, but no luck..

    Perhaps there needs to be some error handling related to the metadata update.

    Thanks,
    Austin

    Plugin Author erolsk8

    (@erolsk8)

    Thank you so much @phoenixseolab! That’s some very useful information.

    I just pushed a new version 1.2.1 where I added a ton of error catching. Because I can never replicate the described issues on my end. So any bit of error information I can gather is valuable.

    Anyway, this didn’t solve an issue with wp_generate_attachment_metadata, because I’m not sure what’s the actual problem. But it would hopefully show us what the error is (in an alert popup or console log).

    If you have any more ideas of what’s wrong with this or how can I replicate this issue, please let me know.

    Thank you
    Erol

    Plugin Author erolsk8

    (@erolsk8)

    Hi @acroundtree, seems like the file is added to Media Library, but without metadata due to some error which I can’t replicate on my end (locally or on the server).

    When I find some time again, I’ll look into it closer.

    Also, @acroundtree or @phoenixseolab, does any of you know if this started happening when you updated this plugin to 1.2.0, or did you maybe update WordPress or you’re using this plugin for the first time?

    Thank you,
    Erol

    Plugin Author erolsk8

    (@erolsk8)

    I’m guessing the issue was because this plugin originally used WordPress function for getting mime type (required for metadata): https://developer.www.ads-software.com/reference/functions/wp_check_filetype/

    But now in a new 1.2.2 version, I’m just using PHP’s built-in function (https://www.php.net/manual/en/function.mime-content-type.php) to hopefully get mime type for all files.

    Please let me know if that helped.

    Thanks

Viewing 10 replies - 1 through 10 (of 10 total)
  • The topic ‘Files not importing or loading.’ is closed to new replies.