bit icon indicating copy to clipboard operation
bit copied to clipboard

Init.sh failure in composite action

Open TGTGamer opened this issue 2 years ago • 9 comments

Describe the bug

Cannot read properties of undefined (reading 'filter')
TypeError: Cannot read properties of undefined (reading 'filter')
    at GcpList.<anonymous> (/usr/local/lib/node_modules/@teambit/bvm/node_modules/@teambit/bvm.list/dist/gcp/gcp-list.js:60:51)
    at Generator.next (<anonymous>)
    at fulfilled (/usr/local/lib/node_modules/@teambit/bvm/node_modules/@teambit/bvm.list/dist/gcp/gcp-list.js:5:58)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
./scripts/bit-init.sh: line 14: bit: command not found
Error: Process completed with exit code 127.

Expected Behavior

Not to error and to init bit

Screenshots, exceptions and logs

https://github.com/Eventiva/Eventiva/blob/6258fe527734b7ed37a4268a57898d6541f11947/.trunk/setup-ci/action.yaml#L1-L14

https://github.com/Eventiva/Eventiva/blob/6258fe527734b7ed37a4268a57898d6541f11947/scripts/bit-init.sh#L1-L14

TGTGamer avatar Dec 12 '23 21:12 TGTGamer

This is a very old version of bit. I'm not sure this specific version even exists. Any reason you use this version?

GiladShoham avatar Dec 12 '23 21:12 GiladShoham

Oh. Thanks hahahaha. No reason other than that's the one still in the sh on your website :) @GiladShoham lets see if that fixes it :)

TGTGamer avatar Dec 12 '23 22:12 TGTGamer

It can also be a network issue. Like you need to set up a proxy server. Where is it shown in our website? @giteden fyi

GiladShoham avatar Dec 12 '23 22:12 GiladShoham

https://bit.dev/reference/ci/automating-component-releases

image

https://github.com/bit-tasks/shell-scripts/raw/main/downloads/automating-component-releases.zip

https://github.com/bit-tasks/nodejs/raw/main/downloads/automating-component-releases.zip

Same version is in both the SH and JS init scripts

TGTGamer avatar Dec 12 '23 22:12 TGTGamer

It looks like your shell-scripts directory is still referencing it too :)

https://github.com/bit-tasks/shell-scripts/blob/55f029a4bd6978cde2cc3f58f43885f170d562f7/scripts/bit-init.sh#L1-L14

TGTGamer avatar Dec 12 '23 22:12 TGTGamer

@TGTGamer Can you check whether the PATH is correct depending on your build agent (following line) export PATH="${HOME}/bin:${PATH}

If you want to use the latest Bit version in your CI (without fixing to a specific version), you can replace the following lines.

Replace

# arguments to the script
WSDIR="$1"
BIT_VERSION="0.2.8" # Leave empty for latest version

# install bvm and bit
npm i -g @teambit/bvm
bvm install ${BIT_VERSION} --use-system-node
export PATH="${HOME}/bin:${PATH}" # This step may change depending on your CI runner

# change to working directory before running bit install
cd ${WSDIR}

With

npx @teambit/bvm install

Note: You can also remove WSDIR if your Bit workspace is at the root of your project.

AshanFernando avatar Dec 14 '23 11:12 AshanFernando

@TGTGamer Can you check whether the PATH is correct depending on your build agent (following line) export PATH="${HOME}/bin:${PATH}

If you want to use the latest Bit version in your CI (without fixing to a specific version), you can replace the following lines.

While I appreciate this response. Simply removing the set version fixed the issue.

The more important component is that this is set in the ZIP files which are referenced in the website, and therefore other users who download the file will experience the same issue (with the same easy fix).

To rectify this issue, the scripts found at https://github.com/bit-tasks need an update - which I might do later when I get home if nobody addresses it before I get to a device I can git pull on :)

TGTGamer avatar Dec 14 '23 12:12 TGTGamer

@TGTGamer Thanks!

Btw what do you mean by "Simply removing the set version fixed the issue"? Is it to set BIT_VERSION=""

AshanFernando avatar Dec 14 '23 14:12 AshanFernando

Is it to set BIT_VERSION=""

Yeah exactly this

TGTGamer avatar Dec 14 '23 15:12 TGTGamer