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

404-NotAuthorizedOrNotFound #4

Closed
anikolop opened this issue May 16, 2022 · 9 comments
Closed

404-NotAuthorizedOrNotFound #4

anikolop opened this issue May 16, 2022 · 9 comments
Assignees
Labels
bug Something isn't working help wanted Extra attention is needed question Further information is requested

Comments

@anikolop
Copy link

Hi @garutilorenzo.

Thanks for your work on this repo.

  1. I am trying to deploy the cluster but I get the following message, 2 times for the 2 backends,
>  Error: 404-NotAuthorizedOrNotFound, Unknown resource Entity of type Backend with key ocid1.instance.oc1.eu-frankfurt-1.xxxxxxnl6dbt2q2ffa.6443 not found
Suggestion: Either the resource has been deleted or service Network Load Balancer Backend need policy to access this resource. Policy reference: https://docs.oracle.com/en-us/iaas/Content/Identity/Reference/policyreference.htm
Provider version: 4.75.0, released on 2022-05-11.
│ Service: Network Load Balancer Backend
│ Operation Name: GetBackend
 with module.k3s_cluster.oci_network_load_balancer_backend.k3s_kube_api_backend[1],
│   on ../k3slb.tf line 36, in resource "oci_network_load_balancer_backend" "k3s_kube_api_backend":
│   36: resource "oci_network_load_balancer_backend" "k3s_kube_api_backend" {

Strangely enough I can see in the web console that the network load balancer is created and has 1 listener and 2 backends.

  1. Don't know if it's relevant but when I run terraform init the first time I got this message
>Initializing the backend...

Initializing provider plugins...
- Reusing previous version of hashicorp/template from the dependency lock file
- Reusing previous version of oracle/oci from the dependency lock file
- Reusing previous version of hashicorp/oci from the dependency lock file
- Using previously-installed hashicorp/template v2.2.0
- Using previously-installed oracle/oci v4.74.0
- Using previously-installed hashicorp/oci v4.75.0

╷
│ Warning: Additional provider information from registry
│
│ The remote registry returned warnings for registry.terraform.io/hashicorp/oci:
│ - For users on Terraform 0.13 or greater, this provider has moved to oracle/oci. Please update your source in
│ required_providers.
╵

Terraform has been successfully initialized!

You may now begin working with Terraform. Try running "terraform plan" to see
any changes that are required for your infrastructure. All Terraform commands
should now work.

If you ever set or change modules or backend configuration for Terraform,
rerun this command to reinitialize your working directory. If you forget, other
commands will detect it and remind you to do so if necessary.

[Terraform on WSL2 Ubuntu 20.04]
Terraform v1.1.9
on linux_amd64

  • provider registry.terraform.io/hashicorp/oci v4.75.0
  • provider registry.terraform.io/hashicorp/template v2.2.0

Thanks in advance for any pointers that you may have.

@garutilorenzo garutilorenzo self-assigned this May 17, 2022
@garutilorenzo garutilorenzo added bug Something isn't working help wanted Extra attention is needed question Further information is requested labels May 17, 2022
@garutilorenzo
Copy link
Owner

Hi @anikolop,

i also see the same message:

Warning: Additional provider information from registry

│ The remote registry returned warnings for registry.terraform.io/hashicorp/oci:
│ - For users on Terraform 0.13 or greater, this provider has moved to oracle/oci. Please update your source in
│ required_providers.

Maybe the problem is here:

  • Using previously-installed oracle/oci v4.74.0
  • Using previously-installed hashicorp/oci v4.75.0

Why there are two plugins?
In my workspace i see only the hashicorp/oci plugin, maybe this might be the problem.

Or maybe is the terraform version you are using (i'm using v1.1.6), I will try to update both terraform and the oci plugin and I try to reproduce this error.

Can you try to clone the repo in a new directory and try to init terraform from scratch to see what happens? Remember to copy the state file (terraform.tfstate) and the customized main.tf file in the new directory.

@anikolop
Copy link
Author

Hi @garutilorenzo ,
I destroyed the last deployment and started again, with 1.1.9 and fresh download from git, and got the same errors.
I then downgraded to v1.1.6 and tried again fresh and got again the same errors.

Maybe it has something to todo with my account / region?

[terraform version]

Terraform v1.1.6
on linux_amd64
+ provider registry.terraform.io/hashicorp/oci v4.64.0
+ provider registry.terraform.io/hashicorp/template v2.2.0

Your version of Terraform is out of date! The latest version
is 1.1.9. You can update by downloading from https://www.terraform.io/downloads.html

[terraform init]

Initializing modules...
- k3s_cluster in ..

Initializing the backend...

Initializing provider plugins...
- Reusing previous version of hashicorp/oci from the dependency lock file
- Reusing previous version of hashicorp/template from the dependency lock file
- Installing hashicorp/oci v4.64.0...
- Installed hashicorp/oci v4.64.0 (signed by HashiCorp)
- Installing hashicorp/template v2.2.0...
- Installed hashicorp/template v2.2.0 (signed by HashiCorp)

╷
│ Warning: Additional provider information from registry
│
│ The remote registry returned warnings for registry.terraform.io/hashicorp/oci:
│ - For users on Terraform 0.13 or greater, this provider has moved to oracle/oci. Please update your source in
│ required_providers.
╵

Terraform has been successfully initialized!

You may now begin working with Terraform. Try running "terraform plan" to see
any changes that are required for your infrastructure. All Terraform commands
should now work.

If you ever set or change modules or backend configuration for Terraform,
rerun this command to reinitialize your working directory. If you forget, other
commands will detect it and remind you to do so if necessary.

[terraform apply]



module.k3s_cluster.oci_core_vcn.default_oci_core_vcn: Creating...
module.k3s_cluster.oci_identity_dynamic_group.compute_dynamic_group: Creating...
module.k3s_cluster.oci_core_vcn.default_oci_core_vcn: Creation complete after 2s [id=ocid1.vcn.oc1.eu-frankfurt-1.amaaaaaavcg3q3qa43koaluiqtmztooft74cud327egexvxoo6fomtl47g2a]
module.k3s_cluster.oci_core_internet_gateway.default_oci_core_internet_gateway: Creating...
module.k3s_cluster.oci_core_network_security_group.public_lb_nsg: Creating...
module.k3s_cluster.oci_core_default_security_list.default_security_list: Creating...
module.k3s_cluster.oci_core_internet_gateway.default_oci_core_internet_gateway: Creation complete after 1s [id=ocid1.internetgateway.oc1.eu-frankfurt-1.aaaaaaaajtgnixyddj3frdfkg3stxdilbkyt43bttpo2kjs2tgsg34fj3eba]
module.k3s_cluster.oci_core_default_route_table.default_oci_core_default_route_table: Creating...
module.k3s_cluster.oci_core_network_security_group.public_lb_nsg: Creation complete after 1s [id=ocid1.networksecuritygroup.oc1.eu-frankfurt-1.aaaaaaaa3ivx2k3rwwopu2gncqi535ipgjgevqi3jbunusbg5ww4tnonzrja]
module.k3s_cluster.oci_core_network_security_group_security_rule.allow_https_from_all: Creating...
module.k3s_cluster.oci_core_network_security_group_security_rule.allow_http_from_all: Creating...
module.k3s_cluster.oci_core_default_security_list.default_security_list: Creation complete after 1s [id=ocid1.securitylist.oc1.eu-frankfurt-1.aaaaaaaae3rw7er5dci36qba7olxrszqktzw2gv5knriwd65ji7bymcnvk6q]
module.k3s_cluster.oci_core_subnet.default_oci_core_subnet10: Creating...
module.k3s_cluster.oci_core_subnet.oci_core_subnet11: Creating...
module.k3s_cluster.oci_core_network_security_group_security_rule.allow_https_from_all: Creation complete after 0s [id=B41947]
module.k3s_cluster.oci_core_network_security_group_security_rule.allow_http_from_all: Creation complete after 0s [id=18D85A]
module.k3s_cluster.oci_core_default_route_table.default_oci_core_default_route_table: Creation complete after 0s [id=ocid1.routetable.oc1.eu-frankfurt-1.aaaaaaaarnxfqazpesgrqrghyfzzwf2ahvskku4dcicvw24odhymibur53bq]
module.k3s_cluster.oci_identity_dynamic_group.compute_dynamic_group: Creation complete after 5s [id=ocid1.dynamicgroup.oc1..aaaaaaaadycwtyboujrgtclgokqfqwtjeedhhthgqgctppnonyjo7ia6cmaq]
module.k3s_cluster.oci_identity_policy.compute_dynamic_group_policy: Creating...
module.k3s_cluster.oci_identity_policy.compute_dynamic_group_policy: Creation complete after 0s [id=ocid1.policy.oc1..aaaaaaaaazmbioqcgcrnws6r5n2ynczaq4qgkveq4xn65eayxkfwpved6qnq]
module.k3s_cluster.oci_core_subnet.default_oci_core_subnet10: Creation complete after 2s [id=ocid1.subnet.oc1.eu-frankfurt-1.aaaaaaaahvqqfnk4ckohpe6pl6l5egmonrrqqb3avttyekbfxiqujqv2agpq]
module.k3s_cluster.oci_core_instance_configuration.k3s_server_template: Creating...
module.k3s_cluster.oci_core_instance_configuration.k3s_worker_template: Creating...
module.k3s_cluster.oci_core_instance_configuration.k3s_worker_template: Creation complete after 1s [id=ocid1.instanceconfiguration.oc1.eu-frankfurt-1.aaaaaaaa2fio7vqzxwut5k34i67wco73nlx2frrd726bfu5jbtvm7nwwueqq]
module.k3s_cluster.oci_core_instance_configuration.k3s_server_template: Creation complete after 2s [id=ocid1.instanceconfiguration.oc1.eu-frankfurt-1.aaaaaaaawpeqeh7yhl42atdeixwvhphmkua7whwxbtq6uamnmhk6vldmksqq]
module.k3s_cluster.oci_core_instance_pool.k3s_servers: Creating...
module.k3s_cluster.oci_core_subnet.oci_core_subnet11: Creation complete after 4s [id=ocid1.subnet.oc1.eu-frankfurt-1.aaaaaaaacbhzkxoyzdfter4piwwjfwvolaqud5e4l7ui454lbj4va6bo6jzq]
module.k3s_cluster.oci_network_load_balancer_network_load_balancer.k3s_load_balancer: Creating...
module.k3s_cluster.oci_load_balancer_load_balancer.k3s_public_lb: Creating...
module.k3s_cluster.oci_core_instance_pool.k3s_servers: Still creating... [10s elapsed]
module.k3s_cluster.oci_load_balancer_load_balancer.k3s_public_lb: Still creating... [10s elapsed]
module.k3s_cluster.oci_network_load_balancer_network_load_balancer.k3s_load_balancer: Still creating... [10s elapsed]
module.k3s_cluster.oci_core_instance_pool.k3s_servers: Still creating... [20s elapsed]
module.k3s_cluster.oci_network_load_balancer_network_load_balancer.k3s_load_balancer: Still creating... [20s elapsed]
module.k3s_cluster.oci_load_balancer_load_balancer.k3s_public_lb: Still creating... [20s elapsed]
module.k3s_cluster.oci_core_instance_pool.k3s_servers: Still creating... [30s elapsed]
module.k3s_cluster.oci_network_load_balancer_network_load_balancer.k3s_load_balancer: Still creating... [30s elapsed]
module.k3s_cluster.oci_load_balancer_load_balancer.k3s_public_lb: Still creating... [30s elapsed]
module.k3s_cluster.oci_network_load_balancer_network_load_balancer.k3s_load_balancer: Creation complete after 34s [id=ocid1.networkloadbalancer.oc1.eu-frankfurt-1.amaaaaaavcg3q3qab2c5ygcmdrlwp2tp7c44dtfy6mdbjtsn7y7phghfou3q]
module.k3s_cluster.oci_network_load_balancer_backend_set.k3s_kube_api_backend_set: Creating...
module.k3s_cluster.oci_core_instance_pool.k3s_workers: Creating...
module.k3s_cluster.oci_load_balancer_load_balancer.k3s_public_lb: Creation complete after 35s [id=ocid1.loadbalancer.oc1.eu-frankfurt-1.aaaaaaaajvzkfllcbtxhhddjdqu3kkaem64d6t4gcolimt34uxnpzek5rb3a]
module.k3s_cluster.oci_load_balancer_certificate.k3s_https_certificate: Creating...
module.k3s_cluster.oci_load_balancer_backend_set.k3s_https_backend_set: Creating...
module.k3s_cluster.oci_load_balancer_backend_set.k3s_http_backend_set: Creating...
module.k3s_cluster.oci_core_instance_pool.k3s_servers: Still creating... [40s elapsed]
module.k3s_cluster.oci_core_instance_pool.k3s_workers: Still creating... [10s elapsed]
module.k3s_cluster.oci_network_load_balancer_backend_set.k3s_kube_api_backend_set: Still creating... [10s elapsed]
module.k3s_cluster.oci_load_balancer_certificate.k3s_https_certificate: Still creating... [10s elapsed]
module.k3s_cluster.oci_load_balancer_backend_set.k3s_http_backend_set: Still creating... [10s elapsed]
module.k3s_cluster.oci_load_balancer_backend_set.k3s_https_backend_set: Still creating... [10s elapsed]
module.k3s_cluster.oci_load_balancer_backend_set.k3s_http_backend_set: Creation complete after 14s [id=loadBalancers/ocid1.loadbalancer.oc1.eu-frankfurt-1.aaaaaaaajvzkfllcbtxhhddjdqu3kkaem64d6t4gcolimt34uxnpzek5rb3a/backendSets/K3s_http_backend_set]
module.k3s_cluster.oci_load_balancer_listener.k3s_http_listener: Creating...
module.k3s_cluster.oci_core_instance_pool.k3s_servers: Still creating... [50s elapsed]
module.k3s_cluster.oci_network_load_balancer_backend_set.k3s_kube_api_backend_set: Still creating... [20s elapsed]
module.k3s_cluster.oci_core_instance_pool.k3s_workers: Still creating... [20s elapsed]
module.k3s_cluster.oci_load_balancer_certificate.k3s_https_certificate: Still creating... [20s elapsed]
module.k3s_cluster.oci_load_balancer_backend_set.k3s_https_backend_set: Still creating... [20s elapsed]
module.k3s_cluster.oci_network_load_balancer_backend_set.k3s_kube_api_backend_set: Creation complete after 23s [id=networkLoadBalancers/ocid1.networkloadbalancer.oc1.eu-frankfurt-1.amaaaaaavcg3q3qab2c5ygcmdrlwp2tp7c44dtfy6mdbjtsn7y7phghfou3q/backendSets/k3s%20kube%20api%20backend]
module.k3s_cluster.oci_network_load_balancer_listener.k3s_kube_api_listener: Creating...
module.k3s_cluster.oci_load_balancer_listener.k3s_http_listener: Still creating... [10s elapsed]
module.k3s_cluster.oci_core_instance_pool.k3s_servers: Still creating... [1m0s elapsed]
module.k3s_cluster.oci_core_instance_pool.k3s_workers: Still creating... [30s elapsed]
module.k3s_cluster.oci_load_balancer_certificate.k3s_https_certificate: Still creating... [30s elapsed]
module.k3s_cluster.oci_load_balancer_backend_set.k3s_https_backend_set: Still creating... [30s elapsed]
module.k3s_cluster.oci_network_load_balancer_listener.k3s_kube_api_listener: Still creating... [10s elapsed]
module.k3s_cluster.oci_load_balancer_listener.k3s_http_listener: Still creating... [20s elapsed]
module.k3s_cluster.oci_core_instance_pool.k3s_servers: Still creating... [1m10s elapsed]
module.k3s_cluster.oci_network_load_balancer_listener.k3s_kube_api_listener: Creation complete after 16s [id=networkLoadBalancers/ocid1.networkloadbalancer.oc1.eu-frankfurt-1.amaaaaaavcg3q3qab2c5ygcmdrlwp2tp7c44dtfy6mdbjtsn7y7phghfou3q/listeners/k3s%20kube%20api%20listener]
module.k3s_cluster.oci_core_instance_pool.k3s_workers: Still creating... [40s elapsed]
module.k3s_cluster.oci_load_balancer_certificate.k3s_https_certificate: Still creating... [40s elapsed]
module.k3s_cluster.oci_load_balancer_backend_set.k3s_https_backend_set: Still creating... [40s elapsed]
module.k3s_cluster.oci_load_balancer_listener.k3s_http_listener: Still creating... [30s elapsed]
module.k3s_cluster.oci_core_instance_pool.k3s_servers: Still creating... [1m20s elapsed]
module.k3s_cluster.oci_core_instance_pool.k3s_workers: Still creating... [50s elapsed]
module.k3s_cluster.oci_load_balancer_certificate.k3s_https_certificate: Still creating... [50s elapsed]
module.k3s_cluster.oci_load_balancer_backend_set.k3s_https_backend_set: Still creating... [50s elapsed]
module.k3s_cluster.oci_load_balancer_listener.k3s_http_listener: Still creating... [40s elapsed]
module.k3s_cluster.oci_core_instance_pool.k3s_servers: Still creating... [1m30s elapsed]
module.k3s_cluster.oci_core_instance_pool.k3s_workers: Still creating... [1m0s elapsed]
module.k3s_cluster.oci_load_balancer_certificate.k3s_https_certificate: Still creating... [1m0s elapsed]
module.k3s_cluster.oci_load_balancer_backend_set.k3s_https_backend_set: Still creating... [1m0s elapsed]
module.k3s_cluster.oci_core_instance_pool.k3s_servers: Creation complete after 1m37s [id=ocid1.instancepool.oc1.eu-frankfurt-1.aaaaaaaaqljr2ea2hv67r5octhqbz3zpshq5tijzuoiscttfuwitttolheaa]
module.k3s_cluster.data.oci_core_instance_pool_instances.k3s_servers_instances: Reading...
module.k3s_cluster.data.oci_core_instance_pool_instances.k3s_servers_instances: Read complete after 0s [id=CoreInstancePoolInstancesDataSource-2697114427]
module.k3s_cluster.data.oci_core_instance.k3s_servers_instances_ips[1]: Reading...
module.k3s_cluster.data.oci_core_instance.k3s_servers_instances_ips[0]: Reading...
module.k3s_cluster.oci_network_load_balancer_backend.k3s_kube_api_backend[0]: Creating...
module.k3s_cluster.oci_network_load_balancer_backend.k3s_kube_api_backend[1]: Creating...
module.k3s_cluster.data.oci_core_instance.k3s_servers_instances_ips[0]: Read complete after 1s [id=ocid1.instance.oc1.eu-frankfurt-1.antheljtvcg3q3qco4o4maylw56wg5atjwck424hbysvfhgvibh3bruljq3q]
module.k3s_cluster.data.oci_core_instance.k3s_servers_instances_ips[1]: Read complete after 1s [id=ocid1.instance.oc1.eu-frankfurt-1.antheljtvcg3q3qcevvf3qyeo5tp5bpvxcxpqzer7ttuwd5ozgboccl4imaa]
module.k3s_cluster.oci_load_balancer_listener.k3s_http_listener: Still creating... [50s elapsed]
module.k3s_cluster.oci_load_balancer_backend_set.k3s_https_backend_set: Creation complete after 1m5s [id=loadBalancers/ocid1.loadbalancer.oc1.eu-frankfurt-1.aaaaaaaajvzkfllcbtxhhddjdqu3kkaem64d6t4gcolimt34uxnpzek5rb3a/backendSets/K3s_https_backend_set]
module.k3s_cluster.oci_core_instance_pool.k3s_workers: Still creating... [1m10s elapsed]
module.k3s_cluster.oci_load_balancer_certificate.k3s_https_certificate: Still creating... [1m10s elapsed]
module.k3s_cluster.oci_network_load_balancer_backend.k3s_kube_api_backend[1]: Still creating... [10s elapsed]
module.k3s_cluster.oci_network_load_balancer_backend.k3s_kube_api_backend[0]: Still creating... [10s elapsed]
module.k3s_cluster.oci_load_balancer_listener.k3s_http_listener: Still creating... [1m0s elapsed]
module.k3s_cluster.oci_load_balancer_certificate.k3s_https_certificate: Creation complete after 1m15s [id=loadBalancers/ocid1.loadbalancer.oc1.eu-frankfurt-1.aaaaaaaajvzkfllcbtxhhddjdqu3kkaem64d6t4gcolimt34uxnpzek5rb3a/certificates/K3s_lb_https_cert]
module.k3s_cluster.oci_load_balancer_listener.k3s_https_listener: Creating...
module.k3s_cluster.oci_core_instance_pool.k3s_workers: Creation complete after 1m17s [id=ocid1.instancepool.oc1.eu-frankfurt-1.aaaaaaaaakoijjeqhugzy4zhoquqilqap73vc75vv5uceoa5l5znp5nbtrdq]
module.k3s_cluster.data.oci_core_instance_pool_instances.k3s_workers_instances: Reading...
module.k3s_cluster.data.oci_core_instance_pool_instances.k3s_workers_instances: Read complete after 1s [id=CoreInstancePoolInstancesDataSource-3767891345]
module.k3s_cluster.data.oci_core_instance.k3s_workers_instances_ips[0]: Reading...
module.k3s_cluster.data.oci_core_instance.k3s_workers_instances_ips[1]: Reading...
module.k3s_cluster.data.oci_core_instance.k3s_workers_instances_ips[1]: Read complete after 0s [id=ocid1.instance.oc1.eu-frankfurt-1.antheljtvcg3q3qcsbascfn267dpbfoaosk2dnnhlb6ct3lynnqb5nzhdcga]
module.k3s_cluster.data.oci_core_instance.k3s_workers_instances_ips[0]: Read complete after 1s [id=ocid1.instance.oc1.eu-frankfurt-1.antheljtvcg3q3qcy23imkkgmve6s6lmwn5wapjdkzpw7cpcvcdtxkzm357a]
module.k3s_cluster.oci_load_balancer_backend.k3s_http_backend[0]: Creating...
module.k3s_cluster.oci_load_balancer_backend.k3s_https_backend[1]: Creating...
module.k3s_cluster.oci_load_balancer_backend.k3s_https_backend[0]: Creating...
module.k3s_cluster.oci_load_balancer_backend.k3s_http_backend[1]: Creating...
module.k3s_cluster.oci_network_load_balancer_backend.k3s_kube_api_backend[0]: Still creating... [20s elapsed]
module.k3s_cluster.oci_network_load_balancer_backend.k3s_kube_api_backend[1]: Still creating... [20s elapsed]
module.k3s_cluster.oci_load_balancer_listener.k3s_http_listener: Still creating... [1m10s elapsed]
module.k3s_cluster.oci_load_balancer_listener.k3s_https_listener: Still creating... [10s elapsed]
module.k3s_cluster.oci_load_balancer_backend.k3s_https_backend[1]: Still creating... [10s elapsed]
module.k3s_cluster.oci_load_balancer_backend.k3s_http_backend[0]: Still creating... [10s elapsed]
module.k3s_cluster.oci_load_balancer_backend.k3s_https_backend[0]: Still creating... [10s elapsed]
module.k3s_cluster.oci_load_balancer_backend.k3s_http_backend[1]: Still creating... [10s elapsed]
module.k3s_cluster.oci_network_load_balancer_backend.k3s_kube_api_backend[1]: Still creating... [30s elapsed]
module.k3s_cluster.oci_network_load_balancer_backend.k3s_kube_api_backend[0]: Still creating... [30s elapsed]
module.k3s_cluster.oci_load_balancer_listener.k3s_http_listener: Still creating... [1m20s elapsed]
module.k3s_cluster.oci_load_balancer_listener.k3s_https_listener: Still creating... [20s elapsed]
module.k3s_cluster.oci_load_balancer_backend.k3s_http_backend[0]: Still creating... [20s elapsed]
module.k3s_cluster.oci_load_balancer_backend.k3s_https_backend[1]: Still creating... [20s elapsed]
module.k3s_cluster.oci_load_balancer_backend.k3s_https_backend[0]: Still creating... [20s elapsed]
module.k3s_cluster.oci_load_balancer_backend.k3s_http_backend[1]: Still creating... [20s elapsed]
module.k3s_cluster.oci_network_load_balancer_backend.k3s_kube_api_backend[0]: Still creating... [40s elapsed]
module.k3s_cluster.oci_network_load_balancer_backend.k3s_kube_api_backend[1]: Still creating... [40s elapsed]
module.k3s_cluster.oci_load_balancer_listener.k3s_http_listener: Still creating... [1m30s elapsed]
module.k3s_cluster.oci_load_balancer_listener.k3s_https_listener: Still creating... [30s elapsed]
module.k3s_cluster.oci_load_balancer_backend.k3s_https_backend[1]: Still creating... [30s elapsed]
module.k3s_cluster.oci_load_balancer_backend.k3s_http_backend[0]: Still creating... [30s elapsed]
module.k3s_cluster.oci_load_balancer_backend.k3s_http_backend[1]: Still creating... [30s elapsed]
module.k3s_cluster.oci_load_balancer_backend.k3s_https_backend[0]: Still creating... [30s elapsed]
module.k3s_cluster.oci_network_load_balancer_backend.k3s_kube_api_backend[0]: Still creating... [50s elapsed]
module.k3s_cluster.oci_network_load_balancer_backend.k3s_kube_api_backend[1]: Still creating... [50s elapsed]
module.k3s_cluster.oci_load_balancer_listener.k3s_http_listener: Still creating... [1m40s elapsed]
module.k3s_cluster.oci_load_balancer_listener.k3s_https_listener: Still creating... [40s elapsed]
module.k3s_cluster.oci_load_balancer_backend.k3s_https_backend[1]: Still creating... [40s elapsed]
module.k3s_cluster.oci_load_balancer_backend.k3s_https_backend[0]: Still creating... [40s elapsed]
module.k3s_cluster.oci_load_balancer_backend.k3s_http_backend[0]: Still creating... [40s elapsed]
module.k3s_cluster.oci_load_balancer_backend.k3s_http_backend[1]: Still creating... [40s elapsed]
module.k3s_cluster.oci_load_balancer_listener.k3s_http_listener: Creation complete after 1m46s [id=loadBalancers/ocid1.loadbalancer.oc1.eu-frankfurt-1.aaaaaaaajvzkfllcbtxhhddjdqu3kkaem64d6t4gcolimt34uxnpzek5rb3a/listeners/K3s_http_listener]
module.k3s_cluster.oci_network_load_balancer_backend.k3s_kube_api_backend[1]: Still creating... [1m0s elapsed]
module.k3s_cluster.oci_network_load_balancer_backend.k3s_kube_api_backend[0]: Still creating... [1m0s elapsed]
module.k3s_cluster.oci_load_balancer_listener.k3s_https_listener: Still creating... [50s elapsed]
module.k3s_cluster.oci_load_balancer_backend.k3s_http_backend[1]: Still creating... [50s elapsed]
module.k3s_cluster.oci_load_balancer_backend.k3s_https_backend[1]: Still creating... [50s elapsed]
module.k3s_cluster.oci_load_balancer_backend.k3s_https_backend[0]: Still creating... [50s elapsed]
module.k3s_cluster.oci_load_balancer_backend.k3s_http_backend[0]: Still creating... [50s elapsed]
module.k3s_cluster.oci_network_load_balancer_backend.k3s_kube_api_backend[0]: Still creating... [1m10s elapsed]
module.k3s_cluster.oci_network_load_balancer_backend.k3s_kube_api_backend[1]: Still creating... [1m10s elapsed]
module.k3s_cluster.oci_load_balancer_listener.k3s_https_listener: Still creating... [1m0s elapsed]
module.k3s_cluster.oci_load_balancer_backend.k3s_http_backend[0]: Still creating... [1m0s elapsed]
module.k3s_cluster.oci_load_balancer_backend.k3s_https_backend[0]: Still creating... [1m0s elapsed]
module.k3s_cluster.oci_load_balancer_backend.k3s_http_backend[1]: Still creating... [1m0s elapsed]
module.k3s_cluster.oci_load_balancer_backend.k3s_https_backend[1]: Still creating... [1m0s elapsed]
module.k3s_cluster.oci_network_load_balancer_backend.k3s_kube_api_backend[0]: Still creating... [1m20s elapsed]
module.k3s_cluster.oci_network_load_balancer_backend.k3s_kube_api_backend[1]: Still creating... [1m20s elapsed]
module.k3s_cluster.oci_load_balancer_listener.k3s_https_listener: Still creating... [1m10s elapsed]
module.k3s_cluster.oci_load_balancer_backend.k3s_https_backend[0]: Still creating... [1m10s elapsed]
module.k3s_cluster.oci_load_balancer_backend.k3s_https_backend[1]: Still creating... [1m10s elapsed]
module.k3s_cluster.oci_load_balancer_backend.k3s_http_backend[0]: Still creating... [1m10s elapsed]
module.k3s_cluster.oci_load_balancer_backend.k3s_http_backend[1]: Still creating... [1m10s elapsed]
module.k3s_cluster.oci_network_load_balancer_backend.k3s_kube_api_backend[1]: Still creating... [1m30s elapsed]
module.k3s_cluster.oci_network_load_balancer_backend.k3s_kube_api_backend[0]: Still creating... [1m30s elapsed]
module.k3s_cluster.oci_load_balancer_listener.k3s_https_listener: Still creating... [1m20s elapsed]
module.k3s_cluster.oci_load_balancer_backend.k3s_https_backend[0]: Still creating... [1m20s elapsed]
module.k3s_cluster.oci_load_balancer_backend.k3s_http_backend[0]: Still creating... [1m20s elapsed]
module.k3s_cluster.oci_load_balancer_backend.k3s_http_backend[1]: Still creating... [1m20s elapsed]
module.k3s_cluster.oci_load_balancer_backend.k3s_https_backend[1]: Still creating... [1m20s elapsed]
module.k3s_cluster.oci_network_load_balancer_backend.k3s_kube_api_backend[0]: Still creating... [1m40s elapsed]
module.k3s_cluster.oci_load_balancer_listener.k3s_https_listener: Still creating... [1m30s elapsed]
module.k3s_cluster.oci_load_balancer_backend.k3s_https_backend[1]: Still creating... [1m30s elapsed]
module.k3s_cluster.oci_load_balancer_backend.k3s_http_backend[1]: Still creating... [1m30s elapsed]
module.k3s_cluster.oci_load_balancer_backend.k3s_http_backend[0]: Still creating... [1m30s elapsed]
module.k3s_cluster.oci_load_balancer_backend.k3s_https_backend[0]: Still creating... [1m30s elapsed]
module.k3s_cluster.oci_load_balancer_listener.k3s_https_listener: Creation complete after 1m36s [id=loadBalancers/ocid1.loadbalancer.oc1.eu-frankfurt-1.aaaaaaaajvzkfllcbtxhhddjdqu3kkaem64d6t4gcolimt34uxnpzek5rb3a/listeners/K3s_https_listener]
module.k3s_cluster.oci_network_load_balancer_backend.k3s_kube_api_backend[0]: Still creating... [1m50s elapsed]
module.k3s_cluster.oci_load_balancer_backend.k3s_https_backend[1]: Still creating... [1m40s elapsed]
module.k3s_cluster.oci_load_balancer_backend.k3s_https_backend[0]: Still creating... [1m40s elapsed]
module.k3s_cluster.oci_load_balancer_backend.k3s_http_backend[0]: Still creating... [1m40s elapsed]
module.k3s_cluster.oci_load_balancer_backend.k3s_http_backend[1]: Still creating... [1m40s elapsed]
module.k3s_cluster.oci_network_load_balancer_backend.k3s_kube_api_backend[0]: Still creating... [2m0s elapsed]
module.k3s_cluster.oci_load_balancer_backend.k3s_http_backend[0]: Creation complete after 1m45s [id=loadBalancers/ocid1.loadbalancer.oc1.eu-frankfurt-1.aaaaaaaajvzkfllcbtxhhddjdqu3kkaem64d6t4gcolimt34uxnpzek5rb3a/backendSets/K3s_http_backend_set/backends/10.0.0.240:80]
module.k3s_cluster.oci_load_balancer_backend.k3s_https_backend[0]: Still creating... [1m50s elapsed]
module.k3s_cluster.oci_load_balancer_backend.k3s_http_backend[1]: Still creating... [1m50s elapsed]
module.k3s_cluster.oci_load_balancer_backend.k3s_https_backend[1]: Still creating... [1m50s elapsed]
module.k3s_cluster.oci_network_load_balancer_backend.k3s_kube_api_backend[0]: Still creating... [2m10s elapsed]
module.k3s_cluster.oci_load_balancer_backend.k3s_https_backend[1]: Still creating... [2m0s elapsed]
module.k3s_cluster.oci_load_balancer_backend.k3s_https_backend[0]: Still creating... [2m0s elapsed]
module.k3s_cluster.oci_load_balancer_backend.k3s_http_backend[1]: Still creating... [2m0s elapsed]
module.k3s_cluster.oci_load_balancer_backend.k3s_https_backend[1]: Creation complete after 2m5s [id=loadBalancers/ocid1.loadbalancer.oc1.eu-frankfurt-1.aaaaaaaajvzkfllcbtxhhddjdqu3kkaem64d6t4gcolimt34uxnpzek5rb3a/backendSets/K3s_https_backend_set/backends/10.0.0.156:443]
module.k3s_cluster.oci_load_balancer_backend.k3s_http_backend[1]: Creation complete after 2m10s [id=loadBalancers/ocid1.loadbalancer.oc1.eu-frankfurt-1.aaaaaaaajvzkfllcbtxhhddjdqu3kkaem64d6t4gcolimt34uxnpzek5rb3a/backendSets/K3s_http_backend_set/backends/10.0.0.156:80]
module.k3s_cluster.oci_load_balancer_backend.k3s_https_backend[0]: Still creating... [2m10s elapsed]
module.k3s_cluster.oci_load_balancer_backend.k3s_https_backend[0]: Still creating... [2m20s elapsed]
module.k3s_cluster.oci_load_balancer_backend.k3s_https_backend[0]: Creation complete after 2m20s [id=loadBalancers/ocid1.loadbalancer.oc1.eu-frankfurt-1.aaaaaaaajvzkfllcbtxhhddjdqu3kkaem64d6t4gcolimt34uxnpzek5rb3a/backendSets/K3s_https_backend_set/backends/10.0.0.240:443]
╷
│ Error: 404-NotAuthorizedOrNotFound
│ Provider version: 4.64.0, released on 2022-02-16. This provider is 12 Update(s) behind to current.
│ Service: Network Load Balancer Backend
│ Error Message: Unknown resource Entity of type Backend with key ocid1.instance.oc1.eu-frankfurt-1.antheljtvcg3q3qco4o4maylw56wg5atjwck424hbysvfhgvibh3bruljq3q.6443 not found
│ OPC request ID: 3f5d0e1f40585237ef22702e84aa1f89/48FB9A01F45BAB065F8161403CE66E94/9B731647487029B172ABD15F5BC9E758
│ Suggestion: Either the resource has been deleted or service Network Load Balancer Backend need policy to access this resource. Policy reference: https://docs.oracle.com/en-us/iaas/Content/Identity/Reference/policyreference.htm
│
│
│   with module.k3s_cluster.oci_network_load_balancer_backend.k3s_kube_api_backend[0],
│   on ../k3slb.tf line 36, in resource "oci_network_load_balancer_backend" "k3s_kube_api_backend":
│   36: resource "oci_network_load_balancer_backend" "k3s_kube_api_backend" {
│
╵
╷
│ Error: 404-NotAuthorizedOrNotFound
│ Provider version: 4.64.0, released on 2022-02-16. This provider is 12 Update(s) behind to current.
│ Service: Network Load Balancer Backend
│ Error Message: Unknown resource Entity of type Backend with key ocid1.instance.oc1.eu-frankfurt-1.antheljtvcg3q3qcevvf3qyeo5tp5bpvxcxpqzer7ttuwd5ozgboccl4imaa.6443 not found
│ OPC request ID: 142683e0e709537c676b4aac4039ca47/F5C1E68FD4497918A3F57F1EFD1006AF/743C329145FC4B16274602DFF0B659C4
│ Suggestion: Either the resource has been deleted or service Network Load Balancer Backend need policy to access this resource. Policy reference: https://docs.oracle.com/en-us/iaas/Content/Identity/Reference/policyreference.htm
│
│
│   with module.k3s_cluster.oci_network_load_balancer_backend.k3s_kube_api_backend[1],
│   on ../k3slb.tf line 36, in resource "oci_network_load_balancer_backend" "k3s_kube_api_backend":
│   36: resource "oci_network_load_balancer_backend" "k3s_kube_api_backend" {
│



@garutilorenzo
Copy link
Owner

Are you using the "root" account or you have created a dedicated terraform user to use with terraform?
Maybe the user you are using to provision the infrastructure has a permission problem?

@anikolop
Copy link
Author

No I didn't create any user. I will try, as cellerich suggested, multiple time to apply the plan and see where it goes from there.

@garutilorenzo
Copy link
Owner

I have this Policy attached to the terrafrom group:

Allow group terraform to manage virtual-network-family in tenancy
Allow group terraform to manage instance-family in tenancy
Allow group terraform to manage compute-management-family in tenancy
Allow group terraform to manage volume-family in tenancy
Allow group terraform to manage load-balancers in tenancy
Allow group terraform to manage network-load-balancers in tenancy

and i'm using the terraform user that is in this group.
Can you please create a dedicated user with a dedicated group and dattach this policy to this group.

@anikolop
Copy link
Author

I created the terraform group and a new user but the outcome was the same.
In any case the network balancer gets created as it should and the backends are set but terraform throws this error.
For now I just comment out the resource "oci_network_load_balancer_backend" "k3s_kube_api_backend" in k3slb.tf after the first time.

@garutilorenzo
Copy link
Owner

Opened issue to oracle oci provider

@garutilorenzo
Copy link
Owner

I've found a workaround.
With some reverse enginereeng i've inspected the html of the web console and i've found that the name was setted to the instance name (the name if is not provided is automatically generated).
Inspecting the page i've found that in the id of the html the name instead was setted to $instance_id:$backend_port

oci-reverse-eng

Then i've tried to import the resurce with:

terraform import module.k3s_cluster.oci_network_load_balancer_backend.k3s_kube_api_backend[1] "networkLoadBalancers/ocid1.networkloadbalancer.oc1.eu-zurich-1.xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx/backendSets/k3s_kube_api_backend/backends/ocid1.instance.oc1.eu-zurich-1.xxxxxxxxxxxxxxxxxxxxxx:6443"

and the import has correctly imported the backend

Changing the backend name to $instance_id:$backend_port fix the problem, but this is only a workaround.

Also, with this workaround the backand name in the web console is always setted to the instance name.
I think something has changed in the OCI api and at the moment is not documented.

@anikolop
Copy link
Author

@garutilorenzo it is working now as you describe.
Thank you for your time and effort.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working help wanted Extra attention is needed question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants