Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multiple plugins updates often leads to "Fetch failed" error #1301

Closed
ghost opened this issue Feb 10, 2017 · 26 comments
Closed

Multiple plugins updates often leads to "Fetch failed" error #1301

ghost opened this issue Feb 10, 2017 · 26 comments
Assignees

Comments

@ghost
Copy link

ghost commented Feb 10, 2017

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.

@paulhibbitts
Copy link

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

@rhukster
Copy link
Member

rhukster commented Feb 10, 2017

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

@flaviocopes flaviocopes self-assigned this Feb 10, 2017
@axel-rank
Copy link

axel-rank commented Feb 10, 2017

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

@flaviocopes
Copy link
Contributor

Which browser are you using? Firefox?

@axel-rank
Copy link

Yes, Firefox 51.0.1.

@ghost
Copy link
Author

ghost commented Feb 11, 2017

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

@paulhibbitts
Copy link

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

@flaviocopes
Copy link
Contributor

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

@flaviocopes
Copy link
Contributor

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.

@flaviocopes
Copy link
Contributor

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

@flaviocopes
Copy link
Contributor

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

screen shot 2017-02-11 at 17 55 13

Chrome works fine.

@w00fz
Copy link
Member

w00fz commented Feb 12, 2017

I'll look into this

@w00fz w00fz assigned w00fz and unassigned flaviocopes Feb 12, 2017
@w00fz
Copy link
Member

w00fz commented Feb 12, 2017

This is now fixed with getgrav/grav-plugin-admin@b5384a4.

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. (getgrav/grav-plugin-admin@f547781#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 🙂

@w00fz w00fz closed this as completed Feb 12, 2017
@paulhibbitts
Copy link

Thanks so much @w00fz and @flaviocopes!

@flaviocopes
Copy link
Contributor

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.

@Duke3D
Copy link

Duke3D commented Apr 12, 2017

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.

@flaviocopes
Copy link
Contributor

@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?

@adrian5
Copy link

adrian5 commented Jul 10, 2017

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

@rhukster
Copy link
Member

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.

@jgonyea
Copy link
Contributor

jgonyea commented Jul 10, 2017

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

@rhukster
Copy link
Member

How about chrome?

@jgonyea
Copy link
Contributor

jgonyea commented Jul 10, 2017

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

@jgonyea
Copy link
Contributor

jgonyea commented Jul 10, 2017

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

@ghost
Copy link
Author

ghost commented Jul 10, 2017

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

@jgonyea
Copy link
Contributor

jgonyea commented Jul 10, 2017

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.

@w00fz
Copy link
Member

w00fz commented Jul 10, 2017

This should be fixed now with getgrav/grav-plugin-admin@e0f9fd2

Cheers

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

8 participants