简体   繁体   English

部署 firebase 文件超时

[英]Timeout on deploying firebase files

I have a simple static HTML and CSS website, a total of 19 files, when I use firebase deploy for the first time it uploads all files except 3 (which I don't know what are they), and then I use firebase deploy again and I get this error with a timeout I have a simple static HTML and CSS website, a total of 19 files, when I use firebase deploy for the first time it uploads all files except 3 (which I don't know what are they), and then I use firebase deploy again我收到这个错误并超时

Error: Task 746db75fe2e30f7db8e598da508ea0151037c4fa9ee122daec252dc18fbb8662 failed: retries exhausted after 6 attempts, with error: Timeout reached making request to https://upload-firebasehosting.googleapis.com/upload/sites/xxxx/versions/0e578bbd3fa0f905/files/746db75fe2e30f7db8e598da508ea0151037c4fa9ee122daec252dc18fbb8662 Error: Task 746db75fe2e30f7db8e598da508ea0151037c4fa9ee122daec252dc18fbb8662 failed: retries exhausted after 6 attempts, with error: Timeout reached making request to https://upload-firebasehosting.googleapis.com/upload/sites/xxxx/versions/0e578bbd3fa0f905/files/746db75fe2e30f7db8e598da508ea0151037c4fa9ee122daec252dc18fbb8662

My version of firebase is 10.0.1我的 firebase 版本是10.0.1
My Node version is 17.3.0我的节点版本是17.3.0

Do the following steps which might help in troubleshooting the issue:执行以下可能有助于解决问题的步骤:

  • Delete node modules and reinstall them again.删除node modules并重新安装它们。
  • Delete firebase files (.firebase, firebase.json)删除firebase files (.firebase, firebase.json)
  • Update Firebase CLI via "npm i -g firebase-tools"通过"npm i -g firebase-tools"更新 Firebase CLI
  • Log in to your account via "firebase login"通过"firebase login"登录到您的帐户
  • Initialize the project via "firebase init hosting"通过"firebase init hosting"初始化项目
  • And lastly deploy it via "firebase deploy --only hosting"最后通过"firebase deploy --only hosting"进行部署

You can also refer to the documentation for further details on Firebase hosting.您还可以参阅文档以获取有关 Firebase 托管的更多详细信息。

I had a (not quite the same but) similar error while trying to deploy firebase functions and hosting in WSL2.在尝试部署 firebase 功能并在 WSL2 中托管时,我遇到了(不完全相同但)类似的错误。 I tried to install different firebase-tools versions, and logout then login again, nothing works.我尝试安装不同的 firebase-tools 版本,然后注销然后再次登录,没有任何效果。

It turns out that the WSL2 DNS issue caused this problem.事实证明, WSL2 DNS 问题导致了这个问题。

So if you're deploying firebase behind WSL2 try this ( credit ):所以如果你在 WSL2 后面部署 firebase 试试这个( 信用):

1. Create a file: /etc/wsl.conf.
2. Put the following lines in the file
[network]
generateResolvConf = false
3. In a cmd window, run wsl --shutdown
4. Restart WSL2
5. Create a file: /etc/resolv.conf. If it exists, replace existing one with this new file.
6. Put the following lines in the file
nameserver 8.8.8.8

If /etc/resolv.conf is deleted every you restart WSL2, and you're on Windows 11, add these lines to the end of the above /etc/wsl.conf file.如果/etc/resolv.conf在您每次重新启动 WSL2 时都被删除,并且您在 Windows 11 上,请将这些行添加到上述/etc/wsl.conf文件的末尾。

[boot]
command = "printf 'nameserver 8.8.8.8\nnameserver 4.4.4.4' > /etc/resolv.conf"

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM