I'm receiving 'GET image 404 errors

Hello, I have been trying to debug this issue for about two weeks and at this point I have come to a point where is nothing I can think of to resolve the issue. I’m finally posting now because the errors are only going to continue to get worse. The site I am working on is https://dwightslade.com

Everytime I delete an image either through the admin media interface or manually I get the 404 error. Even when I replace the image. For whatever reason these images are still being referenced and I’ve tried everything to resolve it.

I have cleared cash, deactivated plugins to check for plugin conflict I have also refreshed permalinks Nothing is fixing the issue. I also changed the theme to default 2017 for further debugging and this resolved the errors.

The slider image remains a 404 error even when the plugin is deactivated. So I don’t think it a conflict with LayerSlider but I don’t know for sure because there was a bigger issue with fonts but that was resolved when I deactivate LayerSlider and reactivated it. The fonts were resolved but still the missing image (which isn’t really missing) is still present. Only the reference to the earlier uploaded file is missing.

This issue is not just an issue with LayerSlider though. This is also causing problems when I deleted two images, one was a thumbnail preview in Essential Grid which was replaced with an optimized version. As soon as I deleted the non-optimized version, a new error appeared This happened also when I deleted a preview thumbnail and replaced with an optimized version with the same name in the skins folder of LayerSlider.

This continues to downgrade my pagespeed ratings because there are missing resource links that I can’t resolve. My fear is that anytime I delete an image this is going to be a problem.

My only idea here is that this is a jquery problem. Please help.

Here are the errors I’m receiving in the console:
GET https://dwightslade.com/wp-content/uploads/2018/08/Dry-Bar-Comedy-Preview.jpg 404 jquery-1.12.4.js:5 GET https://dwightslade.com/wp-content/uploads/2018/09/Ds-Hero-img3.jpg 404 (anonymous) @ jquery-1.12.4.js:5 Y @ jquery-1.12.4.js:3 n.fn.(anonymous function) @ jquery-1.12.4.js:5 r @ 24d65a8635fdbc03a6bf418ccdcb0271.js:12 (anonymous) @ 24d65a8635fdbc03a6bf418ccdcb0271.js:12 (anonymous) @ 24d65a8635fdbc03a6bf418ccdcb0271.js:12 (anonymous) @ 24d65a8635fdbc03a6bf418ccdcb0271.js:12 (anonymous) @ 24d65a8635fdbc03a6bf418ccdcb0271.js:12 f @ 24d65a8635fdbc03a6bf418ccdcb0271.js:12 (anonymous) @ 24d65a8635fdbc03a6bf418ccdcb0271.js:12 /wp-content/plugins/LayerSlider/static/layerslider/skins/v6/nothumb.png:1 GET https://dwightslade.com/wp-content/plugins/LayerSlider/static/layerslider/skins/v6/nothumb.png 404 Image (async) thumbnails @ VM2886:1 imagesOfSlide @ VM2886:1 changeTo @ VM2886:1 init @ VM2886:1 (anonymous) @ VM2886:1 setTimeout (async) (anonymous) @ VM2886:1 dispatch @ jquery-1.12.4.js:3 r.handle @ jquery-1.12.4.js:3 load (async) add @ jquery-1.12.4.js:3 a.event.add @ 24d65a8635fdbc03a6bf418ccdcb0271.js:1 (anonymous) @ jquery-1.12.4.js:3 each @ jquery-1.12.4.js:2 each @ jquery-1.12.4.js:2 sa @ jquery-1.12.4.js:3 on @ jquery-1.12.4.js:3 load @ VM2886:1 skins @ VM2886:1 initialized @ VM2886:1 global @ VM2886:1 load @ VM2886:1 t @ VM2886:1 (anonymous) @ VM2886:1 each @ jquery-1.12.4.js:2 each @ jquery-1.12.4.js:2 e.fn.layerSlider @ VM2886:1 (anonymous) @ 24d65a8635fdbc03a6bf418ccdcb0271.js:13 i @ jquery-1.12.4.js:2 fireWith @ jquery-1.12.4.js:2 ready @ jquery-1.12.4.js:2 K @ jquery-1.12.4.js:2t

Thanks
Pelan

Hi Pelan,

I checked and can see you have wp rocket installed. So when you delete images it’s possible that some of the cache files are still pointing to that old resource which causes the 404 error.

Everytime you make changes or delete something, plesae make sure to clear your plugin cache.

Thanks

@paul.r,

Thanks for the response. Yes, I have cleared plugin cache every time, and I also deleted old references to those files that were in cache/busting for example. I just tried clearing the cache from a specific page just to see if that might make a difference but I am still getting the errors. It still could be a caching issue but this is still an issue.

Also when I used the 2017 theme the errors were gone, and yet I still had wp-rocket active.

Hello There,

Please follow up the steps below:

  1. Ensure everything is up to date according to our version compatibility list here. Please follow the best practices when updating your theme and plugins. Click here for more information.
  2. Go to X > Settings and click on the Clear Style Cache button.
  3. If you’re using a CDN(ex: CloudFlare), please clear the CDN’s cache and disable optimization services. For the CloudFlare you also need to follow the steps below besides the developer mode: https://xthemetips.com/using-cloudflare-rocket-loader-with-x-pro-and-x5/928/1
  4. Test for a plugin conflict. You can do this by deactivating all third-party plugins, and see if the problem remains. If it’s fixed, you’ll know a plugin caused the problem, and you can narrow down which one by reactivating them one at a time.
  5. Remove custom CSS and Javascript from the options or Child Theme and test the case.
  6. Switch to the parent theme to check if the issue persists.
  7. Reset your htaccess file by renaming it to .htaccess-bak. Then in WP Admin Menu, go to Settings > Permalinks and just click the Save Changes button.
  8. Turn off all the cache plugins.

