It seems like for some reason the automatic detection of the local plugin isn’t working for you. I’m not sure why that is from what we’ve discussed so far though, so I think it’ll take some further debugging to understand what’s going on.
One way I can think of to hopefully learn some more about what’s happening on your system is to temporarily set an explicit provider installation configuration that matches the situation that Terraform ought to be detecting automatically, and then we can hopefully learn from how that behaves why the automatic mode isn’t working on your system.
Since you seem to be running Terraform as the user
root, the CLI configuration file for that user would be
/root/.terraformrc. Please create that file and put the following configuration into it, which is intended to match the intended automatic configuration for your situation:
path = "/root/.terraform.d/plugins"
include = ["nexus.xyz.com/artifacts/*"]
exclude = ["nexus.xyz.com/artifacts/*"]
The meaning of the above is that Terraform should look in the local directory for any provider that belongs to the namespace
nexus.xyz.com/artifacts/ but should use upstream registries for any other.
If you run
terraform init again with that configuration in place, I expect you will see a different result. That result might be that it now works, because we’ve bypassed the automatic detection behavior and just told Terraform where to look. Alternatively, the result might be that it now fails with a different error message.
Either way, it would be helpful if you could share the trace log output again with this in place. Now that we’re using explicit configuration the relevant part of the log will be later, so I’d ask if you could share the whole trace log so I can see how Terraform is reacting to the explicit configuration.
(Once you’ve tried this you can remove that
.terraformrc file to recover the previous behavior. I’m not intending this as a solution to the problem, just as a way to help debug what’s happening.)