Firebase托管部署错误:任务5fc ...失败:尝试6次后重试已用尽 [英] Firebase Hosting Deploy Error: Task 5fc... failed: retries exhausted after 6 attempts

查看:102
本文介绍了Firebase托管部署错误:任务5fc ...失败:尝试6次后重试已用尽的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试为生产和开发环境设置2个全新的Firebase项目,其中包含Firestore,Functions,Storage和Hosting.我首先删除了对旧Firebase项目的引用: firebase.json & .firebaserc .然后,我使用 test Firebase项目运行 $ firebase init 来设置托管,功能,存储和Firestore.然后,我使用 $ firebase use --add 设置Firebase别名,以在一个React.js项目中的两个项目之间切换.我构建了npm,并尝试使用以下代码进行部署: $ firebase deploy --project:test ,但是主机继续尝试使用相同的最后一个文件,并失败: Error:Task 5fcd ... failed:尝试6次后重试已用尽..

I am trying to setup a 2 brand new Firebase projects with Firestore, Functions, Storage, and Hosting for both Production and Development environments. I started with deleting the references to the old firebase project: both firebase.json & .firebaserc. I then ran $ firebase init to setup Hosting, Functions, Storage, and Firestore using the test Firebase project. I then setup Firebase aliases with $ firebase use --add to switch between the two projects within one React.js project. I npm built and am attempting to deploy with: $ firebase deploy --project:test, but the hosting keeps trying the same last file and fails with: Error: Task 5fcd... failed: retries exhausted after 6 attempts..

我已经看到一些与服务器暂时关闭有关的Stackoverflow答案,但是我看不到服务器方面的任何问题( https://status.firebase.google.com/),该问题以前一直存在.在我从事的另一个项目上,我试图在同一个Firebase项目上部署到2个托管目标,但是一个失败了,另一个运行正常,我也遇到了同样的错误(我从未找到其他解决方案而不是不使用多个目标.)

I've seen some Stackoverflow answers that relate to the servers being down temporarily, but I do not see any server problems on their side (https://status.firebase.google.com/) and this has persisted before. On another project I have worked on, I was trying to deploy to 2 hosting targets on the same Firebase project, but one was failing and the other was working fine, and I was getting this same error (I never found a solution to that other than not using multiple targets.)

我还能测试什么才能使它正常工作?它在我的React.js代码库中吗?(我最近将其部署到了过去的项目中)也许与我的Firebase设置过程有关?还是与旧的Firebase项目有联系?我不知道接下来要看什么来解决此问题.任何方向都很好,谢谢!

What else can I test to get this working? Is it something inside my React.js code base? (I recently deployed to my past project) Maybe it has to do with my Firebase setup process? Or there is still a connection to the old Firebase project? I don't know what to look at next to fix this. Any direction would be great, thanks!

Ps:可能无法连接的奇怪之处在于,如果我仅运行 $ firebase deploy ,它不会部署firebaserc中定义的默认测试环境,而是实时测试环境?

Ps: Something weird that might not be connected is that if I run just $ firebase deploy, it doesn't deploy the default test env defined in firebaserc, but the live test env?

.firebaserc:

{
  "projects": {
    "default": "test-app-tech",
    "test": "test-app-tech",
    "live": "live-app-tech"
  }
}

firebase.json:

{
  "firestore": {
    "rules": "firestore.rules",
    "indexes": "firestore.indexes.json"
  },
  "functions": {
    "predeploy": "npm --prefix \"$RESOURCE_DIR\" run build"
  },
  "hosting": {
    "public": "build",
    "ignore": [
      "firebase.json",
      "**/.*",
      "**/node_modules/**"
    ],
    "rewrites": [
      {
        "source": "**",
        "destination": "/index.html"
      }
    ]
  },
  "storage": {
    "rules": "storage.rules"
  }
}

完整的控制台日志:(不确定哪里有比控制台更长的日志文件)

Full console log: (not sure where a longer log file is than just the console)

   === Deploying to 'test-app-tech'...

i  deploying storage, firestore, functions, hosting
Running command: npm --prefix "$RESOURCE_DIR" run build

> functions@ build C:\Users\me\Documents\GitHub\react.app.tech\functions
> tsc

+  functions: Finished running predeploy script.
i  firebase.storage: checking storage.rules for compilation errors...
+  firebase.storage: rules file storage.rules compiled successfully
i  firestore: reading indexes from firestore.indexes.json...
i  cloud.firestore: checking firestore.rules for compilation errors...
+  cloud.firestore: rules file firestore.rules compiled successfully
i  functions: ensuring necessary APIs are enabled...
+  functions: all necessary APIs are enabled
i  storage: latest version of storage.rules already up to date, skipping upload...
i  firestore: uploading rules firestore.rules...
+  firestore: deployed indexes in firestore.indexes.json successfully
i  functions: preparing functions directory for uploading...
i  functions: packaged functions (80.39 KB) for uploading
+  functions: functions folder uploaded successfully
i  hosting[test-app-tech]: beginning deploy...
i  hosting[test-app-tech]: found 32 files in build
⠸  hosting: uploading new files [0/1] (0%)
Error: Task 5fcd5c559ded0c02b3ed7840ca3ee77e95b798730af98d9f18bc627ac898071e failed: retries exhausted after 6 attempts

推荐答案

通过添加后缀-debug 后缀进行了更深入的研究,后缀为我提供: TypeError [ERR_INVALID_ARG_TYPE]:路径参数必须为字符串类型.收到的类型未定义.对此进行了探索,并尝试进行修复,但没有成功.我删除了/node_modules/ package-lock.json /build/,重新安装了程序包,并进行了部署.不知道是什么解决了这个问题,因为我之前删除了那些文件都没有用.我做了其他一些看似无关的小更改,谁知道可能已经连接了,但是现在可以正常工作了!

Explored a bit deeper by appending --debug suffix, which gave me: TypeError [ERR_INVALID_ARG_TYPE]: The "path" argument must be of type string. Received type undefined. Explored this, and tried to fix, but didn't work. I deleted /node_modules/, package-lock.json, and /build/, reinstalled packages, deployed and it worked. Not sure what fixed it because I deleted those files before to no avail. I did a few other small, seemingly unrelated changed, which who knows might have been connected, but its working now!

更新:由于生产环境存在相同的问题,因此我必须真正找到此错误,并将其范围缩小到我探索 TypeError [ERR_INVALID_ARG_TYPE] 的步骤.在这篇文章之后,我做了些改变:

UPDATE: I had to truly find the error with this since my production environment was having the same issue, and narrowed it down to the steps I took exploring the TypeError [ERR_INVALID_ARG_TYPE]. Following this post somewhat, I changed:

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

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

然后部署并通过,但是在实时服务器上没有任何显示,因为它当然没有在查看build文件夹.因此,我将其改回指向构建而不是公共的位置,然后再次部署并成功运行.奇怪的解决方案,发送给Firebase团队,看看这里到底发生了什么.

then deployed and it went through, but nothing is shown on the live server, because it isn't looking at the build folder of course. So I changed it back to point to build instead of public, and deployed again and it worked. Weird solution, sending to Firebase team to see what really happened here.

这篇关于Firebase托管部署错误:任务5fc ...失败:尝试6次后重试已用尽的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