actions / runner

The Runner for GitHub Actions :rocket:
https://github.com/features/actions
MIT License
4.91k stars 963 forks source link

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

Open quantuan125 opened 10 months ago

quantuan125 commented 10 months ago

Describe the bug [A clear and concise description of what the bug is.](fatal: could not read Username for 'https://github.com/': No such device or address)

Issue related to authentication through https of the git repo with "git pull" however adding PAT token does NOT help. To Reproduce workflows yaml file:

name: Deploy Streamlit App

on:
  push:
    branches: [ main ]
jobs:
  deploy:
    runs-on: ubuntu-latest
    steps:
    - name: Check out repository code
      uses: actions/checkout@v2

    - name: Set up Python
      uses: actions/setup-python@v2
      with:
        python-version: '3.12'

    - name: Install dependencies
      run: |
        python -m pip install --upgrade pip
        pip install -r requirements.txt

    - name: Set up Git Credentials
      run: git config --global url."https://${GH_PAT}@github.com/".insteadOf "https://github.com/"

    - name: Deploy to EC2
      env:
        EC2_SSH_PRIVATE_KEY: ${{ secrets.EC2_SSH_PRIVATE_KEY }}
        GH_PAT: ${{ secrets.GH_PAT }}
        EC2_HOST: 51.20.12.56
      run: |
        # Install SSH client
        sudo apt-get update
        sudo apt-get install -y ssh-client

        # Set up SSH key
        mkdir -p ~/.ssh
        echo "$EC2_SSH_PRIVATE_KEY" > ~/.ssh/id_rsa
        chmod 600 ~/.ssh/id_rsa
        ssh-keyscan -H "$EC2_HOST" >> ~/.ssh/known_hosts

        # SSH into the EC2 instance and deploy
        ssh -o StrictHostKeyChecking=no ec2-user@"$EC2_HOST" << 'ENDSSH'

        # Go to the application directory
        cd ~/GLN

        # Pull changes from GitHub
        git pull

        # Activate the Python virtual environment, if you have one
        source GLN/bin/activate

        # Install any new dependencies
        pip install -r requirements.txt

        # Restart the Streamlit application
        sudo systemctl restart gln.service
        ENDSSH

Runner Version and Platform

AWS/EC2/AMAZON LINUX

What's not working?

, # ~_ #### Amazon Linux 2023 ~~ _#####\ ~~ ###| ~~ #/ ___ https://aws.amazon.com/linux/amazon-linux-2023 ~~ V~' '->


      ~~._.   _/
         _/ _/
       _/m/'
**fatal: could not read Username for 'https://github.com/': No such device or address**
CarlosVillaRoca commented 10 months ago

Same issue

bryanmacfarlane commented 10 months ago

This looks external to the runner. The runner seems to be running your script and capturing the output correctly

Lee-Dongwook commented 8 months ago

I'm experiencing the same problem now.