Skip to content

Getting --url option is mandatory error for ping and upload commands #94

@mackaybeth

Description

@mackaybeth

Describe the bug

I'm trying to upload in a GitHub Action with jfrog rt upload --spec build/upload_spec.json, and I get the --url option is mandatory error. I tried configuring the JFrog CLI with environment variables (JF_URL and JF_TOKEN), and also with the Config Token exported from my local setup (where the command works).

I tried even just running jfrog rt ping, and that also gives the same error.

If I add --url on on the command line, the ping command works, but the upload does not (get 401 Unauthorized).

Current behavior

This is the output from the jfrog/setup-jfrog-cli@v3 step

Run jfrog/setup-jfrog-cli@v3
  with:
    version: [2](https://github.com/REDACTED/actions/runs/4582980103/jobs/8093546472#step:12:2).[3](https://github.com/REDACTED/actions/runs/4582980103/jobs/8093546472#step:12:3)5.0
  env:
    BRANCH_NAME: 2/merge
    CI: true
    CHANGE_ID: 2
    BUILD_NUMBER: 18
    CHANGE_TARGET: master
    GITHUB_TOKEN: ***
    JFROG_CLI_LOG_LEVEL: DEBUG
    AWS_DEFAULT_REGION: us-east-2
    AWS_REGION: us-east-2
    AWS_ACCESS_KEY_ID: ***
    AWS_SECRET_ACCESS_KEY: ***
    AWS_SESSION_TOKEN: ***
    pythonLocation: /opt/actions-runner/_work/_tool/Python/3.7.16/x6[4](https://github.com/REDACTED/actions/runs/4582980103/jobs/8093546472#step:12:4)
    PKG_CONFIG_PATH: /opt/actions-runner/_work/_tool/Python/3.7.16/x64/lib/pkgconfig
    Python_ROOT_DIR: /opt/actions-runner/_work/_tool/Python/3.7.16/x64
    Python2_ROOT_DIR: /opt/actions-runner/_work/_tool/Python/3.7.16/x64
    Python3_ROOT_DIR: /opt/actions-runner/_work/_tool/Python/3.7.16/x64
    LD_LIBRARY_PATH: /opt/actions-runner/_work/_tool/Python/3.7.16/x64/lib
    JF_ENV_1: 
Setup JFrog CLI
  Downloading JFrog CLI from https://releases.jfrog.io/artifactory/jfrog-cli/v2/2.3[5](https://github.com/REDACTED/actions/runs/4582980103/jobs/8093546472#step:12:5).0/jfrog-cli-linux-amd[6](https://github.com/REDACTED/actions/runs/4582980103/jobs/8093546472#step:12:6)4/jfrog

This is the out put from my next step, which runs the JFrog CLI command

Run jfrog rt upload --spec build/upload_spec.json
11:56:56 [Debug] JFrog CLI version: 2.35.0
11:56:56 [Debug] OS/Arch: linux/amd64
11:56:56 [Debug] Locking config file to run config Clear command.
11:56:56 [Debug] Creating lock in: /home/ubuntu/.jfrog/locks/config
11:56:56 [Debug] Releasing lock: /home/ubuntu/.jfrog/locks/config/jfrog-cli.conf.lck.5874.1680350216994187067
11:56:56 [Debug] Config Clear command completed successfully. config file is released.
Error: 6 [Error] the --url option is mandatory
Error: Process completed with exit code 1.

When I run the jfrog rt ping command locally with the JFROG_CLI_LOG_LEVEL="DEBUG" flag set, I see successful HTTP GET commands and 200 responses.

Reproduction steps

I have this in my action:

      - name: Setup Jfrog CLI
        uses: jfrog/setup-jfrog-cli@v3
        env:
          JF_ENV_1: ${{ secrets.JF_SECRET_ENV_1 }}
#          JF_URL: ${{ secrets.ARTIFACTORY_URL }}
#          JF_ACCESS_TOKEN: ${{ secrets.ARTIFACTORY_TOKEN }}
      - name: Upload to Artifactory
        shell: bash
        run: jfrog rt upload --spec build/upload_spec.json

When I run the action, the Upload to Artifactory step fails with the error the --url option is mandatory. If I add the URL, I get 401 Unauthorized errors (which is the same thing that happens when I run the jfrog rt upload command locally with that flag). The same thing happens if I run with the Config Token (as shown above in the snip), or with the commented out JF_URL and JF_ACCESS_TOKEN env vars instead. I do not try to run with all 3 env vars set.

I created the admin-level access token in the Artifactory UI. We run a self-hosted installation of Artifactory, and do not use JFrog Platform.

Expected behavior

I expect to see something like this

{
  "status": "success",
  "totals": {
    "success": 1,
    "failure": 0
  }

And find my artifact in Artifactory.

Setup JFrog CLI version

@V3 (as of today, this is 3.2.0)

JFrog CLI version

I'm using the default, which is 2.35.0 as of today.

Workflow operating system type and version

linux/amd64 self-hosted runner, ubuntu-jammy-22.04

JFrog Artifactory version (if relevant)

self-hosted, 7.41.7

JFrog Xray version (if relevant)

N/A

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions