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

409 error while deploying to Firebase Hosting #2126

Closed
khaled6mmd opened this issue Apr 11, 2020 · 91 comments
Closed

409 error while deploying to Firebase Hosting #2126

khaled6mmd opened this issue Apr 11, 2020 · 91 comments

Comments

@khaled6mmd
Copy link

whenever I try to deploy my project to new firebase project with firebase deploy I get this error

⠇  hosting: uploading new files [0/7] (0%)
Error: Task 028c5d7ed641a4a3b636f112e22c192200a3b5932144f1b5d765f73e7c02a6d6 
failed: retries exhausted after 6 attempts

old firebase projects work fine

@mikejlaurie
Copy link

Me too!!

@mikejlaurie
Copy link

See https://stackoverflow.com/questions/60699826/firebase-hosting-deploy-error-task-5fc-failed-retries-exhausted-after-6-att
I changed the "public": "www"," to public": "WWW", in firebase.json and it started working..

@bkendall
Copy link
Contributor

@khaled6mmd please follow the template. There's a lot of information missing. What OS are you on? What version of firebase-tools are you using?

@bkendall bkendall added the Needs: Author Feedback Issues awaiting author feedback label Apr 13, 2020
@dalepo
Copy link

dalepo commented Apr 13, 2020

same is happening to me, tried deploying several times today and nothing.
Debian 9
firebase --version: 7.16.1

@bkendall
Copy link
Contributor

@dalepo can you delete the cache that Hosting deploys use and try again? From the root of your project (likely where firebase.json is located), the command will look like rm .firebase/hosting.*.cache (note the beginning period - it's a hidden file)

@dalepo
Copy link

dalepo commented Apr 13, 2020

thanks for responding @bkendall
I already tried deleting the entire .firebase folder

deploying hosting
hosting[my-project]: beginning deploy...
hosting[my-project]: found 1451 files in www
hosting: uploading new files [28/947] (2%)
Error: Task <long-task-string> failed: retries exhausted after 6 attempts

It seems that it gets stuck on certain files, these are mostly minified js files. Earlier it got stuck on the 64th
edit: yeah the number seems irrelevant, it gets stuck randomly.

@bkendall
Copy link
Contributor

That's super curious. I'm working with some other people to try to figure this out - I'll follow up when I have news.

@khaled6mmd
Copy link
Author

@khaled6mmd please follow the template. There's a lot of information missing. What OS are you on? What version of firebase-tools are you using?

windows 10

firebase 8.0.3

problem got solved after changing path to public then dist/project-name
it deployed successfully

@google-oss-bot google-oss-bot added Needs: Attention and removed Needs: Author Feedback Issues awaiting author feedback labels Apr 14, 2020
@dalepo
Copy link

dalepo commented Apr 14, 2020

Tried what @khaled6mmd did but still have the same error today.

@bkendall
Copy link
Contributor

That's super strange that changing the path fixes it.

I've been trying to replicate this on a windows machine of my own but besides being kinda slow (old machine? windows node?), I haven't been able to replicate this issue.

I see that number of files isn't an issues (7 and 9xx both above). Are either of you uploading a lot of data? (Like, maybe we'll call a lot 10+ MB?)

@dalepo
Copy link

dalepo commented Apr 16, 2020

Mine is about 7MB

@mikejlaurie
Copy link

In my case around 5Mb

@dalepo
Copy link

dalepo commented Apr 19, 2020

I think it got fixed on the new cli version 8.1.1.
I was able to deploy it.

@tharinduvindula
Copy link

same hear

i deploying hosting
i hosting[eclassstudent]: beginning deploy...
i hosting[eclassstudent]: found 15 files in dist
⠋ hosting: uploading new files [0/2] (0%)
Error: Task 3e7c89812bf4fd87f9db14f54068690ed64b8be5e64316c9703f9616bef0b00e failed: retries exhausted after 6 attempts

my site is 3.64 Mb

@khaled6mmd
Copy link
Author

Firebase init

same hear

i deploying hosting
i hosting[eclassstudent]: beginning deploy...
i hosting[eclassstudent]: found 15 files in dist
⠋ hosting: uploading new files [0/2] (0%)
Error: Task 3e7c89812bf4fd87f9db14f54068690ed64b8be5e64316c9703f9616bef0b00e failed: retries exhausted after 6 attempts

my site is 3.64 Mb

Firebase init
Then change the path to public
Try to deploy again it will deploy but this isn't what you want
Firebase init again and change the path back to your website
Then try to deploy, works for me every time

@tharinduvindula
Copy link

Firebase init

same hear
i deploying hosting
i hosting[eclassstudent]: beginning deploy...
i hosting[eclassstudent]: found 15 files in dist
⠋ hosting: uploading new files [0/2] (0%)
Error: Task 3e7c89812bf4fd87f9db14f54068690ed64b8be5e64316c9703f9616bef0b00e failed: retries exhausted after 6 attempts
my site is 3.64 Mb

Firebase init
Then change the path to public
Try to deploy again it will deploy but this isn't what you want
Firebase init again and change the path back to your website
Then try to deploy, works for me every time

my case solve when i Firebase init again and again

@dalepo
Copy link

dalepo commented Jun 5, 2020

I think it got fixed on the new cli version 8.1.1.
I was able to deploy it.

Happened again tonight with another project :/

@MarceloSavian
Copy link

I had this problem several times in an older react project, for me, delete .firebase folder solved. But before deploy with build target, i had to deploy with public target and then build. From time to time i keep having this problem, always solved by deleting .firebase folder.

@dalepo
Copy link

dalepo commented Jun 8, 2020

Is this going to be fixed? I had to revert my hosting apps due to inconsistent file errors, I don't know if this is a problem with the files I upload or the fact that I have to run the command several times to be able to deploy.

@vchoudhari45
Copy link

I am running into the same issue, uploading gets stuck at 0%, and fails on some task after 6 attempts. Sometimes it fails for finding the project and doesn't reach uploading step.

But it goes through after multiple attempts for running firebase deploy. Is it failing because the request for upload or lookup hits bad instances?

@vallimangai
Copy link

same error for me also

1 similar comment
@Yhchdev
Copy link

Yhchdev commented Aug 15, 2020

same error for me also

@abhishek-sankar
Copy link

Changing to public and deploying again worked for me.

firebase init Set path to public (which was the actual path to my website) firebase deploy And it worked.

@FelixEhuan
Copy link

In my case deleting .firebase folder as @bkendall mentioned did the trick

@branlok
Copy link

branlok commented Feb 17, 2021

im also getting a similar error

MacOS Big Sur
Firebase version 9.4.0
React 17.0.1

⠏ hosting: uploading new files [0/1] (0%)
Error: Task e8ad9939e2164594316de4d55df0506e33c10c3b66e44322f2fab9f4607a1a47 failed: retries exhausted after 6 attempts

i cant deploy my project at all now

EDIT:
tried all the solutions above - none worked until, I literally just restarted the Computer...and that fixed it somehow.

@aedolfi
Copy link

aedolfi commented Mar 16, 2021

It seams to be an Issue with large websites. What helped me was to reduce the size of all images in the assets by factor 4.

@JayKan
Copy link

JayKan commented Mar 24, 2021

I happen to did a global update for my firebase-cli and this error started to happening. I've tried everything and nothing worked.

Then I downgraded my firebase to 8.1.1 and everything started working. Not really sure why? Hopefully this can be helpful for someone running into a similar issue

@guybarnard
Copy link

I had the same issue with an existing site that has deployed hundreds of times successfully previously., 409 error with a large .js chunk file generated by webpack.

WHAT DIDNT WORK:
Deleting the .firebase cache didn't help, reverting firebase-tools version didn't help, renaming the public folder didnt work, uploading a different build folder which did upload successfully but then re-uploading the original build folder didn't work

WHAT SUCCESSFULLY WORKED AROUND THE ISSUE:
Created a new hosting site within the same project, deployed the site to the new site, then deployed it back to the site that was failing and it worked fine. I can now delete the new site.

@gbourne1
Copy link

gbourne1 commented May 7, 2021

I've been trying all the above tricks and no luck and always stuck at uploading new hosting files. Any new on the serverside fix?

@jerinjohnk
Copy link

