2

after upgrade to version jfrog version 1.38.0 we got the following error when trying to upload a tgz file to artifactory :

09:48:31  > Task :addRepo
09:48:31  >>> Adding repo to push charts
09:48:32  
09:48:32  > Task :publish FAILED
09:48:32  >>> Pushing charts to repo
09:48:32  >>> Pushing 'tag-service-1.11.4.tgz'
09:48:32  [Error] Artifactory response: 400 Bad Request
09:48:32  {
09:48:32    "error": "invalid_request",
09:48:32    "error_description": "User token:**** can only create user token(s) for themselves (requested: ****)"
09:48:32  }

with version 1.26.2 it works with no errors.

here is our relevant code

project.exec {
    commandLine 'jfrog', 'rt', 'config', "--url=${artifactory_url}",
            "--user=${artifactory_user}", "--password=${artifactory_password}",
            '--enc-password=false', 'artifactory'
}

    project.exec {
        workingDir project.projectDir.path
        commandLine 'jfrog', 'rt', 'u', chart.name, "${helm_chart_repo}"
    }

any idea ?

Thanks to @EyalBenMoshe , I added the flag --basic-auth-only that solve the problem

Mor Lajb
  • 2,546
  • 1
  • 15
  • 28
  • What is your Artifactory version? Is the error consistent? Does adding the --basic-auth-only flag to the config command resolve the issue? – Eyal Ben Moshe Jul 14 '20 at 14:23
  • HI Eyal and Thanks for your answer , our artifactory version is 6.17.0 , the error is consistent. will check the --basic-auth-only falg and update – Mor Lajb Jul 14 '20 at 14:52
  • Hi @EyalBenMoshe the added flag fix the issue , Thanks !! BTW it will be great to have the documentation available per version - https://www.jfrog.com/confluence/display/CLI/CLI+for+JFrog+Artifactory – Mor Lajb Jul 15 '20 at 08:11
  • The error you got is not something we expected anyone would receive. Since we haven't been able to reproduce this issue, will you be able to help us understand why this happens? Can you please share with us: 1. Log (console) output with the JFROG_CLI_LOG_LEVEL=DEBUG environment variable set. 2. Which permissions does this user have? Can you try creating another user, see if this one gets the issue as well, and share with us how to reproduce the issue? If is more convenient, you can also put all of this info in a GitHub issue in https://github.com/jfrog/jfrog-cli/issues – Eyal Ben Moshe Jul 15 '20 at 11:37
  • Thanks to https://github.com/jfrog/jfrog-cli/issues/780 we now know the root cause of this issue. This PR - https://github.com/jfrog/jfrog-cli/pull/781 fixes the issue. We plan to release a patch with the fix soon. – Eyal Ben Moshe Jul 18 '20 at 19:09
  • 1
    Thanks @EyalBenMoshe didn’t had the time to create the logs for you , happy you find the root cause of this issue – Mor Lajb Jul 18 '20 at 19:16

1 Answers1

2

Version 1.38.1 of JFrog CLI includes a fix for this issue.

Eyal Ben Moshe
  • 2,400
  • 12
  • 15