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

firebase-tools v11.14.0 does not run predeploy scripts when deploying Hosting from GitHub Actions #5072

Closed
dtinth opened this issue Oct 6, 2022 · 19 comments · Fixed by #5082
Assignees

Comments

@dtinth
Copy link

dtinth commented Oct 6, 2022

[REQUIRED] Environment info

firebase-tools: 11.14.0

Platform: Ubuntu

[REQUIRED] Test case

N/A right now, maybe someone can help add a test case if they are experiencing the same issue. However, a log is available below, and it is confirmed that this only happens in v11.14.0.

I can reproduce this in one of my open-source projects, WebMIDICon:

[REQUIRED] Steps to reproduce

We use https://github.com/FirebaseExtended/action-hosting-deploy to deploy. The command is this:

name: Firebase Preview

on:
  pull_request:

jobs:
  deploy:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v3
      - name: Use Node.js
        uses: actions/setup-node@v3
        with:
          node-version: 16
          cache: yarn
      - run: yarn
      - uses: FirebaseExtended/action-hosting-deploy@v0
        with:
          repoToken: "${{ secrets.GITHUB_TOKEN }}"
          firebaseServiceAccount: "${{ secrets.FIREBASE_SERVICE_ACCOUNT }}"
          expires: 30d
          projectId: "${{ secrets.FIREBASE_PROJECT_ID }}"

This results in this command invoked:

npx firebase-tools hosting:channel:deploy pr285-octopus-perf --expires 30d --project $FIREBASE_PROJECT_ID --json

[REQUIRED] Expected behavior

firebase deploy should trigger the "predeploy" steps configured in "firebase.json"

[REQUIRED] Actual behavior

firebase deploy did not run the script at all.

See image below for log comparison (before/after):

image

Workaround

Downgrade firebase-tools to 11.13.0 before running.

      # Temporarily downgrade to `firebase-tools@11.13.0` because of a bug in `v11.14.0`.
      # See: https://github.com/firebase/firebase-tools/issues/5072
      # Do not use `--global` flag when installing because the `actions-hosting-deploy` action will not pick it up.
      - run: npm install firebase-tools@11.13.0

      - uses: FirebaseExtended/action-hosting-deploy@v0
        with:
          repoToken: "${{ secrets.GITHUB_TOKEN }}"
          firebaseServiceAccount: "${{ secrets.FIREBASE_SERVICE_ACCOUNT }}"
          expires: 30d
          projectId: "${{ secrets.FIREBASE_PROJECT_ID }}"
@dtinth dtinth added the bug label Oct 6, 2022
@rameez-dgc
Copy link

We are facing the same issue our ci cd stopped working since the relaease of 11.14.0

@keithrfung
Copy link

We are having the same issue to add priority to this bug.

@AurelienViridios
Copy link

Having the same issue on our side too since last night when the new version has been released.

@SarvagyaVaish
Copy link

Ditto! Adding the following command before calling using FirebaseExtended/action-hosting-deploy@v0 worked like a charm.

      - run: npm install firebase-tools@11.13.0

@johnnyasantoss
Copy link

This also affects my project. If I manually build, it shows an even weirder error on the log that the deployment action failed because it could not list my cloud functions (I'm deploying to hosting)

firebase-debug.log
[debug] [2022-10-06T16:40:41.792Z] ----------------------------------------------------------------------
[debug] [2022-10-06T16:40:41.794Z] Command:       /usr/bin/node /home/johnny/.npm-global/bin/firebase hosting:channel:deploy MR_30 -e 30d
[debug] [2022-10-06T16:40:41.794Z] CLI Version:   11.14.0
[debug] [2022-10-06T16:40:41.794Z] Platform:      linux
[debug] [2022-10-06T16:40:41.794Z] Node Version:  v16.16.0
[debug] [2022-10-06T16:40:41.795Z] Time:          Thu Oct 06 2022 13:40:41 GMT-0300 (Brasilia Standard Time)
[debug] [2022-10-06T16:40:41.795Z] ----------------------------------------------------------------------
[debug]
[debug] [2022-10-06T16:40:41.860Z] Object "" in "firebase.json" has unknown property: {"additionalProperty":"$schema"}
[debug] [2022-10-06T16:40:41.864Z] > command requires scopes: ["email","openid","https://www.googleapis.com/auth/cloudplatformprojects.readonly","https://www.googleapis.com/auth/firebase","https://www.googleapis.com/auth/cloud-platform"]
[debug] [2022-10-06T16:40:41.865Z] > authorizing via signed-in user (johnnyadsantos@gmail.com)
[debug] [2022-10-06T16:40:41.865Z] [iam] checking project my-project for permissions ["firebase.projects.get","firebasehosting.sites.update"]
[debug] [2022-10-06T16:40:41.867Z] >>> [apiv2][query] POST https://cloudresourcemanager.googleapis.com/v1/projects/my-project:testIamPermissions [none]
[debug] [2022-10-06T16:40:41.868Z] >>> [apiv2][(partial)header] POST https://cloudresourcemanager.googleapis.com/v1/projects/my-project:testIamPermissions x-goog-quota-user=projects/my-project
[debug] [2022-10-06T16:40:41.868Z] >>> [apiv2][body] POST https://cloudresourcemanager.googleapis.com/v1/projects/my-project:testIamPermissions {"permissions":["firebase.projects.get","firebasehosting.sites.update"]}
[debug] [2022-10-06T16:40:43.035Z] <<< [apiv2][status] POST https://cloudresourcemanager.googleapis.com/v1/projects/my-project:testIamPermissions 200
[debug] [2022-10-06T16:40:43.035Z] <<< [apiv2][body] POST https://cloudresourcemanager.googleapis.com/v1/projects/my-project:testIamPermissions {"permissions":["firebase.projects.get","firebasehosting.sites.update"]}
[debug] [2022-10-06T16:40:43.038Z] >>> [apiv2][query] GET https://firebase.googleapis.com/v1beta1/projects/my-project [none]
[debug] [2022-10-06T16:40:43.837Z] <<< [apiv2][status] GET https://firebase.googleapis.com/v1beta1/projects/my-project 200
[debug] [2022-10-06T16:40:43.838Z] <<< [apiv2][body] GET https://firebase.googleapis.com/v1beta1/projects/my-project {"projectId":"my-project","projectNumber":"1234","displayName":"Longui Staging","name":"projects/my-project","resources":{"hostingSite":"my-project","storageBucket":"my-project.appspot.com","locationId":"southamerica-east1"},"state":"ACTIVE","etag":"1_61e73ce6-c372-435b-900b-d6f799ff65ab"}
[debug] [2022-10-06T16:40:43.838Z] Expires TTL: 2592000000
[debug] [2022-10-06T16:40:43.841Z] >>> [apiv2][query] GET https://firebasehosting.googleapis.com/v1beta1/projects/my-project/sites/my-site/channels/MR-30 [none]
[debug] [2022-10-06T16:40:45.165Z] <<< [apiv2][status] GET https://firebasehosting.googleapis.com/v1beta1/projects/my-project/sites/my-site/channels/MR-30 200
[debug] [2022-10-06T16:40:45.165Z] <<< [apiv2][body] GET https://firebasehosting.googleapis.com/v1beta1/projects/my-project/sites/my-site/channels/MR-30 {"name":"projects/my-project/sites/my-site/channels/MR-30","url":"https://my-site--mr-30-hsvhx3hn.web.app","release":{"name":"projects/my-project/sites/my-site/channels/MR-30/releases/1665019237752524","version":{"name":"projects/my-project/sites/my-site/versions/c3faa521f002d562","status":"FINALIZED","config":{"rewrites":[{"regex":"^/api(.*)$","run":{"serviceId":"api","region":"southamerica-east1"}},{"glob":"!/assets/**","path":"/index.html"},{"glob":"**","path":"/index.html"}],"cleanUrls":true,"trailingSlashBehavior":"REMOVE"},"labels":{"deployment-tool":"cli-firebase"},"createTime":"2022-10-06T01:20:19.103085Z","createUser":{"email":"johnnyadsantos@gmail.com"},"finalizeTime":"2022-10-06T01:20:37.098913Z","finalizeUser":{"email":"johnnyadsantos@gmail.com"},"fileCount":"86","versionBytes":"8990267"},"type":"DEPLOY","releaseTime":"2022-10-06T01:20:37.752524174Z","releaseUser":{"email":"johnnyadsantos@gmail.com"}},"createTime":"2022-10-06T01:18:47.804168465Z","updateTime":"2022-10-06T16:39:35.865466112Z","retainedReleaseCount":10,"expireTime":"2022-11-05T16:39:35.865466112Z"}
[debug] [2022-10-06T16:40:45.166Z] [hosting] found existing channel for site my-site {"name":"projects/my-project/sites/my-site/channels/MR-30","url":"https://my-site--mr-30-hsvhx3hn.web.app","release":{"name":"projects/my-project/sites/my-site/channels/MR-30/releases/1665019237752524","version":{"name":"projects/my-project/sites/my-site/versions/c3faa521f002d562","status":"FINALIZED","config":{"rewrites":[{"regex":"^/api(.*)$","run":{"serviceId":"api","region":"southamerica-east1"}},{"glob":"!/assets/**","path":"/index.html"},{"glob":"**","path":"/index.html"}],"cleanUrls":true,"trailingSlashBehavior":"REMOVE"},"labels":{"deployment-tool":"cli-firebase"},"createTime":"2022-10-06T01:20:19.103085Z","createUser":{"email":"johnnyadsantos@gmail.com"},"finalizeTime":"2022-10-06T01:20:37.098913Z","finalizeUser":{"email":"johnnyadsantos@gmail.com"},"fileCount":"86","versionBytes":"8990267"},"type":"DEPLOY","releaseTime":"2022-10-06T01:20:37.752524174Z","releaseUser":{"email":"johnnyadsantos@gmail.com"}},"createTime":"2022-10-06T01:18:47.804168465Z","updateTime":"2022-10-06T16:39:35.865466112Z","retainedReleaseCount":10,"expireTime":"2022-11-05T16:39:35.865466112Z"}
[debug] [2022-10-06T16:40:45.168Z] >>> [apiv2][query] PATCH https://firebasehosting.googleapis.com/v1beta1/projects/my-project/sites/my-site/channels/MR-30 updateMask=ttl
[debug] [2022-10-06T16:40:45.168Z] >>> [apiv2][body] PATCH https://firebasehosting.googleapis.com/v1beta1/projects/my-project/sites/my-site/channels/MR-30 {"ttl":"2592000s"}
[debug] [2022-10-06T16:40:46.427Z] <<< [apiv2][status] PATCH https://firebasehosting.googleapis.com/v1beta1/projects/my-project/sites/my-site/channels/MR-30 200
[debug] [2022-10-06T16:40:46.427Z] <<< [apiv2][body] PATCH https://firebasehosting.googleapis.com/v1beta1/projects/my-project/sites/my-site/channels/MR-30 {"name":"projects/my-project/sites/my-site/channels/MR-30","url":"https://my-site--mr-30-hsvhx3hn.web.app","release":{"name":"projects/my-project/sites/my-site/channels/MR-30/releases/1665019237752524","version":{"name":"projects/my-project/sites/my-site/versions/c3faa521f002d562","status":"FINALIZED","config":{"rewrites":[{"regex":"^/api(.*)$","run":{"serviceId":"api","region":"southamerica-east1"}},{"glob":"!/assets/**","path":"/index.html"},{"glob":"**","path":"/index.html"}],"cleanUrls":true,"trailingSlashBehavior":"REMOVE"},"labels":{"deployment-tool":"cli-firebase"},"createTime":"2022-10-06T01:20:19.103085Z","createUser":{"email":"johnnyadsantos@gmail.com"},"finalizeTime":"2022-10-06T01:20:37.098913Z","finalizeUser":{"email":"johnnyadsantos@gmail.com"},"fileCount":"86","versionBytes":"8990267"},"type":"DEPLOY","releaseTime":"2022-10-06T01:20:37.752524174Z","releaseUser":{"email":"johnnyadsantos@gmail.com"}},"createTime":"2022-10-06T01:18:47.804168465Z","updateTime":"2022-10-06T16:40:46.206471791Z","retainedReleaseCount":10,"expireTime":"2022-11-05T16:40:46.206471791Z"}
[debug] [2022-10-06T16:40:46.428Z] [hosting] updated TTL for existing channel for site my-site {"name":"projects/my-project/sites/my-site/channels/MR-30","url":"https://my-site--mr-30-hsvhx3hn.web.app","release":{"name":"projects/my-project/sites/my-site/channels/MR-30/releases/1665019237752524","version":{"name":"projects/my-project/sites/my-site/versions/c3faa521f002d562","status":"FINALIZED","config":{"rewrites":[{"regex":"^/api(.*)$","run":{"serviceId":"api","region":"southamerica-east1"}},{"glob":"!/assets/**","path":"/index.html"},{"glob":"**","path":"/index.html"}],"cleanUrls":true,"trailingSlashBehavior":"REMOVE"},"labels":{"deployment-tool":"cli-firebase"},"createTime":"2022-10-06T01:20:19.103085Z","createUser":{"email":"johnnyadsantos@gmail.com"},"finalizeTime":"2022-10-06T01:20:37.098913Z","finalizeUser":{"email":"johnnyadsantos@gmail.com"},"fileCount":"86","versionBytes":"8990267"},"type":"DEPLOY","releaseTime":"2022-10-06T01:20:37.752524174Z","releaseUser":{"email":"johnnyadsantos@gmail.com"}},"createTime":"2022-10-06T01:18:47.804168465Z","updateTime":"2022-10-06T16:40:46.206471791Z","retainedReleaseCount":10,"expireTime":"2022-11-05T16:40:46.206471791Z"}
[info]
[info] === Deploying to 'my-project'...
[info]
[info] i  deploying hosting
[debug] [2022-10-06T16:40:46.430Z] >>> [apiv2][query] POST https://firebasehosting.googleapis.com/v1beta1/projects/-/sites/my-site/versions [none]
[debug] [2022-10-06T16:40:46.430Z] >>> [apiv2][body] POST https://firebasehosting.googleapis.com/v1beta1/projects/-/sites/my-site/versions {"status":"CREATED","labels":{"deployment-tool":"cli-firebase"}}
[debug] [2022-10-06T16:40:47.852Z] <<< [apiv2][status] POST https://firebasehosting.googleapis.com/v1beta1/projects/-/sites/my-site/versions 200
[debug] [2022-10-06T16:40:47.852Z] <<< [apiv2][body] POST https://firebasehosting.googleapis.com/v1beta1/projects/-/sites/my-site/versions {"name":"projects/1234/sites/my-site/versions/1234","status":"CREATED","config":{},"labels":{"deployment-tool":"cli-firebase"}}
[info] i  hosting[my-site]: beginning deploy...
[info] i  hosting[my-site]: found 84 files in build/web
[debug] [2022-10-06T16:40:47.922Z] [hosting] uploading with 200 concurrency
[debug] [2022-10-06T16:40:47.930Z] [hosting] hash cache [YnVpbGQvd2Vi] stored for 84 files
[debug] [2022-10-06T16:40:47.931Z] [hosting][hash queue][FINAL] {"max":2,"min":0,"avg":0.03121780396166577,"active":0,"complete":84,"success":84,"errored":0,"retried":0,"total":84,"elapsed":5}
[debug] [2022-10-06T16:40:47.931Z] >>> [apiv2][query] POST https://firebasehosting.googleapis.com/v1beta1/projects/1234/sites/my-site/versions/1234:populateFiles [none]
[debug] [2022-10-06T16:40:47.932Z] >>> [apiv2][body] POST https://firebasehosting.googleapis.com/v1beta1/projects/1234/sites/my-site/versions/1234:populateFiles {"files":{"/favicon.ico":"6886ceb013d7ca4e641a456c10028915d205e18900b372b785439f4554437612","/firebase-messaging-sw.js":"917857d32d50646ace59c23a95442ddd5205401ecbe0dc6050a7732c8ce8697a","/flutter.js":"68a37241339e3b6b99c825aab661dab7a77482fabc94be44f8a9505d7d5a1911","/flutter_service_worker.js":"e1464f5b36bd41028d84545c2e1b2a00b5c2611f41d79419def955e4d2982849","/index.html":"a9740c1835d8b638e8314175e27d661a9bf6ee75a983d686cad53f91d0d8209f","/main.dart.js":"5b8d0b2d0c456cf68fb3cb3fefe7fc459b74b40d3467fc6612a1b9770e5c485d","/manifest.json":"08aacedd3ffc68df9d1d244509d5835be23f2bf58b66bc96c078a0c62b076283","/version.json":"6867398d98e08fb03aae7886d09519550745650f277e85fdd9e374153b8317f0","/assets/AssetManifest.json":"9424bbc2cafed43294373c55fae7eb9c94957eb30546db25e465885587302d3b","/assets/FontManifest.json":"1a586cd5c666f53be57ae322c72fd0cbfcc36b740f3effefa13e097d6b8153d5","/assets/NOTICES":"65dd43983f8e05a71e7e820b7d48887ac64c0dd724a40c79fdb6e729a4daa407","/assets/assets/3th-party/js/jsQR.min.js":"e28d9aa416b401e6254e9a306adc79386a5d7b86663a95ef0683dbfbbb547428","/assets/assets/animations/icon.json":"1118ac9097916ea8cf3877f3a49e8ecc6f69c1b750dfd89d26e80bb8c2017f36","/assets/assets/fonts/satoshi/web/css/satoshi.css":"c7eba042be3c2416a2de5a3e9c5eb156905b35b363dc027e0fb30abc3b976038","/assets/assets/fonts/satoshi/web/fonts/Satoshi-Variable.ttf":"dbc5c30d80f1144bbaa7f571541d15c77c6fab2097d9454e49eab140316071aa","/assets/assets/fonts/satoshi/web/fonts/Satoshi-Variable.woff":"0f7baeb9851ac01eea7134fcddb159cf202fa7e69349e9ecec228eff196c4992","/assets/assets/fonts/satoshi/web/fonts/Satoshi-Variable.woff2":"d76f1cae7a0fa0225070d9eef0e68a5f742b66d8eee62178d591c825c33cb2a6","/assets/assets/fonts/satoshi/web/fonts/Satoshi-VariableItalic.ttf":"14789828811f67ae564c1035751d1571c7ea21f4ea0980f129b9173af7ab2cc3","/assets/assets/fonts/satoshi/web/fonts/Satoshi-VariableItalic.woff":"2933e1bd67bcef5aec65305695f1555acb3fa2c0a060ef63dc5c94fef6a981ed","/assets/assets/fonts/satoshi/web/fonts/Satoshi-VariableItalic.woff2":"0712df556a1bd83d302e82f753a96ff6f7edaca67de044e433396e4d97d1689e","/assets/assets/icons/phosphor/duotone/arrow-down-left.svg":"5b7560a2fd4bf5f72c90a16fbb6443e1c6f7e7c17729b789f63088b51a6b3974","/assets/assets/icons/phosphor/duotone/arrow-left.svg":"1d473199e5bcbf9be0a8cf235bc9e78d01117c336706a1c020b1c9cd049225ae","/assets/assets/icons/phosphor/duotone/calendar-x.svg":"dbdb00ef6b7de5efb9fffa3418e05350896997ca0109cb0be96d52cf4dc60703","/assets/assets/icons/phosphor/duotone/camera-rotate.svg":"47e596aa54965462e7d66b4f74a96e53272b76ed75b6c4b25708a25e37b07618","/assets/assets/icons/phosphor/duotone/camera.svg":"2fab4cd44c68d317eb6bef431e7c6b64c4ea9f506ec4e21325be609627a76319","/assets/assets/icons/phosphor/duotone/check-circle.svg":"ddc0e51450a04cb54c5a639dab8af043c9b1e8a69bf89ef256ce543f25a0224d","/assets/assets/icons/phosphor/duotone/confetti.svg":"63514f98fd0c8819504a761b25e66f879571dbd2ea0838f466d6cc80cfde4cef","/assets/assets/icons/phosphor/duotone/copy.svg":"2af1836a9e6649a52924a7eb0bc8e1385b31462d2f86f8378d8239a3ebb5d794","/assets/assets/icons/phosphor/duotone/currency-btc.svg":"136debb6c55fa4be8bf68ae85fe29ffb3be8212781de47b5d1fa7afaf1b66b75","/assets/assets/icons/phosphor/duotone/envelope.svg":"bf0d8a6493438fa84ed4cee4cae2740f2ddff82714e28c96e2b743695aef741d","/assets/assets/icons/phosphor/duotone/flashlight.svg":"181802ede7d0c213d3d62c92e8a945e74a013a36ae7962a071704991d7895a62","/assets/assets/icons/phosphor/duotone/hourglass-medium.svg":"ef2b1d46c0a94b12a17e352e1a14700a00b5719e5f58f6abb7190e89aec46705","/assets/assets/icons/phosphor/duotone/magnifying-glass.svg":"b1a22aa8ba763ed00c0f45fb630e0b5686751e122790b0e807c46953d1923129","/assets/assets/icons/phosphor/duotone/money.svg":"deaf086b5225708ef82ee1a0bb5801cf159f1025926de9d254ead9071f04b9a3","/assets/assets/icons/phosphor/duotone/paper-plane-tilt.svg":"06b0ad3f7fa4e02c1d391a9a4aabf3602b1314744f25a6648f55c86585cfed40","/assets/assets/icons/phosphor/duotone/play-circle.svg":"cfbdad21f3cfb6166cae9c958ea9c10c5149b9dba25c6a7afd94499b91e544b4","/assets/assets/icons/phosphor/duotone/question.svg":"f07e8c6439e3ae5abfe1b25d8960a2b038b39db084aa477bdc622311dde39d8a","/assets/assets/icons/phosphor/duotone/sign-out.svg":"2419a82141c6a28632017b3073513af1bb017b9b4098b6205253b4e49cadbd71","/assets/assets/icons/phosphor/duotone/telegram-logo.svg":"aa594d9349d7722d136b88d76050d55fed7a5cb9af5cb17609522642defcad78","/assets/assets/icons/phosphor/duotone/whatsapp-logo.svg":"0aa06b35ad847ba8f97e326598d5aaa1904fcfd603ce8c00b34dc4d12ca2bddd","/assets/assets/icons/phosphor/duotone/x-circle.svg":"4cd376b022122c49ab74d749bb9cd51fc9caaf7e9c9aa7c87ffca3eb2841ae0f","/assets/assets/images/logo.png":"6f914324847941442748be7653f4eb07cc2f48bd4e3fd9257d6832896d692894","/assets/assets/images/logo_secundary.svg":"296010999bc5715fc0861e4d7fde6ee340d492a284f325c160b4f35fe37eab8b","/assets/assets/images/dark/logo.png":"fe800a2cf8e9c249f6dea57518ff4ae423aeb7290e14fcedec50c597a54725ab","/assets/assets/licenses/Fontshare_EULA.txt":"fcbdb6760f3f31153b1444457e9bace9a9ce04224c9ad912beae3e801323e810","/assets/fonts/MaterialIcons-Regular.otf":"afeb5d8a2519cf6eef4ca5a451a202e0b71c658ab989b207b70967c9c5e1368f","/assets/packages/flutter_signin_button/assets/logos/facebook_new.png":"b1aeff59d59de073e2789952d431e6c6f62bc5fb11eba42fb306b3f5b4a8a00c","/assets/packages/flutter_signin_button/assets/logos/google_dark.png":"1b4876c9390964ad58bab3a65ebf886be9c8a5b48150bca6cf393a814cfd2b50","/assets/packages/flutter_signin_button/assets/logos/google_light.png":"5bfe4fb6f18ac766c7fdad295efd6ea2219d20cf99776f74265170ac83612b20","/assets/packages/flutter_signin_button/assets/logos/2.0x/facebook_new.png":"bbce65ea25b70a592cb80b58fda62c0917e81d350069b9ee0f6285456df44bed","/assets/packages/flutter_signin_button/assets/logos/2.0x/google_dark.png":"4dd4e141946e4e9a6b4332693a2847165139e368ce5b3be8d54154a7b1ea713e","/assets/packages/flutter_signin_button/assets/logos/2.0x/google_light.png":"4787758c88c55981215526cbb987e6bb917753d12022fd655e41035b79c80f36","/assets/packages/flutter_signin_button/assets/logos/3.0x/facebook_new.png":"53ace88da120eb71a1f7ba77e5afeabbf2ad7ac7176320d435819d385bccd795","/assets/packages/flutter_signin_button/assets/logos/3.0x/google_dark.png":"861e8426b48b8464b731740ce7fcb732838835933f3c32c375677a4c1df4177b","/assets/packages/flutter_signin_button/assets/logos/3.0x/google_light.png":"1e7a5bf94bc148c2b58174a3a0040d4311fca5122869ec3703e9b12012aaf934","/assets/packages/fluttertoast/assets/toastify.css":"b3106479402ae9cdfaebc5e46d5b8f807692c6fff685bd43b29ef265fe1f59de","/assets/packages/fluttertoast/assets/toastify.js":"af7cc93040f6a408fc5081768148326a2d6fa411d38e24c6adfa5dc067f8a1cd","/assets/packages/font_awesome_flutter/lib/fonts/fa-brands-400.ttf":"cb8d0cf50901e683424c497276b238e49874b5a0b4ed5cf0c2c6590843115f34","/assets/packages/font_awesome_flutter/lib/fonts/fa-regular-400.ttf":"d8398fa4468c375c88e1dd0b248a01cde6d3f1f5954c66ea56ebd14eaf2c9132","/assets/packages/font_awesome_flutter/lib/fonts/fa-solid-900.ttf":"624d1177420db4d61e859b6fba807960a0540a611f6d4b2fc8b2e940462c6fb3","/assets/packages/phosphor_flutter/lib/fonts/phosphor.ttf":"1a29e7ab5568ac4d24379e367b48a5e3281330f5513b67e50c16b5e773956d8b","/assets/packages/widgetbook/google_fonts/Nunito-Black.ttf":"cef503f467a8445af96307ecdb1e1e7dca20f3720a1857318d53eb1b9cc67e5c","/assets/packages/widgetbook/google_fonts/Nunito-BlackItalic.ttf":"b7f3dbb14741411c636b4585236f1246720a54a598cdcd307be18a645c6f7fd3","/assets/packages/widgetbook/google_fonts/Nunito-Bold.ttf":"3258707def1f726e475704ea60e97284ac11c3fd3d0375f53b09d7c42aa2805a","/assets/packages/widgetbook/google_fonts/Nunito-BoldItalic.ttf":"9e0c860071750f89921b7c468a351941af9ca4f9dbbf9f77e9692754c5075c09","/assets/packages/widgetbook/google_fonts/Nunito-ExtraBold.ttf":"3a50b34992977345a99fe8a0d16c32b0d391861bf95741496d32eff58fdbb8e8","/assets/packages/widgetbook/google_fonts/Nunito-ExtraBoldItalic.ttf":"40cc978dacccc82e77bbd1b7a80ab217627c96dddf7f042f1d943a00f4cdbeb6","/assets/packages/widgetbook/google_fonts/Nunito-ExtraLight.ttf":"7cc1e094376e83cbfe0f124ee6d9f2935b8a79adbcd20995511306c2caa11e5a","/assets/packages/widgetbook/google_fonts/Nunito-ExtraLightItalic.ttf":"fbd34c1d9556649b59bc08517f5fe5393ad622a8f2ab267b17121f39ce39afd8","/assets/packages/widgetbook/google_fonts/Nunito-Italic.ttf":"6612e4e30ea7164f8724e1f6f6c74023164cb31b96af2dbead7603d4df00708b","/assets/packages/widgetbook/google_fonts/Nunito-Light.ttf":"6b83611c3cf4715897cc6c95df424ff3beccc9e47e12e1e68a743782a7390344","/assets/packages/widgetbook/google_fonts/Nunito-LightItalic.ttf":"081766c4c14f30126bfedc69770ba01218e6ed132398ccc40d22fb02222ebe27","/assets/packages/widgetbook/google_fonts/Nunito-Regular.ttf":"f1ba390986d4b82b2d9d680b4515f68d1854c5e14d64ca56783a800bb74ccc61","/assets/packages/widgetbook/google_fonts/Nunito-SemiBold.ttf":"2f5c7d15543967b407be35831ffe715ad9db18e62b18ac2796cee46de6d68886","/assets/packages/widgetbook/google_fonts/Nunito-SemiBoldItalic.ttf":"ff606f838893944e94927b5be268dd0d5a8e0b3ca033a05849d7f767f3af7b8e","/assets/packages/widgetbook/google_fonts/OFL.txt":"0ec4f3fa62447de6d6dc5b32b6d78393f66cdaea7dfbb6bed9e31a8e97f1498a","/assets/shaders/ink_sparkle.frag":"bdaf291a118e68fb9d7b93b72a0ff74982d0c613c0d210aa981e2322f3dd75cf","/canvaskit/canvaskit.js":"8c1e2ccfb8a5ae261329285846e51a99d878535b368c07fa4ee49d3ffb463fce","/canvaskit/canvaskit.wasm":"d845fac2ce5701b2f761a737012038d9666f42e2593a8e4db2052afde2ea1dd2","/canvaskit/profiling/canvaskit.js":"83191929a757e84e35e50f7aaaefdca6cdf7bbfd1d41ee4463f0df377c59f4b2","/canvaskit/profiling/canvaskit.wasm":"0fedd1a3f5e61921626136b46225454c7ff603a26ffc284bd4ef4840186aef76","/icons/Icon-192.png":"eda68b7d01be0146ded68dc0d6aa6517a67eb2031b57d4139134d1dd6aafced9","/icons/Icon-512.png":"8adda95d18cbc6c53da0a8c449a36341ef21605c952bf334317b8f0acd0e5951","/icons/Icon-96.png":"a080579892c95305171bac7c72207c08f8f4e8e7f84ce8756890a6b44f4e03ac"}}
[debug] [2022-10-06T16:40:49.212Z] <<< [apiv2][status] POST https://firebasehosting.googleapis.com/v1beta1/projects/1234/sites/my-site/versions/1234:populateFiles 200
[debug] [2022-10-06T16:40:49.212Z] <<< [apiv2][body] POST https://firebasehosting.googleapis.com/v1beta1/projects/1234/sites/my-site/versions/1234:populateFiles {"uploadUrl":"https://upload-firebasehosting.googleapis.com/upload/sites/my-site/versions/1234/files"}
[debug] [2022-10-06T16:40:49.213Z] [hosting][populate queue][FINAL] {"max":1284,"min":1284,"avg":1284,"active":0,"complete":1,"success":1,"errored":0,"retried":0,"total":1,"elapsed":1284}
[debug] [2022-10-06T16:40:49.213Z] [hosting] uploads queued: 0
[debug] [2022-10-06T16:40:49.213Z] [hosting][upload queue][FINAL] {"max":0,"min":9999999999,"avg":0,"active":0,"complete":0,"success":0,"errored":0,"retried":0,"total":0,"elapsed":1665074449213}
[info] ✔  hosting[my-site]: file upload complete
[debug] [2022-10-06T16:40:49.214Z] [hosting] deploy completed after 1357ms
[debug] [2022-10-06T16:40:49.215Z] [
  {
    "config": {
      "public": "build/web",
      "ignore": [
        "firebase.json",
        "**/.*",
        "**/node_modules/**"
      ],
      "target": "app",
      "cleanUrls": true,
      "trailingSlash": false,
      "rewrites": [
        {
          "regex": "/api(.*)",
          "run": {
            "serviceId": "api",
            "region": "southamerica-east1"
          }
        },
        {
          "source": "!/assets/**",
          "destination": "/index.html"
        },
        {
          "source": "**",
          "destination": "/index.html"
        }
      ],
      "site": "my-site"
    },
    "version": "projects/1234/sites/my-site/versions/1234"
  }
]
[info] i  hosting[my-site]: finalizing version...
[debug] [2022-10-06T16:40:49.217Z] >>> [apiv2][query] GET https://cloudfunctions.googleapis.com/v1/projects/my-project/locations/-/functions [none]
[debug] [2022-10-06T16:40:50.080Z] <<< [apiv2][status] GET https://cloudfunctions.googleapis.com/v1/projects/my-project/locations/-/functions 403
[debug] [2022-10-06T16:40:50.080Z] <<< [apiv2][body] GET https://cloudfunctions.googleapis.com/v1/projects/my-project/locations/-/functions {"error":{"code":403,"message":"Cloud Functions API has not been used in project 1234 before or it is disabled. Enable it by visiting https://console.developers.google.com/apis/api/cloudfunctions.googleapis.com/overview?project=1234 then retry. If you enabled this API recently, wait a few minutes for the action to propagate to our systems and retry.","status":"PERMISSION_DENIED","details":[{"@type":"type.googleapis.com/google.rpc.Help","links":[{"description":"Google developers console API activation","url":"https://console.developers.google.com/apis/api/cloudfunctions.googleapis.com/overview?project=1234"}]},{"@type":"type.googleapis.com/google.rpc.ErrorInfo","reason":"SERVICE_DISABLED","domain":"googleapis.com","metadata":{"service":"cloudfunctions.googleapis.com","consumer":"projects/1234"}}]}}
[debug] [2022-10-06T16:40:50.082Z] [functions] failed to list functions for my-project
[debug] [2022-10-06T16:40:50.082Z] [functions] HTTP Error: 403, Cloud Functions API has not been used in project 1234 before or it is disabled. Enable it by visiting https://console.developers.google.com/apis/api/cloudfunctions.googleapis.com/overview?project=1234 then retry. If you enabled this API recently, wait a few minutes for the action to propagate to our systems and retry.
[debug] [2022-10-06T16:40:50.084Z] FirebaseError: HTTP Error: 403, Cloud Functions API has not been used in project 1234 before or it is disabled. Enable it by visiting https://console.developers.google.com/apis/api/cloudfunctions.googleapis.com/overview?project=1234 then retry. If you enabled this API recently, wait a few minutes for the action to propagate to our systems and retry.
    at responseToError (/home/johnny/.npm-global/lib/node_modules/firebase-tools/lib/responseToError.js:49:12)
    at RetryOperation._fn (/home/johnny/.npm-global/lib/node_modules/firebase-tools/lib/apiv2.js:288:77)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
[error]
[error] Error: Failed to list functions for my-project

@marcello-morena
Copy link

Same here. Our CI/CD for deploying to Firebase Hosting stopped working after this release. The error is that it could not list our cloud functions.
I hope the devs fix this real quick.

@bkendall bkendall self-assigned this Oct 6, 2022
@bkendall
Copy link
Contributor

bkendall commented Oct 6, 2022

For folks who are seeing this: can you tell me how you've configured your predeploy steps? I'm struggling to reproduce this trivially by adding hosting[].predeploy = [steps] to my firebase.json.

@xEvanM
Copy link

xEvanM commented Oct 6, 2022

I've tried calling run: npm install firebase-tools@11.13.0 before calling FirebaseExtended/action-hosting-deploy@v0 but still get this error: The following package was not found and will be installed: firebase-tools@11.14.0

As seen in the screenshot, run: npm install firebase-tools@11.13.0 actually worked as expected but this installation didn't seem to be recognised when I called the action-hosting-deploy

image

@dtinth
Copy link
Author

dtinth commented Oct 6, 2022

@bkendall I can reproduce this on one of my open source projects.

Hope it helps!

@bkendall
Copy link
Contributor

bkendall commented Oct 6, 2022

@dtinth does it fail to run the predeploy script if you run the same command (firebase hosting:channel:deploy) locally?

@bkendall
Copy link
Contributor

bkendall commented Oct 6, 2022

@johnnyasantoss the permissions issue you see is #5071 and has a fix on the way, fwiw. 🙂 I'm just really stumped on trying to get this issue happening locally.

@dtinth
Copy link
Author

dtinth commented Oct 6, 2022

@bkendall No. I mean, yes, it fails to run. It does not run the predeploy script.

❯ yarn firebase hosting:channel:deploy pr71-predeploy --expires 7d --project webmidicon --json --debug
{
  "status": "error",
  "error": "Specified \"public\" directory \"dist\" does not exist, can't deploy hosting to site \"webmidicon\""
}

@bkendall
Copy link
Contributor

bkendall commented Oct 6, 2022

Okay, I'm thinking out loud a bit. The predeploy value should be picked up by by the deploy target (hosting) and run if it's found. I'm debugging the code and am struggling to see where it may be failing to pick it up. I'm still looking, but confused.

@bkendall
Copy link
Contributor

bkendall commented Oct 6, 2022

Here's a question: if you have a way to do it, does it work with just firebase deploy --only hosting, rather than hosting:channel:deploy?

edit: I don't think this is the difference.

@dtinth
Copy link
Author

dtinth commented Oct 6, 2022

@bkendall The easiest way to reproduce the error would be to follow the same steps done by GitHub Actions (i.e. cloning the same repo, checking out the same commit, running the same commands but with a different Firebase project).

From my further testing, it seems that firebase-tools now checks for the existence of the public directory before running the predeploy script. If the directory exists (even if it’s completely empty), the predeploy script does get run.

Upon further digging, it seems that these PRs are related to the introduction of this bug:

With the above changes, firebase.json config is validated before running predeploy. The error message seen in the logs came from the validation phase, which happens before predeploy.

A validation stop checks if the directory specified in "public" exists, and fails early if it doesn’t, so the predeploy script never got a chance to run.

@bkendall
Copy link
Contributor

bkendall commented Oct 6, 2022

A validation stop checks if the directory specified in "public" exists, and fails early if it doesn’t, so the predeploy script never got a chance to run.

@dtinth that is different than what I thought that issue was, and is good insight. I think I know how to address that!

@bkendall
Copy link
Contributor

bkendall commented Oct 6, 2022

it's a really, really hacky fix, but if you mkdir [the public directory] before running the deploy, that's a workaround to unblock.

I have the code in front of me now and am furiously making changes

@johnnyasantoss
Copy link

@bkendall is there an ETA to deploy this fix along with the fix for #5071?

@bkendall
Copy link
Contributor

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

9 participants