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

Installing v11.12.0 fails with EBADPLATFORM on linux container #5041

Closed
williamchong opened this issue Sep 29, 2022 · 21 comments
Closed

Installing v11.12.0 fails with EBADPLATFORM on linux container #5041

williamchong opened this issue Sep 29, 2022 · 21 comments

Comments

@williamchong
Copy link

williamchong commented Sep 29, 2022

Runing npm install -g firebase-tools@11 on circle ci gets an error

npm ERR! code EBADPLATFORM
npm ERR! notsup Unsupported platform for esbuild-android-64@0.15.8: wanted {"os":"android","arch":"x64"} (current: {"os":"linux","arch":"x64"})
npm ERR! notsup Valid OS:    android
npm ERR! notsup Valid Arch:  x64
npm ERR! notsup Actual OS:   linux
npm ERR! notsup Actual Arch: x64

Also reproducible on Docker with node:14 image
docker run --rm -ti node:14 npm install -g firebase-tools@11

[REQUIRED] Environment info

firebase-tools: v11.12.0

Platform: Docker node:14, Debian based

[REQUIRED] Test case

Run a node14 container and try to install firebase tool

docker run --rm -ti node:14 npm install -g firebase-tools@11

[REQUIRED] Steps to reproduce

docker run --rm -ti node:14 npm install -g firebase-tools@11

[REQUIRED] Expected behavior

Install the linux version of firebase-tool successfully

[REQUIRED] Actual behavior

Throws error stating I should be on android OS

❯ docker run --rm -ti node:14 npm install -g firebase-tools@11
npm ERR! code EBADPLATFORM
npm ERR! notsup Unsupported platform for esbuild-android-64@0.15.8: wanted {"os":"android","arch":"x64"} (current: {"os":"linux","arch":"arm64"})
npm ERR! notsup Valid OS:    android
npm ERR! notsup Valid Arch:  x64
npm ERR! notsup Actual OS:   linux
npm ERR! notsup Actual Arch: arm64

npm ERR! A complete log of this run can be found in:
npm ERR!     /root/.npm/_logs/2022-09-29T18_39_46_531Z-debug.log
@google-oss-bot
Copy link
Contributor

This issue does not have all the information required by the template. Looks like you forgot to fill out some sections. Please update the issue with more information.

@octaviodivy
Copy link

Same here, EBADPLATFORM on Github Actions

name: Test Backend

on:
   workflow_dispatch:

jobs:
  setupTests:
    runs-on: ubuntu-latest
    steps:
       - name: Install Firebase locally
              run: |
                cd packages/functions
                npm i -g firebase-tools

@octaviodivy
Copy link

octaviodivy commented Sep 29, 2022

This output got inside Actions

npm ERR! code EBADPLATFORM
npm ERR! notsup Unsupported platform for esbuild-android-64@0.15.8: wanted {"os":"android","arch":"x64"} (current: {"os":"linux","arch":"x64"})
npm ERR! notsup Valid OS:    android
npm ERR! notsup Valid Arch:  x64
npm ERR! notsup Actual OS:   linux
npm ERR! notsup Actual Arch: x64

With

Current runner version: '[2](...).297.0'
Operating System
      Ubuntu
      20.0[4](...).[5](...)
      LTS
Runner Image
      Image: ubuntu-20.04
      Version: 20220[9](...)22.2
      Included Software: https://github.com/actions/runner-images/blob/ubuntu20/20220922.2/images/linux/Ubuntu2004-Readme.md
      Image Release: https://github.com/actions/runner-images/releases/tag/ubuntu20%2F20220922.2
Runner Image Provisioner
      1.0.0.0-main-20220916-1
GITHUB_TOKEN Permissions
      Actions: write
      Checks: write
      Contents: write
      Deployments: write
      Discussions: write
      Issues: write
      Metadata: read
      Packages: write
      Pages: write
      PullRequests: write
      RepositoryProjects: write
      SecurityEvents: write
      Statuses: write
Secret source: Actions
Prepare workflow directory
Prepare all required actions
Getting action download info
Download action repository 'actions/setup-java@v2.3.1' (SHA:8db439b[6](...)b47e5e12[31](...)2bf036760bbaa6893481ac)
Download action repository 'actions/setup-node@v2.5.0' (SHA:04c56d2f954f1e4c69436aa54cfef261a018f458)
Download action repository 'actions/checkout@v2' (SHA:7884fcad6b5d53d10[32](...)3aee724dc68d8b9096a2e)

