firebase-tools icon indicating copy to clipboard operation
firebase-tools copied to clipboard

Can't deploy my project to hosting. Crashes my internet

Open fiere210 opened this issue 7 years ago • 5 comments

[REQUIRED] Environment info

firebase-tools: 6.3.1

Platform: Windows 10

[REQUIRED] Test case

Whenever I try to deploy a Ionic project to Firebase Hosting, it gets stuck at 3-5%. After a couple of minutes it simple crashes my internet connection for like 10-15 minutes.

[REQUIRED] Steps to reproduce

Create a new Ionic project (ionic start test-project) Build Production version (ionic build --prod) Add firebase to the project (firebase init) Select www folder as Firebase public folder Single page YES Override index.html NO Run firebase deploy

[REQUIRED] Expected behavior

The project deploys correctly

[REQUIRED] Actual behavior

It gets stuck at 33/** files, one time 43/** files, and if I wait for a couple of minutes, my internet crashes (I think it's mainly the dns but still). I have tried this multiple times on different days with no success.

This is my firebase-debug.log https://pastebin.com/phkHn7uL

fiere210 avatar Feb 16 '19 14:02 fiere210

First off, thank you for supplying your firebase-debug.log it really makes things easier.

My first thought is that it successfully uploading some of your files, but getting stuck on one particular batch of them maybe because it is taking too long to upload and it is timing out. I'll dig into the code a bit to confirm if that lines up with the log lines.

I got a couple of questions that might help me explain things:

  • What do you mean by your internet crashes?
    • Like all bandwidth stops across everything for a little while?
    • Does it come back on its own or do you have to restart it?
  • What is your internet speed?
    • Do you happen to have a bandwidth quota on it?
  • Do you have any large files that you're trying to deploy? (>10 MiB)
    • What is the overall size of all of your files?

Memeriaj avatar Feb 20 '19 01:02 Memeriaj

From the debug file it seems that the local hashing all of the files you were trying to deploy finished (line 31) and then sending Hosting all of the file paths and their content hashes finished (line 36) . It looks like one upload finished (line 38) but all of the rest of the parallel uploads failed and retried. It appears that the connection timed out (lines 1039-1044), which I suspect is not an issue with the Hosting sever and I think is more likely an issue with your network connection. It appears that from the start of the uploads (line 37) to when it failed (line 1040) it took about ~2.5 minutes for the uploads to hit the maximum number of retries.

Bad news: I suspect that normally the CLI is attempting to upload too much too quickly for you. You might try to turn down the number of parallel uploads (there isn't a flag for this right now but you can edit the file directly) and see if that helps at all.

Good news: Hosting will remember each of the files (by the hash of its contents) that you successfully upload for a period of time, even if the deploy fails overall. That means that each file you uploaded gets you closer to a successful deploy.

Memeriaj avatar Feb 20 '19 17:02 Memeriaj

Hi, thanks for your response. It must be an issue with my internet connection at home because I just tried at my workplace and everything was OK. But still is pretty weird because my internet connection at home is decent (~30mb). To answer your questions:

  • What do you mean by your internet crashes?

I mean that i can't access any site by domain, but most of the times that I tried I could access by IP address, so it probably crashes the DNS or something? My phone also could not access any site (I didn't tried by IP with it).

  • Does it come back on its own or do you have to restart it?

Yes, after like 10 minutes it come back on its own. Btw I was connected with WI-FI, and the icon at the bottom right of my screen was displaying normal internet connection.

  • What is your internet speed?

30 mb

*Do you happen to have a bandwidth quota on it?

No, just a normal internet connection

*Do you have any large files that you're trying to deploy? (>10 MiB)

No, just a bunch of js files and some small icons

  • What is the overall size of all of your files?

The whole folder is 3mb

You might try to turn down the number of parallel uploads

Thanks, that looks promising. I will try this as soon as I get home and I'll post my results.

fiere210 avatar Feb 20 '19 20:02 fiere210

I think that fixed the issue. I tried changing the parallel uploads and it worked fine, then I went back to the default value and worked fine again... I swear I tried to deploy in different days and different hours to make sure it wasn't a problem with my internet. Maybe I was unlucky or maybe the parallel uploads change did something to make it work again with the default settings. Anyway the problem is solved, thank you very much for the help.

fiere210 avatar Feb 21 '19 00:02 fiere210

Awesome, that is good to hear. Glad I could help.

Memeriaj avatar Feb 21 '19 00:02 Memeriaj