• Resolved Nazrinn

    (@nazrinn)


    Hello Optimole team!

    I’ve had this problem for a while where, occasionally, some of my Optimole images disappear from my media library with no obvious cause. Here is what it looks like on the backend (screenshot).

    Trying to load the image causes this error:
    Failed to load resource: the server responded with a status of 400 ()

    Unfortunately, clearing the image cache doesn’t solve the problem either.
    I usually manually go around the problem by using Phoenix Media Replace and manually reuploading the missing image one by one.

    Any idea of what my cause this issue?

    For background: I am a full stack WordPress developer. My site also uses Elementor.

Viewing 7 replies - 1 through 7 (of 7 total)
  • Plugin Support Vytis

    (@bvytis)

    Hi @nazrinn,

    Do you have images offloaded to Optimole’s cloud or they are kept locally and only served by Optimole?

    Also, if you’re using the cloud library, does this happen at the same time when you upload image to your server and it’s offloaded to Optimole’s cloud, or at first it appears there, and only after some time images randomly stop showing in the library?

    Thread Starter Nazrinn

    (@nazrinn)

    They are offloaded to Optimole’s cloud.

    The 400 error seems to be a “Bad Request”. If I try to view the image via the Optimole URL in my browser, instead of displaying the image, it displays “Bad Request” or “Invalid URL” on a blank page.

    The image seems to disappear after some time, and there is no problem with the image as I upload it. It’s hard to pinpoint when it exactly happens, and there doesn’t seem to be a pattern in what disappears.
    Last time, however, it affected images related to a custom post in my website. About 25-40 images.

    Usually it’s just an image there and there that disappears.

    I’ll let you know if I spot another image that disappears on the website so we can investigate further at that point.

    AC

    (@purplecodes)

    Themeisle Support

    Hello @nazrinn,

    Should this happen again, kindly share the link to your site or the image so we can closely check.

    L D

    (@ldaniels137)

    The same thing happened to me at my site, all my images are gone now

    Plugin Support Poonam Namdev

    (@poonam9)

    Hi @ldaniels137,

    Please create a new ticket with more information that includes your website URL and some screenshots related to optimole plugin settings. It would help us to debug the issue clearly.

    Thank you!

    Thread Starter Nazrinn

    (@nazrinn)

    Okay so yesterday I have discovered one cause for the issue.

    For saving bandwidth and server resources, I use Optimole with the CDN on when I make copies of my website for local development and staging, then simply change the URL of the meta box (using Velvet Blues Update URLs plugin
    ) to correctly point the image URL toward my main domain, where the images are stored in the cloud. It goes a bit like this.

    1. Images get uploaded to the live version of the site.
    2. I make a copy of my website to my staging and/or local environment using Duplicator Pro.
    3. Since all instance of “domain.com” URL gets changed to “staging.domain.com”or “localhost/domain”, I use Velvet Blues Update URLs to update all my image URL to point toward “domain.com” instead (because “optimole.cdn/staging.domain.com/image.jpg” or “optimole.cdn/localhost/domain.com/image.jpg” simply doesn’t exist),
    4. Once I am done with developing my feature, I import all new content my clients might have created on the live site to the staging. This requires me to rollback the images on the live site before using the WordPress Importer to transfer my media files. *

    So far so good. However, when using the WordPress importer, things can get tricky. I haven’t followed what happened there 100% but I think it’s because I might have duplicated the import. I think something like this happens.

    • Image on live site is marked as such: optimole.cdn/domain.com/image.jpg
    • Image on staging is normally marked as such: optimole.cdn/staging.domain.com/image.jpg (I do not disable the CDN since image URL should match anyway). The original image should be simply named image.jpg
    • However, the image Optimole picks up is called image-1.jpg. This is probably due to the WordPress importer uploading images with the image.jpg name twice in the same day. This create a cdn link looking like this: optimole.cdn/staging.domain.com/image-1.jpg
    • Once I push my staging site to live, it changes the staging URL to the live once, converting optimole.cdn/staging.domain.com/image-1.jpg to optimole.cdn/domain.com/image-1.jpg

    However, optimole.cdn/domain.com/image-1.jpg doesn’t exist! only optimole.cdn/domain.com/image.jpg does, which results in a 400 error when Optimole try to look at optimole.cdn/domain.com/image-1.jpg in its CDN!

    Potential solution: make the local, staging, and live site share the same media pool under the same “domain” in Optimole’s CDN. (Not entirely sure if there is an option for that yet. If so, I haven’t figured it with current documentation.)

    * I usually avoid rollbacking my images. The reason being that doing so replace the URL of the image with my local URL (normal) and affect the “last edited” date of my blog posts (undesirable effect) on top of being a lengthy operation. Since the live site will be replaced by what’s in the staging very soon, I don’t care too much about that “last edited” date changes on the live site.

    I think there is another case where this 400 error happens where it was truly “random” (no deployment/dev copies installed recently). I’ll let you know when I’ll encounter this again.

    Hopefully this helps.

    • This reply was modified 3 years, 9 months ago by Nazrinn.
    • This reply was modified 3 years, 9 months ago by Nazrinn.
    • This reply was modified 3 years, 9 months ago by Nazrinn.
    Thread Starter Nazrinn

    (@nazrinn)

    I have found that I could rollback the missing image via the list view of the media library (for some reason it worked?). However it’s tedious because I could only rollback 5 images at the time, and there was about a few hundred missing.

    • This reply was modified 3 years, 9 months ago by Nazrinn.
Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Optimole images disapear from media library’ is closed to new replies.