question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

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

See original GitHub issue

Behaviour

It seems breaking changes was introduced to tag v2 this weekend. Locking action to 1b7db3498a1941bc89504b474567da7ddc1341c solves the issue.

Steps to reproduce this issue

  1. Use docker/build-push-action@v2 with attached workflow file
  2. Trigger action

Expected behaviour

It should work as before the weekend using the same tag (@v2)

Actual behaviour

Build fails

Configuration

  • Repository URL (if public): private
  • Build URL (if public): private
name: "Docker Build/Push and Deploy to k8s"

on:
  push:
    branches:
      - master
  pull_request:
    branches:
      - master

env:
  REGISTRY: private.registry.tld
  IMAGE_NAME: myrepo

jobs:
  build:
    runs-on: ubuntu-latest
    steps:
      - name: Set up Docker Buildx
        uses: docker/setup-buildx-action@v1
        id: buildx
        with:
          install: true

      - name: Cache Docker layers
        uses: actions/cache@v2
        with:
          path: /tmp/.buildx-cache
          key: ${{ runner.os }}-buildx-${{ github.sha }}
          restore-keys: |
            ${{ runner.os }}-buildx-

      - uses: actions/checkout@v2

      - uses: docker/login-action@v1
        with:
          registry: ${{ env.REGISTRY }}
          username: ${{ secrets.registry_username }}
          password: ${{ secrets.registry_password }}

      - name: Build and push
        uses: docker/build-push-action@v2
        with:
          # Only push if we are on the master branch
          push: ${{ endswith(github.ref, 'master') }}
          tags: "${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ github.sha }}"
          cache-from: type=local,src=/tmp/.buildx-cache
          cache-to: type=local,dest=/tmp/.buildx-cache

Logs

Buildx version: 0.4.2
🏃 Starting build...
/usr/bin/docker buildx build --tag plattform.azurecr.io/myrepo/master:3b9518b1d1444f6307f491a4d8e59692c3df21ea --iidfile /tmp/docker-build-push-AmL3yR/iidfile --cache-from type=local,src=/tmp/.buildx-cache --cache-to type=local,dest=/tmp/.buildx-cache --secret id=GIT_AUTH_TOKEN,src=/tmp/docker-build-push-AmL3yR/tmp-3255-cPRnHGzuxj5J --file ./Dockerfile https://github.com/myorg/myrepo.git#pull/5/merge
time="2020-10-05T08:16:01Z" level=warning msg="invalid non-bool value for BUILDX_NO_DEFAULT_LOAD: "
time="2020-10-05T08:16:01Z" level=warning msg="No output specified for docker-container driver. Build result will only remain in the build cache. To push result image into registry use --push or to load image into docker use --load" 
#1 [internal] load git source https://github.com/myorg/myrepo.git#pull/...
#1 0.085 Initialized empty Git repository in /var/lib/buildkit/runc-overlayfs/snapshots/snapshots/1/fs/
#1 0.641 fatal: could not read Username for 'https://github.com': No such device or address
#1 ERROR: failed to fetch remote https://github.com/myorg/myrepo.git: exit status 128 
------
 > [internal] load git source https://github.com/myorg/myrepo.git#pull/5/merge:
------
failed to solve: rpc error: code = Unknown desc = failed to solve with frontend dockerfile.v0: failed to read dockerfile: failed to load cache key: failed to fetch remote https://github.com/myorg/myrepo.git: exit status 128 
Error: The process '/usr/bin/docker' failed with exit code 1

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:2
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

14reactions
ystxncommented, Dec 1, 2020

this issue is closed but the error still exists on docker/build-push-action@v2 today

4reactions
stigokcommented, Oct 5, 2020

Pipeline works correctly using context: . as described.

Read more comments on GitHub >

github_iconTop Results From Across the Web

fatal: could not read Username for 'https://github.com': No such ...
This is an issue with your stored credentials in the system credential cache. You probably have the config variable 'credential.helper' set to ...
Read more >
Fatal: Could not read Username for "https://github.com", No ...
Hello! Today I was doing the setup of a git automation inside a Docker container using hub and I ran into something that...
Read more >
Fixing could not read Username for 'https://github.com'
But this inscrutable error message comes up. There is a fairly simple fix, especially if you're using an HTTPS URL to access the...
Read more >
failed during stage 'preparing repo': error checking for ref: fatal ...
failed during stage 'preparing repo': error checking for ref: fatal: could not read Username for 'https://github.com': No such device or address Anybody ...
Read more >
Git push origin master could not read username for http ...
fatal : could not read Username for 'https://github.com': No such file or directory ... git remote set-url origin git@github.com:username/repo.git.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found