I did try changing firebase.json to "public": "public", and reverting back but that didn't fix for me.
Had to roll back my deployment.

So, I ran firebase deploy --debug which gave me logs. On scrolling to the end got

557e24311393e9ef8dee516a0d38143e2b [stream]
[2021-05-08T12:17:44.851Z] [hosting][upload] static/css/22.95f441df.chunk.css
(9e216fb33b325a6d324ff0505102d8557e24311393e9ef8dee516a0d381) 
HTTP ERROR 409: [object Headers] Couldn't process request (status=409)

Now in the build folder, I opened up this chunk file to identify the particular file.
Found the corresponding file inside my source added an enter at the end.

  • Deleted build folder
  • cache from .firebase folder
  • Created build folder and ran deploy once again and it successfully uploaded. (this created a new hashmap named file)

Got the idea from kmcnellis(comment) and this pull request

@ido50
Copy link

ido50 commented May 9, 2021

This is absolutely killing me. I can't deploy new versions of my websites. This should be a first priority issue, not something you may have a fix for sometime this week maybe.

@ido50
Copy link

ido50 commented May 9, 2021

I have been able to deploy by connecting to a US-based VPN (I am located in Israel). Have no idea why, but it worked.

@vidklopcic
Copy link

This is truly unacceptable! I'm so glad that I abandoned Firebase a long time ago. Unfortunately, I have to maintain one old project - I literally cannot deploy anymore. Great.

@benomatis
Copy link

@guybarnard @gbourne1 @ido50 @vidklopcic kmcnellis gave a workaround above, should be fairly simple to do. If you are using a builder, make a change to a file that would trigger the recreation of the problematic file the debug log points to (you may want to use firebase --debug to find out).

@ryanjohndias
Copy link

ryanjohndias commented May 10, 2021

For what it's worth, this hack has allowed me to resume daily automated deployments of generated content again:

# 1. Run the data generator script, etc

# 2. Workaround for failing file uploads. Add a trailing space
echo ' ' >> ../public/{file name a}.json
echo ' ' >> ../public/{file name b}.json
echo ' ' >> ../public/{file name c}.json
# etc etc

# 3. Deploy
firebase deploy

I know this is very specific to my situation and won't work for everybody 🤷‍♂️. For me, it's been the same files failing over and over, so once I identified them, I could add them to this list to change their content by adding a trailing space, thus resolving the 409 conflicts that were happening. If you can inject step 2 into your process somewhere before deployment (and if a trailing space isn't destructive to your content), then maybe this can work temporarily.

@bjornharvold
Copy link

bjornharvold commented May 10, 2021

Same issue here using v9.10.2 on Ubuntu 20.10.

A few takeaways:

  • We have 10 apps in a monorepo
  • Only one file in our largest SPA fails (43Kb js file)
  • All other SPAs deploy fine

I tried installing firebase-tools all the way down to 7.16.2 to see if this was a regression error. No such luck.

@jerinjohnk
Copy link

When along with my colleague I tried to deploy build from different machines for the same branch.
For me, the conflicting hashcode was generated for a .css file
But for him, it was in a minified file of decimal.js-light generated in node_modules.
Being minified version adding enter or spaces wasn't working so instead added a comment which resulted in the generation of a new hashmap.
So on different systems, the hashmap conflicts can be different.
Better to identify the conflicting hashmap file and make some changes there.

@userJulienMoreau
Copy link

userJulienMoreau commented May 10, 2021

The solution that works for me,
is to create a temporary site on firebase (same project) then to deploy the project on this temporary site (I needed 2 build actions then deployment) and it worked.
Then I simply deployed on the right site.
Then I deleted the temporary site.

I tried this solution on 2 different sites and it worked.

It looks like a cache story related to the firebase project... to be continued

@benomatis
Copy link

@userJulienMoreau You don't need to go through all that unless there is no way for you to make modifications either directly in the public folder to the file in question or to another file that would trigger your builder (if you're using one) to rebuild and generate new files. Again, see the workaround from kmcnellis above for details and explanation.

@mbleigh
Copy link
Contributor

mbleigh commented May 10, 2021

Hey folks, we've rolled out a backend change that we think may address this issue. If you've been experiencing 409 errors while deploying, can you please try again and see if it's working now?

Thanks!

@kmcnellis
Copy link
Member

This is fixed now. If you are having deploy errors still, please file a new issue.

@noreff
Copy link

noreff commented May 10, 2021

@mbleigh thank you, now it works.

@bjornharvold
Copy link

Works like a charm @mbleigh - Thank you :-)

@ryanjohndias
Copy link

Thanks a ton to the team @mbleigh @kmcnellis for this fix 👏

@noreff
Copy link

noreff commented May 15, 2021

And this is error is back again. Absolutely nothing changed in my setup so I suspect firebase server has issues again. @mbleigh @kmcnellis

...
⠦  hosting: uploading new files [188/21023] (0%)
Error: Task 9a21ef19dd53be16bfe88d5b062c55d43c49e8a9e11172c254b9b6dff02b975b failed: retries exhausted after 6 attempts

Second attempt looking even more interesting, because there is no actual upload started

...
⠙  hosting: adding files to version [21000/21030] (99%)
Error: Task 5aa5023619e03edb15f9511dc5ad22a89ccd5bc954d92fffe36b9852229acfe8 failed: retries exhausted after 6 attempts

Also for some reason number of the files between first and second try is different while no changes to public folder was made.

@kmcnellis
Copy link
Member

@noreff Please run with the --debug flag. Unfortunately the retry logic swallows up the actual error returned by the server (made #3345 to fix that)

@noreff
Copy link

noreff commented May 15, 2021

@kmcnellis thanks for quick reply, here is a deploy output with --debug flag:

...
i  hosting: uploading new files [178/18238] (0%) 
[2021-05-15T22:38:31.098Z] [uploadQueue] Retrying task 574ddb4f3461bc7e746ef06d4f6e62fc10981009db413f2b5b1e0ebb0f9edc80
[2021-05-15T22:38:31.099Z] >>> [apiv2][query] POST https://upload-firebasehosting.googleapis.com/upload/sites/traveltables-ch/versions/eefe9d9ecd4d9e5b/files/574ddb4f3461bc7e746ef06d4f6e62fc10981009db413f2b5b1e0ebb0f9edc80 [none]
[2021-05-15T22:38:31.099Z] >>> [apiv2][body] POST https://upload-firebasehosting.googleapis.com/upload/sites/traveltables-ch/versions/eefe9d9ecd4d9e5b/files/574ddb4f3461bc7e746ef06d4f6e62fc10981009db413f2b5b1e0ebb0f9edc80 [stream]
Task 54f27beb88b86208499c1f4d05f41b3578d2e73598cbe9348d2b6f0ca5b55a9e failed: retries exhausted after 6 attempts
[2021-05-15T22:38:32.388Z] [hosting][upload queue][FINAL] {"max":18024,"min":6040,"avg":9317.10674157304,"active":199,"complete":179,"success":178,"errored":1,"retried":962,"total":18238,"elapsed":177214}
[2021-05-15T22:38:32.394Z] FirebaseError: Timeout reached making request to https://upload-firebasehosting.googleapis.com/upload/sites/traveltables-ch/versions/eefe9d9ecd4d9e5b/files/54f27beb88b86208499c1f4d05f41b3578d2e73598cbe9348d2b6f0ca5b55a9e
    at Client.doRequest (/usr/local/lib/node_modules/firebase-tools/lib/apiv2.js:209:23)
    at runMicrotasks (<anonymous>)
    at processTicksAndRejections (internal/process/task_queues.js:93:5)
    at runNextTicks (internal/process/task_queues.js:62:3)
    at listOnTimeout (internal/timers.js:523:9)
    at processTimers (internal/timers.js:497:7)
    at async Client.request (/usr/local/lib/node_modules/firebase-tools/lib/apiv2.js:96:20)
    at async Uploader.uploadHandler (/usr/local/lib/node_modules/firebase-tools/lib/deploy/hosting/uploader.js:173:21)
    at async Queue.executeTask (/usr/local/lib/node_modules/firebase-tools/lib/throttler/throttler.js:180:22)
    at async Queue.handle (/usr/local/lib/node_modules/firebase-tools/lib/throttler/throttler.js:96:22)

Error: Task 54f27beb88b86208499c1f4d05f41b3578d2e73598cbe9348d2b6f0ca5b55a9e failed: retries exhausted after 6 attempts
Task fa49e2d61c1677f16898e90ba1c47a4dffffb418420de47a7e26414f2c9ea94b failed: retries exhausted after 6 attempts
Task 76ceb668fcf3df242839b4c6ac4bff837173557a53695af44b287bf46007903a failed: retries exhausted after 6 attempts
Task bb61e0b6209f62a1c1353edf3c2a4c7ceacc5dbb524a33ccd1f0c7897b8d21d4 failed: retries exhausted after 6 attempts
Task b14b262b14011c5ba8133c5547149c2085fe5c088da33f5528fdcba7e8f3b85c failed: retries exhausted after 6 attempts
Task f87101725129ba9e75a0356c395d2f1e988ed11ecd69e24cb17cc35752f2dea1 failed: retries exhausted after 6 attempts
Task b9d1cb89225bc70b4b43196d6fe33bce26d7dd62715f1d5ea41c6fda9c0753e8 failed: retries exhausted after 6 attempts
Task 1543d49b734390f511d6398ba82ac28d8e7df3eb8beea3ea0bc2230d7e8053f0 failed: retries exhausted after 6 attempts
Task dcfc277d327430f8e38e87c3b68c4f4d26e630364ec48e9addc4b86ab416a6e5 failed: retries exhausted after 6 attempts
Task 4680d505e474573312b2a6226484ab6df2706fb85f453bbc5b3d4a9264706afc failed: retries exhausted after 6 attempts
Task 64fd325ef596ccfbfc6d5644591848ba29bfb81fe25977f4f4baec3b46291898 failed: retries exhausted after 6 attempts
Task e009c2164b92d01320c5f4741737ab8cf0c752e467da3dd3622b4808c59f1566 failed: retries exhausted after 6 attempts
Task 3ab6c1f755d1bd7bcbc7a9ed0dbcec8339f93f7faa34c29a152c5ce27dae3457 failed: retries exhausted after 6 attempts
Task f35ae18cb6d69fcc6c07b103def5c03e8295262746ba74cf6cda30f69b6da8d6 failed: retries exhausted after 6 attempts
Task 4e6f99c800c2a58faa478cd153f3d58b91797855bf5dd8d81167c53fbbd62e1a failed: retries exhausted after 6 attempts
Task e48af2dc22289f0329e12b9dea722ce41af412a0016cf81e67f6a8b5964367cb failed: retries exhausted after 6 attempts
Task c1b89d68cf3c98e8329a6fadb555d5549d071ded266185b15f33423c5dc8dd1a failed: retries exhausted after 6 attempts
Task cfac850ed25bb28d72d91de15197b8e4f7714039531723db8edaae36065864d4 failed: retries exhausted after 6 attempts
Task 8f08dd8310ccc753fc6b56fa474770000b7c563f61be0c1183cbadfebbe0275f failed: retries exhausted after 6 attempts
Task 2894f5018bf400ec00cf909e8ee8438612587c87236c8c755ffe429a24056921 failed: retries exhausted after 6 attempts
Task fba64b2f46578c3a1584e86d5e1dc7dbbd4ea34d09f4db31f054bace19232473 failed: retries exhausted after 6 attempts
Task 14fafd79abec3ae4da518be020d1632cdb87405273dbd6f1ebb4149e8ec64553 failed: retries exhausted after 6 attempts

@kmcnellis
Copy link
Member

kmcnellis commented May 16, 2021

Yup, that's a different issue. Looks like it's probably a timeout during upload due to a large file size or bad network connection. (Though it could also be some sort of server timeout)

To keep things clear, let's restrict this thread to the 409 error code issue. Feel free to start another issue, or file a support case at https://firebase.google.com/support.
Please make sure to include details about the specific file that's failing.

@Lauravdearmas
Copy link

@yuchenshi
Copy link
Member

@Lauravdearmas That seems to be a different issue. Feel free to open a new issue in this repo and let us know about the details. In the meantime, I'm going to lock this issue since the original 409 error seems resolved.

@firebase firebase locked as off-topic and limited conversation to collaborators May 23, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests