firebase / firebase-tools

The Firebase Command Line Tools
MIT License
4.01k stars 925 forks source link

Unable to Deploy Next.js to Firebase Hosting #5754

Closed iamalvisng closed 1 year ago

iamalvisng commented 1 year ago

[REQUIRED] Environment info

Firebase tools: 11.18.0

Dependencies that are worth mentioning:

"firebase": "^9.16.0",
"firebase-admin": "^11.5.0",
"next": "13.1.6",
"react": "18.2.0",
"react-dom": "18.2.0",

Platform: macOS

[REQUIRED] Test case

We have not been able to deploy via our CI/CD with version 11.18.0 over the past few days. It was working fine last week, but no longer the case now with the exact same codebase. Below is a snippet from our workflow file.

jobs:
  build_and_deploy:
    runs-on: ubuntu-latest
    steps:
      - name: Checkout
        uses: actions/checkout@v2

      - uses: pnpm/action-setup@v2.2.4
        with:
          version: latest
      - run: pnpm install
      - run: pnpm build

      - name: Deploy to Firebase Hosting
        uses: FirebaseExtended/action-hosting-deploy@v0
        with:
          firebaseToolsVersion: 11.18.0
          repoToken: ${{ secrets.repo_token }}
          firebaseServiceAccount: ${{ secrets.service_account }}
          channelId: live
          projectId: ${{ secrets.firebase_project_id }}
        env:
          FIREBASE_CLI_EXPERIMENTS: webframeworks

[REQUIRED] Steps to reproduce

Deploy a Next.js with firebase-tools 11.8.0 as a 2nd Gen Cloud Function

[REQUIRED] Expected behavior

  1. App should be successfully deployed
  2. Deployed Cloud Function should not be in error

