2
votes

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

1
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
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
Hi @EyalBenMoshe the added flag fix the issue , Thanks !! BTW it will be great to have the documentation available per version - jfrog.com/confluence/display/CLI/CLI+for+JFrog+Artifactory - Mor Lajb
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 github.com/jfrog/jfrog-cli/issues - Eyal Ben Moshe
Thanks @EyalBenMoshe didn’t had the time to create the logs for you , happy you find the root cause of this issue - Mor Lajb

1 Answers

2
votes

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