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

Action fails on ubuntu-jammy runner #54

Closed
Ravio1i opened this issue Dec 16, 2022 · 16 comments
Closed

Action fails on ubuntu-jammy runner #54

Ravio1i opened this issue Dec 16, 2022 · 16 comments

Comments

@Ravio1i
Copy link

Ravio1i commented Dec 16, 2022

Description

When using the action on a github runner with ubuntu-jammy (22.04) it fails with:

Error

Error: Error: error:25066067:DSO support routines:dlfcn_load:could not load the shared library

Usage

jobs:
    build:
    runs-on: ubuntu-jammy
        steps:
          - name: Generate token from github app
            id: generate_token
            uses: tibdex/github-app-token@v1.7
            with:
              app_id: ${{ secrets.APP_ID }}
              private_key: ${{ secrets.APP_KEY }}

References

hamnis added a commit to hamnis/github-app-token that referenced this issue Jan 9, 2023
@Eran-BenShahar
Copy link

I'm also getting this error, when will the fix be merged?
Or is there any other workaround?

@prein
Copy link

prein commented Jan 12, 2023

@hamnis is there a way to use the action from your fork? I wanted to see if it fixes the issue for me

@hamnis
Copy link

hamnis commented Jan 12, 2023

No idea if I need to tag as a release or not.

One way is to compile the action locally then adding the dist folder and the action.yaml to your own repo.
then you can run it like this:

https://github.com/hamnis/github-app-token/blob/upgrade-octocat-auth-app/.github/workflows/test.yml#L24-L28

@hamnis
Copy link

hamnis commented Jan 12, 2023

Seems like this should be possible: https://stackoverflow.com/a/68286342

@prein
Copy link

prein commented Jan 13, 2023

Seems like this should be possible: https://stackoverflow.com/a/68286342

Thanks for looking it up for me. This way I tried first and it didn't work producing the following error

File not found: '/runner/_work/_actions/hamnis/github-app-token/upgrade-octocat-auth-app/dist/index.js'

I tried branch, sha, and local copy - it needs to be compiled like you said in your other reply.

@hamnis
Copy link

hamnis commented Jan 13, 2023

@prein try using the upgrade-octocat-auth-app-dist branch

@jazzlyn
Copy link

jazzlyn commented Jan 13, 2023

@hamnis I tried with your reference, still same error.

it seems this is an issue with node 16 and openssl, see https://stackoverflow.com/questions/72104449/node-js-crypto-fails-to-sign-pem-key-string-from-file-with-error25066067dso-su fixe

      - name: Generate token
        id: generate_token
        uses: tibdex/github-app-token@v1.7.0
        env:
          OPENSSL_CONF: /dev/null

fixed it for me.

@prein
Copy link

prein commented Jan 13, 2023

@jazzlyn thanks for sharing! It worked for me too

@hamnis I got it to run with the action compiled locally, but got a different error

Error: secretOrPrivateKey must be an asymmetric key when using RS256
Sharing the code just for completeness
     - name: Get github-app-token action from forked repo
       uses: actions/checkout@v3
       with:
         repository: hamnis/github-app-token
         ref: upgrade-octocat-auth-app
         path: hamnis-github-app-token
     # Compile the action to be able to use it
     - uses: actions/setup-node@v3
       with:
         node-version: latest
     - name: Install Yarn
       run: npm install -g yarn
     - name: Install
       run: yarn install --frozen-lockfile
       working-directory: hamnis-github-app-token
     - name: Deduplicate dependencies
       run: yarn run yarn-deduplicate --fail --strategy fewer
       working-directory: hamnis-github-app-token
     - name: Build
       run: yarn run build
       working-directory: hamnis-github-app-token
     - name: Format
       run: yarn run prettier --check
       working-directory: hamnis-github-app-token
     - name: Lint
       run: yarn run xo
       working-directory: hamnis-github-app-token
     # action should now be compiled, we can use it like this:
     - name: Generate app token
       id: generate_token
       uses: ./hamnis-github-app-token
       with:
         app_id: ${{ inputs.gh_app_id }}
         private_key: ${{ inputs.gh_app_private_key }}

@tibdex
Copy link
Owner

tibdex commented Jan 26, 2023

Can you please check if the issue still occurs with the latest version (1.8.0)?

@Ravio1i
Copy link
Author

Ravio1i commented Jan 31, 2023

I've tested the v1.8. Now I'm facing this error when using the key which is created from the private keys section of the github app.

Error: Error: secretOrPrivateKey must be an asymmetric key when using RS256

Running v1.8 on ubuntu-20.04 however works fine.

@sileon-e
Copy link

Seems to work for us on ubuntu-latest / ubuntu-jammy. Runner image version 20230219.1

@kosdp
Copy link

kosdp commented Mar 15, 2023

Just wanted to note here that as mentioned above adding below to generate_token step fixes the issue with secretOrPrivateKey must be an asymmetric key when using RS256. Works for me on both 1.7.0 and 1.8.0 version with this workaround.

        env:
          OPENSSL_CONF: /dev/null

@sahilshahane
Copy link

sahilshahane commented Jun 5, 2023

I'm still getting this error

Error: Error: secretOrPrivateKey must be an asymmetric key when using RS256

i tried all fixes mentioned here, but it still doesn't work. (with ubuntu-20.04 and ubuntu-latest)

i added this, in my steps

- name: Generate Org. level Access token
        id: generate_token
        uses: tibdex/github-app-token@v1.8.0
        with:
          app_id: ${{ secrets.INTERNAL_APP_ID }}
          private_key: ${{ secrets.INTERNAL_APP_PRIVATE_KEY }}
        env:
            OPENSSL_CONF: /dev/null

just for completeness,
github gives me a private key in this form SHA256:xxxxxxxxxxxxxxxxxxx

@grigorye
Copy link

grigorye commented Jun 9, 2023

I'm still getting this error

Error: Error: secretOrPrivateKey must be an asymmetric key when using RS256

i tried all fixes mentioned here, but it still doesn't work. (with ubuntu-20.04 and ubuntu-latest)

...

just for completeness, github gives me a private key in this form SHA256:xxxxxxxxxxxxxxxxxxx

I faced it as well, then I realized that that value that you see above, is a hash shown on GitHub application page, rather than the key itself. The actual key is downloaded by your browser when you press "Generate private key" on GitHub App settings page (that's a file that ends with .private-key.pem). Using that file as the key makes it work as expected.

@tibdex
Copy link
Owner

tibdex commented Sep 8, 2023

Can someone check if the issue still occurs with the latest version (2.0.0)?

@tibdex tibdex closed this as completed Sep 19, 2023
@sascha-mueller-icebaum
Copy link

@tibdex i also having these issues and tested different versions. Just getting more detailed error messages:

1.8.0
image

2.0.0
image

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.