question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

GH Actions: playwright.sh and node: Permission denied

See original GitHub issue

Repro step:

  1. Step a Python project on GitHub using GH Actions to install playwright-python on the CI machine
  2. While running python -m playwright install, you might see
Traceback (most recent call last):
1230
  File "/opt/hostedtoolcache/Python/3.9.2/x64/lib/python3.9/runpy.py", line 197, in _run_module_as_main
1231
    return _run_code(code, main_globals, None,
1232
  File "/opt/hostedtoolcache/Python/3.9.2/x64/lib/python3.9/runpy.py", line 87, in _run_code
1233
    exec(code, run_globals)
1234
  File "/opt/hostedtoolcache/Python/3.9.2/x64/lib/python3.9/site-packages/playwright-1.9.2-py3.9-linux-x86_64.egg/playwright/__main__.py", line 32, in <module>
1235
    main()
1236
  File "/opt/hostedtoolcache/Python/3.9.2/x64/lib/python3.9/site-packages/playwright-1.9.2-py3.9-linux-x86_64.egg/playwright/__main__.py", line 28, in main
1237
    subprocess.run([str(driver_executable), *sys.argv[1:]], env=my_env)
1238
  File "/opt/hostedtoolcache/Python/3.9.2/x64/lib/python3.9/subprocess.py", line 505, in run
1239
    with Popen(*popenargs, **kwargs) as process:
1240
  File "/opt/hostedtoolcache/Python/3.9.2/x64/lib/python3.9/subprocess.py", line 951, in __init__
1241
    self._execute_child(args, executable, preexec_fn, close_fds,
1242
  File "/opt/hostedtoolcache/Python/3.9.2/x64/lib/python3.9/subprocess.py", line 1823, in _execute_child
1243
    raise child_exception_type(errno_num, err_msg, err_filename)
1244
PermissionError: [Errno 13] Permission denied: '/opt/hostedtoolcache/Python/3.9.2/x64/lib/python3.9/site-packages/playwright-1.9.2-py3.9-linux-x86_64.egg/playwright/driver/playwright.sh'
1245
Error: Process completed with exit code 1.

Sample GH Actions output: https://github.com/imWildCat/scylla/runs/2159854168?check_suite_focus=true#step:4:1244

I can only install playwright drive by using this workaround:

sudo chmod +x /opt/hostedtoolcache/Python/3.9.2/x64/lib/python3.9/site-packages/playwright-1.9.2-py3.9-linux-x86_64.egg/playwright/driver/playwright.sh
python -m playwright install

In addition, after working around this issue, I also found another issue where no permission for node:

---------------------------- Captured stderr setup -----------------------------
/opt/hostedtoolcache/Python/3.9.2/x64/lib/python3.9/site-packages/playwright-1.9.2-py3.9-linux-x86_64.egg/playwright/driver/playwright.sh: 3: /opt/hostedtoolcache/Python/3.9.2/x64/lib/python3.9/site-packages/playwright-1.9.2-py3.9-linux-x86_64.egg/playwright/driver/node: Permission denied

Reference: https://github.com/imWildCat/scylla/pull/137/checks?check_run_id=2159995227#step:6:142

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:5 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
kumaraditya303commented, Mar 22, 2021

It is permission issue due to the use of sudo Try this config:

name: 'Python package: Scylla'

on: [push, pull_request]

jobs:
  build:

    runs-on: ubuntu-latest
    strategy:
      max-parallel: 2
      matrix:
        python-version: [ 3.9 ]

    steps:
    - uses: actions/checkout@v2
    - uses: microsoft/playwright-github-action@v1
    - name: Set up Python ${{ matrix.python-version }}
      uses: actions/setup-python@v2
      with:
        python-version: ${{ matrix.python-version }}
    - name: Install dependencies
      run: |
        sudo apt-get update -y
        sudo apt-get install libgnutls28-dev libcurl4-openssl-dev libssl-dev -y
        pip install -r tests/requirements-test.txt
        pip install -e.
        python -m playwright install
    - name: Lint with flake8
      run: |
        make style-check
    - name: Test with pytest
      run: |
        pytest --cov=./scylla tests
0reactions
imWildCatcommented, Mar 23, 2021

@kumaraditya303 Thanks a lot!

It works!

Could you share the location of playwright.sh? I couldn’t find it but would like to take a look.

Read more comments on GitHub >

github_iconTop Results From Across the Web

[BUG] Playwright installation cause to ... - GitHub
@Pooort There's an access error - for some reason your user cannot access /home/test/.cache/ms-playwright folder. Does it happen for you on v1.
Read more >
GitHub Actions: Fixing the 'Permission Denied' error for shell ...
"Permission denied" means that your script file does not have the "execute" permission set. On Mac and Linux you can use the chmod...
Read more >
Getting an npm permissions error running ESLint in GH ...
After upgrading from Node 14.15 => 16.18.1 , I have started getting a Error: EACCES: permission denied, scandir '/root/.npm/_logs' error ...
Read more >
7 Github Actions Tricks I Wish I Knew Before I Started
#1: How to Use Github Action Triggers. Triggers is what starts a workflow. Here's how it looks like: name: ...
Read more >
Complete Guide To Selenium Testing with GitHub Actions
A GitHub Actions example is the best way to get hands-on experience with the CI/CD tool. Learn all about Selenium GitHub Actions and ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found