@nsweeting
Copy link

We are experiencing the same issue. On 2 different runs we had 2 similar but different errors.

Attempt 1:

npm ERR! notsup Unsupported platform for esbuild-android-64@0.15.8: wanted {"os":"android","arch":"x64"} (current: {"os":"linux","arch":"x64"})

Attempt 2:

npm ERR! notsup Unsupported platform for esbuild-freebsd-64@0.15.8: wanted {"os":"freebsd","arch":"x64"} (current: {"os":"linux","arch":"x64"})

@williamchong williamchong changed the title Installing v11.12.0 fails on linux container, node@14 Installing v11.12.0 fails with EBADPLATFORM on linux container Sep 29, 2022
@bkendall
Copy link
Contributor

This is interesting. Did the same happen on v11.11?

esbuild has those dependencies marked as optional, so I'm curious why it's trying. maybe it has something to do with how we clean npm-shrinkwrap of dev dependencies? But I'm really not sure. I'll bring this up with the team though.

@williamchong
Copy link
Author

Pining to v11.11 works fine

e.g. docker run --rm -ti node:14 npm install -g firebase-tools@11.11.0

@bkendall
Copy link
Contributor

bkendall commented Sep 29, 2022

Here's an interesting thought: it only happens with npm@6. I installed npm@8 first and it didn't try to install the optional dependencies (I assume where platform didn't match? or not install optional dependencies at all?)

Fix/Workaround

So if you're stuck, see if you can upgrade npm to 8 (which is also the default of node:16 if that's an "easier" upgrade).

Or, upgrade to v11.13.0 which should have a fix.

@MaXiao
Copy link

MaXiao commented Sep 29, 2022

I had the same issue today on v11.12. Found this issue on esbuild repo. It looks like older(< 7) npm would cause it.

So for now, the solution would be to upgrade npm or specify firebase-tools@11.11.0.

@brian-cresicor
Copy link

+1 We started seeing this in our github action using https://github.com/FirebaseExtended/action-hosting-deploy since that's using firebase-tools@latest

@bkendall bkendall pinned this issue Sep 29, 2022
@octaviodivy
Copy link

It is a bit harmful because node 14 with npm 6 are both LTS

Forced upgrade appears to be a pretty bad solution

@bkendall
Copy link
Contributor

Node 14 is actually in maintenance mode (I don't know about/if npm follows the same ruleset, but the last v6 tag is from April, so don't think they're actively working on it) and so I think it's very unlikely that this npm bug will be fixed for the combination of node@14,npm@6.

It's a bit of a "rock and a hard place" situation we're still discussing internally. We want to bring the cool new features to you! But having to fight/work around tooling is the worst.

Until then, I'm not aware of any issues using npm@8 with node@14, so the workaround above to install npm@8 should work, but I acknowledge that it's not ideal.

@bkendall
Copy link
Contributor

We think we have a solution to move the troublesome dependency around. We're doing some verification on the idea, but if it works out we'll try to get a new release out tomorrow (Friday).

@dannyskoog
Copy link

dannyskoog commented Sep 30, 2022

I experienced this same issue. Went with the upgrade to node:16 solution 👍

@bkendall
Copy link
Contributor

This should be addressed by #5052, which I plan to release soon.

@bkendall
Copy link
Contributor

Alright, this should be addressed in v11.13.0. Please let me know if it persists.

@SpiegelSoft
Copy link

Still happening for me. v11.13.0, Node version 16.17.1.

@SpiegelSoft
Copy link

I'm using Cloud Build with the following yaml:

steps:
  - name: 'node:16.17.1'
    id: 'node'
    entrypoint: 'npm'
    dir: 'functions'
    args: ['install']
  - name: gcr.io/cloud-builders/gcloud
    id: concurrency-prevention
    entrypoint: bash
    args:
      - -c
      - |
        initialbuilds=$(gcloud builds list --ongoing | sed "1 d" | cut -f1 -d " ")
        while [[ $( gcloud builds list --ongoing | sed "1 d" | cut -f1 -d " " | grep "$initialbuilds" | wc -l ) -ge 2 ]]; do
          echo "Waiting for the following existing builds to finish. Will retry in 5 minutes."
          echo $initialbuilds
          sleep 300
        done
    waitFor: ['node']
  - name: gcr.io/$PROJECT_ID/firebase
    id: check-pr
    entrypoint: bash
    env:
    args:
      - -c
      - |
        case "$_BASE_BRANCH" in
          develop)
            echo "PR in to develop"
            ;;
          *)
            echo "PR not into develop but into $_BASE_BRANCH"
            exit 1
            ;;
        esac
    waitFor: ['concurrency-prevention']
  - name: gcr.io/$PROJECT_ID/firebase
    id: run-tests
    entrypoint: bash
    dir: functions
    args:
      - -c
      - |
        npm i && firebase use dev && npm run env:dev && npm run test
    waitFor: ['check-pr']

@bkendall
Copy link
Contributor

bkendall commented Oct 3, 2022

@SpiegelSoft I'm not sure where you're seeing your issue. Could you give more details and ideally a minimal repro sample? If the issue is in the gcr.io/$PROJECT_ID/firebase container, that's not something I can help debug.

@SpiegelSoft
Copy link

@SpiegelSoft I'm not sure where you're seeing your issue. Could you give more details and ideally a minimal repro sample? If the issue is in the gcr.io/$PROJECT_ID/firebase container, that's not something I can help debug.

This is happening in the GCP Cloud Build system. Currently, my entire CI build process is broken.

@MiroStW
Copy link

MiroStW commented Oct 25, 2022

same issue, i get the following errors on deploy:

Build failed: npm ERR! @esbuild/android-arm not accessible from firebase-tools:esbuild

npm ERR! A complete log of this run can be found in:
npm ERR!     /www-data-home/.npm/_logs/2022-10-25T08_54_35_302Z-debug.log; Error ID: beaf8772
Build failed: npm ERR! @esbuild/android-arm not accessible from firebase-tools:esbuild

npm ERR! A complete log of this run can be found in:
npm ERR!     /www-data-home/.npm/_logs/2022-10-25T08_54_27_849Z-debug.log; Error ID: beaf8772
Build failed: npm ERR! @esbuild/android-arm not accessible from firebase-tools:esbuild

npm ERR! A complete log of this run can be found in:
npm ERR!     /www-data-home/.npm/_logs/2022-10-25T08_55_25_107Z-debug.log; Error ID: beaf8772
Build failed: npm ERR! @esbuild/android-arm not accessible from firebase-tools:esbuild

npm ERR! A complete log of this run can be found in:
npm ERR!     /www-data-home/.npm/_logs/2022-10-25T08_55_28_088Z-debug.log; Error ID: beaf8772
Build failed: npm ERR! @esbuild/android-arm not accessible from firebase-tools:esbuild

npm ERR! A complete log of this run can be found in:
npm ERR!     /www-data-home/.npm/_logs/2022-10-25T08_55_32_844Z-debug.log; Error ID: beaf8772

This happens for all currently released versions above 11.11.8 (so 11.12.0 - 11.15.0)

I am using Node14

my package.json:

"dependencies": {
    "@dnd-kit/core": "^6.0.5",
    "@dnd-kit/modifiers": "^6.0.0",
    "@dnd-kit/sortable": "^7.0.1",
    "cors": "^2.8.5",
    "firebase": "^9.9.3",
    "firebase-admin": "^11.0.1",
    "firebase-functions": "^3.23.0",
    "firebase-tools": "^11.11.0",
    "firebaseui": "^6.0.1",
    "material-icons": "^1.11.8",
    "next": "^12.3.0",
    "nodemailer": "^6.7.8",
    "react": "18.2.0",
    "react-dom": "18.2.0",
    "react-firebase-hooks": "^5.0.3"
  },
  "devDependencies": {
    "@types/firebase": "^3.2.1",
    "@types/node": "^18.6.2",
    "@types/nodemailer": "^6.4.6",
    "@types/react": "^18.0.15",
    "@types/react-dom": "18.0.6",
    "@typescript-eslint/eslint-plugin": "^5.31.0",
    "@typescript-eslint/parser": "^5.31.0",
    "eslint": "^8.23.0",
    "eslint-config-airbnb-base": "^15.0.0",
    "eslint-config-next": "^12.2.5",
    "eslint-config-prettier": "^8.5.0",
    "eslint-plugin-import": "^2.26.0",
    "prettier": "^2.7.1",
    "typescript": "^4.7.4"
  }

UPDATE

It works after updating to Node16 with firebase-tools 11.15.0 and firebase-functions 4.0.1

@colerogers colerogers unpinned this issue Nov 7, 2022
@pradella
Copy link

Same error here, after upgrading firebase-tools from 11.4.2 to 11.18.0, even with Node16 local.

Solution: downgrade firebase-tools to 11.4.2 and worked again.

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

No branches or pull requests