Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

[BUG] Permission denied in /entrypoint.sh: line 40 #12

Closed
adriaandotcom opened this issue Apr 8, 2020 · 18 comments · Fixed by #14
Closed

[BUG] Permission denied in /entrypoint.sh: line 40 #12

adriaandotcom opened this issue Apr 8, 2020 · 18 comments · Fixed by #14
Assignees
Labels
bug Something isn't working

Comments

@adriaandotcom
Copy link

adriaandotcom commented Apr 8, 2020

Not sure why this is happening, but if I use v1.0 this does not happen:

Run creyD/prettier_action@v2.2
  with:
    prettier_options: --write {**/*,*}.{js,html,json,md,yml,css,scss} !.github/workflows/**/* !static/**/*
    commit_message: Run prettier via GitHub Action
    branch: fix-twitter-hostname
    file_pattern: .
    dry: false
  env:
    GITHUB_TOKEN: ***
/usr/bin/docker run --name *** --label d00b33 --workdir /github/workspace --rm -e GITHUB_TOKEN -e INPUT_PRETTIER_OPTIONS -e INPUT_COMMIT_MESSAGE -e INPUT_BRANCH -e INPUT_FILE_PATTERN -e INPUT_COMMIT_OPTIONS -e INPUT_DRY -e INPUT_PRETTIER_VERSION -e HOME -e GITHUB_JOB -e GITHUB_REF -e GITHUB_SHA -e GITHUB_REPOSITORY -e GITHUB_RUN_ID -e GITHUB_RUN_NUMBER -e GITHUB_ACTOR -e GITHUB_WORKFLOW -e GITHUB_HEAD_REF -e GITHUB_BASE_REF -e GITHUB_EVENT_NAME -e GITHUB_WORKSPACE -e GITHUB_ACTION -e GITHUB_EVENT_PATH -e RUNNER_OS -e RUNNER_TOOL_CACHE -e RUNNER_TEMP -e RUNNER_WORKSPACE -e ACTIONS_RUNTIME_URL -e ACTIONS_RUNTIME_TOKEN -e ACTIONS_CACHE_URL -e GITHUB_ACTIONS=true -e CI=true -v "/var/run/docker.sock":"/var/run/docker.sock" -v "/home/runner/work/_temp/_github_home":"/github/home" -v "/home/runner/work/_temp/_github_workflow":"/github/workflow" -v "/home/runner/work/queue/queue":"/github/workspace" ***:***
/entrypoint.sh: line 40: : Permission denied
Installing prettier...
/usr/local/bin/prettier -> /usr/local/lib/node_modules/prettier/bin-prettier.js
+ prettier@2.0.4
added 1 package from 1 contributor in 0.546s
Prettifing files...
Files:
file1.js 50ms
file2.js 13ms
Nothing to commit. Exiting.
@adriaandotcom adriaandotcom added the bug Something isn't working label Apr 8, 2020
@creyD
Copy link
Owner

creyD commented Apr 9, 2020

Do you have any news on this? Does it work again or could you fix it?

@creyD
Copy link
Owner

creyD commented Apr 9, 2020

Could you please try your config with prettier_version: false?

@adriaandotcom
Copy link
Author

With prettier_version: false I don't get any error. Hm.

@creyD
Copy link
Owner

creyD commented Apr 16, 2020

In b5eb80d I replaced the default value for prettier_version - can you please try again and confirm that it works?

@adriaandotcom
Copy link
Author

I now get another error when the action needs to commit:

Commiting and pushing changes...
error: pathspec 'prettier-fix' did not match any file(s) known to git
Problem checking out the specified branch: prettier-fix
[detached HEAD 989721d] Run prettier via GitHub Action
 Author: *** <***>
 1 file changed, 1 insertion(+), 1 deletion(-)
To https://github.com/simpleanalytics/queue
 ! [rejected]        HEAD -> prettier-fix (fetch first)
error: failed to push some refs to 'https://github.com/***'
hint: Updates were rejected because the remote contains work that you do
hint: not have locally. This is usually caused by another repository pushing
hint: to the same ref. You may want to first integrate the remote changes
hint: (e.g., 'git pull ...') before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details.

@creyD
Copy link
Owner

creyD commented Apr 22, 2020

Sadly I couldn't find out why this problem occurs for you. I am running this action on multiple of my own repos and it works so far.

@adriaandotcom
Copy link
Author

Will keep you posted if I see it again. It's gone for me now as well.

@boardfish
Copy link

I now get another error when the action needs to commit:

Commiting and pushing changes...
error: pathspec 'prettier-fix' did not match any file(s) known to git
Problem checking out the specified branch: prettier-fix
[detached HEAD 989721d] Run prettier via GitHub Action
 Author: *** <***>
 1 file changed, 1 insertion(+), 1 deletion(-)
To https://github.com/simpleanalytics/queue
 ! [rejected]        HEAD -> prettier-fix (fetch first)
error: failed to push some refs to 'https://github.com/***'
hint: Updates were rejected because the remote contains work that you do
hint: not have locally. This is usually caused by another repository pushing
hint: to the same ref. You may want to first integrate the remote changes
hint: (e.g., 'git pull ...') before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details.

I'm getting this too. I'll try setting prettier_version to false as above.

boardfish added a commit to boardfish/com3504-assignment that referenced this issue Apr 28, 2020
boardfish added a commit to boardfish/com3504-assignment that referenced this issue Apr 28, 2020
@creyD
Copy link
Owner

creyD commented Apr 29, 2020

@adriaanvanrossum Could you please send me your config yml file? Thank you!

@adriaandotcom
Copy link
Author

Not sure if this is the same config as where the issue was happening though.

My workflow config file
name: Node CI Main

on:
  pull_request:
    types: [opened, synchronize]
  push:
    branches:
      - master

jobs:
  build:
    runs-on: ubuntu-latest
    timeout-minutes: 5

    steps:
      - name: Check if node is version 12
        run: |
          if [[ $(node -v | cut -d '.' -f 1 | grep -Eo '[0-9]{1,4}') -eq 12 ]];
            then
              echo "Node.js version is 12";
            else
              echo "Node.js version is not 12";
              exit 1;
          fi
        shell: bash

      - uses: actions/checkout@v2

      - name: Prettier Action on PR
        if: github.event_name == 'pull_request'
        uses: creyD/prettier_action@v2.2
        with:
          prettier_version: ^2.0.5
          prettier_options: "--write {,!(static|.github)/**/}*.{js,html,json,md,yml,css,scss} static/js/**/*.js"
          commit_message: "Run prettier via GitHub Action"
          branch: ${{ github.head_ref }}
          file_pattern: "."
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

      - name: Prettier Action on master
        if: github.ref == 'refs/heads/master'
        uses: creyD/prettier_action@v2.2
        with:
          prettier_version: ^2.0.5
          prettier_options: "--write {,!(static|.github)/**/}*.{js,html,json,md,yml,css,scss} static/js/**/*.js"
          commit_message: "Run prettier via GitHub Action"
          branch: master
          file_pattern: "."
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

      - uses: harmon758/postgresql-action@v1
        with:
          postgresql version: "12"
          postgresql db: "test_ci"
          postgresql user: "test"
          postgresql password: "password"

      - name: Use Node.js ${{ matrix.node-version }}
        uses: actions/setup-node@v1
        with:
          node-version: ${{ matrix.node-version }}

      - name: npm install, and test
        run: |
          npm install
          npm test
        env:
          CI: true
          NODE_ENV: test

@creyD
Copy link
Owner

creyD commented Apr 29, 2020

Could you try the same without the ^? Please specify the version using only a number for this test!

@ghost
Copy link

ghost commented May 1, 2020

Hi @creyD ,
I am also facing issue here.
When prettier_version set to false it works fine but i want version 1.19.1.
So when i set version , i receive error:

Installing prettier...
/entrypoint.sh: line 40: 1.19.1: not found
/usr/local/bin/prettier -> /usr/local/lib/node_modules/prettier/bin-prettier.js
+ prettier@2.0.5
added 1 package from 1 contributor in 0.584s
Prettifing files...

my yml file:

  prettier:
    runs-on: ubuntu-latest

    steps:
      - name: Checkout
        uses: actions/checkout@v2
        with:
          # Make sure the actual branch is checked out when running on pull requests
          ref: ${{ github.head_ref }}

      - name: Prettify code
        uses: creyD/prettier_action@v2.2
        with:
          prettier_version: '1.19.1'
          # Push back to the same branch that was checked out
          branch: ${{ github.head_ref }}
          dry: true
          # This part is also where you can pass other options, for example:
          prettier_options: --config .prettierrc --write **/*.{js,md}

@ghost
Copy link

ghost commented May 1, 2020

I did versio to this
prettier_version: 2.0.5
still getting error

/entrypoint.sh: line 40: 2.0.5: not found
Installing prettier...
/usr/local/bin/prettier -> /usr/local/lib/node_modules/prettier/bin-prettier.js
+ prettier@2.0.5

@creyD
Copy link
Owner

creyD commented May 1, 2020

Hi @creyD ,

I am also facing issue here.

When prettier_version set to false it works fine but i want version 1.19.1.

So when i set version , i receive error:


Installing prettier...

/entrypoint.sh: line 40: 1.19.1: not found

/usr/local/bin/prettier -> /usr/local/lib/node_modules/prettier/bin-prettier.js

+ prettier@2.0.5

added 1 package from 1 contributor in 0.584s

Prettifing files...

my yml file:


  prettier:

    runs-on: ubuntu-latest



    steps:

      - name: Checkout

        uses: actions/checkout@v2

        with:

          # Make sure the actual branch is checked out when running on pull requests

          ref: ${{ github.head_ref }}



      - name: Prettify code

        uses: creyD/prettier_action@v2.2

        with:

          prettier_version: '1.19.1'

          # Push back to the same branch that was checked out

          branch: ${{ github.head_ref }}

          dry: true

          # This part is also where you can pass other options, for example:

          prettier_options: --config .prettierrc --write **/*.{js,md}



This is another issue, as this is another problem with the install statement. Could you please try to remove the single quotes (') around your version spec?

@ghost
Copy link

ghost commented May 1, 2020

Hi @creyD ,
I am also facing issue here.
When prettier_version set to false it works fine but i want version 1.19.1.
So when i set version , i receive error:


Installing prettier...

/entrypoint.sh: line 40: 1.19.1: not found

/usr/local/bin/prettier -> /usr/local/lib/node_modules/prettier/bin-prettier.js

+ prettier@2.0.5

added 1 package from 1 contributor in 0.584s

Prettifing files...

my yml file:


  prettier:

    runs-on: ubuntu-latest



    steps:

      - name: Checkout

        uses: actions/checkout@v2

        with:

          # Make sure the actual branch is checked out when running on pull requests

          ref: ${{ github.head_ref }}



      - name: Prettify code

        uses: creyD/prettier_action@v2.2

        with:

          prettier_version: '1.19.1'

          # Push back to the same branch that was checked out

          branch: ${{ github.head_ref }}

          dry: true

          # This part is also where you can pass other options, for example:

          prettier_options: --config .prettierrc --write **/*.{js,md}

This is another issue, as this is another problem with the install statement. Could you please try to remove the single quotes (') around your version spec?

Yes i did...like this
prettier_version: 2.0.5
Still the same error .

@creyD
Copy link
Owner

creyD commented May 4, 2020

@boardfish BTW did it work for you?

@creyD creyD linked a pull request May 4, 2020 that will close this issue
@boardfish
Copy link

Sorry I didn't get back to you sooner - afraid not:

error: pathspec 'dev-prettify-everything' did not match any file(s) known to git
Problem checking out the specified branch: dev-prettify-everything
[detached HEAD ae42b60] Prettified Code!
 Author: boardfish <boardfish@users.noreply.github.com>
 12 files changed, 238 insertions(+), 245 deletions(-)
 rewrite bin/www (61%)
 rewrite routes/index.js (83%)
To https://github.com/boardfish/com3504-assignment
 ! [rejected]        HEAD -> dev-prettify-everything (fetch first)
error: failed to push some refs to 'https://github.com/boardfish/com3504-assignment'
hint: Updates were rejected because the remote contains work that you do
hint: not have locally. This is usually caused by another repository pushing
hint: to the same ref. You may want to first integrate the remote changes
hint: (e.g., 'git pull ...') before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details

I've got the leeway to merge in despite the action failing - master gets prettified just fine after that.

@creyD creyD closed this as completed in #14 May 4, 2020
@creyD
Copy link
Owner

creyD commented May 4, 2020

I hope all bugs regarding this are resolved with version 3.0. If not, please reopen this!

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants