terraform-provider-artifactory: artifactory_file checksum issue

Describe the bug I’m trying to create a POC of the Artifactory provider to then use to refactor our internal lambda module.

terraform {
  required_providers {
    artifactory = {
      source  = "registry.terraform.io/jfrog/artifactory"
      version = "6.6.0"
    }
  }
}

provider "artifactory" {
  url           = "http://host.blah.blah"
  api_key       = "[redacted]"
}

data "artifactory_file" "my-file" {
  repository  = "cloud"
  path        = "log-renderer-17.zip"
  output_path = "log-renderer-17.zip"
}

output "name" {
  value = data.artifactory_file.my-file
}

I can curl the zip file locally no problem (at http://host.blah.blah/artifactory/cloud/log-renderer-17.zip, along with the API endpoint I see in the code here

When I run a plan on the above TF, I get the following:

Refreshing Terraform state in-memory prior to plan...
The refreshed state will be used to calculate this plan, but will not be
persisted to local or remote state storage.

data.artifactory_file.my-file: Refreshing state...

Error: log-renderer-17.zip checksum and  checksum do not match, expectd 

  on main.tf line 34, in data "artifactory_file" "my-file":
  34: data "artifactory_file" "my-file" {

This makes it seem like the fileInfo struct does not get filled in. It does download a file into the output_path that seems to be a html page.

Artifactory version: EnterpriseX license 7.33.9 rev Terraform version: 0.13.7 Terraform provider: 6.6.0 (but also tried 6.5.2 and 6.5.3)

Requirements for and issue

  • A description of the bug
  • A fully functioning terraform snippet that can be copy&pasted (no outside files or ENV vars unless that’s part of the issue).
  • Your version of artifactory (you can curl it at $host/artifactory/api/system/version
  • Your version of terraform
  • Your version of terraform provider

Expected behavior File is downloaded from Artifactory, output is populated with correct values and then can be used in lambda module.

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Comments: 22 (7 by maintainers)

Commits related to this issue

Most upvoted comments

@sixxta Our email system blocked the email due to the content. Would it be possible for you to share the logs in a private Gist?

@sixxta We’ve included additional debug logging in released v6.8.1.

Can you test again and capture the logs for us?

Steps:

  • Delete the file to be downloaded in the target location if exist (provider won’t download it if already exists)
  • Execute the terraform apply but now prefix with TF_LOG=DEBUG, e.g. TF_LOG=DEBUG terraform apply.
  • You’ll see lots of output in your shell. Copy them and share with us via public gist. Or if you feel more comfortable, email us at partner-support@jfrog.com