Errors when trying to connect to kubernetes - azure

I've been trying to connect to k8s cluster which is running in azure from my Mac laptop, but unfortunately I can't retrieve any information.
user#MyMac ~ % k get nodes
error: unknown flag: --environment
error: unknown flag: --environment
error: unknown flag: --environment
Unable to connect to the server: getting credentials: exec: executable kubelogin failed with exit code 1
when I extend the log I get this:
user#MyMac ~ % kubectl get deployments --all-namespaces=true -v 8
I0924 10:32:14.451255 28517 loader.go:372] Config loaded from file: /Users/user/.kube/config
I0924 10:32:14.461468 28517 round_trippers.go:432] GET https://dev-cluster.privatelink.westeurope.azmk8s.io:443/api?timeout=32s
I0924 10:32:14.461484 28517 round_trippers.go:438] Request Headers:
I0924 10:32:14.461490 28517 round_trippers.go:442] Accept: application/json, */*
I0924 10:32:14.461495 28517 round_trippers.go:442] User-Agent: kubectl/v1.22.5 (darwin/amd64) kubernetes/5c99e2a
error: unknown flag: --environment
I0924 10:32:14.555302 28517 round_trippers.go:457] Response Status: in 93 milliseconds
I0924 10:32:14.555318 28517 round_trippers.go:460] Response Headers:
I0924 10:32:14.555828 28517 cached_discovery.go:121] skipped caching discovery info due to Get "https://dev-cluster.privatelink.westeurope.azmk8s.io:443/api?timeout=32s": getting credentials: exec:
I0924 10:32:14.569821 28517 shortcut.go:89] Error loading discovery information: Get "https://dev-cluster.privatelink.westeurope.azmk8s.io:443/api?timeout=32s": getting credentials: exec: executable kubelogin failed with exit code 1
I0924 10:32:14.570037 28517 round_trippers.go:432] GET https://dev-cluster.privatelink.westeurope.azmk8s.io:443/api?timeout=32s
I0924 10:32:14.570050 28517 round_trippers.go:438] Request Headers:
I0924 10:32:14.570068 28517 round_trippers.go:442] Accept: application/json, */*
I0924 10:32:14.570088 28517 round_trippers.go:442] User-Agent: kubectl/v1.22.5 (darwin/amd64) kubernetes/5c99e2a
I0924 10:32:14.618944 28517 round_trippers.go:457] Response Status: in 17 milliseconds
I0924 10:32:14.618976 28517 round_trippers.go:460] Response Headers:
I0924 10:32:14.619147 28517 cached_discovery.go:121] skipped caching discovery info due to Get "https://dev-cluster.privatelink.westeurope.azmk8s.io:443/api?timeout=32s": getting credentials: exec: executable kubelogin failed with exit code 1
I0924 10:32:14.619790 28517 helpers.go:235] Connection error: Get https://dev-cluster.privatelink.westeurope.azmk8s.io:443/api?timeout=32s: getting credentials: exec: executable kubelogin failed with exit code 1
F0924 10:32:14.620768 28517 helpers.go:116] Unable to connect to the server: getting credentials: exec: executable kubelogin failed with exit code 1
goroutine 1 [running]:
k8s.io/kubernetes/vendor/k8s.io/klog/v2.stacks(0xc0000cc001, 0xc000258000, 0x97, 0x23d)
/workspace/src/k8s.io/kubernetes/_output/dockerized/go/src/k8s.io/kubernetes/vendor/k8s.io/klog/v2/klog.go:1026 +0xb9
k8s.io/kubernetes/vendor/k8s.io/klog/v2.(*loggingT).output(0x3cd80e0, 0xc000000003, 0x0, 0x0, 0xc0004d8150, 0x2, 0x33f6d63, 0xa, 0x74, 0x100e100)
/workspace/src/k8s.io/kubernetes/_output/dockerized/go/src/k8s.io/kubernetes/vendor/k8s.io/klog/v2/klog.go:975 +0x1e5
k8s.io/kubernetes/vendor/k8s.io/klog/v2.(*loggingT).printDepth(0x3cd80e0, 0xc000000003, 0x0, 0x0, 0x0, 0x0, 0x2, 0xc0004e0db0, 0x1, 0x1)
/workspace/src/k8s.io/kubernetes/_output/dockerized/go/src/k8s.io/kubernetes/vendor/k8s.io/klog/v2/klog.go:735 +0x185
k8s.io/kubernetes/vendor/k8s.io/klog/v2.FatalDepth(...)
/workspace/src/k8s.io/kubernetes/_output/dockerized/go/src/k8s.io/kubernetes/vendor/k8s.io/klog/v2/klog.go:1500
k8s.io/kubernetes/vendor/k8s.io/kubectl/pkg/cmd/util.fatal(0xc00081c3f0, 0x68, 0x1)
/workspace/src/k8s.io/kubernetes/_output/dockerized/go/src/k8s.io/kubernetes/vendor/k8s.io/kubectl/pkg/cmd/util/helpers.go:94 +0x288
k8s.io/kubernetes/vendor/k8s.io/kubectl/pkg/cmd/util.checkErr(0x2e6b0e0, 0xc0004e7410, 0x2cebdc8)
/workspace/src/k8s.io/kubernetes/_output/dockerized/go/src/k8s.io/kubernetes/vendor/k8s.io/kubectl/pkg/cmd/util/helpers.go:189 +0x935
k8s.io/kubernetes/vendor/k8s.io/kubectl/pkg/cmd/util.CheckErr(...)
/workspace/src/k8s.io/kubernetes/_output/dockerized/go/src/k8s.io/kubernetes/vendor/k8s.io/kubectl/pkg/cmd/util/helpers.go:116
k8s.io/kubernetes/vendor/k8s.io/kubectl/pkg/cmd/get.NewCmdGet.func2(0xc0001ef680, 0xc000820cc0, 0x1, 0x4)
/workspace/src/k8s.io/kubernetes/_output/dockerized/go/src/k8s.io/kubernetes/vendor/k8s.io/kubectl/pkg/cmd/get/get.go:180 +0x159
k8s.io/kubernetes/vendor/github.com/spf13/cobra.(*Command).execute(0xc0001ef680, 0xc000820c80, 0x4, 0x4, 0xc0001ef680, 0xc000820c80)
/workspace/src/k8s.io/kubernetes/_output/dockerized/go/src/k8s.io/kubernetes/vendor/github.com/spf13/cobra/command.go:856 +0x2c2
k8s.io/kubernetes/vendor/github.com/spf13/cobra.(*Command).ExecuteC(0xc000401180, 0xc0000ce180, 0xc0000ce120, 0x6)
/workspace/src/k8s.io/kubernetes/_output/dockerized/go/src/k8s.io/kubernetes/vendor/github.com/spf13/cobra/command.go:960 +0x375
k8s.io/kubernetes/vendor/github.com/spf13/cobra.(*Command).Execute(...)
/workspace/src/k8s.io/kubernetes/_output/dockerized/go/src/k8s.io/kubernetes/vendor/github.com/spf13/cobra/command.go:897
main.main()
_output/dockerized/go/src/k8s.io/kubernetes/cmd/kubectl/kubectl.go:49 +0x21d
goroutine 18 [chan receive]:
k8s.io/kubernetes/vendor/k8s.io/klog/v2.(*loggingT).flushDaemon(0x3cd80e0)
/workspace/src/k8s.io/kubernetes/_output/dockerized/go/src/k8s.io/kubernetes/vendor/k8s.io/klog/v2/klog.go:1169 +0x8b
created by k8s.io/kubernetes/vendor/k8s.io/klog/v2.init.0
/workspace/src/k8s.io/kubernetes/_output/dockerized/go/src/k8s.io/kubernetes/vendor/k8s.io/klog/v2/klog.go:420 +0xdf
goroutine 23 [select]:
k8s.io/kubernetes/vendor/k8s.io/apimachinery/pkg/util/wait.BackoffUntil(0x2cebcd0, 0x2e695e0, 0xc0004e6000, 0x1, 0xc00009eb40)
/workspace/src/k8s.io/kubernetes/_output/dockerized/go/src/k8s.io/kubernetes/vendor/k8s.io/apimachinery/pkg/util/wait/wait.go:167 +0x118
k8s.io/kubernetes/vendor/k8s.io/apimachinery/pkg/util/wait.JitterUntil(0x2cebcd0, 0x12a05f200, 0x0, 0x1, 0xc00009eb40)
/workspace/src/k8s.io/kubernetes/_output/dockerized/go/src/k8s.io/kubernetes/vendor/k8s.io/apimachinery/pkg/util/wait/wait.go:133 +0x98
k8s.io/kubernetes/vendor/k8s.io/apimachinery/pkg/util/wait.Until(0x2cebcd0, 0x12a05f200, 0xc00009eb40)
/workspace/src/k8s.io/kubernetes/_output/dockerized/go/src/k8s.io/kubernetes/vendor/k8s.io/apimachinery/pkg/util/wait/wait.go:90 +0x4d
created by k8s.io/kubernetes/vendor/k8s.io/kubectl/pkg/util/logs.InitLogs
/workspace/src/k8s.io/kubernetes/_output/dockerized/go/src/k8s.io/kubernetes/vendor/k8s.io/kubectl/pkg/util/logs/logs.go:51 +0x96
I updated the az cli, but nothing changed.
I removed too the .kube/config file, and it didn't work too.
I don't know what went wrong after the update of the MacOs.

This happens because the ./kube config file was rewritten in the upgrade process, so you would need to add the credentials, run this command to refresh them:
az aks get-credentials --resource-group group --name cluster-name --admin --overwrite-existing
Details of the Kubernetes Service Connection:
Authentication method: Azure Subscription
Azure Subscription:
Cluster:
Namespace:
Use cluster admin credentials

Related

"InvalidResourceName" when trying to access parquet files from Microsoft's Planetary Computer Blob Storage

I have some python code that makes a call to Microsoft's Planetary Computer api and gets back a signed url. I am then trying to call ogr2ogr in a subprocess to pull down the parquet files and insert them into a database.
When I use dask as illustrated in the example from the link above, everything works as expected:
asset = <Asset href=abfs://footprints/global/2022-06-14/ml-buildings.parquet/RegionName=Malaysia>
get_region = dask_geopandas.read_parquet(
asset.href, storage_options=asset.extra_fields["table:storage_options"]
)
get_region.to_parquet("some path")
This downloads all of the parquet files from Malaysia.
However, when I try to use ogr2ogr in a subprocess, I get an Azure "InvalidResourceName" name error:
connstring = f"PG:host=host.docker.internal port=2345 dbname={os.getenv('DATABASE_DB')} \
user={os.getenv('DATABASE_USER')} password={os.getenv('DATABASE_PW')}"
exp = ["ogr2ogr", "--debug", "ON", "--config", "CPL_CURL_VERBOSE", "YES",
"--config", "AZURE_STORAGE_ACCOUNT", asset.extra_fields["table:storage_options"]["account_name"],
"--config", "AZURE_STORAGE_ACCESS_TOKEN", asset.extra_fields["table:storage_options"]["credential"],
"-f", "PostgreSQL", connstring,
"/vsiadls/abfs://footprints/global/2022-06-14/ml-buildings.parquet/RegionName=Malaysia",
"-nln", f"{schema}.{tablename}",
"-sql",
f"SELECT geometry, RegionName, quadkey FROM {region}",
"-append",
"--config", "PG_USE_COPY", "YES"]
os.environ['AZURE_STORAGE_ACCOUNT'] = asset.extra_fields['table:storage_options']['account_name']
os.environ['AZURE_STORAGE_ACCESS_KEY'] = asset.extra_fields['table:storage_options']['credential']
subprocess.run(exp)
Error snippet:
* Connection #0 to host bingmlbuildings.dfs.core.windows.net left intact
ADLS: Got response_code=400
* Couldn't find host bingmlbuildings.dfs.core.windows.net in the (nil) file; using defaults
* Found bundle for host bingmlbuildings.dfs.core.windows.net: 0x40000f1a30 [serially]
* Can not multiplex, even if we wanted to!
* Re-using existing connection! (#0) with host bingmlbuildings.dfs.core.windows.net
* Connected to bingmlbuildings.dfs.core.windows.net (20.150.42.226) port 443 (#0)
> GET /abfs%3A?directory=%2Ffootprints%2Fglobal%2F2022-06-14%2Fml-buildings.parquet&maxresults=1000&recursive=false&resource=filesystem HTTP/1.1
Host: bingmlbuildings.dfs.core.windows.net
Accept: */*
x-ms-date: Thu, 03 Nov 2022 16:58:50 GMT
x-ms-version: 2019-12-12
Authorization: SharedKey bingmlbuildings:pBYJFXjZcwKHO0+qJwQ6qkb/+ae6YE7zhKfXlvZxFE4=
* Mark bundle as not supporting multiuse
< HTTP/1.1 400 The specifed resource name contains invalid characters.
< Content-Length: 191
< Content-Type: application/json;charset=utf-8
< Server: Windows-Azure-HDFS/1.0 Microsoft-HTTPAPI/2.0
< x-ms-error-code: InvalidResourceName
< x-ms-request-id: c9856b49-901f-0082-55a5-ef2182000000
< x-ms-version: 2019-12-12
< Access-Control-Expose-Headers: Content-Length,Content-Type,Date,Server,x-ms-error-code,x-ms-request-id,x-ms-version
< Access-Control-Allow-Origin: *
< Date: Thu, 03 Nov 2022 16:58:49 GMT
<
* Connection #0 to host bingmlbuildings.dfs.core.windows.net left intact
ADLS: {"error":{"code":"InvalidResourceName","message":"The specifed resource name contains invalid characters.\nRequestId:c9856b49-901f-0082-55a5-ef2182000000\nTime:2022-11-03T16:58:50.6453948Z"}}
FAILURE:
Unable to open datasource `/vsiadls/abfs://footprints/global/2022-06-14/ml-buildings.parquet/RegionName=Malaysia' with the following drivers.
I can print the ENV variables and see the Azure Account and Azure Token. According to ogr2ogr's documentation, it should pick this up via environment variables. I have also tried setting them with the 'export' command via bash, and get the same error.
I will note that I am using the latest development version of osgeo/gdal in a docker container because ogr2ogr doesn't support multiple parquet files in a directory before version 3.6.
I will also note that I did not submit this question to gis.stackexchange because I am unsure if the error lies with Azure being unable to process the url that's being sent, or, if ogr2ogr's virtual driver (/vsiadls/) is at fault.

Terraform plan with 1Password provider fails with rpc error unavailable desc transport is closing

After adding some new secrets to Terraform using the 1Password provider, we saw an error without much helpful output.
$ terraform plan
...
Error: rpc error: code = Unavailable desc = transport is closing
Error: rpc error: code = Canceled desc = context canceled
...
Terraform provider:
terraform {
required_providers {
onepassword = {
source = "anasinnyk/onepassword"
version = "~> 1.2.1"
}
}
required_version = "~> 0.13"
}
Terraform yml:
data "onepassword_item_password" "search_cloud_id" {
name = "Azure Elastic Cloud ID"
vault = data.onepassword_vault.vault_name.id
}
data "onepassword_item_password" "search_api_key" {
name = "Azure Elastic Cloud API key"
vault = data.onepassword_vault.vault_name.id
}
resource "kubernetes_secret" "search" {
metadata {
name = "search"
namespace = kubernetes_namespace.production.id
}
data = {
"ELASTICSEARCH_CLOUD_ID" = data.onepassword_item_password.api_search_cloud_id.password
"ELASTICSEARCH_API_KEY" = data.onepassword_item_password.api_search_api_key.password
}
type = "Opaque"
}
We managed to get some useful output by removing one data reference at a time, which lead to the errors printing:
panic: runtime error: invalid memory address or nil pointer dereference
2021-08-27T15:34:29.367+0930 [DEBUG] plugin.terraform-provider-onepassword_v1.2.1: [signal SIGSEGV: segmentation violation code=0x1 addr=0x18 pc=0x147d1bd]
2021-08-27T15:34:29.367+0930 [DEBUG] plugin.terraform-provider-onepassword_v1.2.1:
2021-08-27T15:34:29.367+0930 [DEBUG] plugin.terraform-provider-onepassword_v1.2.1: goroutine 194 [running]:
2021-08-27T15:34:29.367+0930 [DEBUG] plugin.terraform-provider-onepassword_v1.2.1: github.com/anasinnyk/terraform-provider-1password/onepassword.resourceItemPasswordRead(0x19418a0, 0xc0004ac540, 0xc000096f80, 0x173d040, 0xc0007ac740, 0xc0003bce40, 0xc000119910, 0x100c9b8)
2021-08-27T15:34:29.367+0930 [DEBUG] plugin.terraform-provider-onepassword_v1.2.1: github.com/anasinnyk/terraform-provider-1password/onepassword/resource_item_password.go:75 +0x18d
2021-08-27T15:34:29.367+0930 [DEBUG] plugin.terraform-provider-onepassword_v1.2.1: github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*Resource).read(0xc0004613f0, 0x1941820, 0xc000384300, 0xc000096f80, 0x173d040, 0xc0007ac740, 0x0, 0x0, 0x0)
2021-08-27T15:34:29.367+0930 [DEBUG] plugin.terraform-provider-onepassword_v1.2.1: github.com/hashicorp/terraform-plugin-sdk/v2#v2.0.0/helper/schema/resource.go:288 +0x1ec
2021-08-27T15:34:29.367+0930 [DEBUG] plugin.terraform-provider-onepassword_v1.2.1: github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*Resource).ReadDataApply(0xc0004613f0, 0x1941820, 0xc000384300, 0xc000304b80, 0x173d040, 0xc0007ac740, 0xc0007ac740, 0xc000304b80, 0x0, 0x0)
2021-08-27T15:34:29.367+0930 [DEBUG] plugin.terraform-provider-onepassword_v1.2.1: github.com/hashicorp/terraform-plugin-sdk/v2#v2.0.0/helper/schema/resource.go:489 +0xff
2021-08-27T15:34:29.367+0930 [DEBUG] plugin.terraform-provider-onepassword_v1.2.1: github.com/hashicorp/terraform-plugin-sdk/v2/internal/helper/plugin.(*GRPCProviderServer).ReadDataSource(0xc00026e6a0, 0x1941820, 0xc000384300, 0xc0003842c0, 0xc00026e6a0, 0xc00026e6b0, 0x185a058)
2021-08-27T15:34:29.367+0930 [DEBUG] plugin.terraform-provider-onepassword_v1.2.1: github.com/hashicorp/terraform-plugin-sdk/v2#v2.0.0/internal/helper/plugin/grpc_provider.go:1102 +0x4c5
2021-08-27T15:34:29.367+0930 [DEBUG] plugin.terraform-provider-onepassword_v1.2.1: github.com/hashicorp/terraform-plugin-sdk/v2/internal/tfplugin5._Provider_ReadDataSource_Handler.func1(0x1941820, 0xc000384300, 0x17dcd60, 0xc0003842c0, 0xc000384300, 0x1773c80, 0xc0004ac401, 0xc000304640)
2021-08-27T15:34:29.367+0930 [DEBUG] plugin.terraform-provider-onepassword_v1.2.1: github.com/hashicorp/terraform-plugin-sdk/v2#v2.0.0/internal/tfplugin5/tfplugin5.pb.go:3348 +0x86
2021-08-27T15:34:29.367+0930 [DEBUG] plugin.terraform-provider-onepassword_v1.2.1: github.com/hashicorp/terraform-plugin-sdk/v2/plugin.Serve.func3.1(0x19418e0, 0xc0003d4480, 0x17dcd60, 0xc0003842c0, 0xc000304620, 0xc000304640, 0xc0007c8ba0, 0x11b81c8, 0x17c7a20, 0xc0003d4480)
2021-08-27T15:34:29.367+0930 [DEBUG] plugin.terraform-provider-onepassword_v1.2.1: github.com/hashicorp/terraform-plugin-sdk/v2#v2.0.0/plugin/serve.go:76 +0x87
2021-08-27T15:34:29.367+0930 [DEBUG] plugin.terraform-provider-onepassword_v1.2.1: github.com/hashicorp/terraform-plugin-sdk/v2/internal/tfplugin5._Provider_ReadDataSource_Handler(0x17fdb60, 0xc00026e6a0, 0x19418e0, 0xc0003d4480, 0xc0004ac4e0, 0xc00000d080, 0x19418e0, 0xc0003d4480, 0xc000010090, 0x90)
2021-08-27T15:34:29.367+0930 [DEBUG] plugin.terraform-provider-onepassword_v1.2.1: github.com/hashicorp/terraform-plugin-sdk/v2#v2.0.0/internal/tfplugin5/tfplugin5.pb.go:3350 +0x14b
2021-08-27T15:34:29.367+0930 [DEBUG] plugin.terraform-provider-onepassword_v1.2.1: google.golang.org/grpc.(*Server).processUnaryRPC(0xc00027ae00, 0x1949c60, 0xc000103380, 0xc00018e000, 0xc00020acf0, 0x1e49910, 0x0, 0x0, 0x0)
2021-08-27T15:34:29.367+0930 [DEBUG] plugin.terraform-provider-onepassword_v1.2.1: google.golang.org/grpc#v1.30.0/server.go:1171 +0x50a
2021-08-27T15:34:29.367+0930 [DEBUG] plugin.terraform-provider-onepassword_v1.2.1: google.golang.org/grpc.(*Server).handleStream(0xc00027ae00, 0x1949c60, 0xc000103380, 0xc00018e000, 0x0)
2021-08-27T15:34:29.367+0930 [DEBUG] plugin.terraform-provider-onepassword_v1.2.1: google.golang.org/grpc#v1.30.0/server.go:1494 +0xccd
2021-08-27T15:34:29.367+0930 [DEBUG] plugin.terraform-provider-onepassword_v1.2.1: google.golang.org/grpc.(*Server).serveStreams.func1.2(0xc0000382e0, 0xc00027ae00, 0x1949c60, 0xc000103380, 0xc00018e000)
2021-08-27T15:34:29.367+0930 [DEBUG] plugin.terraform-provider-onepassword_v1.2.1: google.golang.org/grpc#v1.30.0/server.go:834 +0xa1
2021-08-27T15:34:29.367+0930 [DEBUG] plugin.terraform-provider-onepassword_v1.2.1: created by google.golang.org/grpc.(*Server).serveStreams.func1
2021-08-27T15:34:29.367+0930 [DEBUG] plugin.terraform-provider-onepassword_v1.2.1: google.golang.org/grpc#v1.30.0/server.go:832 +0x204
2021-08-27T15:34:29.368+0930 [WARN] plugin.stdio: received EOF, stopping recv loop: err="rpc error: code = Unavailable desc = transport is closing"
2021/08/27 15:34:29 [ERROR] eval: *terraform.evalReadDataRefresh, err: rpc error: code = Unavailable desc = transport is closing
2021/08/27 15:34:29 [ERROR] eval: *terraform.evalReadDataRefresh, err: rpc error: code = Unavailable desc = transport is closing
2021/08/27 15:34:29 [ERROR] eval: *terraform.evalReadDataRefresh, err: rpc error: code = Unavailable desc = transport is closing
2021/08/27 15:34:29 [ERROR] eval: *terraform.EvalSequence, err: rpc error: code = Unavailable desc = transport is closing
2021-08-27T15:34:29.369+0930 [DEBUG] plugin: plugin process exited: path=.terraform/plugins/registry.terraform.io/anasinnyk/onepassword/1.2.1/darwin_amd64/terraform-provider-onepassword_v1.2.1 pid=17549 error="exit status 2"
2021/08/27 15:34:29 [ERROR] eval: *terraform.EvalSequence, err: rpc error: code = Unavailable desc = transport is closing
2021/08/27 15:34:29 [TRACE] [walkRefresh] Exiting eval tree: data.onepassword_item_password.search_api_key
2021/08/27 15:34:29 [ERROR] eval: *terraform.EvalSequence, err: rpc error: code = Unavailable desc = transport is closing
2021/08/27 15:34:29 [TRACE] vertex "data.onepassword_item_password.search_api_key": visit complete
2021/08/27 15:34:29 [TRACE] vertex "data.onepassword_item_password.search_api_key": dynamic subgraph encountered errors
2021/08/27 15:34:29 [TRACE] vertex "data.onepassword_item_password.search_api_key": visit complete
2021/08/27 15:34:29 [TRACE] vertex "data.onepassword_item_password.search_api_key (expand)": dynamic subgraph encountered errors
2021/08/27 15:34:29 [TRACE] vertex "data.onepassword_item_password.search_api_key (expand)": visit complete
2021/08/27 15:34:29 [TRACE] dag/walk: upstream of "provider[\"registry.terraform.io/hashicorp/kubernetes\"] (close)" errored, so skipping
2021/08/27 15:34:29 [TRACE] dag/walk: upstream of "provider[\"registry.terraform.io/anasinnyk/onepassword\"] (close)" errored, so skipping
2021/08/27 15:34:29 [TRACE] dag/walk: upstream of "root" errored, so skipping
2021-08-27T15:34:29.501+0930 [DEBUG] plugin: plugin exited
2021-08-27T15:34:29.502+0930 [WARN] plugin.stdio: received EOF, stopping recv loop: err="rpc error: code = Unavailable desc = transport is closing"
2021-08-27T15:34:29.507+0930 [DEBUG] plugin: plugin process exited: path=.terraform/plugins/registry.terraform.io/hashicorp/kubernetes/1.13.3/darwin_amd64/terraform-provider-kubernetes_v1.13.3_x4 pid=17673
2021-08-27T15:34:29.507+0930 [DEBUG] plugin: plugin exited
!!!!!!!!!!!!!!!!!!!!!!!!!!! TERRAFORM CRASH !!!!!!!!!!!!!!!!!!!!!!!!!!!!
Terraform crashed! This is always indicative of a bug within Terraform.
A crash log has been placed at "crash.log" relative to your current
working directory. It would be immensely helpful if you could please
report the crash with Terraform[1] so that we can fix this.
When reporting bugs, please include your terraform version. That
information is available on the first line of crash.log. You can also
get it by running 'terraform --version' on the command line.
SECURITY WARNING: the "crash.log" file that was created may contain
sensitive information that must be redacted before it is safe to share
on the issue tracker.
[1]: https://github.com/hashicorp/terraform/issues
!!!!!!!!!!!!!!!!!!!!!!!!!!! TERRAFORM CRASH !!!!!!!!!!!!!!!!!!!!!!!!!!!!
This led us to find that one of our team members managed to create two 1Password entries with the same name in the same vault.
After deleting the duplicate entry in 1Password, terraform plan ran without error again.

can az cli command automatically retry in case of http error 429

I have observed that az command prints http headers only if --debug flag is passed to it.
E.g.
az storage account list --debug
and headers are printed to stderr and stdout contains nothing.
In case of HTTP 429, too many errors errors, guidance is to retry after interval mentioned in Retry-After response header.
Is there any mechanism that can make az cli automatically retry the API in case of HTTP 429 error?
Edit -- Retries built into az command
urllib3.util.retry : Incremented Retry for (url='/subscriptions/REMOVED/providers/Microsoft.Storage/storageAccounts?api-version=2019-06-01'): Retry(total=3, connect=4, read=4, redirect=None, status=None)
urllib3.util.retry : Incremented Retry for (url='/subscriptions/REMOVED/providers/Microsoft.Storage/storageAccounts?api-version=2019-06-01'): Retry(total=2, connect=4, read=4, redirect=None, status=None)
urllib3.util.retry : Incremented Retry for (url='/subscriptions/REMOVED/providers/Microsoft.Storage/storageAccounts?api-version=2019-06-01'): Retry(total=1, connect=4, read=4, redirect=None, status=None)
urllib3.util.retry : Incremented Retry for (url='/subscriptions/REMOVED/providers/Microsoft.Storage/storageAccounts?api-version=2019-06-01'): Retry(total=0, connect=4, read=4, redirect=None, status=None)
Base on the responses received so far, answer is "No" and that caller must run az command with --debug option and parse stderr. Here is sample Groovy code.
def pat = /'Retry-After': '(\d+)'/
stderr.split("\n").each { line ->
def m = line =~ pat
if (m.size() > 0 && m.hasGroup()) {
retryAfterDuration = Integer.parseInt(m[0][1])
println("Found Retry-After header, value = ${retryAfterDuration}")
}
}
Here is sample response.
msrest.http_logger : Response status: 429
msrest.http_logger : Response headers:
msrest.http_logger : 'Cache-Control': 'no-cache'
msrest.http_logger : 'Pragma': 'no-cache'
msrest.http_logger : 'Content-Length': '207'
msrest.http_logger : 'Content-Type': 'application/json'
msrest.http_logger : 'Expires': '-1'
msrest.http_logger : 'Retry-After': '17'
msrest.http_logger : 'x-ms-request-id': 'c7102dca-4bb1-4d24-8333-0128b8b85b24'
msrest.http_logger : 'Strict-Transport-Security': 'max-age=31536000; includeSubDomains'
msrest.http_logger : 'Server': 'Microsoft-Azure-Storage-Resource-Provider/1.0,Microsoft-HTTPAPI/2.0 Microsoft-HTTPAPI/2.0'
msrest.http_logger : 'x-ms-ratelimit-remaining-subscription-reads': '11989'
msrest.http_logger : 'x-ms-correlation-request-id': '3a7ba2e1-6908-414b-b162-d6f41dc10521'
msrest.http_logger : 'x-ms-routing-request-id': 'EASTUS:20200830T234133Z:3a7ba2e1-6908-414b-b162-d6f41dc10521'
msrest.http_logger : 'X-Content-Type-Options': 'nosniff'
msrest.http_logger : 'Date': 'Sun, 30 Aug 2020 23:41:32 GMT'
msrest.http_logger : 'Connection': 'close'
msrest.http_logger : Response content:
msrest.http_logger : {"error":{"code":"TooManyRequests","message":"The request is being throttled as the limit has been reached for operation type - List_PerHour. For more information, see - https://aka.ms/srpthrottlinglimits"}}
msrest.exceptions : The request is being throttled as the limit has been reached for operation type - List_PerHour. For more information, see - https://aka.ms/srpthrottlinglimits

Panic when querying the chaincode to fabric-sdk-go

I'm trying to figure out how fabric-sdk-go works.
I created a connection with hyperledger, installed chaincode, but when I try to execute the request for some reason I get an error.
My function:
response, err := setup.client.Query(channel.Request{ChaincodeID: setup.ChainCodeID, Fcn: "invoke", Args: [][]byte{[]byte("query"), []byte("hello")}})
And the output log:
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x8 pc=0x9384f0]
goroutine 1 [running]:
github.com/hyperledger/fabric-sdk-go/pkg/client/channel.(*Client).Query(0x0, 0xce8db5, 0x5, 0xce9c7d, 0x6, 0xc0001b1bd0, 0x3, 0x3, 0x0, 0x0, ...)
/home/batazor/.gvm/pkgsets/go1.12/global/pkg/mod/github.com/hyperledger/fabric-sdk-go#v1.0.0-alpha5/pkg/client/channel/chclient.go:97 +0xc0
main.(*FabricSetup).QueryHello(0xc000171eb0, 0x0, 0x0, 0x28, 0xc0001b0460)
/home/batazor/.gvm/pkgsets/go1.12/global/src/github.com/batazor/hyperledger-fabric/cmd/hyperledger-fabric/example.go:10 +0x217
main.main()
/home/batazor/.gvm/pkgsets/go1.12/global/src/github.com/batazor/hyperledger-fabric/cmd/hyperledger-fabric/main.go:43 +0x143
P.S. My chaincode -> https://github.com/batazor/hyperledger-fabric/blob/master/chaincode/hello/go/hello.go
I skipped the channel connection setup step
https://github.com/chainHero/heroes-service/blob/master/blockchain/setup.go#L93-L136

Generating signed XPI via jpm failed

There was a problem signing an Add-On via jpm: The command
jpm -v sign --api-key 'user:xxxxxxxx:xxx' --api-secret xxxxxxxxxxxxxxxxxxxxxxxxx
failed with the error message
Error: Received bad response from the server while requesting https://addons.mozilla.org/api/v3/addons/%40addonname/versions/0.x.y/
Signing via the web interface worked.
How can this be fixed?
The full verbose output is
JPM [info] binary set to /usr/bin/firefox
JPM [info] verbose set
JPM [info] Checking compatability bootstrap.js and install.rdf for xpi
Validating the manifest
JPM [info] Creating fallbacks if they are necessary..
Creating XPI
JPM [info] Creating XPI...
JPM [info] .jpmignore found
JPM [info] Adding: /path/to/file
[...]
JPM [info] Adding: /path/to/another_file
JPM [info] XPI created at /tmp/tmp-unsigned-xpi-25600yuqzFN3Alxa0/#addonname-0.x.y.xpi (121ms)
JPM [info] Removing fallbacks if they were necessary..
JPM [info] Creating updateRDF...
Created XPI at /tmp/tmp-unsigned-xpi-25600yuqzFN3Alxa0/#addonname-0.x.y.xpi
JPM [info] Created XPI for signing: /tmp/tmp-unsigned-xpi-25600yuqzFN3Alxa0/#addonname-0.x.y.xpi
JPM [debug] [API] -{ url: 'https://addons.mozilla.org/api/v3/addons/%40addonname/versions/0.x.y/',
formData:
{ upload:
{ _readableState: [Object],
readable: true,
domain: null,
_events: [Object],
_eventsCount: 1,
_maxListeners: undefined,
path: '/tmp/tmp-unsigned-xpi-25600yuqzFN3Alxa0/#addonname-0.x.y.xpi',
fd: null,
flags: 'r',
mode: 438,
start: undefined,
end: undefined,
autoClose: true,
pos: undefined } },
headers: { Authorization: '<REDACTED>', Accept: 'application/json' } }
JPM [debug] [API] <- { headers:
{ allow: 'GET, PUT, HEAD, OPTIONS',
'content-type': 'application/json',
date: 'Thu, 17 Dec 2015 10:17:23 GMT',
server: 'nginx',
'set-cookie': '<REDACTED>',
'strict-transport-security': 'max-age=31536000',
vary: 'Accept, X-Mobile, User-Agent',
'www-authenticate': 'JWT realm="api"',
'x-frame-options': 'DENY',
'content-length': '51',
connection: 'Close' },
response: { detail: 'Incorrect authentication credentials.' } }
JPM [error] FAIL
Error: Received bad response from the server while requesting https://addons.mozilla.org/api/v3/addons/%40addonname/versions/0.x.y/
status: 401
response: {"detail":"Incorrect authentication credentials."}
headers: {"allow":"GET, PUT, HEAD, OPTIONS","content-type":"application/json","date":"Thu, 17 Dec 2015 10:17:23 GMT","server":"nginx","set-cookie":["multidb_pin_writes=y; expires=Thu, 17-Dec-2015 10:17:38 GMT; Max-Age=15; Path=/"],"strict-transport-security":"max-age=31536000","vary":"Accept, X-Mobile, User-Agent","www-authenticate":"JWT realm=\"api\"","x-frame-options":"DENY","content-length":"51","connection":"Close"}
at /usr/local/lib/node_modules/jpm/lib/amo-client.js:85:13
at tryCatchReject (/usr/local/lib/node_modules/jpm/node_modules/when/lib/makePromise.js:845:30)
at runContinuation1 (/usr/local/lib/node_modules/jpm/node_modules/when/lib/makePromise.js:804:4)
at Fulfilled.when (/usr/local/lib/node_modules/jpm/node_modules/when/lib/makePromise.js:592:4)
at Pending.run (/usr/local/lib/node_modules/jpm/node_modules/when/lib/makePromise.js:483:13)
at Scheduler._drain (/usr/local/lib/node_modules/jpm/node_modules/when/lib/Scheduler.js:62:19)
at Scheduler.drain (/usr/local/lib/node_modules/jpm/node_modules/when/lib/Scheduler.js:27:9)
at doNTCallback0 (node.js:417:9)
at process._tickCallback (node.js:346:13)
These posts (1), (2) show that this error can occur if your local clock is off by more than 60 seconds with the Mozilla server.
This is also documented in the Olympia 3.0 Authentication API (see exp parameter):
iat
This is a standard JWT claim indicating the issued at time. It should be a Unix epoch timestamp and must be in UTC time.
exp
This is a standard JWT claim indicating the expiration time. It should be a Unix epoch timestamp in UTC time and must be no longer
than 60 seconds past the issued at time.
Note:
If you’re having trouble authenticating, make sure your system clock
is correct and consider synchronizing it with something like NTP
(Network Time Protocol).

Resources