If you still have problems kindly get back to us with the result of the steps above and URL/User/Pass of your WordPress dashboard using the Secure Note functionality of the post to follow up the case.

Thank you.

@thai Thank you.

I just wanted to let you know that these steps you provided are all standard measures I take before ever requesting support. It is very rare that I even have to post a support thread in the forum because I try to debug it myself. Although the method takes me more time; I usually resolve the matter through research and often methods found by searching this forum. This forum has proven very helpful.

With that said, there were a few things in the list, I hadn’t been made aware of like the Cornerstone page rule declaration in Cloudflare. I was hoping that would have resolved the issue but it did not. Just to make certain I exhausted all of my efforts, I went through this list of mesures again.

A detailed list of steps I took are below. In my next post, I’ll provide you with a secure login to my staging site. It has the same issue but only with the original image error and that is it. I have not removed those other images for optimization in staging as there wasn’t a need.

Important!:
Staging is going to look almost the same and using the same top level domain. You’ll know it is staging because it clearly labeled in the footer

These Errors still were present through all of the steps taken listed below!

##Caching Steps:

  • I first made the page rule in Cloudflare only after I cleared the WP Rocket Cache, Cloudflare cache and the Pro styling cache.
  • The declaration I uses was mysite.com/pro ( Note: I did not use https):
  • Cloudflare is paused, in dev mode with all DNS records offline and all minifications unchecked.
  • Caching purged several times over these steps taken

I cleared the cache from the browser and this was almost always performed in every stage. I also using incognito mode. Testing reloads were almost always while I had the console open and I also performed refreshes using the ‘emptying cache and hard reloads’ methode while in Chrome.

Similarly, I performed redundant testing in Safari, and Firefox using their development tools and private tabs clearing browser history in each of those browser environments.

##.htaccess rebuilding & permalink refreshing

  • I backed up the .htaccess, and updated the permalinks structure
  • I followed the caching method described above through these steps
  • I double checked for the new .htaccess state verifying it was newly generated with only the WordPress rewrites inside the file.

##Plugin Conflict Checks:

  • All plugins are up to date as well as the theme.
    Note:You should update your versions list ( Pro is up to v2.3.8 now) Under Construction is v2.4)

  • I deactivated all plugin. The error still persists so there was no need to reinstate them in stages.

  • I followed caching method described above through these steps.

  • I deleted the entire caching folder from WP Rocket,

  • I made a backup of advanced-cache.php file and deleted the wp-rocket config folder

  • All WP Rocket caching instances were deleted

  • I followed caching method described above through these steps.

##Custom functions, and css/js scripts handling
Note: Standard procedure for me is to replicate Pro Theme structure inside the Child theme folder for any customization I might do. If I have a lot of functions I’ll move them to the structured files otherwise I will leave them in functions.php. In this case that is where the functions are stored. Things usually will get moved later when the project is complete.

I enqueue all styles and scripts into proper folder structure
(/includes/ .css
(/includes/js/.js

  • I removed all custom code from functions.php
  • I removed all styling.
  • I only temporarily inline style to make sure it looks good and works on the fly. If it does it gets moved. I don’t believe I have any inline styling. It’s all in .css files
  • I followed caching method described above through these steps.

Theme Conflict Checks

I had already tried this step but this time I had all custom code and styling removed and plugins deactivated before testing the parent theme.

The errors still remain through ll of these steps and only resolve when I use a default theme.

The logs are here:

Safari Console Error log:

[Error] Failed to load resource: the server responded with a status of 404 () (cs-head.js.map, line 0)
[Error] Failed to load resource: the server responded with a status of 404 () (x.js.map, line 0)
[Error] Failed to load resource: the server responded with a status of 404 () (cs-body.js.map, line 0)

##Chrome Log Error Log

`GETdwightslade.com/staging/wp-content/uploads/2018/09/Ds-Hero-img3.jpg 404  
 jquery.js?ver=1.12.4:5` 

(anonymous) @ jquery.js?ver=1.12.4:5
Y @ jquery.js?ver=1.12.4:3
n.fn.(anonymous function) @ jquery.js?ver=1.12.4:5
r @ cs-body.js?ver=3.3.8:1
(anonymous) @ cs-body.js?ver=3.3.8:1
(anonymous) @ cs-body.js?ver=3.3.8:1
(anonymous) @ cs-body.js?ver=3.3.8:1
(anonymous) @ cs-body.js?ver=3.3.8:1
f @ cs-body.js?ver=3.3.8:1
(anonymous) @ cs-body.js?ver=3.3.8:1 

I hope this info is useful
I’d still appreciate continued help resolving this problem.

Hi,

I checked the console and can see one image returnning a 404

Then I checked your site’s source code and can see that you have added is as backround on one of your row.

So most probably you have deleted that image in Media Library.

Please note that when you delete an image in Media Library, it does not automatically remove/update elements in your pages that refers to that image. You will need to remove/update that manually.

Thanks

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.