firebase-tools: Firebase hosting: HTTP Error: 404, Requested entity was not found

Everything was working just fine yesterday. Last thing I did yesterday was to deploy the app and then update the firebase-tools to its latest version. And this morning it was no longer possible to deploy and this error pops up. I can only assume it is related to update firebase-tools. But the error continues even downgrading it. I tried to also update firebase, but no success. The function to serve the nextjs app is created, but the website is not deployed.

[REQUIRED] Environment info

Firebase CLI 12.4.3

Firebase 10.0.0

Windows

[REQUIRED] Test case

./firebase.json

{
  "hosting": {
    "source": ".",
    "ignore": ["firebase.json", "**/.*", "**/node_modules/**"],
    "frameworksBackend": {
      "region": "asia-east1"
    }
  }
}

.firebasesrc

{
  "projects": {
    "default": "[PROJECT_NAME]"
  }
}

[REQUIRED] Steps to reproduce

firebase deploy

[REQUIRED] Expected behavior

Properly deploy app

[REQUIRED] Actual behavior

Error after creating nextjs function

i  hosting[PROJECT_NAME]: beginning deploy...
i  hosting[PROJECT_NAME]: found 633 files in .firebase\PROJECT_NAME\hosting
+  hosting[PROJECT_NAME]: file upload complete
i  functions: updating Node.js 18 (2nd Gen) function firebase-frameworks-PROJECT_NAME:ssrPROJECT_NAME(asia-east1)...
+  functions[firebase-frameworks-PROJECT_NAME:ssrPROJECT_NAME(asia-east1)] Successful update operation.
Function URL (firebase-frameworks-PROJECT_NAME:ssrPROJECT_NAME(asia-east1)): https://ssrPROJECT_NAME-xxxxxx-de.a.run.app
i  functions: cleaning up build files...
i  hosting[PROJECT_NAME]: finalizing version...

Error: HTTP Error: 404, Requested entity was not found.

firebase-debug.log

This goes on repeat for around 100 lines, and no other message is printed. This is the end of the firebase-debug.log.

[debug] [2023-07-11T11:10:28.643Z] [create-firebase-frameworks-PROJECT_NAME-asia-east1-ssrPROJECT_NAME] Retrying task index 0
[debug] [2023-07-11T11:10:28.643Z] >>> [apiv2][query] GET https://cloudfunctions.googleapis.com/v2/projects/PROJECT_NAME/locations/asia-east1/operations/operation-1689073669967-600341c191066-017485c2-df7ba452 [none]
[debug] [2023-07-11T11:10:28.765Z] <<< [apiv2][status] GET https://cloudfunctions.googleapis.com/v2/projects/PROJECT_NAME/locations/asia-east1/operations/operation-1689073669967-600341c191066-017485c2-df7ba452 200
[debug] [2023-07-11T11:10:28.765Z] <<< [apiv2][body] GET https://cloudfunctions.googleapis.com/v2/projects/PROJECT_NAME/locations/asia-east1/operations/operation-1689073669967-600341c191066-017485c2-df7ba452 {"name":"projects/PROJECT_NAME/locations/asia-east1/operations/operation-1689073669967-600341c191066-017485c2-df7ba452","metadata":{"@type":"type.googleapis.com/google.cloud.functions.v2.OperationMetadata","createTime":"2023-07-11T11:07:50.417080718Z","target":"projects/PROJECT_NAME/locations/asia-east1/functions/ssrPROJECT_NAME","verb":"create","cancelRequested":false,"apiVersion":"v2","requestResource":{"@type":"type.googleapis.com/google.cloud.functions.v2.Function","name":"projects/PROJECT_NAME/locations/asia-east1/functions/ssrPROJECT_NAME","buildConfig":{"runtime":"nodejs18","entryPoint":"ssrPROJECT_NAME","source":{"storageSource":{"bucket":"gcf-v2-sources-105427367185-asia-east1","object":"ssrPROJECT_NAME/function-source.zip"}},"environmentVariables":{"GOOGLE_NODE_RUN_SCRIPTS":""}},"serviceConfig":{"service":"projects/PROJECT_NAME/locations/asia-east1/services/ssrPROJECT_NAME","timeoutSeconds":60," .. ..................... ,"availableMemory":"256Mi","maxInstanceRequestConcurrency":80,"availableCpu":"1"},"labels":{"deployment-tool":"cli-firebase","firebase-functions-codebase":"firebase-frameworks-PROJECT_NAME","firebase-functions-hash":""},"environment":"GEN_2"},"stages":[{"name":"BUILD","message":"Creating build","state":"IN_PROGRESS","resource":"projects/*******/locations/asia-east1/builds/","resourceUri":"https://console.cloud.google.com/cloud-build/builds;region=asia-east1/"},{"name":"SERVICE","state":"NOT_STARTED"}]},"done":false}

About this issue

  • Original URL
  • State: closed
  • Created a year ago
  • Reactions: 19
  • Comments: 31 (6 by maintainers)

Most upvoted comments

Update: We think there is a server-side error. We are investigating and addressing this. This is an error that affects users using the pinTags feature, which includes all web frameworks users while the feature is available.

Fortunately, pintags is still an experiment and can be disabled without downgrading your CLI. If you turn off this experiment, you’ll lose atomic rollbacks and preview channels with server-side content, but you’ll be able to deploy to production again while we figure this out. To disable the experiment, run:

firebase experiments:disable pintags

You will permanently lose the feature until we either remove the experiment guard or until you reenable the feature with

firebase experiments:enable pintags

It was an unrelated update. There was a bad server-side update in Cloud Run that affected tagged URLs. The change has been rolled back and you should be able to reenable pintags. Note that you will need to push to production with pintags enabled before you can create a new preview with pintags (otherwise the preview would modify prod).

I am facing the same problem with deploying the NextJS project. It seems it is not related to firebase-tools library directly and instead, there was some Google Cloud + Firebase Hosting integration change on their side. The error started happening without any local config changes. Tried multiple firebase-tools versions, no luck. Tried creating a new hosting profile/app, and it’s not able to even deploy the first deployment. The thing is, the deployment succeeds, it created a Cloud Run instance, but it creates an incorrect URL (not Firebase Hosting URL). Started happening a couple of days ago or so.

At this point, this is a critical outage from our side as we’re not able to deploy any new updates via the current flow.

It seems that the behavior of the updateVersion API has changed. It started returning 404 responses today.

A quick hack for people with PRD impact while waiting for the proper fix:

  1. Go to your Cloud Run service YAML section
  2. Under traffic copy the tag value of the entry that’s one before the last one. (For me it’s the one above - percent: 100
  3. Edit your api.js file of firebase-tools (node_modules\firebase-tools\lib\hosting\api.js)

Find updateVersion method and hardcode the tag to one that you copied

Like that:

async function updateVersion(site, versionId, version) {
    version["config"]["rewrites"][0]["run"]["tag"] = "fh-bd0d4fbb2xxxxxxxxx";
    const res = await apiClient.patch(`projects/-/sites/${site}/versions/${versionId}`, version, {
        queryParams: {
            updateMask: proto.fieldMasks(version, "labels", "config").join(","),
        },
    });
    return res.body;
}

It will deploy the previously failed deployment.

I have also been encountering this bug. I’m not aware of any fix, but right now I can reproduce it using the simplest possible SvelteKit demo app. Specifically:

yarn create vite

(Follow instructions to create a SvelteKit project.)

cd vite-project
npm install
firebase init

(Follow instructions to create a project with only hosting enabled, and connect it to a Firebase app on the Blaze plan.)

firebase deploy

I then encounter the exact same error:

i  functions: updating Node.js 18 (2nd Gen) function firebase-frameworks-*****:ssr*****(asia-east1)...
+  functions[firebase-frameworks-*****:ssr*****(asia-east1)] Successful update operation.
Function URL (firebase-frameworks-*****:ssr*****(asia-east1)): https://ssr*****-***-de.a.run.app
i  functions: cleaning up build files...
i  hosting[*****]: finalizing version...

Error: HTTP Error: 404, Requested entity was not found.

This error seems especially inconsistent to me. For instance, a couple of weeks ago I had the error on my main firebase project, but when I tried to reproduce with a sample project (as above), the sample project actually worked.

Same here. Thank you!

Hopefully they’ll communicate on it at some point. It was a pain just to find this issue. https://status.firebase.google.com/ doesn’t show anything yet.

Agreed. This issue should be in the status page, otherwise that page can’t be trusted.

Edit: they added a message there.

I also shared mine: case 10238751

Hey, thanks @aalej! Just in case no one has done it yet, I have shared my firebase-debug.log and project ID to firebase support.

Case 10239154

Hi everyone, sorry for the extra hoop here, but we would like to ask if anyone can share their firebase-debug.log and project ID to Firebase Support. Our team has an idea of what might be causing this issue, but we would need to take a look into the project to verify.

Also, please mention this GitHub issue in the support ticket.

Same problem for me (on a sveltekit project) I have provided support with debug output from my deploy. firebase deploy --debug

Just be carful sharing that file however, it contains your private key. I redacted mine before sharing with support.

Also happening here… Incredibly frustrating having things just break

@aalej
It fails on finalizing version for hosting.

[2023-07-11T14:57:07.277Z] <<< [apiv2][status] PATCH https://firebasehosting.googleapis.com/v1beta1/projects/-/sites/rotmg-trade/versions/80b63ff8d33b7de1 404
[2023-07-11T14:57:07.277Z] <<< [apiv2][body] PATCH https://firebasehosting.googleapis.com/v1beta1/projects/-/sites/rotmg-trade/versions/80b63ff8d33b7de1 {"error":{"code":404,"message":"Requested entity was not found.","status":"NOT_FOUND"}}

Error: HTTP Error: 404, Requested entity was not found.
[2023-07-11T14:57:07.336Z] Error Context: {
  "body": {
    "error": {
      "code": 404,
      "message": "Requested entity was not found.",
      "status": "NOT_FOUND"
    }
  },
  "response": {
    "statusCode": 404
  }
}