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

Gitlab CI issue #646

Open
muuvmuuv opened this issue Oct 29, 2024 · 6 comments
Open

Gitlab CI issue #646

muuvmuuv opened this issue Oct 29, 2024 · 6 comments
Assignees
Labels
bug Something isn't working

Comments

@muuvmuuv
Copy link

muuvmuuv commented Oct 29, 2024

What version?

0.41.7

Which command?

proto install

What happened?

I am using the following script to install proto in our Gitlab pipelines. Unfortunately it fails pulling node. Is there a recommend way of using proto in other CI env?

.workspace:
  image: debian:latest
  before_script: &install_pnpm
    - apt-get update -y && apt-get install -y git unzip gzip xz-utils curl
    - mkdir -p $HOME/proto &&
      curl -fsSL https://github.com/moonrepo/proto/releases/download/v0.41.7/proto_cli-x86_64-unknown-linux-gnu.tar.xz |
      tar -xJ -C $HOME/proto --strip-components=1
    - $HOME/proto/proto install
    - $HOME/proto/proto run pnpm config set store-dir .cache/pnpm-store
    - $HOME/proto/proto run pnpm --silent install

Trace logs?

node Installing Node.js ~22
pnpm Installing pnpm ~9
node Downloading pre-built archive
pnpm Downloading pre-built archive
pnpm Unpacking archive
pnpm pnpm 9.12.3 installed!
Error: net::http
  × Failed to make HTTP request for https://nodejs.org/download/release/
  │ v22.10.0/node-v22.10.0-linux-x64.tar.xz.
  ├─▶ error decoding response body
  ├─▶ error reading a body from connection
  ╰─▶ stream error received: unexpected internal error encountered

Operating system?

Linux

Architecture?

x64

@muuvmuuv muuvmuuv added the bug Something isn't working label Oct 29, 2024
@muuvmuuv
Copy link
Author

Ok that seemed to be a network error that just occured a lot of times. Maybe a load balancing issue on node side since I tried a lot of times to fix the pipeline.

Now I get:

Successfully installed 2 tools!
 Tool  Configured  Resolved  Installed                        Config                            
 node  >=22        22.10.0   /root/.proto/tools/node/22.10.0  /builds/m8finder/app/package.json 
 pnpm  >=9         9.12.3    /root/.proto/tools/pnpm/9.12.3   /builds/m8finder/app/package.json 
$ $HOME/proto/proto run pnpm --version
proto-run 0.41.7
$ $HOME/proto/proto run pnpm -- --version
Error:   × No such file or directory (os error 2)

@muuvmuuv
Copy link
Author

Wow, this works. I just had to explicitly set the shell due to no $SHELL available in CI context.

.workspace:
  image: debian:latest
  before_script: &install_pnpm
    - apt-get update -y && apt-get install -y git unzip gzip xz-utils curl
    - curl -fsSL https://moonrepo.dev/install/proto.sh | bash -s -- latest --shell=bash --yes
    - source $HOME/.profile && proto install
    - pnpm config set store-dir .cache/pnpm-store
    - pnpm --silent install

@milesj
Copy link
Contributor

milesj commented Oct 29, 2024

Nice find! This should fallback to sh shell when one could not be found.

If possible, the command that errors with "No such file or directory", can you run it with PROTO_LOG=trace. It will help to pinpoint where the error is coming frmo.

@milesj
Copy link
Contributor

milesj commented Oct 31, 2024

Yeah this would hard error if no shell is found: https://github.com/moonrepo/proto/blob/master/crates/cli/src/commands/setup.rs#L65

@muuvmuuv
Copy link
Author

muuvmuuv commented Nov 1, 2024

Maybe using this helper would work out? https://github.com/moonrepo/starbase/blob/master/crates/shell/src/shell.rs#L59

@milesj
Copy link
Contributor

milesj commented Nov 1, 2024

It does use that helper.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Development

No branches or pull requests

2 participants