Firebase hosting deployment failing
Asked Answered
E

10

16

Running firebase deploy will run for a few minutes before giving me a timeout error Error: ESOCKETTIMEDOUT

I've successfully deployed multiple times earlier, without changing anything but the frontend of my project (written in React).

I have a separate folder with my cloud functions, which deploy perfectly with firebase deploy --only functions

I've tried regular deployment with firebase deploy as well as with --except functions flag but with no luck.

Also tried updating npm and firebase-tools

running firebase deploy --debug yields the following error after a few minutes:

[2019-09-12T16:25:59.115Z] FirebaseError: Task 6822eef99ebcce0df4baf9cc03e49b399d046c7cdfeb5b2a2ef2511c1df963d1 failed: retries exhausted after 6 attempts
[2019-09-12T16:25:59.115Z] [hosting][upload queue][FINAL] max=7278, min=7278, avg=7278, active=4, complete=2, success=1, errored=1, retried=25, total=6, elapsed=192701
[2019-09-12T16:25:59.127Z] FirebaseError: Task f98dce8e7830e8cd5881bc5e109453c208ff7fc643d61ad64ca34a7d098abc2c failed: retries exhausted after 6 attempts
[2019-09-12T16:25:59.127Z] FirebaseError: Task 5a7166c6cab1624c8a0c074fc535a23685c338be838012dced4006be3cc6dedd failed: retries exhausted after 6 attempts
[2019-09-12T16:25:59.128Z] FirebaseError: Task 76dd5b5551e5cd383875692455ff415bf8df56c97f67e4a3746e3c53c23478e1 failed: retries exhausted after 6 attempts
[2019-09-12T16:25:59.129Z] FirebaseError: Task 541bb1a8843dd0c62ea7e673f2260c85e0b456f35cfde358b6ab3be936e9c705 failed: retries exhausted after 6 attempts
[2019-09-12T16:25:59.211Z] Error: ESOCKETTIMEDOUT
    at ClientRequest.<anonymous> (/usr/local/lib/node_modules/firebase-tools/node_modules/request/request.js:816:19)
    at Object.onceWrapper (events.js:298:28)
    at ClientRequest.emit (events.js:209:13)
    at ClientRequest.EventEmitter.emit (domain.js:476:20)
    at TLSSocket.emitRequestTimeout (_http_client.js:690:9)
    at Object.onceWrapper (events.js:298:28)
    at TLSSocket.emit (events.js:209:13)
    at TLSSocket.EventEmitter.emit (domain.js:476:20)
    at TLSSocket.Socket._onTimeout (net.js:468:8)
    at listOnTimeout (internal/timers.js:531:17)

Error: Task 6822eef99ebcce0df4baf9cc03e49b399d046c7cdfeb5b2a2ef2511c1df963d1 failed: retries exhausted after 6 attempts
Excursus answered 12/9, 2019 at 16:43 Comment(2)
Could be related to Hosting incident #19015 ... see also very similar issue on Stack Overflow.Snotty
thanks for the find, I was going crazy trying to figure out what changes broke my deploy builds! @SnottyHardihood
D
33

Delete the hidden folder in you project root directory.

.firebase/hosting.*.cache

Dail answered 25/5, 2020 at 8:45 Comment(2)
I had a same issue and resolved it by deleting .firebase folder.Dail
thanks. it also fixed my case. In my case I didn't delete it but renamed the cache file, just in case I need to restore it, but it wasn't necessary, deploy created a new cache file that worked!Veloz
L
9

Deleting the .firebase folder and tried firebase deploy command again. Things seemed to be working fine.

Linsang answered 2/7, 2020 at 4:59 Comment(0)
E
2

As @thmsdnnr mentioned, it seems that this error was caused by issues at firebase. Tried a new deployment first thing in the morning and everything went through first try.

Excursus answered 13/9, 2019 at 6:35 Comment(0)
C
1

There are two reasons to happen this.

  1. by deleting .firebase folder in your root folder will solve problem. if this dosen't work,
  2. your internet connection may slow and size of files in your project may be bigger. so try with fast internet connection.

with slow internet, if you try deploying again and again, you will see that number of files uploading decreases on console. that means your files are getting uploaded, but it taking too much time, and firebase is getting exhausted.

Chondrule answered 23/4, 2021 at 5:21 Comment(0)
R
0

as explained already by @thmsdnnr, it is indeed a firebase issue, but can be due to some issues at your end as well. For example, for me it was the slow internet connection responsible for it.

Besides, you can always delete the ".firebase" folder, and re-build your project for starting afresh with hosting.

Revell answered 18/9, 2020 at 10:4 Comment(0)
P
0

I also faced an issue like that

Error: Task 91525507ddf6d644ed40f9c46c3e30a2164f496acb1328512d4cf5eaf8d18768 failed: retries exhausted after 6 attempts
PS D:\React\amazon-clone> firebase deploy

But I fixed it. Put this change in your firebase.json file:

{
  "hosting": {
    "public": "build",
    "ignore": [
      "firebase.json",
      "**/.*",
      "**/node_modules/**"
    ],
    "rewrites": [
      {
        "source": "**",
        "destination": "/index.html"
      }
    ]
  }
}

to

{
  "hosting": {
    "public": "public",
    "ignore": [
      "firebase.json",
      "**/.*",
      "**/node_modules/**"
    ],
    "rewrites": [
      {
        "source": "**",
        "destination": "/index.html"
      }
    ]
  }
}

and it will work fine.

Preachment answered 31/1, 2021 at 9:34 Comment(0)
L
0

I was struggling with this problem too. After trying many methods, I solved the deployment issue as follows;

At first, I deleted node modules and reinstalled it again. I deleted firebase files (.firebase, firebase.json)

Then I applied them;

  1. Update Firebase CLI via "npm i -g firebase-tools"
  2. Log in to your account via "firebase login",
  3. Initialize the project via "firebase init hosting"
  4. And lastly deploy it via "firebase deploy --only hosting"

I was able to deploy my project on firebase with these steps. I hope someone else's problem is solved this way.

I recommend you to check here for detailed information.

Lungfish answered 25/12, 2021 at 13:27 Comment(0)
I
0

As mentioned in the error massage: Timeout reached making request to https://url_path.

I found the same problem, the mine relates to the network. So check your network connection.

Iridotomy answered 25/6, 2022 at 12:18 Comment(0)
A
0

If you are using vite,

change your firebase.json file.

{
  "hosting": {
    "public": "dist",
    "ignore": [],
    "rewrites": [
      {
        "source": "**",
        "destination": "/index.html"
      }
    ]
  }
}
  • deleted .firebase folder
  • build again npm run build
  • now run again firebase deploy
Ascanius answered 16/4, 2023 at 10:29 Comment(0)
K
0

Delete these hidden folders in you project root directory:

  • .dart_tool
  • .firebase

Then type on the terminal:

  1. flutter pub get
  2. flutter build web
  3. firebase deploy
Kolnick answered 16/1 at 7:44 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.