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

Username and password not recognized #29

Closed
slimcdk opened this issue Nov 12, 2020 · 14 comments
Closed

Username and password not recognized #29

slimcdk opened this issue Nov 12, 2020 · 14 comments

Comments

@slimcdk
Copy link

slimcdk commented Nov 12, 2020

Behaviour

I'm using this example to authenticate with docker hub, however the build fails with the error. What am I missing?
Secrets are set. Both username, password and a PAT - nothing fixes it

Run docker/login-action@v1
  with:
    logout: true
Error: Username and password required

Configuration

name: Publish Docker image
on:
  push:
    tags:
      - v*

jobs:
  push_to_registry:
    name: Push Docker image to Docker Hub
    runs-on: ubuntu-latest
    steps:
      - name: Check out the repo
        uses: actions/checkout@v2

      - name: Login to DockerHub
        uses: docker/login-action@v1 
        with:
          username: ${{ secrets.DOCKER_USERNAME }}
          password: ${{ secrets.DOCKER_TOKEN }}
          logout: true

      - name: Push to Docker Hub
        uses: docker/build-push-action@v2
        with:
          push: true
          tags: <removed>:latest

      - name: Image digest
        run: echo ${{ steps.docker_build.outputs.digest }}
@crazy-max
Copy link
Member

crazy-max commented Nov 12, 2020

@slimcdk Do you have a link to your repo or logs of your build?

@slimcdk
Copy link
Author

slimcdk commented Nov 12, 2020

Yea, I'll let it be public for the regards of this issue. It is here https://github.com/MSDO-ImageHost/Posts

@slimcdk
Copy link
Author

slimcdk commented Nov 12, 2020

I had commented out the username and password as I was trying something else. When I reverted to username and password again, it worked...

@crazy-max
Copy link
Member

@slimcdk Ok, get back to me if you reproduce the issue.

@kushthedude
Copy link

kushthedude commented Nov 20, 2020

@kushthedude
Copy link

This is making it very difficult to debug as logs are quite ambiguous given I have already set-up repo secrets

@crazy-max
Copy link
Member

@kushthedude Secrets are not passed to the runner when a workflow is triggered from a forked repository.

@kushthedude
Copy link

Makes sense, got it

@tobiolusa
Copy link

Still having similar issue.
Error: Username and password required

@elvisAR-git
Copy link

Yeah, me too. Any Fix, please :)

@harshraj22
Copy link

Same issue.

@lhcunha
Copy link

lhcunha commented Mar 10, 2023

Have you tried to use the docker/[email protected] instead of docker/login-action@v1 ?
Also, I'd try to run it without logout: true .

@mdeous
Copy link

mdeous commented Sep 23, 2023

I'm facing the same issue (docker/[email protected]). I have a workflow with a matrix to push both to ghcr.io and docker.io, and while the job for ghcr.io has the password properly passed to it, the output for the job for docker.io looks like no password was passed at all and fails with a Username and password required error. The definition of my GH workflow can be found here.

The error seems to happen / stop happening more or less randomly, and in my case only with docker.io. I had the issue in the past, disabled my job for docker.io, then I re-enabled it some time later and it worked again, and now after upgrading the action to its latest version the issue is back.

@leocavalcante
Copy link

Facing the same issue at opencodeco/phpctl#36

@docker docker locked as resolved and limited conversation to collaborators Mar 13, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

9 participants