Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

jf rt u source to destination says success but doesn't upload the artifact to the repository #104

Open
igorcosta opened this issue Jul 7, 2023 · 3 comments
Labels
bug Something isn't working

Comments

@igorcosta
Copy link

igorcosta commented Jul 7, 2023

Describe the bug

Working a demo with a simple goal of uploading a terraform module to Artifactory, the workflow file works fine and everything execute according to plan, but when checking the files at Artifactory it's not uploading, it says upload but doesn't count the success as 1.

Steps to reproduce:

GitHub Workflow file.

name: "github-repo-creation-workflow"

on:
  workflow_dispatch:
  push:
    branches:
      - main
jobs:
  Plan:
    name: Plan
    runs-on: ubuntu-latest
    steps:
      - name: Checkout out code
        uses: actions/checkout@v3
      - name: Set up terraform
        uses: hashicorp/setup-terraform@v2
      - name: Terraform fmt
        run: terraform fmt -recursive
      - name: terraform init
        run: terraform init
      - name: terraform plan
        run: terraform plan
      - name: save plan
        run: | 
          mkdir artifacts
          terraform plan -out=artifacts/file_provision.zip
      - name: upload artifact
        uses: actions/upload-artifact@v3
        with:
          name: terraform-plan
          path: artifacts/file_provision.zip
  Internal:
    name: Test JFrog Artifactory
    needs: Plan
    runs-on: [ubuntu-latest]
    steps:
      - name: download artifact
        uses: actions/download-artifact@v3
        with:
          name: terraform-plan
          path: artifacts/file_provision.zip
        
      - name: Display structure of downloaded files
        run: ls -R
        working-directory: artifacts
      - name: Setup JFrog
        uses: jfrog/setup-jfrog-cli@v3
        env:
          JF_URL: ${{ vars.JFROG_URL }}
          JF_ACCESS_TOKEN: ${{ secrets.JFROG_TF }}
      - name: ping artifactory
        run: |
          jf rt ping --insecure-tls
      - name: upload artifacts 
        run: jf rt u artifacts/file_provision.zip target-repo

Current behavior

Execute successfully but it doesn't upload the file.

Run jfrog/setup-jfrog-cli@v3
Setup JFrog CLI
1s
Run jf rt ping --insecure-tls
OK
[1](https://github.com/customer-demo/jfrog-demo/actions/runs/5485004767/jobs/9993263291#step:5:1)s
Run jf rt u artifacts/file_provision.zip generic-local
{
  "status": "success",
  "totals": {
    "success": 0,
    "failure": 0
  }
}

Reproduction steps

No response

Expected behavior

To upload the file.

Setup JFrog CLI version

latest version

JFrog CLI version

lastest version

Workflow operating system type and version

ubuntu

JFrog Artifactory version (if relevant)

No response

JFrog Xray version (if relevant)

No response

@igorcosta igorcosta added the bug Something isn't working label Jul 7, 2023
@sverdlov93
Copy link
Contributor

Hi @igorcosta,
Can you please try again with JFROG_CLI_LOG_LEVEL=DEBUG environment variable and provide the full logs you receive?

@filipajdacic
Copy link

filipajdacic commented May 3, 2024

Any clue for this?

I am getting the same behavior.

jfrog rt u "lol.txt" "studio-generic/"
[Debug] Usage Report: Sending info...
 Log path: /home/ubuntu/.jfrog/logs/jfrog-cli.2024-05-03.14-10-02.10757.log
{
  "status": "success",
  "totals": {
    "success": 1,
    "failure": 0
  }
}

DEBUG log:

[Debug] Sending HTTP GET request to: https://xxx.jfrog.io/artifactory/api/system/version
[Info] [Thread 2] Uploading artifact: lol.txt
[Debug] The Artifactory version is: 7.84.6
[Debug] Sending HTTP POST request to: https://xxx.jfrog.io/artifactory/api/system/usage
[Debug] Usage Report: Artifactory response: 200 OK
[Debug] Usage Report: Usage info sent successfully.
[Debug] [Thread 2]  Artifactory response: 201 Created
[Debug] Uploaded 1 artifacts.

@sverdlov93
Copy link
Contributor

Hi @filipajdacic, On your example it looks like it successfully uploaded a file.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants