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

PEM routines:get_name:no start line #532

Open
penguin02007 opened this issue Sep 21, 2022 · 5 comments
Open

PEM routines:get_name:no start line #532

penguin02007 opened this issue Sep 21, 2022 · 5 comments
Labels
question Further information is requested

Comments

@penguin02007
Copy link

penguin02007 commented Sep 21, 2022

Hi, I'm trying to get UHA running in Github Cloud Enterprise.

I double checked the private key is in Repository secrets and the App is installed under Org level for permission.

What should I check next? Any help would be appreciated.

Run jnwng/github-app-installation-token-action@v[1](https://github.com/xxxl/xxx/actions/runs/3095721034/jobs/5010435933#step:2:1)
  with:
    appId: ***
    installationId: ***
    privateKey: ***
  
Error: error:0909006C:PEM routines:get_name:no start line
@gagoar gagoar added the question Further information is requested label Sep 21, 2022
@gagoar
Copy link
Owner

gagoar commented Sep 21, 2022

Hey, @penguin02007 This issue seems to be that your privateKey is not properly generated. Did you follow the steps to create the App in your org?

I built a command line tool that might give you a hint. (it's what that action uses underneath)

You can run it on your computer and see what's going on. here is the project.

@penguin02007
Copy link
Author

@gagoar,

Yes i did indeed!
image

I am on MacOS m1 12.6 and for some reason npm keep barks at me...

penguin02007$ npm -v
8.15.0
penguin02007$ npm cache clean --force
npm WARN using --force Recommended protections disabled.
penguin02007$ npm -g install github-app-installation-token
npm ERR! code EACCES
npm ERR! syscall rename
npm ERR! path /usr/local/lib/node_modules/github-app-installation-token
npm ERR! dest /usr/local/lib/node_modules/.github-app-installation-token-l59W0We5
npm ERR! errno -13
npm ERR! Error: EACCES: permission denied, rename '/usr/local/lib/node_modules/github-app-installation-token' -> '/usr/local/lib/node_modules/.github-app-installation-token-l59W0We5'
npm ERR!  [Error: EACCES: permission denied, rename '/usr/local/lib/node_modules/github-app-installation-token' -> '/usr/local/lib/node_modules/.github-app-installation-token-l59W0We5'] {
npm ERR!   errno: -13,
npm ERR!   code: 'EACCES',
npm ERR!   syscall: 'rename',
npm ERR!   path: '/usr/local/lib/node_modules/github-app-installation-token',
npm ERR!   dest: '/usr/local/lib/node_modules/.github-app-installation-token-l59W0We5'
npm ERR! }
npm ERR!
npm ERR! The operation was rejected by your operating system.
npm ERR! It is likely you do not have the permissions to access this file as the current user
npm ERR!
npm ERR! If you believe this might be a permissions issue, please double-check the
npm ERR! permissions of the file and its containing directories, or try running
npm ERR! the command again as root/Administrator.

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/ka.chan/.npm/_logs/2022-09-21T21_09_26_446Z-debug-0.log

@gagoar
Copy link
Owner

gagoar commented Sep 21, 2022 via email

@penguin02007
Copy link
Author

penguin02007 commented Sep 21, 2022

Thanks for the tips @gagoar!

I have no luck using npm run or npm exec, it works perfectlynpx!

$ npm -g install github-app-installation-token

added 109 packages, and audited 110 packages in 5s

11 packages are looking for funding
  run `npm fund` for details

found 0 vulnerabilities

mbp:github-app-installation-token penguin02007$ npm run github-app-installation-token \
> --appId xxx --installationId xxx \
> --privateKeyLocation ~/Documents/uha_private_key.pem \
>
npm ERR! Missing script: "github-app-installation-token"
npm ERR!
npm ERR! Did you mean this?
npm ERR!     npm exec github-app-installation-token # run the "github-app-installation-token" command from either this or a remote npm package
npm ERR!
npm ERR! To see a list of scripts, run:
npm ERR!   npm run

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/penguin02007/.npm/_logs/2022-09-21T21_30_34_044Z-debug-0.log
mbp:github-app-installation-token penguin02007$ npx github-app-installation-token \
> --appId xxx \
> --installationId xxx \
> --privateKeyLocation ~/Documents/uha_private_key.pem \
>
💫 The token is: ghs_1234567890 and expires 2022-09-21T22:33:1Z ******

@gagoar
Copy link
Owner

gagoar commented Sep 21, 2022

Means that how you put the secrets in GitHub is not right. Also don't share the token in a public channel. Please edit the comment you left !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants