Title: 502 error retrieving thumbnails
Last modified: August 31, 2016

---

# 502 error retrieving thumbnails

 *  Resolved [adijeff](https://wordpress.org/support/users/adijeff/)
 * (@adijeff)
 * [10 years, 5 months ago](https://wordpress.org/support/topic/502-error-retrieving-thumbnails/)
 * I have just updated to the latest version (1.9.2) and I’m now getting bad gateway
   errors (502) when retrieving all thumbnail images. I notice the [latest review](https://wordpress.org/support/topic/not-working-anymore-61?replies=1)
   says the same thing.
 * Possibly a bug, or coincidence? I’m not sure where to start diagnosing.
 * [https://wordpress.org/plugins/wp-instagram-widget/](https://wordpress.org/plugins/wp-instagram-widget/)

Viewing 15 replies - 1 through 15 (of 37 total)

1 [2](https://wordpress.org/support/topic/502-error-retrieving-thumbnails/page/2/?output_format=md)
[3](https://wordpress.org/support/topic/502-error-retrieving-thumbnails/page/3/?output_format=md)
[→](https://wordpress.org/support/topic/502-error-retrieving-thumbnails/page/2/?output_format=md)

 *  Plugin Author [Scott (@scottsweb)](https://wordpress.org/support/users/scottsweb/)
 * (@scottsweb)
 * [10 years, 5 months ago](https://wordpress.org/support/topic/502-error-retrieving-thumbnails/#post-6930207)
 * Hi
    Is the bad gateway error on your own site or on Instagram? Can you find the
   PHP logs for your site and post back anything referring to the Instagram widget.
 * The latest review pre-dates this release (1.9.2) and does not coincide with any
   other release so I have no idea what the problem is there.
 *  Thread Starter [adijeff](https://wordpress.org/support/users/adijeff/)
 * (@adijeff)
 * [10 years, 5 months ago](https://wordpress.org/support/topic/502-error-retrieving-thumbnails/#post-6930213)
 * Ah, I didn’t notice the review date, sorry.
 * Instagram looks fine, it is getting the image from instagram that generates the
   502 error. The errors show in the developer tools console:
 * GET [http://scontent.cdninstagram.com/s160x160/&#8230](http://scontent.cdninstagram.com/s160x160/&#8230);
   502 (Bad Gateway)
 * There are no errors in the log file.
 *  Plugin Author [Scott (@scottsweb)](https://wordpress.org/support/users/scottsweb/)
 * (@scottsweb)
 * [10 years, 5 months ago](https://wordpress.org/support/topic/502-error-retrieving-thumbnails/#post-6930214)
 * Can you provide a link to your Instagram account so I can test it. It sounds 
   like your images are using a different CDN url format. If you could provide a
   link to your site that would be good too.
 *  Thread Starter [adijeff](https://wordpress.org/support/users/adijeff/)
 * (@adijeff)
 * [10 years, 5 months ago](https://wordpress.org/support/topic/502-error-retrieving-thumbnails/#post-6930215)
 * It’s a client’s instagram: [https://www.instagram.com/ollystabler/](https://www.instagram.com/ollystabler/)
   and his site is [http://www.ollystabler.com/](http://www.ollystabler.com/) (see
   footer, right)
 *  Plugin Author [Scott (@scottsweb)](https://wordpress.org/support/users/scottsweb/)
 * (@scottsweb)
 * [10 years, 5 months ago](https://wordpress.org/support/topic/502-error-retrieving-thumbnails/#post-6930219)
 * Just ran quick test on my local setup and the username is working for me: [https://dl.dropboxusercontent.com/u/3019972/screenshots/160111-161608.png](https://dl.dropboxusercontent.com/u/3019972/screenshots/160111-161608.png)
 * I would recommend flushing your transients, there is a plugin to help with that:
   [https://wordpress.org/plugins/artiss-transient-cleaner/](https://wordpress.org/plugins/artiss-transient-cleaner/)
 *  Thread Starter [adijeff](https://wordpress.org/support/users/adijeff/)
 * (@adijeff)
 * [10 years, 5 months ago](https://wordpress.org/support/topic/502-error-retrieving-thumbnails/#post-6930225)
 * Thanks for your efforts Scott.
 * Transients flushed, but still the same unfortunately. Here is the generated HTML
   of the first thumbnail:
 * `<img src="////scontent.cdninstagram.com/s160x160/hphotos-xpf1/t51.2885-15/s640x640/
   sh0.08/e35/12393624_1027999930577038_1127942759_n.jpg" alt="Behind the scenes
   from today's shoot" title="Behind the scenes from today's shoot" class="">`
 *  Plugin Author [Scott (@scottsweb)](https://wordpress.org/support/users/scottsweb/)
 * (@scottsweb)
 * [10 years, 5 months ago](https://wordpress.org/support/topic/502-error-retrieving-thumbnails/#post-6930228)
 * This is the HTML I am seeing generated for the first image on my local account:
 * `<img src="//scontent-lhr3-1.cdninstagram.com/hphotos-xpf1/t51.2885-15/s160x160/
   sh0.08/e35/12393624_1027999930577038_1127942759_n.jpg" alt="Behind the scenes
   from today's shoot" title="Behind the scenes from today's shoot" class="">`
 * So the difference here is the CDN partly (mine is at LHR), yours seems more generic
   and possibly missing something. You also have far too many forward slashes at
   the start which is unusual.
 * For now I would roll back the plugin to this version: [https://github.com/scottsweb/wp-instagram-widget/blob/c66550eded59bd51f508f304a85a3e031ac4044c/wp-instagram-widget.php](https://github.com/scottsweb/wp-instagram-widget/blob/c66550eded59bd51f508f304a85a3e031ac4044c/wp-instagram-widget.php)
 *  Thread Starter [adijeff](https://wordpress.org/support/users/adijeff/)
 * (@adijeff)
 * [10 years, 5 months ago](https://wordpress.org/support/topic/502-error-retrieving-thumbnails/#post-6930239)
 * Thanks Scott, v 1.9.1 gives no 502 errors, and the thumbnails appear fine. For
   reference, the generated code is:
 * `<img src="//scontent.cdninstagram.com/hphotos-xpf1/t51.2885-15/s160x160/sh0.08/
   e35/12393624_1027999930577038_1127942759_n.jpg" alt="Behind the scenes from today's
   shoot" title="Behind the scenes from today's shoot" class="">`
 * As you say, there are two extra forward slashes. Very strange.
 *  Plugin Author [Scott (@scottsweb)](https://wordpress.org/support/users/scottsweb/)
 * (@scottsweb)
 * [10 years, 5 months ago](https://wordpress.org/support/topic/502-error-retrieving-thumbnails/#post-6930248)
 * Very odd, I have tried hard coding your good URL into my local version running
   1.9.2 and I still get the expected result – a working URL at the end:
 * In:
    `https://scontent.cdninstagram.com/hphotos-xpf1/t51.2885-15/sh0.08/e35/12393624_1027999930577038_1127942759_n.
   jpg`
 * Out:
    `<img src="//scontent.cdninstagram.com/hphotos-xpf1/t51.2885-15/s160x160/
   sh0.08/e35/12393624_1027999930577038_1127942759_n.jpg" alt="Behind the scenes
   from today's shoot" title="Behind the scenes from today's shoot" class="">`
 * I am completely confused. Let’s see if more people report bugs.
 *  Thread Starter [adijeff](https://wordpress.org/support/users/adijeff/)
 * (@adijeff)
 * [10 years, 5 months ago](https://wordpress.org/support/topic/502-error-retrieving-thumbnails/#post-6930254)
 * Thanks for your efforts and quick response Scott – really appreciated.
 *  [dohnutt](https://wordpress.org/support/users/dohnutt/)
 * (@dohnutt)
 * [10 years, 5 months ago](https://wordpress.org/support/topic/502-error-retrieving-thumbnails/#post-6930335)
 * Hey Scott, I’m getting the same issue in the footer here: [http://ericmoss.ca](http://ericmoss.ca)
 *  Plugin Author [Scott (@scottsweb)](https://wordpress.org/support/users/scottsweb/)
 * (@scottsweb)
 * [10 years, 5 months ago](https://wordpress.org/support/topic/502-error-retrieving-thumbnails/#post-6930368)
 * I am going to need some help debugging this from all you folks that encounter
   this issue. Due to my geographic location I am seeing images served from Instagram
   on different URLs and it is making it very hard to debug.
 * Firstly I would like you to try this version of the plugin: [https://github.com/scottsweb/wp-instagram-widget/blob/master/wp-instagram-widget.php](https://github.com/scottsweb/wp-instagram-widget/blob/master/wp-instagram-widget.php)
 * I have just reverted some of the changes I made yesterday, I hoping it catches
   it. If not we will need to go through a number of debugging steps.
 * Let me know how you get on
 *  [BrianShrader](https://wordpress.org/support/users/brianshrader/)
 * (@brianshrader)
 * [10 years, 5 months ago](https://wordpress.org/support/topic/502-error-retrieving-thumbnails/#post-6930419)
 * I’m getting the same issue on my client’s blog:
    [http://shradersworld.com/clients/caroline/blog/](http://shradersworld.com/clients/caroline/blog/)
 * I’m a developer (though new-ish to PHP) and would love to help you debug this.
   Let me know what I can do to help.
 *  Plugin Author [Scott (@scottsweb)](https://wordpress.org/support/users/scottsweb/)
 * (@scottsweb)
 * [10 years, 5 months ago](https://wordpress.org/support/topic/502-error-retrieving-thumbnails/#post-6930426)
 * [@brianshrader](https://wordpress.org/support/users/brianshrader/) great! thank
   you. Please can you try this version of the plugin: [https://github.com/scottsweb/wp-instagram-widget/blob/master/wp-instagram-widget.php](https://github.com/scottsweb/wp-instagram-widget/blob/master/wp-instagram-widget.php)
 * and report back your findings.
 *  [george.grigorita](https://wordpress.org/support/users/georgegrigorita/)
 * (@georgegrigorita)
 * [10 years, 4 months ago](https://wordpress.org/support/topic/502-error-retrieving-thumbnails/#post-6930429)
 * Hi Scott,
 * I had the same problem (502 error) but only when I switched the photo size format(
   i.e. from Large to Thumbnail, or Small). With the new version everything works
   as it should.
 * If you need more testing done let me know 🙂

Viewing 15 replies - 1 through 15 (of 37 total)

1 [2](https://wordpress.org/support/topic/502-error-retrieving-thumbnails/page/2/?output_format=md)
[3](https://wordpress.org/support/topic/502-error-retrieving-thumbnails/page/3/?output_format=md)
[→](https://wordpress.org/support/topic/502-error-retrieving-thumbnails/page/2/?output_format=md)

The topic ‘502 error retrieving thumbnails’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/wp-instagram-widget_d7eadd.svg)
 * [WP Instagram Widget](https://wordpress.org/plugins/wp-instagram-widget/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/wp-instagram-widget/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/wp-instagram-widget/)
 * [Active Topics](https://wordpress.org/support/plugin/wp-instagram-widget/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wp-instagram-widget/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wp-instagram-widget/reviews/)

 * 37 replies
 * 7 participants
 * Last reply from: [Scott (@scottsweb)](https://wordpress.org/support/users/scottsweb/)
 * Last activity: [10 years, 4 months ago](https://wordpress.org/support/topic/502-error-retrieving-thumbnails/page/3/#post-6930544)
 * Status: resolved