[JIRA] (JENKINS-52761) withDockerRegistry fails to login with complex password

9 views
Skip to first unread message

gtirloni@ret.cx (JIRA)

unread,
Jul 26, 2018, 5:42:02 PM7/26/18
to jenkinsc...@googlegroups.com
Giovanni Tirloni created an issue
 
Jenkins / Bug JENKINS-52761
withDockerRegistry fails to login with complex password
Issue Type: Bug Bug
Assignee: Unassigned
Components: docker-workflow-plugin
Created: 2018-07-26 21:41
Environment: Jenkins 2.134
Docker Pipeline 1.17
Priority: Minor Minor
Reporter: Giovanni Tirloni

Jenkinsfile:

    stage('Deliver') {
      steps {
        withDockerRegistry([credentialsId: 'docker-creds', url: '']) {
          sh "docker push imagename"
        }
      }
    }

Error:

$ docker login -u username -p ******** https://index.docker.io/v1/
WARNING! Using --password via the CLI is insecure. Use --password-stdin.
Error response from daemon: Get https://registry-1.docker.io/v2/: unauthorized: incorrect username or password

Workaround:

Change Docker Hub password from something complex (e.g. "]GT~XMRZwWc6]dUg:NMs") to something very simple (e.g. "insecurepass"). Using a simple password that is very long (e.g. "verylongpasswordhere") works fine too.

`docker login` using complex password from the CLI works just fine.

Add Comment Add Comment
 
This message was sent by Atlassian JIRA (v7.10.1#710002-sha1:6efc396)

johan@zoom.nu (JIRA)

unread,
Jan 29, 2020, 6:41:02 AM1/29/20
to jenkinsc...@googlegroups.com
Johan Maasing commented on Bug JENKINS-52761
 
Re: withDockerRegistry fails to login with complex password

Just ran into the same issue (Jenkins ver. 2.204.1)

It looks like the plugin does not quote the arguments. In my case the password is actually a JSON file from google.

So from a bash shell this does not work, it gives the same error message as I see in the jenkins logs from withDockerRegistry

 

docker login -u _json_key -p $(cat jsonkey.json) https://eu.gcr.io/...

 

 

However this works in the bash shell:

docker login -u _json_key -p "$(cat jsonkey.json) https://eu.gcr.io/...

Note the usage of quotes ".

I guess the plugin has similar problems when passing the arguments to the command line.

 

This message was sent by Atlassian Jira (v7.13.6#713006-sha1:cc4451f)
Atlassian logo

johan@zoom.nu (JIRA)

unread,
Jan 29, 2020, 6:42:02 AM1/29/20
to jenkinsc...@googlegroups.com
Johan Maasing edited a comment on Bug JENKINS-52761
Just ran into the same issue (Jenkins ver. 2.204.1)

It looks like the plugin does not quote the arguments. In my case the password is actually a JSON file from google.

So from a bash shell this does *not* work, it gives the same error message as I see in the jenkins logs from withDockerRegistry

 
{noformat}
docker login -u _json_key -p $(cat jsonkey.json) https://eu.gcr.io/...{noformat}
 

 

However this *works* in the bash shell:
{noformat}
docker login -u _json_key -p "$(cat jsonkey.json)
" https://eu.gcr.io/...{noformat}

Note the usage of quotes ".

I guess the plugin has similar problems when passing the arguments to the command line.

 

jbiel@bushelpowered.com (JIRA)

unread,
Mar 12, 2020, 4:21:04 PM3/12/20
to jenkinsc...@googlegroups.com

In case anyone runs across this, I've opened a [PR|https://github.com/jenkinsci/docker-commons-plugin/pull/86] to solve this issue. The artifact from that PR build can be manually installed in Jenkins until it's merged or fixed in some other way.

This message was sent by Atlassian Jira (v7.13.12#713012-sha1:6e07c38)
Atlassian logo

jbiel@bushelpowered.com (JIRA)

unread,
Mar 12, 2020, 4:21:04 PM3/12/20
to jenkinsc...@googlegroups.com
Jared Biel edited a comment on Bug JENKINS-52761
In case anyone runs across this, I've opened a [PR|[https://github.com/jenkinsci/docker-commons-plugin/pull/86]] to solve this issue. [The artifact|https://ci.jenkins.io/job/Plugins/job/docker-commons-plugin/job/PR-86/1/artifact/org/jenkins-ci/plugins/docker-commons/1.17-rc347.f3e1aa3e5799/docker-commons-1.17-rc347.f3e1aa3e5799.hpi] from that PR build can be manually installed in Jenkins until it's merged or fixed in some other way.

jbiel@bushelpowered.com (JIRA)

unread,
Mar 12, 2020, 4:22:03 PM3/12/20
to jenkinsc...@googlegroups.com
Jared Biel edited a comment on Bug JENKINS-52761
In case anyone runs across this, I've opened a [ PR |[ ( https://github.com/jenkinsci/docker-commons-plugin/pull/86 ]] ) to solve this issue. [ The artifact | from that PR build can be manually installed in Jenkins until it's merged or fixed in some other way ( https://ci.jenkins.io/job/Plugins/job/docker-commons-plugin/job/PR-86/1/artifact/org/jenkins-ci/plugins/docker-commons/1.17-rc347.f3e1aa3e5799/docker-commons-1.17-rc347.f3e1aa3e5799.hpi ] from that PR build can be manually installed in Jenkins until it's merged or fixed in some other way ) .
Reply all
Reply to author
Forward
0 new messages