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

observe failed #246

Closed
chris-tian89 opened this issue Aug 1, 2023 · 1 comment
Closed

observe failed #246

chris-tian89 opened this issue Aug 1, 2023 · 1 comment
Labels
bug Something isn't working needs:triage

Comments

@chris-tian89
Copy link

chris-tian89 commented Aug 1, 2023

What happened?

I tried to use the upjet-provider-template for implementing an artifactory-provider with the terraform-artifactory-provider. While creation of repositories is working pretty well, the creation of an artifactory-user fails within this Method:
Refresh-Method

  • Observe()
    • Refresh()
      • runTF( ... "apply", "-refresh-only", "-auto-approve", "-input=false", "-lock=false", "-json") << this method is throwing the error in the end since the log-entry starting with "refresh ended" contains the following error:
{
    "@level": "error",
    "@message": "Error: Unable to Refresh Resource",
    "@module": "terraform.ui",
    "@timestamp": "2023-07-28T11:23:08.130707Z",
    "diagnostic": {
        "address": "artifactory_user.crossplane-user",
        "detail": "An unexpected error occurred while attempting to refresh resource state. Please retry the operation or report this issue to the provider developers.HTTP Error: 404 GET REDACTED/api/security/users/crossplane-user{"errors": [ {    "status" : 404,    "message" : "Not Found"  } ]}",
        "range": {
            "end": {
                "byte": 399,
                "column": 400,
                "line": 1
            },
            "filename": "main.tf.json",
            "start": {
                "byte": 398,
                "column": 399,
                "line": 1
            }
        },
        "severity": "error",
        "snippet": {
            "code": {
                "provider": {
                    "artifactory": {
                        "access_token": "REDACTED",
                        "url": "REDACTED"
                    }
                },
                "resource": {
                    "artifactory_user": {
                        "crossplane-user": {
                            "admin": false,
                            "disable_ui_access": false,
                            "email": "[email protected]",
                            "internal_password_disabled": true,
                            "lifecycle": {
                                "prevent_destroy": true
                            },
                            "name": "crossplane-user"
                        }
                    }
                },
                "terraform": {
                    "required_providers": {
                        "artifactory": {
                            "source": "jfrog/artifactory",
                            "version": "8.3.0"
                        }
                    }
                }
            },
            "context": "resource.artifactory_user.crossplane-user",
            "highlight_end_offset": 399,
            "highlight_start_offset": 398,
            "start_line": 1,
            "values": []
        },
        "summary": "Unable to Refresh Resource"
    },
    "type": "diagnostic"
}

("\n" and "\" from log removed)

How can we reproduce it?

terraform-version 2.5.1
terraform-artifactory-provider: 8.3.0

  • create crossplane-provider based on the template and terraform-provider mentioned above
  • ExternalNameConfigs configured with "artifactory_user": config.NameAsIdentifier,
  • apply a custom-resource for a artifactory-user

Additional:

  • Also the hint for lateInitialisation seems not to match, since this error occurs before the check of the async-mode...
  • If I go into the provider-shell, remove the terraform.tf-statefile and run the terraform-command directly withe args metioned above, the refresh works... >> That means, out of any reason the controller tries to get the resource from the external system befor it gets created, which doesn't make sense of course. I was still not able to determine why it behaves like that...
@chris-tian89 chris-tian89 added bug Something isn't working needs:triage labels Aug 1, 2023
@chris-tian89
Copy link
Author

After some further research it pointed out, that the error is located at the terraform-provider. Closing the issue.

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

No branches or pull requests

1 participant