1

I am attempting to deploy my React.js project to a secondary dev hosting site on Firebase, but I am getting Error: Task ab14... failed: retries exhausted after 6 attempts after running the command firebase deploy --only hosting:dev.

As I have done successfully on another project, I setup hosting by running: firebase target:apply hosting dev dev-sitename-com then firebase target:apply hosting live live-sitename-com to apply each site. Then I change firebase.json from

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

TO

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

I've deleted node_modules and reinstalled. I've deleted the build folder and rebuilt. I've tried setting GENERATE_SOURCEMAP from false to true. I can still deploy to the live target, but not dev, which should be indicative of the issue. Looks like some others with the same issue had the issue resolve over a few hours as it was on firebase's side, but I doubt is the issue because live will deploy. From the logs it looks like the deploy is getting stuck on uploading the last 2 files. The logs also indicate The "path" argument must be of type string. Received type undefined at validateString (internal/validators.js:107:11), which isn't directing anywhere in my code. Any ideas on how to fix this?

Here are the logs for --debug when deploying: https://pastebin.com/xhPZFnzr

douglasrcjames
  • 1,133
  • 3
  • 17
  • 37
  • Any resolution? I've encountered the same issue. – Drew Burnett Dec 17 '20 at 21:20
  • @AndrewBurnett does this other thread the same issue? (https://stackoverflow.com/questions/60699826/firebase-hosting-deploy-error-task-5fc-failed-retries-exhausted-after-6-att/65332659#65332659) I think I made another question because this question was flagged and it didn't post, but I guess it still went through? Not sure, but might flag as duplicate. – douglasrcjames Dec 18 '20 at 00:57
  • I realized I'm encountering a similar but slightly different issue. I'm trying to deploy my app to two different Firebase projects (environments dev & prod) via the 'use' command. I'm encountering an error as it attempts to upload the last 5 or so files. – Drew Burnett Dec 18 '20 at 01:04
  • @AndrewBurnett sounds the same to me, when I was working through the bug, I remember sometimes it would be 5 files it failed on, sometimes 9, etc. The `use` command is used just to setup the aliases, and is used twice to setup aliases in the `.firebaserc` file (https://firebase.google.com/docs/cli#add_alias) – douglasrcjames Dec 18 '20 at 01:14
  • Ok, so the issue is unrelated to the actual deployment commands. How did you ultimately solve the issue? Mine deploys fine to one project but not at all to the other. – Drew Burnett Dec 18 '20 at 01:59
  • Pretty sure you just use the flag like so for commands `firebase deploy --project=alias-name` – douglasrcjames Dec 18 '20 at 02:14

1 Answers1

1

I solved this issue doing the following:

  • update firebase cli and run firebase init
  • delete .firebase cache folder
MadeInLagny
  • 185
  • 1
  • 12