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

MacOS 11: Something went wrong, self-installer exits with code 1 #44

Closed
aminya opened this issue May 25, 2022 · 10 comments · Fixed by #46
Closed

MacOS 11: Something went wrong, self-installer exits with code 1 #44

aminya opened this issue May 25, 2022 · 10 comments · Fixed by #46

Comments

@aminya
Copy link

aminya commented May 25, 2022

The action fails on MacOS 11
https://github.com/aminya/setup-cpp/runs/6601627749?check_suite_focus=true#step:5:1

Run pnpm/action-setup@v[2](https://github.com/aminya/setup-cpp/runs/6601627749?check_suite_focus=true#step:5:2)
  with:
    version: 7
    dest: ~/setup-pnpm
    run_install: null
Running self-installer...
  [stdin]:1
  <!DOCTYPE html>
  ^
  
  SyntaxError: Unexpected token '<'
      at new Script (vm.js:88:7)
      at createScript (vm.js:261:10)
      at Object.runInThisContext (vm.js:[3](https://github.com/aminya/setup-cpp/runs/6601627749?check_suite_focus=true#step:5:3)09:10)
      at Object.<anonymous> ([stdin]-wrapper:10:26)
      at Module._compile (internal/modules/cjs/loader.js:999:30)
      at evalScript (internal/process/execution.js:9[4](https://github.com/aminya/setup-cpp/runs/6601627749?check_suite_focus=true#step:5:4):2[5](https://github.com/aminya/setup-cpp/runs/6601627749?check_suite_focus=true#step:5:5))
      at internal/main/eval_stdin.js:29:5
      at Socket.<anonymous> (internal/process/execution.js:207:5)
      at Socket.emit (events.js:32[6](https://github.com/aminya/setup-cpp/runs/6601627749?check_suite_focus=true#step:5:7):22)
      at endReadableNT (_stream_readable.js:[12](https://github.com/aminya/setup-cpp/runs/6601627749?check_suite_focus=true#step:5:13)41:12)
Error: Something went wrong, self-installer exits with code 1
Installation Completed!
@yonycalsin
Copy link

I'm getting the same error.

I guess that in the logs it tries to parse the html syntax, and why would pnpm have to do that ?

image

@aminya
Copy link
Author

aminya commented May 26, 2022

It seems it fetches pnpm from 'https://pnpm.js.org/pnpm.js' and tries to parse the result.

const response = await fetch('https://pnpm.js.org/pnpm.js')
response.body.pipe(cp.stdin)

The JS file is not minified; its size is 4.3 MB! No surprise if it fails due to network issues.

image

@ankurk91
Copy link

ankurk91 commented May 26, 2022

Same here
https://github.com/ankurk91/google-chat-electron/runs/6605847171?check_suite_focus=true

      - name: Setup pnpm
        uses: pnpm/action-setup@v2.2.1
        with:
          version: 7.x.x

Looks like https://pnpm.js.org/pnpm.js is returning HTML instead of JS?

I ended up using this flow now

      - name: Setup node.js
        uses: actions/setup-node@v2
        with:
          node-version: 16.x

      - name: Install pnpm
        run: npm install -g pnpm@^7

@Conduitry
Copy link

https://pnpm.js.org/ is protected by Cloudflare, so my best (and only) guess is that the IPs GitHub is using for its macOS runners got ratelimited, and so what we're getting is Cloudflare's blocked page or its CAPTCHA page.

@zkochan
Copy link
Member

zkochan commented May 26, 2022

We don't fetch from pnpm.js.org

const response = await fetch('https://get.pnpm.io/v6.16.js')

@Conduitry
Copy link

Well, all right, but it looks like https://get.pnpm.io/ is behind Cloudflare too, so I'm still betting it's the same thing.

@zkochan
Copy link
Member

zkochan commented May 26, 2022

I am not sure. I have enabled caching for get.pnpm.io, so I don't think it would rate limit anything.

@dominikg
Copy link

one workaround is to use setup-node twice, and npm i -g pnpm. You can even parse packageManager field with jq
example: https://github.com/sveltejs/vite-plugin-svelte/blob/main/.github/workflows/ci.yml#L27-L35

The solution for fixing this action is including pnpms install.sh in this repo and not relying on downloads from pnpm.io as discussed here #22

@zkochan
Copy link
Member

zkochan commented May 28, 2022

🚢 2.2.2

@aminya
Copy link
Author

aminya commented Jun 30, 2022

Now, it fails on Ubuntu 18.04
https://github.com/aminya/setup-cpp/runs/7125419782?check_suite_focus=true#step:5:9

Run pnpm/action-setup@v2
Running self-installer...
  [stdin]:1
  <!DOCTYPE html>
  ^
  
  SyntaxError: Unexpected token '<'
      at new Script (vm.js:88:7)
    at createScript (vm.js:2[6](https://github.com/aminya/setup-cpp/runs/7125419782?check_suite_focus=true#step:5:7)1:10)
    at Object.runInThisContext (vm.js:309:10)
    at Object.<anonymous> ([stdin]-wrapper:10:26)
Error: Something went wrong, self-installer exits with code 1
Installation Completed!
    at Module._compile (internal/modules/cjs/loader.js:999:30)
    at evalScript (internal/process/execution.js:94:25)
    at internal/main/eval_stdin.js:29:5
    at Socket.<anonymous> (internal/process/execution.js:20[7](https://github.com/aminya/setup-cpp/runs/7125419782?check_suite_focus=true#step:5:8):5)
    at Socket.emit (events.js:326:22)
    at endReadableNT (_stream_readable.js:[12](https://github.com/aminya/setup-cpp/runs/7125419782?check_suite_focus=true#step:5:13)41:12)

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

Successfully merging a pull request may close this issue.

6 participants