You need to enable JavaScript to run this app.
最新活动
大模型
产品
解决方案
定价
生态与合作
支持与服务
开发者
了解我们

运行jfrog rt config时出现参数数量错误问题排查

Fixing the "Wrong number of arguments" Error with JFrog CLI rt config

The error you're hitting comes down to a breaking change in JFrog CLI's syntax for the rt config command that happened after 2018. Back then, you could configure a default Artifactory connection without specifying a server ID, but modern versions of the CLI require you to explicitly define a server ID (either as a positional argument or via an option).

What Changed?

In 2018, the rt config command allowed you to set up a default connection using just --url and --interactive false. Newer versions enforce that you associate the configuration with a named server ID—this helps manage multiple Artifactory instances, but breaks older command syntax.

Updated Commands to Fix the Issue

You have two straightforward fixes:

Add a custom server ID (e.g., my-org-artifactory) at the start of the rt config command, plus --default to mark it as your primary connection:

RUN curl -fL https://getcli.jfrog.io | sh && mv jfrog /usr/local/bin/jfrog && jfrog rt config my-org-artifactory --interactive false --url https://artifactory.myorg.com/artifactory --default

Option 2: Use the --server-id Flag

If you prefer to keep the server ID as an option instead of a positional argument, use this variant:

RUN curl -fL https://getcli.jfrog.io | sh && mv jfrog /usr/local/bin/jfrog && jfrog rt config --interactive false --server-id my-org-artifactory --url https://artifactory.myorg.com/artifactory --default

Verify Locally First

Before updating your CI pipeline, test the command locally to confirm it works:

  1. Run the corrected jfrog rt config command
  2. Validate the connection with:
    jfrog rt ping
    

You should get a successful response from your Artifactory instance.


内容的提问来源于stack exchange,提问作者jamiet

火山引擎 最新活动