google / ground-platform

Ground hosted components: Web console, Cloud Functions, db config
http://groundplatform.org
Apache License 2.0
202 stars 80 forks source link

Web app unavailable #1846

Closed gino-m closed 1 month ago

gino-m commented 1 month ago

Cloud Function /profile-refresh fails with:

Unhandled error FirebaseAppError: The default Firebase app does not exist. Make sure you call initializeApp() before using any of the Firebase services.
    at AppStore.getApp (/workspace/node_modules/firebase-admin/lib/app/lifecycle.js:65:19)
    at getApp (/workspace/node_modules/firebase-admin/lib/app/lifecycle.js:106:36)
    at getAuth (/workspace/node_modules/firebase-admin/lib/auth/index.js:50:34)
    at handleProfileRefresh (/workspace/dist/profile-refresh.js:30:43)
    at /workspace/dist/index.js:40:88
    at /workspace/node_modules/firebase-functions/lib/common/onInit.js:33:16
    at fixedLen (/workspace/node_modules/firebase-functions/lib/v2/providers/https.js:135:62)
    at /workspace/node_modules/firebase-functions/lib/common/providers/https.js:467:32
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5) {
  errorInfo: {
    code: 'app/no-app',
    message: 'The default Firebase app does not exist. Make sure you call initializeApp() before using any of the Firebase services.'
  },
  codePrefix: 'app'
}
sufyanAbbasi commented 1 month ago

Checking the logs, I see:

Build failed: npm error code EUSAGE
npm error
npm error `npm ci` can only install packages when your package.json and package-lock.json or npm-shrinkwrap.json are in sync. Please update your lock file with `npm install` before continuing.
npm error
npm error Invalid: lock file's gts@3.1.1 does not satisfy gts@5.3.1
npm error Invalid: lock file's @typescript-eslint/eslint-plugin@5.39.0 does not satisfy @typescript-eslint/eslint-plugin@5.62.0
npm error Invalid: lock file's @typescript-eslint/parser@5.39.0 does not satisfy @typescript-eslint/parser@5.62.0
npm error Invalid: lock file's eslint@8.26.0 does not satisfy eslint@8.57.0
npm error Invalid: lock file's eslint-config-prettier@8.5.0 does not satisfy eslint-config-prettier@9.1.0
npm error Missing: eslint-plugin-n@15.7.0 from lock file
npm error Invalid: lock file's eslint-plugin-prettier@3.4.1 does not satisfy eslint-plugin-prettier@5.1.3
npm error Missing: prettier@3.2.5 from lock file
npm error Missing: write-file-atomic@4.0.2 from lock file
npm error Missing: @eslint-community/regexpp@4.10.1 from lock file
npm error Invalid: lock file's @typescript-eslint/scope-manager@5.39.0 does not satisfy @typescript-eslint/scope-manager@5.62.0
npm error Invalid: lock file's @typescript-eslint/type-utils@5.39.0 does not satisfy @typescript-eslint/type-utils@5.62.0
npm error Invalid: lock file's @typescript-eslint/utils@5.39.0 does not satisfy @typescript-eslint/utils@5.62.0
npm error Missing: graphemer@1.4.0 from lock file
npm error Missing: natural-compare-lite@1.4.0 from lock file
npm error Invalid: lock file's @typescript-eslint/types@5.39.0 does not satisfy @typescript-eslint/types@5.62.0
npm error Invalid: lock file's @typescript-eslint/typescript-estree@5.39.0 does not satisfy @typescript-eslint/typescript-estree@5.62.0
npm error Invalid: lock file's @typescript-eslint/visitor-keys@5.39.0 does not satisfy @typescript-eslint/visitor-keys@5.62.0
npm error Missing: @eslint-community/eslint-utils@4.4.0 from lock file
npm error Invalid: lock file's @types/json-schema@7.0.11 does not satisfy @types/json-schema@7.0.15
npm error Missing: @types/semver@7.5.8 from lock file
npm error Missing: semver@7.6.2 from lock file
npm error Invalid: lock file's @eslint/eslintrc@1.3.3 does not satisfy @eslint/eslintrc@2.1.4
npm error Missing: @eslint/js@8.57.0 from lock file
npm error Invalid: lock file's @humanwhocodes/config-array@0.11.7 does not satisfy @humanwhocodes/config-array@0.11.14
npm error Missing: @ungap/structured-c… [message truncated due to size]

Looks like it might be when I pushed the e2e-tests. Let me try regenerating the package-locks and see if that doesn't fix it!

rm **/package-lock.json

npm i --package-lock-only && npm i --package-lock-only --prefix e2e-tests; npm i --package-lock-only --prefix functions; npm i --package-lock-only --prefix lib; npm i --package-lock-only --prefix proto; npm i --package-lock-only --prefix web

npm ci && npm ci --prefix e2e-tests && npm ci --prefix functions && npm ci --prefix lib && npm ci --prefix proto && npm ci --prefix web
gino-m commented 1 month ago

This may be due to my shift to ground-platform as a monorepo. References:

sufyanAbbasi commented 1 month ago

Darn, I also see a new error here when trying to build e2e-tests:


path /home/runner/work/ground-platform/ground-platform/e2e-tests/node_modules/esbuild
command failed
command sh -c node install.js
/home/runner/work/ground-platform/ground-platform/e2e-tests/node_modules/esbuild/install.js:133
    throw new Error(`Expected $***JSON.stringify(versionFromPackageJSON)*** but got $***JSON.stringify(stdout)***`);
          ^
Error: Expected "0.19.12" but got "0.20.1"
    at validateBinaryVersion (/home/runner/work/ground-platform/ground-platform/e2e-tests/node_modules/esbuild/install.js:133:11)
    at /home/runner/work/ground-platform/ground-platform/e2e-tests/node_modules/esbuild/install.js:286:5
Node.js v18.20.3
``
https://github.com/google/ground-platform/actions/runs/9523008152/job/26253662838

Maybe we can upgrade `esbuild` throughout?