[REQUIRED] Actual behavior

  1. Failed to deploy the app
  2. Deployed Cloud Function is problematic(with red exclamation mark stated Function failed to deploy)
  /usr/local/bin/npx firebase-tools@11.18.0 deploy --only hosting --project *** --debug
  [2023-04-28T08:50:44.449Z] > 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"]
  [2023-04-28T08:50:44.616Z] [iam] checking project *** for permissions ["firebase.projects.get","firebasehosting.sites.update"]
  [2023-04-28T08:50:44.620Z] >>> [apiv2][query] POST https://cloudresourcemanager.googleapis.com/v1/projects/***:testIamPermissions [none]
  [2023-04-28T08:50:44.621Z] >>> [apiv2][(partial)header] POST https://cloudresourcemanager.googleapis.com/v1/projects/***:testIamPermissions x-goog-quota-user=projects/***
  [2023-04-28T08:50:44.621Z] >>> [apiv2][body] POST https://cloudresourcemanager.googleapis.com/v1/projects/***:testIamPermissions ***"permissions":["firebase.projects.get","firebasehosting.sites.update"]***
  [2023-04-28T08:50:44.709Z] <<< [apiv2][status] POST https://cloudresourcemanager.googleapis.com/v1/projects/***:testIamPermissions 200
  [2023-04-28T08:50:44.709Z] <<< [apiv2][body] POST https://cloudresourcemanager.googleapis.com/v1/projects/***:testIamPermissions ***"permissions":["firebase.projects.get","firebasehosting.sites.update"]***
  [2023-04-28T08:50:44.714Z] >>> [apiv2][query] GET https://firebase.googleapis.com/v1beta1/projects/*** [none]
  [2023-04-28T08:50:44.991Z] <<< [apiv2][status] GET https://firebase.googleapis.com/v1beta1/projects/*** 200
  [2023-04-28T08:50:44.992Z] <<< [apiv2][body] GET https://firebase.googleapis.com/v1beta1/projects/*** ***"projectId":"***","projectNumber":"***","displayName":"echo-development","name":"projects/***","resources":***"hostingSite":"***"***,"state":"ACTIVE","etag":"1_fc103cae-3788-40cf-aae1-7935513bd0a2"***
  [2023-04-28T08:50:59.405Z] >>> [apiv2][query] GET https://firebasehosting.googleapis.com/v1beta1/projects/***/sites pageToken=&pageSize=10
  [2023-04-28T08:50:59.694Z] <<< [apiv2][status] GET https://firebasehosting.googleapis.com/v1beta1/projects/***/sites 200
  [2023-04-28T08:50:59.694Z] <<< [apiv2][body] GET https://firebasehosting.googleapis.com/v1beta1/projects/***/sites ***"sites":[***"name":"projects/***/sites/***","defaultUrl":"https://***.web.app","appId":"***","type":"DEFAULT_SITE"***]***
  [2023-04-28T08:50:59.696Z] >>> [apiv2][query] GET https://firebase.googleapis.com/v1beta1/projects/-/webApps/***/config [none]
  [2023-04-28T08:51:00.039Z] <<< [apiv2][status] GET https://firebase.googleapis.com/v1beta1/projects/-/webApps/***/config 200
  [2023-04-28T08:51:00.040Z] <<< [apiv2][body] GET https://firebase.googleapis.com/v1beta1/projects/-/webApps/***/config ***"projectId":"***","appId":"***","storageBucket":"***","apiKey":"***","authDomain":"***","messagingSenderId":"***","measurementId":"***"***
  Detected a Next.js codebase. This is an experimental integration, proceed with caution.

  info  - Linting and checking validity of types...
  info  - Creating an optimized production build...
  info  - Compiled successfully
  info  - Collecting page data...
  info  - Generating static pages (0/3)
  Your custom Document (pages/_document) did not render all the required subcomponent.
  Missing component: <Head />
  Read how to fix here: https://nextjs.org/docs/messages/missing-document-component
  Your custom Document (pages/_document) did not render all the required subcomponent.
  Missing component: <Head />
  Read how to fix here: https://nextjs.org/docs/messages/missing-document-component
  Your custom Document (pages/_document) did not render all the required subcomponent.
  Missing component: <Head />
  Read how to fix here: https://nextjs.org/docs/messages/missing-document-component
  info  - Generating static pages (3/3)
  info  - Finalizing page optimization...

  Route (pages)                              Size     First Load JS
  ┌ ○ /                                      1.5 kB         74.6 kB
  ├   /_app                                  0 B            73.1 kB
  └ ○ /404                                   182 B          73.3 kB
  + First Load JS shared by all              73.1 kB
    ├ chunks/framework-ac88a2a245aea9ab.js   45.2 kB
    ├ chunks/main-2c0669d9c9806c39.js        26.8 kB
    ├ chunks/pages/_app-bedf99e5729d36c5.js  288 B
    └ chunks/webpack-8fa1640cc84ba8fe.js     750 B

  ○  (Static)  automatically rendered as static HTML (uses no initial props)

  up to date in 3s

  125 packages are looking for funding
    run `npm fund` for details

  === Deploying to '***'...

  i  deploying functions, hosting 
  [2023-04-28T08:51:42.147Z] >>> [apiv2][query] GET https://firebase.googleapis.com/v1beta1/projects/*** [none]
  [2023-04-28T08:51:42.484Z] <<< [apiv2][status] GET https://firebase.googleapis.com/v1beta1/projects/*** 200
  [2023-04-28T08:51:42.484Z] <<< [apiv2][body] GET https://firebase.googleapis.com/v1beta1/projects/*** ***"projectId":"***","projectNumber":"***","displayName":"echo-development","name":"projects/***","resources":***"hostingSite":"***"***,"state":"ACTIVE","etag":"1_fc103cae-3788-40cf-aae1-7935513bd0a2"***
  i  functions: ensuring required API cloudfunctions.googleapis.com is enabled... 
  i  functions: ensuring required API cloudbuild.googleapis.com is enabled... 
  i  artifactregistry: ensuring required API artifactregistry.googleapis.com is enabled... 
  [2023-04-28T08:51:42.487Z] >>> [apiv2][query] GET https://serviceusage.googleapis.com/v1/projects/***/services/cloudfunctions.googleapis.com [none]
  [2023-04-28T08:51:42.487Z] >>> [apiv2][(partial)header] GET https://serviceusage.googleapis.com/v1/projects/***/services/cloudfunctions.googleapis.com x-goog-quota-user=projects/***
  [2023-04-28T08:51:42.489Z] >>> [apiv2][query] GET https://serviceusage.googleapis.com/v1/projects/***/services/runtimeconfig.googleapis.com [none]
  [2023-04-28T08:51:42.489Z] >>> [apiv2][(partial)header] GET https://serviceusage.googleapis.com/v1/projects/***/services/runtimeconfig.googleapis.com x-goog-quota-user=projects/***
  [2023-04-28T08:51:42.490Z] >>> [apiv2][query] GET https://serviceusage.googleapis.com/v1/projects/***/services/cloudbuild.googleapis.com [none]
  [2023-04-28T08:51:42.490Z] >>> [apiv2][(partial)header] GET https://serviceusage.googleapis.com/v1/projects/***/services/cloudbuild.googleapis.com x-goog-quota-user=projects/***
  [2023-04-28T08:51:42.492Z] >>> [apiv2][query] GET https://serviceusage.googleapis.com/v1/projects/***/services/artifactregistry.googleapis.com [none]
  [2023-04-28T08:51:42.492Z] >>> [apiv2][(partial)header] GET https://serviceusage.googleapis.com/v1/projects/***/services/artifactregistry.googleapis.com x-goog-quota-user=projects/***
  [2023-04-28T08:51:42.689Z] <<< [apiv2][status] GET https://serviceusage.googleapis.com/v1/projects/***/services/runtimeconfig.googleapis.com 200
  [2023-04-28T08:51:42.689Z] <<< [apiv2][body] GET https://serviceusage.googleapis.com/v1/projects/***/services/runtimeconfig.googleapis.com [omitted]
  [2023-04-28T08:51:42.695Z] <<< [apiv2][status] GET https://serviceusage.googleapis.com/v1/projects/***/services/cloudbuild.googleapis.com 200
  [2023-04-28T08:51:42.695Z] <<< [apiv2][body] GET https://serviceusage.googleapis.com/v1/projects/***/services/cloudbuild.googleapis.com [omitted]
  ✔  functions: required API cloudbuild.googleapis.com is enabled 
  [2023-04-28T08:51:42.701Z] <<< [apiv2][status] GET https://serviceusage.googleapis.com/v1/projects/***/services/cloudfunctions.googleapis.com 200
  [2023-04-28T08:51:42.702Z] <<< [apiv2][body] GET https://serviceusage.googleapis.com/v1/projects/***/services/cloudfunctions.googleapis.com [omitted]
  ✔  functions: required API cloudfunctions.googleapis.com is enabled 
  [2023-04-28T08:51:42.712Z] <<< [apiv2][status] GET https://serviceusage.googleapis.com/v1/projects/***/services/artifactregistry.googleapis.com 200
  [2023-04-28T08:51:42.712Z] <<< [apiv2][body] GET https://serviceusage.googleapis.com/v1/projects/***/services/artifactregistry.googleapis.com [omitted]
  ✔  artifactregistry: required API artifactregistry.googleapis.com is enabled 
  [2023-04-28T08:51:42.713Z] >>> [apiv2][query] GET https://firebase.googleapis.com/v1beta1/projects/***/adminSdkConfig [none]
  [2023-04-28T08:51:42.968Z] <<< [apiv2][status] GET https://firebase.googleapis.com/v1beta1/projects/***/adminSdkConfig 200
  [2023-04-28T08:51:42.976Z] <<< [apiv2][body] GET https://firebase.googleapis.com/v1beta1/projects/***/adminSdkConfig ***"projectId":"***","storageBucket":"***"***
  [2023-04-28T08:51:42.976Z] >>> [apiv2][query] GET https://runtimeconfig.googleapis.com/v1beta1/projects/***/configs [none]
  [2023-04-28T08:51:43.098Z] <<< [apiv2][status] GET https://runtimeconfig.googleapis.com/v1beta1/projects/***/configs 200
  [2023-04-28T08:51:43.098Z] <<< [apiv2][body] GET https://runtimeconfig.googleapis.com/v1beta1/projects/***/configs ***
  i  functions: preparing codebase firebase-frameworks-*** for deployment 
  [2023-04-28T08:51:43.102Z] Validating nodejs source
  ⚠  functions: package.json indicates an outdated version of firebase-functions. Please upgrade using npm install --save firebase-functions@latest in your functions directory. 
  ⚠  functions: Please note that there will be breaking changes when you upgrade. 
  [2023-04-28T08:51:45.132Z] > [functions] package.json contents: ***
    "name": "echo-frontend-app",
    "version": "0.1.0",
    "private": true,
    "scripts": ***
      "dev": "next dev",
      "build": "next build",
      "export": "next export",
      "start": "next start",
      "lint": "next lint",
      "test": "jest --passWithNoTests",
      "test:watch": "pnpm test -- --watch",
      "generate": "plop",
      "emulators:start": "firebase emulators:start --import=./echo-firebase-seed",
      "emulators:export": "firebase emulators:export ./echo-firebase-seed"
    ***,
    "lint-staged": ***
      "*.***js,jsx,ts,tsx***": [
        "eslint --fix",
        "git add"
      ],
      "*.***json,md***": [
        "prettier --write",
        "git add"
      ]
    ***,
    "dependencies": ***
      "@hookform/resolvers": "^2.9.11",
      "@next/font": "13.1.6",
      "@popperjs/core": "^2.11.6",
      "@reduxjs/toolkit": "^1.9.3",
      "@stitches/react": "^1.2.8",
      "@tanstack/match-sorter-utils": "^8.7.6",
      "@tanstack/react-table": "^8.7.9",
      "@types/node": "18.11.18",
      "@types/react": "18.0.27",
      "@types/react-datepicker": "^4.10.0",
      "@types/react-dom": "18.0.10",
      "@typescript-eslint/parser": "^5.50.0",
      "axios": "^1.3.2",
      "bootstrap": "^5.2.3",
      "csstype": "^3.1.1",
      "date-fns": "^2.29.3",
      "eslint": "8.33.0",
      "eslint-config-next": "13.1.6",
      "firebase": "^9.16.0",
      "firebase-admin": "^11.5.0",
      "next": "13.1.6",
      "nookies": "^2.5.2",
      "pino": "^8.11.0",
      "pino-pretty": "^10.0.0",
      "react": "18.2.0",
      "react-bootstrap": "^2.7.0",
      "react-datepicker": "^4.10.0",
      "react-dom": "18.2.0",
      "react-hook-form": "^7.43.5",
      "react-hook-form-persist": "^3.0.0",
      "react-hot-toast": "^2.4.0",
      "react-redux": "^8.0.5",
      "reactfire": "^4.2.2",
      "redux": "^4.2.1",
      "redux-persist": "^6.0.0",
      "type-fest": "^3.7.2",
      "typescript": "4.9.5",
      "yup": "^1.0.2",
      "zod": "^3.20.6",
      "firebase-frameworks": "^0.6.0",
      "firebase-functions": "^3.23.0"
    ***,
    "main": "server.js",
    "engines": ***
      "node": "18"
    ***
  ***
  [2023-04-28T08:51:45.132Z] Building nodejs source
  i  functions: Loaded environment variables from .env. 
  [2023-04-28T08:51:45.136Z] Found functions.yaml. Got spec: ***
    "endpoints": ***
      "ssrechodevelopment378010": ***
        "platform": "gcfv2",
        "region": [
          "us-central1"
        ],
        "labels": ***,
        "httpsTrigger": ***,
        "entryPoint": "ssr"
      ***
    ***,
    "specVersion": "v1alpha1",
    "requiredAPIs": []
  ***
  i  functions: preparing .firebase/***/functions directory for uploading... 
  i  functions: packaged /home/runner/work/echo-frontend-app/echo-frontend-app/.firebase/***/functions (2.16 MB) for uploading 
  [2023-04-28T08:51:45.496Z] >>> [apiv2][query] GET https://cloudfunctions.googleapis.com/v1/projects/***/locations/-/functions [none]
  [2023-04-28T08:51:45.873Z] <<< [apiv2][status] GET https://cloudfunctions.googleapis.com/v1/projects/***/locations/-/functions 200
  [2023-04-28T08:51:45.874Z] <<< [apiv2][body] GET https://cloudfunctions.googleapis.com/v1/projects/***/locations/-/functions ***"functions":[***"name":"projects/***/locations/europe-central2/functions/beforeUserCreated","httpsTrigger":***"url":"https://europe-central2-***.cloudfunctions.net/beforeUserCreated","securityLevel":"SECURE_ALWAYS"***,"status":"ACTIVE","entryPoint":"beforeUserCreated","timeout":"60s","availableMemoryMb":256,"serviceAccountEmail":"***@appspot.gserviceaccount.com","updateTime":"2023-04-28T08:11:27.828Z","versionId":"1","labels":***"deployment-tool":"cli-firebase","deployment-blocking":"before-create","firebase-functions-hash":"2b91ff36e0042193216f1f1af3dfdeac4f709373"***,"sourceUploadUrl":"https://storage.googleapis.com/uploads-322033870716.europe-central2.cloudfunctions.appspot.com/de2a31c0-c8b5-4c67-9189-fa3e081992d7.zip","environmentVariables":***"FIREBASE_CONFIG":"***\"projectId\":\"***\",\"storageBucket\":\"***\"***","GCLOUD_PROJECT":"***","EVENTARC_CLOUD_EVENT_SOURCE":"projects/***/locations/europe-central2/functions/beforeUserCreated"***,"runtime":"nodejs16","ingressSettings":"ALLOW_ALL","buildId":"d658fdfd-ef36-44ea-a738-8d8fdf517064","buildEnvironmentVariables":***"GOOGLE_NODE_RUN_SCRIPTS":""***,"buildName":"projects/***/locations/europe-central2/builds/d658fdfd-ef36-44ea-a738-8d8fdf517064","dockerRegistry":"ARTIFACT_REGISTRY"***,***"name":"projects/***/locations/europe-central2/functions/beforeUserSignedIn","httpsTrigger":***"url":"https://europe-central2-***.cloudfunctions.net/beforeUserSignedIn","securityLevel":"SECURE_ALWAYS"***,"status":"ACTIVE","entryPoint":"beforeUserSignedIn","timeout":"60s","availableMemoryMb":256,"serviceAccountEmail":"***@appspot.gserviceaccount.com","updateTime":"2023-04-28T08:11:41.991Z","versionId":"1","labels":***"deployment-tool":"cli-firebase","deployment-blocking":"before-sign-in","firebase-functions-hash":"2b91ff36e0042193216f1f1af3dfdeac4f709373"***,"sourceUploadUrl":"https://storage.googleapis.com/uploads-322033870716.europe-central2.cloudfunctions.appspot.com/de2a31c0-c8b5-4c67-9189-fa3e081992d7.zip","environmentVariables":***"FIREBASE_CONFIG":"***\"projectId\":\"***\",\"storageBucket\":\"***\"***","GCLOUD_PROJECT":"***","EVENTARC_CLOUD_EVENT_SOURCE":"projects/***/locations/europe-central2/functions/beforeUserSignedIn"***,"runtime":"nodejs16","ingressSettings":"ALLOW_ALL","buildId":"d658fdfd-ef36-44ea-a738-8d8fdf517064","buildEnvironmentVariables":***"GOOGLE_NODE_RUN_SCRIPTS":""***,"buildName":"projects/***/locations/europe-central2/builds/d658fdfd-ef36-44ea-a738-8d8fdf517064","dockerRegistry":"ARTIFACT_REGISTRY"***]***
  [2023-04-28T08:51:45.875Z] >>> [apiv2][query] GET https://cloudfunctions.googleapis.com/v2/projects/***/locations/-/functions filter=environment%3D%22GEN_2%22
  [2023-04-28T08:51:46.393Z] <<< [apiv2][status] GET https://cloudfunctions.googleapis.com/v2/projects/***/locations/-/functions 200
  [2023-04-28T08:51:46.393Z] <<< [apiv2][body] GET https://cloudfunctions.googleapis.com/v2/projects/***/locations/-/functions ***"functions":[***"name":"projects/***/locations/europe-central2/functions/notificationPubSubEventHandler","buildConfig":***"build":"projects/***/locations/europe-central2/builds/d9b4c1c3-5ae7-4c0c-8b6f-f8b5c595c925","runtime":"php81","entryPoint":"notificationPubSubEventHandler","source":***"storageSource":***"bucket":"gcf-v2-sources-***-europe-central2","object":"notificationPubSubEventHandler/function-source.zip"***,"sourceProvenance":***"resolvedStorageSource":***"bucket":"gcf-v2-sources-***-europe-central2","object":"notificationPubSubEventHandler/function-source.zip","generation":"1682667035458206"***,"serviceConfig":***"service":"projects/***/locations/europe-central2/services/notificationpubsubeventhandler","timeoutSeconds":60,"environmentVariables":***"ENVIRONMENT":"DEVELOPMENT","GOOGLE_APPLICATION_CREDENTIALS":"/workspace/gha-creds-d1adeedee970f1b3.json","GOOGLE_CLOUD_PROJECT":"***","SENDER_EMAIL":"echo.admin@yopeso.com","SLACK_BOT_TOKEN":"1//0gl_TiSCYcspQCgYIARAAGBASNwF-L9IrqVQ3NsXoqWESwGhwYNzl-KIQ9Prm7Z6aU90jL5Cy59mQ0gzEclMPxhWd6aq18HA-MaY","SLACK_POST_MESSAGE_ENDPOINT":"https://slack.com/api/chat.postMessage","SLACK_USER_LIST_ENDPOINT":"https://slack.com/api/users.list","SUBSCRIPTION":"projects/***/subscriptions/echo-notification-subscriber"***,"maxInstanceCount":100,"ingressSettings":"ALLOW_ALL","uri":"https://notificationpubsubeventhandler-bxdz7k6agq-lm.a.run.app","serviceAccountEmail":"notification-email-dev@***.iam.gserviceaccount.com","availableMemory":"256M","allTrafficOnLatestRevision":true,"revision":"notificationpubsubeventhandler-00001-rez","maxInstanceRequestConcurrency":1,"availableCpu":"0.1666"***,"eventTrigger":***"trigger":"projects/***/locations/europe-central2/triggers/notificationpubsubeventhandler-758701","triggerRegion":"europe-central2","eventType":"google.cloud.pubsub.topic.v1.messagePublished","pubsubTopic":"projects/***/topics/echo-notifications","serviceAccountEmail":"notification-email-dev@***.iam.gserviceaccount.com","retryPolicy":"RETRY_POLICY_DO_NOT_RETRY"***,"state":"ACTIVE","updateTime":"2023-04-28T07:32:32.653303635Z","labels":***"deployment-tool":"cli-gcloud"***,"environment":"GEN_2"***,***"name":"projects/***/locations/europe-central2/functions/processnotification","buildConfig":***"build":"projects/***/locations/europe-central2/builds/d486b483-3a0c-45d7-8a6e-d5e518397850","runtime":"php81","entryPoint":"processNotification","source":***"storageSource":***"bucket":"gcf-v2-sources-***-europe-central2","object":"processnotification/function-source.zip"***,"sourceProvenance":***"resolvedStorageSource":***"bucket":"gcf-v2-sources-***-europe-central2","object":"processnotification/function-source.zip","generation":"1682666472749534"***,"serviceConfig":***"service":"projects/***/locations/europe-central2/services/processnotification","timeoutSeconds":60,"environmentVariables":***"ENVIRONMENT":"DEVELOPMENT","GOOGLE_CLOUD_PROJECT":"***","TOPIC":"projects/***/topics/echo-notifications"***,"maxInstanceCount":100,"ingressSettings":"ALLOW_ALL","uri":"https://processnotification-bxdz7k6agq-lm.a.run.app","serviceAccountEmail":"notification-processor@***.iam.gserviceaccount.com","availableMemory":"256M","allTrafficOnLatestRevision":true,"revision":"processnotification-00001-yag","maxInstanceRequestConcurrency":1,"availableCpu":"0.1666"***,"state":"ACTIVE","updateTime":"2023-04-28T07:22:31.712151870Z","labels":***"deployment-tool":"cli-gcloud"***,"environment":"GEN_2"***,***"name":"projects/***/locations/europe-central2/functions/sessionmanager","buildConfig":***"build":"projects/***/locations/europe-central2/builds/b09a6e68-5682-448d-af80-d9ab791d684c","runtime":"php81","entryPoint":"sessionManager","source":***"storageSource":***"bucket":"gcf-v2-sources-***-europe-central2","object":"sessionmanager/function-source.zip"***,"sourceProvenance":***"resolvedStorageSource":***"bucket":"gcf-v2-sources-***-europe-central2","object":"sessionmanager/function-source.zip","generation":"1682665821645278"***,"serviceConfig":***"service":"projects/***/locations/europe-central2/services/sessionmanager","timeoutSeconds":60,"environmentVariables":***"ENVIRONMENT":"DEVELOPMENT","GOOGLE_CLOUD_PROJECT":"***"***,"maxInstanceCount":100,"ingressSettings":"ALLOW_ALL","uri":"https://sessionmanager-bxdz7k6agq-lm.a.run.app","serviceAccountEmail":"session-manager-cf@***.iam.gserviceaccount.com","availableMemory":"256M","allTrafficOnLatestRevision":true,"revision":"sessionmanager-00001-qux","maxInstanceRequestConcurrency":1,"availableCpu":"0.1666"***,"state":"ACTIVE","updateTime":"2023-04-28T07:11:42.847839711Z","labels":***"deployment-tool":"cli-gcloud"***,"environment":"GEN_2"***,***"name":"projects/***/locations/europe-central2/functions/syncportaldata","buildConfig":***"build":"projects/***/locations/europe-central2/builds/e946f65b-ce33-46c3-a0c6-ccfe25492468","runtime":"php81","entryPoint":"syncPortalData","source":***"storageSource":***"bucket":"gcf-v2-sources-***-europe-central2","object":"syncportaldata/function-source.zip"***,"sourceProvenance":***"resolvedStorageSource":***"bucket":"gcf-v2-sources-***-europe-central2","object":"syncportaldata/function-source.zip","generation":"1682665453510310"***,"serviceConfig":***"service":"projects/***/locations/europe-central2/services/syncportaldata","timeoutSeconds":900,"environmentVariables":***"ENVIRONMENT":"DEVELOPMENT","GOOGLE_APPLICATION_CREDENTIALS_PATH":"google-application-credentials.json","GOOGLE_CLOUD_PROJECT":"***","PORTAL_API_TOKEN":"***","PORTAL_ENDPOINT":"https://portal.yopeso.com/api/"***,"maxInstanceCount":100,"ingressSettings":"ALLOW_ALL","uri":"https://syncportaldata-bxdz7k6agq-lm.a.run.app","serviceAccountEmail":"***-compute@developer.gserviceaccount.com","availableMemory":"256M","allTrafficOnLatestRevision":true,"revision":"syncportaldata-00001-vuv","maxInstanceRequestConcurrency":1,"availableCpu":"0.1666"***,"state":"ACTIVE","updateTime":"2023-04-28T07:05:38.046342263Z","labels":***"deployment-tool":"cli-gcloud"***,"environment":"GEN_2"***,***"name":"projects/***/locations/us-central1/functions/ssrechodevelopment378010","buildConfig":***"build":"projects/***/locations/us-central1/builds/ebd7f2e2-5a2a-4c64-8aa3-ecdf53c420e7","runtime":"nodejs18","entryPoint":"ssr","source":***"storageSource":***"bucket":"gcf-v2-sources-***-us-central1","object":"ssrechodevelopment378010/function-source.zip"***,"sourceProvenance":***"resolvedStorageSource":***"bucket":"gcf-v2-sources-***-us-central1","object":"ssrechodevelopment378010/function-source.zip","generation":"1682671723574224"***,"state":"FAILED","updateTime":"2023-04-28T08:50:24.534027394Z","labels":***"deployment-tool":"cli-firebase--action-hosting-deploy","firebase-functions-codebase":"firebase-frameworks-***","firebase-functions-hash":"17f0ceb3986ff106cfbb450f54a0f93b411eac29"***,"stateMessages":[***"severity":"ERROR","type":"CloudRunServiceNotFound","message":"Cloud Run service projects/***/locations/us-central1/services/ssrechodevelopment378010 for the function was not found. The function will not work correctly. Please redeploy."***],"environment":"GEN_2"***]***
  [2023-04-28T08:51:46.395Z] >>> [apiv2][query] GET https://run.googleapis.com/v1/projects/***/locations/europe-central2/services/notificationpubsubeventhandler [none]
  [2023-04-28T08:51:46.397Z] >>> [apiv2][query] GET https://run.googleapis.com/v1/projects/***/locations/europe-central2/services/processnotification [none]
  [2023-04-28T08:51:46.399Z] >>> [apiv2][query] GET https://run.googleapis.com/v1/projects/***/locations/europe-central2/services/sessionmanager [none]
  [2023-04-28T08:51:46.400Z] >>> [apiv2][query] GET https://run.googleapis.com/v1/projects/***/locations/europe-central2/services/syncportaldata [none]
  [2023-04-28T08:51:46.404Z] TypeError: Cannot read properties of undefined (reading 'service')
      at /home/runner/.npm/_npx/adf8eb92c5e6b574/node_modules/firebase-tools/lib/deploy/functions/backend.js:198:113
      at Array.map (<anonymous>)
      at loadExistingBackend (/home/runner/.npm/_npx/adf8eb92c5e6b574/node_modules/firebase-tools/lib/deploy/functions/backend.js:198:69)
      at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
      at async Object.existingBackend (/home/runner/.npm/_npx/adf8eb92c5e6b574/node_modules/firebase-tools/lib/deploy/functions/backend.js:174:9)
      at async prepare (/home/runner/.npm/_npx/adf8eb92c5e6b574/node_modules/firebase-tools/lib/deploy/functions/prepare.js:151:115)
      at async chain (/home/runner/.npm/_npx/adf8eb92c5e6b574/node_modules/firebase-tools/lib/deploy/index.js:35:9)
      at async deploy (/home/runner/.npm/_npx/adf8eb92c5e6b574/node_modules/firebase-tools/lib/deploy/index.js:79:5)

  Error: An unexpected error has occurred.
  [2023-04-28T08:50:44.449Z] > 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"]
  [2023-04-28T08:50:44.616Z] [iam] checking project *** for permissions ["firebase.projects.get","firebasehosting.sites.update"]
  [2023-04-28T08:50:44.620Z] >>> [apiv2][query] POST https://cloudresourcemanager.googleapis.com/v1/projects/***:testIamPermissions [none]
  [2023-04-28T08:50:44.621Z] >>> [apiv2][(partial)header] POST https://cloudresourcemanager.googleapis.com/v1/projects/***:testIamPermissions x-goog-quota-user=projects/***
  [2023-04-28T08:50:44.621Z] >>> [apiv2][body] POST https://cloudresourcemanager.googleapis.com/v1/projects/***:testIamPermissions ***"permissions":["firebase.projects.get","firebasehosting.sites.update"]***
  [2023-04-28T08:50:44.709Z] <<< [apiv2][status] POST https://cloudresourcemanager.googleapis.com/v1/projects/***:testIamPermissions 200
  [2023-04-28T08:50:44.709Z] <<< [apiv2][body] POST https://cloudresourcemanager.googleapis.com/v1/projects/***:testIamPermissions ***"permissions":["firebase.projects.get","firebasehosting.sites.update"]***
  [2023-04-28T08:50:44.714Z] >>> [apiv2][query] GET https://firebase.googleapis.com/v1beta1/projects/*** [none]
  [2023-04-28T08:50:44.991Z] <<< [apiv2][status] GET https://firebase.googleapis.com/v1beta1/projects/*** 200
  [2023-04-28T08:50:44.992Z] <<< [apiv2][body] GET https://firebase.googleapis.com/v1beta1/projects/*** ***"projectId":"***","projectNumber":"***","displayName":"echo-development","name":"projects/***","resources":***"hostingSite":"***"***,"state":"ACTIVE","etag":"1_fc103cae-3788-40cf-aae1-7935513bd0a2"***
  [2023-04-28T08:50:59.405Z] >>> [apiv2][query] GET https://firebasehosting.googleapis.com/v1beta1/projects/***/sites pageToken=&pageSize=10
  [2023-04-28T08:50:59.694Z] <<< [apiv2][status] GET https://firebasehosting.googleapis.com/v1beta1/projects/***/sites 200
  [2023-04-28T08:50:59.694Z] <<< [apiv2][body] GET https://firebasehosting.googleapis.com/v1beta1/projects/***/sites ***"sites":[***"name":"projects/***/sites/***","defaultUrl":"https://***.web.app","appId":"***","type":"DEFAULT_SITE"***]***
  [2023-04-28T08:50:59.696Z] >>> [apiv2][query] GET https://firebase.googleapis.com/v1beta1/projects/-/webApps/***/config [none]
  [2023-04-28T08:51:00.039Z] <<< [apiv2][status] GET https://firebase.googleapis.com/v1beta1/projects/-/webApps/***/config 200
  [2023-04-28T08:51:00.040Z] <<< [apiv2][body] GET https://firebase.googleapis.com/v1beta1/projects/-/webApps/***/config ***"projectId":"***","appId":"***","storageBucket":"***","apiKey":"***","authDomain":"***","messagingSenderId":"***","measurementId":"***"***
  Detected a Next.js codebase. This is an experimental integration, proceed with caution.

  info  - Linting and checking validity of types...
  info  - Creating an optimized production build...
  info  - Compiled successfully
  info  - Collecting page data...
  info  - Generating static pages (0/3)
  info  - Generating static pages (3/3)
  info  - Finalizing page optimization...

  Route (pages)                              Size     First Load JS
  ┌ ○ /                                      1.5 kB         74.6 kB
  ├   /_app                                  0 B            73.1 kB
  └ ○ /404                                   182 B          73.3 kB
  + First Load JS shared by all              73.1 kB
    ├ chunks/framework-ac88a2a245aea9ab.js   45.2 kB
    ├ chunks/main-2c0669d9c9806c39.js        26.8 kB
    ├ chunks/pages/_app-bedf99e5729d36c5.js  288 B
    └ chunks/webpack-8fa1640cc84ba8fe.js     750 B

  ○  (Static)  automatically rendered as static HTML (uses no initial props)

  up to date in 3s

  125 packages are looking for funding
    run `npm fund` for details

  === Deploying to '***'...

  i  deploying functions, hosting 
  [2023-04-28T08:51:42.147Z] >>> [apiv2][query] GET https://firebase.googleapis.com/v1beta1/projects/*** [none]
  [2023-04-28T08:51:42.484Z] <<< [apiv2][status] GET https://firebase.googleapis.com/v1beta1/projects/*** 200
  [2023-04-28T08:51:42.484Z] <<< [apiv2][body] GET https://firebase.googleapis.com/v1beta1/projects/*** ***"projectId":"***","projectNumber":"***","displayName":"echo-development","name":"projects/***","resources":***"hostingSite":"***"***,"state":"ACTIVE","etag":"1_fc103cae-3788-40cf-aae1-7935513bd0a2"***
  i  functions: ensuring required API cloudfunctions.googleapis.com is enabled... 
  i  functions: ensuring required API cloudbuild.googleapis.com is enabled... 
  i  artifactregistry: ensuring required API artifactregistry.googleapis.com is enabled... 
  [2023-04-28T08:51:42.487Z] >>> [apiv2][query] GET https://serviceusage.googleapis.com/v1/projects/***/services/cloudfunctions.googleapis.com [none]
  [2023-04-28T08:51:42.487Z] >>> [apiv2][(partial)header] GET https://serviceusage.googleapis.com/v1/projects/***/services/cloudfunctions.googleapis.com x-goog-quota-user=projects/***
  [2023-04-28T08:51:42.489Z] >>> [apiv2][query] GET https://serviceusage.googleapis.com/v1/projects/***/services/runtimeconfig.googleapis.com [none]
  [2023-04-28T08:51:42.489Z] >>> [apiv2][(partial)header] GET https://serviceusage.googleapis.com/v1/projects/***/services/runtimeconfig.googleapis.com x-goog-quota-user=projects/***
  [2023-04-28T08:51:42.490Z] >>> [apiv2][query] GET https://serviceusage.googleapis.com/v1/projects/***/services/cloudbuild.googleapis.com [none]
  [2023-04-28T08:51:42.490Z] >>> [apiv2][(partial)header] GET https://serviceusage.googleapis.com/v1/projects/***/services/cloudbuild.googleapis.com x-goog-quota-user=projects/***
  [2023-04-28T08:51:42.492Z] >>> [apiv2][query] GET https://serviceusage.googleapis.com/v1/projects/***/services/artifactregistry.googleapis.com [none]
  [2023-04-28T08:51:42.492Z] >>> [apiv2][(partial)header] GET https://serviceusage.googleapis.com/v1/projects/***/services/artifactregistry.googleapis.com x-goog-quota-user=projects/***
  [2023-04-28T08:51:42.689Z] <<< [apiv2][status] GET https://serviceusage.googleapis.com/v1/projects/***/services/runtimeconfig.googleapis.com 200
  [2023-04-28T08:51:42.689Z] <<< [apiv2][body] GET https://serviceusage.googleapis.com/v1/projects/***/services/runtimeconfig.googleapis.com [omitted]
  [2023-04-28T08:51:42.695Z] <<< [apiv2][status] GET https://serviceusage.googleapis.com/v1/projects/***/services/cloudbuild.googleapis.com 200
  [2023-04-28T08:51:42.695Z] <<< [apiv2][body] GET https://serviceusage.googleapis.com/v1/projects/***/services/cloudbuild.googleapis.com [omitted]
  ✔  functions: required API cloudbuild.googleapis.com is enabled 
  [2023-04-28T08:51:42.701Z] <<< [apiv2][status] GET https://serviceusage.googleapis.com/v1/projects/***/services/cloudfunctions.googleapis.com 200
  [2023-04-28T08:51:42.702Z] <<< [apiv2][body] GET https://serviceusage.googleapis.com/v1/projects/***/services/cloudfunctions.googleapis.com [omitted]
  ✔  functions: required API cloudfunctions.googleapis.com is enabled 
  [2023-04-28T08:51:42.712Z] <<< [apiv2][status] GET https://serviceusage.googleapis.com/v1/projects/***/services/artifactregistry.googleapis.com 200
  [2023-04-28T08:51:42.712Z] <<< [apiv2][body] GET https://serviceusage.googleapis.com/v1/projects/***/services/artifactregistry.googleapis.com [omitted]
  ✔  artifactregistry: required API artifactregistry.googleapis.com is enabled 
  [2023-04-28T08:51:42.713Z] >>> [apiv2][query] GET https://firebase.googleapis.com/v1beta1/projects/***/adminSdkConfig [none]
  [2023-04-28T08:51:42.968Z] <<< [apiv2][status] GET https://firebase.googleapis.com/v1beta1/projects/***/adminSdkConfig 200
  [2023-04-28T08:51:42.976Z] <<< [apiv2][body] GET https://firebase.googleapis.com/v1beta1/projects/***/adminSdkConfig ***"projectId":"***","storageBucket":"***"***
  [2023-04-28T08:51:42.976Z] >>> [apiv2][query] GET https://runtimeconfig.googleapis.com/v1beta1/projects/***/configs [none]
  [2023-04-28T08:51:43.098Z] <<< [apiv2][status] GET https://runtimeconfig.googleapis.com/v1beta1/projects/***/configs 200
  [2023-04-28T08:51:43.098Z] <<< [apiv2][body] GET https://runtimeconfig.googleapis.com/v1beta1/projects/***/configs ***
  i  functions: preparing codebase firebase-frameworks-*** for deployment 
  [2023-04-28T08:51:43.102Z] Validating nodejs source
  ⚠  functions: package.json indicates an outdated version of firebase-functions. Please upgrade using npm install --save firebase-functions@latest in your functions directory. 
  ⚠  functions: Please note that there will be breaking changes when you upgrade. 
  [2023-04-28T08:51:45.132Z] > [functions] package.json contents: ***
    "name": "echo-frontend-app",
    "version": "0.1.0",
    "private": true,
    "scripts": ***
      "dev": "next dev",
      "build": "next build",
      "export": "next export",
      "start": "next start",
      "lint": "next lint",
      "test": "jest --passWithNoTests",
      "test:watch": "pnpm test -- --watch",
      "generate": "plop",
      "emulators:start": "firebase emulators:start --import=./echo-firebase-seed",
      "emulators:export": "firebase emulators:export ./echo-firebase-seed"
    ***,
    "lint-staged": ***
      "*.***js,jsx,ts,tsx***": [
        "eslint --fix",
        "git add"
      ],
      "*.***json,md***": [
        "prettier --write",
        "git add"
      ]
    ***,
    "dependencies": ***
      "@hookform/resolvers": "^2.9.11",
      "@next/font": "13.1.6",
      "@popperjs/core": "^2.11.6",
      "@reduxjs/toolkit": "^1.9.3",
      "@stitches/react": "^1.2.8",
      "@tanstack/match-sorter-utils": "^8.7.6",
      "@tanstack/react-table": "^8.7.9",
      "@types/node": "18.11.18",
      "@types/react": "18.0.27",
      "@types/react-datepicker": "^4.10.0",
      "@types/react-dom": "18.0.10",
      "@typescript-eslint/parser": "^5.50.0",
      "axios": "^1.3.2",
      "bootstrap": "^5.2.3",
      "csstype": "^3.1.1",
      "date-fns": "^2.29.3",
      "eslint": "8.33.0",
      "eslint-config-next": "13.1.6",
      "firebase": "^9.16.0",
      "firebase-admin": "^11.5.0",
      "next": "13.1.6",
      "nookies": "^2.5.2",
      "pino": "^8.11.0",
      "pino-pretty": "^10.0.0",
      "react": "18.2.0",
      "react-bootstrap": "^2.7.0",
      "react-datepicker": "^4.10.0",
      "react-dom": "18.2.0",
      "react-hook-form": "^7.43.5",
      "react-hook-form-persist": "^3.0.0",
      "react-hot-toast": "^2.4.0",
      "react-redux": "^8.0.5",
      "reactfire": "^4.2.2",
      "redux": "^4.2.1",
      "redux-persist": "^6.0.0",
      "type-fest": "^3.7.2",
      "typescript": "4.9.5",
      "yup": "^1.0.2",
      "zod": "^3.20.6",
      "firebase-frameworks": "^0.6.0",
      "firebase-functions": "^3.23.0"
    ***,
    "main": "server.js",
    "engines": ***
      "node": "18"
    ***
  ***
  [2023-04-28T08:51:45.132Z] Building nodejs source
  i  functions: Loaded environment variables from .env. 
  [2023-04-28T08:51:45.136Z] Found functions.yaml. Got spec: ***
    "endpoints": ***
      "ssrechodevelopment378010": ***
        "platform": "gcfv2",
        "region": [
          "us-central1"
        ],
        "labels": ***,
        "httpsTrigger": ***,
        "entryPoint": "ssr"
      ***
    ***,
    "specVersion": "v1alpha1",
    "requiredAPIs": []
  ***
  i  functions: preparing .firebase/***/functions directory for uploading... 
  i  functions: packaged /home/runner/work/echo-frontend-app/echo-frontend-app/.firebase/***/functions (2.16 MB) for uploading 
  [2023-04-28T08:51:45.496Z] >>> [apiv2][query] GET https://cloudfunctions.googleapis.com/v1/projects/***/locations/-/functions [none]
  [2023-04-28T08:51:45.873Z] <<< [apiv2][status] GET https://cloudfunctions.googleapis.com/v1/projects/***/locations/-/functions 200
  [2023-04-28T08:51:45.874Z] <<< [apiv2][body] GET https://cloudfunctions.googleapis.com/v1/projects/***/locations/-/functions ***"functions":[***"name":"projects/***/locations/europe-central2/functions/beforeUserCreated","httpsTrigger":***"url":"https://europe-central2-***.cloudfunctions.net/beforeUserCreated","securityLevel":"SECURE_ALWAYS"***,"status":"ACTIVE","entryPoint":"beforeUserCreated","timeout":"60s","availableMemoryMb":256,"serviceAccountEmail":"***@appspot.gserviceaccount.com","updateTime":"2023-04-28T08:11:27.828Z","versionId":"1","labels":***"deployment-tool":"cli-firebase","deployment-blocking":"before-create","firebase-functions-hash":"2b91ff36e0042193216f1f1af3dfdeac4f709373"***,"sourceUploadUrl":"https://storage.googleapis.com/uploads-322033870716.europe-central2.cloudfunctions.appspot.com/de2a31c0-c8b5-4c67-9189-fa3e081992d7.zip","environmentVariables":***"FIREBASE_CONFIG":"***\"projectId\":\"***\",\"storageBucket\":\"***\"***","GCLOUD_PROJECT":"***","EVENTARC_CLOUD_EVENT_SOURCE":"projects/***/locations/europe-central2/functions/beforeUserCreated"***,"runtime":"nodejs16","ingressSettings":"ALLOW_ALL","buildId":"d658fdfd-ef36-44ea-a738-8d8fdf517064","buildEnvironmentVariables":***"GOOGLE_NODE_RUN_SCRIPTS":""***,"buildName":"projects/***/locations/europe-central2/builds/d658fdfd-ef36-44ea-a738-8d8fdf517064","dockerRegistry":"ARTIFACT_REGISTRY"***,***"name":"projects/***/locations/europe-central2/functions/beforeUserSignedIn","httpsTrigger":***"url":"https://europe-central2-***.cloudfunctions.net/beforeUserSignedIn","securityLevel":"SECURE_ALWAYS"***,"status":"ACTIVE","entryPoint":"beforeUserSignedIn","timeout":"60s","availableMemoryMb":256,"serviceAccountEmail":"***@appspot.gserviceaccount.com","updateTime":"2023-04-28T08:11:41.991Z","versionId":"1","labels":***"deployment-tool":"cli-firebase","deployment-blocking":"before-sign-in","firebase-functions-hash":"2b91ff36e0042193216f1f1af3dfdeac4f709373"***,"sourceUploadUrl":"https://storage.googleapis.com/uploads-322033870716.europe-central2.cloudfunctions.appspot.com/de2a31c0-c8b5-4c67-9189-fa3e081992d7.zip","environmentVariables":***"FIREBASE_CONFIG":"***\"projectId\":\"***\",\"storageBucket\":\"***\"***","GCLOUD_PROJECT":"***","EVENTARC_CLOUD_EVENT_SOURCE":"projects/***/locations/europe-central2/functions/beforeUserSignedIn"***,"runtime":"nodejs16","ingressSettings":"ALLOW_ALL","buildId":"d658fdfd-ef36-44ea-a738-8d8fdf517064","buildEnvironmentVariables":***"GOOGLE_NODE_RUN_SCRIPTS":""***,"buildName":"projects/***/locations/europe-central2/builds/d658fdfd-ef36-44ea-a738-8d8fdf517064","dockerRegistry":"ARTIFACT_REGISTRY"***]***
  [2023-04-28T08:51:45.875Z] >>> [apiv2][query] GET https://cloudfunctions.googleapis.com/v2/projects/***/locations/-/functions filter=environment%3D%22GEN_2%22
  [2023-04-28T08:51:46.393Z] <<< [apiv2][status] GET https://cloudfunctions.googleapis.com/v2/projects/***/locations/-/functions 200
  [2023-04-28T08:51:46.393Z] <<< [apiv2][body] GET https://cloudfunctions.googleapis.com/v2/projects/***/locations/-/functions ***"functions":[***"name":"projects/***/locations/europe-central2/functions/notificationPubSubEventHandler","buildConfig":***"build":"projects/***/locations/europe-central2/builds/d9b4c1c3-5ae7-4c0c-8b6f-f8b5c595c925","runtime":"php81","entryPoint":"notificationPubSubEventHandler","source":***"storageSource":***"bucket":"gcf-v2-sources-***-europe-central2","object":"notificationPubSubEventHandler/function-source.zip"***,"sourceProvenance":***"resolvedStorageSource":***"bucket":"gcf-v2-sources-***-europe-central2","object":"notificationPubSubEventHandler/function-source.zip","generation":"1682667035458206"***,"serviceConfig":***"service":"projects/***/locations/europe-central2/services/notificationpubsubeventhandler","timeoutSeconds":60,"environmentVariables":***"ENVIRONMENT":"DEVELOPMENT","GOOGLE_APPLICATION_CREDENTIALS":"/workspace/gha-creds-d1adeedee970f1b3.json","GOOGLE_CLOUD_PROJECT":"***","SENDER_EMAIL":"echo.admin@yopeso.com","SLACK_BOT_TOKEN":"1//0gl_TiSCYcspQCgYIARAAGBASNwF-L9IrqVQ3NsXoqWESwGhwYNzl-KIQ9Prm7Z6aU90jL5Cy59mQ0gzEclMPxhWd6aq18HA-MaY","SLACK_POST_MESSAGE_ENDPOINT":"https://slack.com/api/chat.postMessage","SLACK_USER_LIST_ENDPOINT":"https://slack.com/api/users.list","SUBSCRIPTION":"projects/***/subscriptions/echo-notification-subscriber"***,"maxInstanceCount":100,"ingressSettings":"ALLOW_ALL","uri":"https://notificationpubsubeventhandler-bxdz7k6agq-lm.a.run.app","serviceAccountEmail":"notification-email-dev@***.iam.gserviceaccount.com","availableMemory":"256M","allTrafficOnLatestRevision":true,"revision":"notificationpubsubeventhandler-00001-rez","maxInstanceRequestConcurrency":1,"availableCpu":"0.1666"***,"eventTrigger":***"trigger":"projects/***/locations/europe-central2/triggers/notificationpubsubeventhandler-758701","triggerRegion":"europe-central2","eventType":"google.cloud.pubsub.topic.v1.messagePublished","pubsubTopic":"projects/***/topics/echo-notifications","serviceAccountEmail":"notification-email-dev@***.iam.gserviceaccount.com","retryPolicy":"RETRY_POLICY_DO_NOT_RETRY"***,"state":"ACTIVE","updateTime":"2023-04-28T07:32:32.653303635Z","labels":***"deployment-tool":"cli-gcloud"***,"environment":"GEN_2"***,***"name":"projects/***/locations/europe-central2/functions/processnotification","buildConfig":***"build":"projects/***/locations/europe-central2/builds/d486b483-3a0c-45d7-8a6e-d5e518397850","runtime":"php81","entryPoint":"processNotification","source":***"storageSource":***"bucket":"gcf-v2-sources-***-europe-central2","object":"processnotification/function-source.zip"***,"sourceProvenance":***"resolvedStorageSource":***"bucket":"gcf-v2-sources-***-europe-central2","object":"processnotification/function-source.zip","generation":"1682666472749534"***,"serviceConfig":***"service":"projects/***/locations/europe-central2/services/processnotification","timeoutSeconds":60,"environmentVariables":***"ENVIRONMENT":"DEVELOPMENT","GOOGLE_CLOUD_PROJECT":"***","TOPIC":"projects/***/topics/echo-notifications"***,"maxInstanceCount":100,"ingressSettings":"ALLOW_ALL","uri":"https://processnotification-bxdz7k6agq-lm.a.run.app","serviceAccountEmail":"notification-processor@***.iam.gserviceaccount.com","availableMemory":"256M","allTrafficOnLatestRevision":true,"revision":"processnotification-00001-yag","maxInstanceRequestConcurrency":1,"availableCpu":"0.1666"***,"state":"ACTIVE","updateTime":"2023-04-28T07:22:31.712151870Z","labels":***"deployment-tool":"cli-gcloud"***,"environment":"GEN_2"***,***"name":"projects/***/locations/europe-central2/functions/sessionmanager","buildConfig":***"build":"projects/***/locations/europe-central2/builds/b09a6e68-5682-448d-af80-d9ab791d684c","runtime":"php81","entryPoint":"sessionManager","source":***"storageSource":***"bucket":"gcf-v2-sources-***-europe-central2","object":"sessionmanager/function-source.zip"***,"sourceProvenance":***"resolvedStorageSource":***"bucket":"gcf-v2-sources-***-europe-central2","object":"sessionmanager/function-source.zip","generation":"1682665821645278"***,"serviceConfig":***"service":"projects/***/locations/europe-central2/services/sessionmanager","timeoutSeconds":60,"environmentVariables":***"ENVIRONMENT":"DEVELOPMENT","GOOGLE_CLOUD_PROJECT":"***"***,"maxInstanceCount":100,"ingressSettings":"ALLOW_ALL","uri":"https://sessionmanager-bxdz7k6agq-lm.a.run.app","serviceAccountEmail":"session-manager-cf@***.iam.gserviceaccount.com","availableMemory":"256M","allTrafficOnLatestRevision":true,"revision":"sessionmanager-00001-qux","maxInstanceRequestConcurrency":1,"availableCpu":"0.1666"***,"state":"ACTIVE","updateTime":"2023-04-28T07:11:42.847839711Z","labels":***"deployment-tool":"cli-gcloud"***,"environment":"GEN_2"***,***"name":"projects/***/locations/europe-central2/functions/syncportaldata","buildConfig":***"build":"projects/***/locations/europe-central2/builds/e946f65b-ce33-46c3-a0c6-ccfe25492468","runtime":"php81","entryPoint":"syncPortalData","source":***"storageSource":***"bucket":"gcf-v2-sources-***-europe-central2","object":"syncportaldata/function-source.zip"***,"sourceProvenance":***"resolvedStorageSource":***"bucket":"gcf-v2-sources-***-europe-central2","object":"syncportaldata/function-source.zip","generation":"1682665453510310"***,"serviceConfig":***"service":"projects/***/locations/europe-central2/services/syncportaldata","timeoutSeconds":900,"environmentVariables":***"ENVIRONMENT":"DEVELOPMENT","GOOGLE_APPLICATION_CREDENTIALS_PATH":"google-application-credentials.json","GOOGLE_CLOUD_PROJECT":"***","PORTAL_API_TOKEN":"***","PORTAL_ENDPOINT":"https://portal.yopeso.com/api/"***,"maxInstanceCount":100,"ingressSettings":"ALLOW_ALL","uri":"https://syncportaldata-bxdz7k6agq-lm.a.run.app","serviceAccountEmail":"***-compute@developer.gserviceaccount.com","availableMemory":"256M","allTrafficOnLatestRevision":true,"revision":"syncportaldata-00001-vuv","maxInstanceRequestConcurrency":1,"availableCpu":"0.1666"***,"state":"ACTIVE","updateTime":"2023-04-28T07:05:38.046342263Z","labels":***"deployment-tool":"cli-gcloud"***,"environment":"GEN_2"***,***"name":"projects/***/locations/us-central1/functions/ssrechodevelopment378010","buildConfig":***"build":"projects/***/locations/us-central1/builds/ebd7f2e2-5a2a-4c64-8aa3-ecdf53c420e7","runtime":"nodejs18","entryPoint":"ssr","source":***"storageSource":***"bucket":"gcf-v2-sources-***-us-central1","object":"ssrechodevelopment378010/function-source.zip"***,"sourceProvenance":***"resolvedStorageSource":***"bucket":"gcf-v2-sources-***-us-central1","object":"ssrechodevelopment378010/function-source.zip","generation":"1682671723574224"***,"state":"FAILED","updateTime":"2023-04-28T08:50:24.534027394Z","labels":***"deployment-tool":"cli-firebase--action-hosting-deploy","firebase-functions-codebase":"firebase-frameworks-***","firebase-functions-hash":"17f0ceb3986ff106cfbb450f54a0f93b411eac29"***,"stateMessages":[***"severity":"ERROR","type":"CloudRunServiceNotFound","message":"Cloud Run service projects/***/locations/us-central1/services/ssrechodevelopment378010 for the function was not found. The function will not work correctly. Please redeploy."***],"environment":"GEN_2"***]***
  [2023-04-28T08:51:46.395Z] >>> [apiv2][query] GET https://run.googleapis.com/v1/projects/***/locations/europe-central2/services/notificationpubsubeventhandler [none]
  [2023-04-28T08:51:46.397Z] >>> [apiv2][query] GET https://run.googleapis.com/v1/projects/***/locations/europe-central2/services/processnotification [none]
  [2023-04-28T08:51:46.399Z] >>> [apiv2][query] GET https://run.googleapis.com/v1/projects/***/locations/europe-central2/services/sessionmanager [none]
  [2023-04-28T08:51:46.400Z] >>> [apiv2][query] GET https://run.googleapis.com/v1/projects/***/locations/europe-central2/services/syncportaldata [none]
  [2023-04-28T08:51:46.404Z] TypeError: Cannot read properties of undefined (reading 'service')
      at /home/runner/.npm/_npx/adf8eb92c5e6b574/node_modules/firebase-tools/lib/deploy/functions/backend.js:198:113
      at Array.map (<anonymous>)
      at loadExistingBackend (/home/runner/.npm/_npx/adf8eb92c5e6b574/node_modules/firebase-tools/lib/deploy/functions/backend.js:198:69)
      at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
      at async Object.existingBackend (/home/runner/.npm/_npx/adf8eb92c5e6b574/node_modules/firebase-tools/lib/deploy/functions/backend.js:174:9)
      at async prepare (/home/runner/.npm/_npx/adf8eb92c5e6b574/node_modules/firebase-tools/lib/deploy/functions/prepare.js:151:115)
      at async chain (/home/runner/.npm/_npx/adf8eb92c5e6b574/node_modules/firebase-tools/lib/deploy/index.js:35:9)
      at async deploy (/home/runner/.npm/_npx/adf8eb92c5e6b574/node_modules/firebase-tools/lib/deploy/index.js:79:5)

  Error: An unexpected error has occurred.

  The process '/usr/local/bin/npx' failed with exit code 2
  Error: The process '/usr/local/bin/npx' failed with exit code 2
  ***
    conclusion: 'failure',
    output: ***
      title: 'Deploy preview failed',
      summary: "Error: The process '/usr/local/bin/npx' failed with exit code 2"
    ***
  ***
MuhammadBilalQamar commented 10 months ago

Any solution ?