Grav: Multiple plugins updates often leads to "Fetch failed" error

Created on 10 Feb 2017  Â·  26Comments  Â·  Source: getgrav/grav

2017-02-10_17-42-07

Testing locally use WAMPSERVER - I've found this on many of my local GRAV updates that I get a networkerror when doing multiple plugin updates and this can sometimes wreck site too. Single updates appear to work ok.

admin bug

Most helpful comment

This is now fixed with https://github.com/getgrav/grav-plugin-admin/commit/b5384a4f8de4ff1a468791769a1540bf762e31e6.

The issue was that for each plugin getting updated, the callback was invoked. This caused confusion in Firefox probably because the callback includes a window reload.

It might also explain the issue we had with the admin after updating plugins, where some of them didn't show as updated. A couple months back I was forced to set a timeout before refreshing to fix this. (https://github.com/getgrav/grav-plugin-admin/commit/f5477817b7fe39981b2e1d52b5b42741ac68ae97#diff-f6fb147006cc04a8d7adc70c5f261972).

I have now fixed the issue using Promises and only invoking the callback once when all the promises are fulfilled. Please give it a try.

Btw for the future, admin issues should be filed under getgrav/grav-plugin-admin 🙂

All 26 comments

I also get this error quite often, using MAMP locally on a Mac.

@flaviocopes you have mamp, ever seen this? I've never had a problem with my apache setup.

Yes, I can confirm. Had this issue just now on latest Grav/Admin/Form Update
Single plugin updates --> no error message
Multiple plugins --> Fetch Failed Network Error message
But all plugins are updated

Which browser are you using? Firefox?

Yes, Firefox 51.0.1.

Yes Firefox 51.0.1 (64 bit) for me too on Windows 10.

I most often use Firefox (Mac) when testing locally too.

This looks like a Firefox issue - could not replicate in Chrome, but I could replicate it on Firefox.

The problems seems to be that on Firefox, the Fetch network calls are failing (not returning a 200), while on Chrome they do.

This seems to me a Fetch implementation issue, or quirk, as the same issue can be seen on Firefox by clicking on the Dashboard "Check for updates", and then click something else: a red "Fetch error" appears, because the Fetch request is immediately closed with no 200 return code. @w00fz could this be possible? I see FF supports Fetch natively, so it's not a polyfill problem.

Example, installing 3 plugins altogether:

Firefox (weird):

screen shot 2017-02-11 at 17 53 55

Chrome (normal):

screen shot 2017-02-11 at 17 53 36

Clicked "Add" right after "Check for updates", FF

screen shot 2017-02-11 at 17 55 13

Chrome works fine.

I'll look into this

This is now fixed with https://github.com/getgrav/grav-plugin-admin/commit/b5384a4f8de4ff1a468791769a1540bf762e31e6.

The issue was that for each plugin getting updated, the callback was invoked. This caused confusion in Firefox probably because the callback includes a window reload.

It might also explain the issue we had with the admin after updating plugins, where some of them didn't show as updated. A couple months back I was forced to set a timeout before refreshing to fix this. (https://github.com/getgrav/grav-plugin-admin/commit/f5477817b7fe39981b2e1d52b5b42741ac68ae97#diff-f6fb147006cc04a8d7adc70c5f261972).

I have now fixed the issue using Promises and only invoking the callback once when all the promises are fulfilled. Please give it a try.

Btw for the future, admin issues should be filed under getgrav/grav-plugin-admin 🙂

Thanks so much @w00fz and @flaviocopes!

You're right!
As with the backup example, the "fetch failed" comes from the browser navigating to another page. On Chrome/Safari, the request is halted but we don't get this error. On Firefox on the other hand, when navigating away and a Fetch request is still running, the error pops up.

The issue has returned with an upgrade to Admin 1.3 running on XAMPP.
Initial dashboard load, navigating configuration tabs, launching multiple plugin updates, opening pages for editing from the Pages list view.. The loads/next tasks do not fail. It just appears that processes waiting for a callback throw an error when clicking away.

@Duke3D which browser are you using?

I can replicate this on Firefox, where it's annoying. Fetch raises an error whenever a network connection is active and you click away.

The only way I found to stop this is to detect the error message, and if it's "NetworkError when attempting to fetch resource.", do not raise any error, but silently fail. Since comparing the error message does not look like a proper way to determine that kind of problem to me (but works), @w00fz do you have any other suggestion on how to solve this?

I'm again running into this issue, as described by Duke3D, as well. It has disappeared from my local environment, but I've taken the site online and there it occurs constantly (maybe network latency is relevant) – almost every click. Any ideas how to tackle this? The site is to be administrated by someone else, so this recurring flashing error message leaves a terrible impression.

task_post_error

It's a tricky one because its only happening for very people folks and is almost certainly something related to how the server is setup/configured. It is probably some security software on the server or some configuration option that is limiting certain calls.

I think the first thing to do is to try to contact your hosting provider and ask them about anything that could potentially interfering.

I also have the problem:
XAMPP Portable, running locally on a flash drive, PHP7
Firefox browser

How about chrome?

No, Chrome doesn't display the error message
Windows 10x64
Chrome v59.0.3017.115 Official build,
Firefox v55.0b7 (32-bit)

Edge (40.15063.0.0) and IE (v11.413.15063.0) also work fine.

I am not sure if this helps or not but it;s easy to reproduce these "fetch failed" errors in Firefox on a PC. Simply go to the GRAV dashboard and, whilst the spinner are still going for notifications and news feeds, click on "Gantry 5" and you'll see the error.

2017-07-10_20-48-19

I don't have Gantry installed, but if you mash a bunch of the admin menus on the left, I was able to reproduce the error as well.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ekumlin picture ekumlin  Â·  37Comments

fabrizioT picture fabrizioT  Â·  26Comments

giansi picture giansi  Â·  17Comments

ursbraem picture ursbraem  Â·  29Comments

joville picture joville  Â·  23Comments