codemonauts / craft-instagram-feed

Craft CMS plugin to receive Instragram feed data as variable in templates
MIT License
27 stars 7 forks source link

Error - Unknown Account #61

Closed rossthomson89 closed 2 years ago

rossthomson89 commented 2 years ago

Describe the bug: Hi there! I've recently ran into a bug which seemed to appear out of nowhere....

I've been working on a site and was using your plugin without any issue, until today I came across an "Unknown Account" error on the front end. The plugin worked fine for several weeks and I haven't changed anything in the code for the feed and the control panel settings haven't been touched.

As far as I can tell from the logs the feed is being found but I'm still being met with the "Unknown Account" error on the front end:

2022-06-13 18:14:25 [-][1][-][profile begin][Twig template] render template: _includes/_content-builder/_blocks/instagramFeed 2022-06-13 18:14:25 [-][1][-][trace][codemonauts\instagramfeed\services\InstagramService::getFeed] Get feed for "portiaknightseaweed" 2022-06-13 18:14:25 [-][1][-][trace][codemonauts\instagramfeed\services\InstagramService::getFeed] Returning cached items. 2022-06-13 18:14:25 [-][1][-][profile end][Twig template] render template: _includes/_content-builder/_blocks/instagramFeed 2022-06-13 18:14:25 [-][1][-][profile end][Twig template] render block: content

Can you think of any ideas why the plugin would suddenly stop working and throw up a "Unknown Account" error after working fine for several weeks? Could this relate to the feature update by instagram? I saw you have an update for the Craft 4 version of the plugin so thought it could be related.

Any advise would be much appreciated!

Thanks Ross

Steps to reproduce:

  1. Install the plugin
  2. Use default code
  3. Add Instagram username in the settings section of the control panel

Where is it happening?

What are you requesting: Username: portiaknightseaweed Hashtag: N/A

Config file: instagramfeed: edition: standard enabled: true schemaVersion: 1.0.0 settings: dump: false instagramUser: portiaknightseaweed proxyKey: XXXXXXXXXXXXXX subpath: '' timeout: 10 useGuzzle: true useProxy: true useVolume: '' userAgent: 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.75 Safari/537.36' volume: s3

Software versions: Plugin Version: 1.1.8 PHP Version: 7.4 CraftCMS Version: 3.7.44

bossanova808 commented 2 years ago

I presume this is because of the Instagram changes (see: recent commits - https://github.com/codemonauts/craft-instagram-feed/commits/master)

The V2.0+ of this plugin solves - however, that version is Craft 4 only - which seems quite premature. I know Craft 4 is out, but the vast bulk of sites will not yet have moved (as they'll be waiting on various other updates, realistically...).

@kringkaste - any chance that you can make a Craft 3 version available/working again??

fleaz commented 2 years ago

@bossanova808 The required changes have been released for Craft3 on the same day like the Craft4 release. You just need to check the craft3 branch ;) And the plugin store should also show you 1.1.8 which is the required update for Craft3.

@rossthomson89 Thanks for the detailed issue. "Unknown account" means that you successfully talked to our proxy but we didn't get any images for this account. We already discovered this in the past for hashtags, that they sometimes don't return any images but we haven't seen this for accounts yet. I will look into this and let you know if I find something.

rossthomson89 commented 2 years ago

@fleaz Thanks for the reply and taking the time to look at this!

Just to add to the mystery it seems to work fine if I use my own companies handle (fortytwo_studio) or one of the clients hashtags (#ebbandupwell). Just doesnt seem to like "portiaknightseaweed" as a handle for some reason... "portiaknightseaweed" worked just fine for a week or so before throwing a wobble

bossanova808 commented 2 years ago

An well I presumed wrongly then...sorry! I am on 1.1.8

Well, in any case, we are seeing this too, with our handle imagescience

adamhenretty commented 2 years ago

I had the same issue in Craft 3 after updating the plugin, but clearing the caches in the craft control panel fixed the issue for me.

fleaz commented 2 years ago

I had the same issue in Craft 3 after updating the plugin, but clearing the caches in the craft control panel fixed the issue for me.

Our proxy consists of a lot of accounts behind a loadbalancer. The current problem is that IG sometimes blocks one of the accounts (which we need to detect) and then the proxy thinks the account you requested doesn't exists and you get the "Unknown account" error. Therefore when you clear the cache, you make a new request to our proxy and get a different of our account which then works.

rossthomson89 commented 2 years ago

@fleaz - Cleared the cache in the Control Panel (CMS) and the feed is now working again. Thank you!

fleaz commented 2 years ago

But keep in mind that it's not a permanent fix for the problem. You just had luck and din't catched the broken account behind the loadbalancer.

I'm currenly working on a way to detect the root cause and will close this issue as soon as it's permanently fixed :)

fleaz commented 2 years ago

Has been fixed now and shouldn't happen anymore.

bossanova808 commented 1 year ago

Unfortunately I am seeing this again this morning - just a sudden 'Unknown Account' for imagescience - no other changes at our end.

thisiscap commented 1 year ago

Also seeing this issue (Unknown Account) with the following: Plugin Version: 1.1.8 PHP Version: 8.1.7 CraftCMS Version: 3.7.48

Clearing Craft CMS caches didn't make any change.

fleaz commented 1 year ago

We indeed had a problem with the proxy yesterday where multiple accounts were marked as "Unknown". This has already been fixed yesterday and you should already see the correct data again. We also build monitoring to catch such problem faster in the future. Sorry for the inconvenience!