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

Error loading key "/tmp/git-resource-private-key": error in libcrypto #8927

Open
dove-young opened this issue Mar 22, 2024 · 2 comments
Open
Labels

Comments

@dove-young
Copy link

Summary

  1. I am walking through the quick start at here https://concourse-ci.org/tutorial-resources.html#put-steps. my pipeline cannot check this git resouce via ssh protocal.
    I got following error at http://localhost:8080/teams/main/pipelines/hello-world-git-failed/resources/repo-ssh page

Error loading key "/tmp/git-resource-private-key": error in libcrypto

  1. when I change resource uri to https protocol, I can get git repo been cloned, but I cannot make a commit to it.
resources:
- name: repo
type: git
source:
  uri: https://github.com/dove-young/concourse-examples.git
  # specify branch because it's required for the put step
  branch: master
  username: dove-young
  password: <my password>

Then I got error like this in repo-ssh step.

fatal: could not read Username for 'https://github.com': No such device or address

Steps to reproduce

Expected results

Actual results

Additional context

Here is my pipeline file

resources:
- name: repo-ssh
  type: git
  source:
    uri: [email protected]:dove-young/concourse-examples.git
    # specify branch because it's required for the put step
    branch: master
    private_key_user: dove-young
    private_key: |
      -----BEGIN OPENSSH PRIVATE KEY-----
      MIIEpQIBAAKCAQEAsRW99pw8xv0lypgEM3sWkPlr5+M5ssIkZ5lyHz+VctEQ+lZw
      <something else goes here>
      T/kczzBWXUYOacyPhk5aXvIW8U16htV0eDoAJssy4fpXAX5xSdpeKkw=
      -----END OPENSSH PRIVATE KEY-----

jobs:
- name: hello-world-job-put-github
  plan:
  - get: repo-ssh
    trigger: true
  - task: create-commit # renamed task
    config:
      platform: linux
      image_resource:
        type: registry-image
        source:
          repository: gitea/gitea # use any image that has the git cli
      inputs:
      - name: repo-ssh
      outputs: # Add repo as an output
      - name: repo-ssh
      params: # Change these to match your ssh key info
        EMAIL: [email protected]
        GIT_AUTHOR_NAME: dove-young
      run:
        path: sh
        args:
        - -cx
        # this is just a bash script
        - |
          cd repo-ssh
          date +%Y-%m-%d > todays-date
          git add ./todays-date
          git config --global user.email $EMAIL
          git config --global user.name $GIT_AUTHOR_NAME
          git commit -m "Update todays date"
  - put: repo-ssh
    params:
      repository: repo-ssh

Triaging info

  • Concourse version:
  • Browser (if applicable):
  • Did this used to work?
@dove-young dove-young added the bug label Mar 22, 2024
@dove-young
Copy link
Author

I can workaround the problem 2 by adding username and password in uri, like this

source:
  uri: https://dove-young:<my-password>@github.com/dove-young/concourse-examples.git

but this will be rejected by github with this message

Support for password authentication was removed on August 13, 2021

To workaround this, I need to replace <my-password> to my personal access token. Then it works.

@xtremerui
Copy link
Contributor

For using the key, please make sure the format of the key and you can actually use the key the get access to github in your local env.

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

No branches or pull requests

2 participants