CLI, wsk property get results in runtime error: index out of range Application exited unexpectedly error
- Lenguaje dominante
- Go
- Estrellas
- 109
- Forks
- 98
- Métricas de merge de PR
- Sin PR fusionados en 30 d
Descripción
Both the wsk version from brew install wsk and the latest wsk from the releases.
I have been trying to install wsk and configure to start experimenting with the framework locally.
However, I'm running into a major issue.
After setting apihost and auth, I wanted to see if they were set correctly so I run the command:
`wsk property get`
and the output I get is this
```
runtime error: index out of range
Application exited unexpectedly
```
I tried removing ~/.wskprops file, reinstalling wsk but I still get the same error.
This is the output of `wsk property get --debug`:
```
[(*Client).LoadX509KeyPair]:210:[Wrn] The Cert file is not configured. Please configure the missing Cert file, if there is a security issue accessing the service.
[(*Client).LoadX509KeyPair]:219:[Wrn] The Key file is not configured. Please configure the missing Key file, if there is a security issue accessing the service.
whisk API host http://127.0.0.1:8080
whisk auth james
[k.(*Client).addAuthHeader]:334:[Inf] Adding basic auth header; using authkey
REQUEST:
[GET] http://127.0.0.1:8080/api/v1/namespaces
Req Headers
{
"Authorization": [
"Basic amFtZXM="
],
"User-Agent": [
"OpenWhisk-CLI/1.0 (2020-05-04T04:29:27.788+0000) darwin amd64"
]
}
RESPONSE:Got response with code 200
Resp Headers
{
"Cache-Control": [
"no-cache, private"
],
"Content-Length": [
"2113"
],
"Content-Type": [
"application/json"
],
"Date": [
"Wed, 17 Jun 2020 23:35:49 GMT"
]
}
Response body size is 2113 bytes
Response body received:
{"kind":"NamespaceList","apiVersion":"v1","metadata":{"selfLink":"/api/v1/namespaces","resourceVersion":"497993"},"items":[{"metadata":{"name":"default","selfLink":"/api/v1/namespaces/default","uid":"be7bcfde-ce06-47c2-a4d8-1cf36bf911bf","resourceVersion":"145","creationTimestamp":"2020-06-03T23:22:20Z"},"spec":{"finalizers":["kubernetes"]},"status":{"phase":"Active"}},{"metadata":{"name":"docker","selfLink":"/api/v1/namespaces/docker","uid":"63a17d15-39fa-47ad-979d-303c9aff492f","resourceVersion":"483","creationTimestamp":"2020-06-03T23:23:34Z"},"spec":{"finalizers":["kubernetes"]},"status":{"phase":"Active"}},{"metadata":{"name":"kube-node-lease","selfLink":"/api/v1/namespaces/kube-node-lease","uid":"95c6ba59-7297-4562-98cf-09bba6008d79","resourceVersion":"36","creationTimestamp":"2020-06-03T23:22:18Z"},"spec":{"finalizers":["kubernetes"]},"status":{"phase":"Active"}},{"metadata":{"name":"kube-public","selfLink":"/api/v1/namespaces/kube-public","uid":"f3ffee51-a93a-47fb-935e-62ac86fb151f","resourceVersion":"35","creationTimestamp":"2020-06-03T23:22:18Z"},"spec":{"finalizers":["kubernetes"]},"status":{"phase":"Active"}},{"metadata":{"name":"kube-system","selfLink":"/api/v1/namespaces/kube-system","uid":"41d28d3b-3e56-4df8-94d8-fb2846843c02","resourceVersion":"32","creationTimestamp":"2020-06-03T23:22:18Z"},"spec":{"finalizers":["kubernetes"]},"status":{"phase":"Active"}},{"metadata":{"name":"kubeless","selfLink":"/api/v1/namespaces/kubeless","uid":"89ea767e-8d5d-4d6b-b0b4-3a8108e2ed14","resourceVersion":"1779","creationTimestamp":"2020-06-03T23:35:28Z"},"spec":{"finalizers":["kubernetes"]},"status":{"phase":"Active"}},{"metadata":{"name":"kubernetes-dashboard","selfLink":"/api/v1/namespaces/kubernetes-dashboard","uid":"7b8fe8c1-e578-406e-acbb-85f692b1fe52","resourceVersion":"291845","creationTimestamp":"2020-06-08T14:27:29Z","annotations":{"kubectl.kubernetes.io/last-applied-configuration":"{\"apiVersion\":\"v1\",\"kind\":\"Namespace\",\"metadata\":{\"annotations\":{},\"name\":\"kubernetes-dashboard\"}}\n"}},"spec":{"finalizers":["kubernetes"]},"status":{"phase":"Active"}}]}
[o/whisk.PrintResponseInfo]:535:[Inf] Response body received (ASCII quoted string):
"{\"kind\":\"NamespaceList\",\"apiVersion\":\"v1\",\"metadata\":{\"selfLink\":\"/api/v1/namespaces\",\"resourceVersion\":\"497993\"},\"items\":[{\"metadata\":{\"name\":\"default\",\"selfLink\":\"/api/v1/namespaces/default\",\"uid\":\"be7bcfde-ce06-47c2-a4d8-1cf36bf911bf\",\"resourceVersion\":\"145\",\"creationTimestamp\":\"2020-06-03T23:22:20Z\"},\"spec\":{\"finalizers\":[\"kubernetes\"]},\"status\":{\"phase\":\"Active\"}},{\"metadata\":{\"name\":\"docker\",\"selfLink\":\"/api/v1/namespaces/docker\",\"uid\":\"63a17d15-39fa-47ad-979d-303c9aff492f\",\"resourceVersion\":\"483\",\"creationTimestamp\":\"2020-06-03T23:23:34Z\"},\"spec\":{\"finalizers\":[\"kubernetes\"]},\"status\":{\"phase\":\"Active\"}},{\"metadata\":{\"name\":\"kube-node-lease\",\"selfLink\":\"/api/v1/namespaces/kube-node-lease\",\"uid\":\"95c6ba59-7297-4562-98cf-09bba6008d79\",\"resourceVersion\":\"36\",\"creationTimestamp\":\"2020-06-03T23:22:18Z\"},\"spec\":{\"finalizers\":[\"kubernetes\"]},\"status\":{\"phase\":\"Active\"}},{\"metadata\":{\"name\":\"kube-public\",\"selfLink\":\"/api/v1/namespaces/kube-public\",\"uid\":\"f3ffee51-a93a-47fb-935e-62ac86fb151f\",\"resourceVersion\":\"35\",\"creationTimestamp\":\"2020-06-03T23:22:18Z\"},\"spec\":{\"finalizers\":[\"kubernetes\"]},\"status\":{\"phase\":\"Active\"}},{\"metadata\":{\"name\":\"kube-system\",\"selfLink\":\"/api/v1/namespaces/kube-system\",\"uid\":\"41d28d3b-3e56-4df8-94d8-fb2846843c02\",\"resourceVersion\":\"32\",\"creationTimestamp\":\"2020-06-03T23:22:18Z\"},\"spec\":{\"finalizers\":[\"kubernetes\"]},\"status\":{\"phase\":\"Active\"}},{\"metadata\":{\"name\":\"kubeless\",\"selfLink\":\"/api/v1/namespaces/kubeless\",\"uid\":\"89ea767e-8d5d-4d6b-b0b4-3a8108e2ed14\",\"resourceVersion\":\"1779\",\"creationTimestamp\":\"2020-06-03T23:35:28Z\"},\"spec\":{\"finalizers\":[\"kubernetes\"]},\"status\":{\"phase\":\"Active\"}},{\"metadata\":{\"name\":\"kubernetes-dashboard\",\"selfLink\":\"/api/v1/namespaces/kubernetes-dashboard\",\"uid\":\"7b8fe8c1-e578-406e-acbb-85f692b1fe52\",\"resourceVersion\":\"291845\",\"creationTimestamp\":\"2020-06-08T14:27:29Z\",\"annotations\":{\"kubectl.kubernetes.io/last-applied-configuration\":\"{\\\"apiVersion\\\":\\\"v1\\\",\\\"kind\\\":\\\"Namespace\\\",\\\"metadata\\\":{\\\"annotations\\\":{},\\\"name\\\":\\\"kubernetes-dashboard\\\"}}\\n\"}},\"spec\":{\"finalizers\":[\"kubernetes\"]},\"status\":{\"phase\":\"Active\"}}]}\n"
[hisk.parseSuccessResponse]:619:[Inf] Parsing HTTP response into struct type: *[]string
[hisk.parseSuccessResponse]:631:[Wrn] Unsuccessful parse of HTTP response into struct type: *[]string; parse error 'json: cannot unmarshal object into Go value of type []string'
[hisk.parseSuccessResponse]:632:[Wrn] Request was successful, so ignoring the following unexpected response body that could not be parsed: {"kind":"NamespaceList","apiVersion":"v1","metadata":{"selfLink":"/api/v1/namespaces","resourceVersion":"497993"},"items":[{"metadata":{"name":"default","selfLink":"/api/v1/namespaces/default","uid":"be7bcfde-ce06-47c2-a4d8-1cf36bf911bf","resourceVersion":"145","creationTimestamp":"2020-06-03T23:22:20Z"},"spec":{"finalizers":["kubernetes"]},"status":{"phase":"Active"}},{"metadata":{"name":"docker","selfLink":"/api/v1/namespaces/docker","uid":"63a17d15-39fa-47ad-979d-303c9aff492f","resourceVersion":"483","creationTimestamp":"2020-06-03T23:23:34Z"},"spec":{"finalizers":["kubernetes"]},"status":{"phase":"Active"}},{"metadata":{"name":"kube-node-lease","selfLink":"/api/v1/namespaces/kube-node-lease","uid":"95c6ba59-7297-4562-98cf-09bba6008d79","resourceVersion":"36","creationTimestamp":"2020-06-03T23:22:18Z"},"spec":{"finalizers":["kubernetes"]},"status":{"phase":"Active"}},{"metadata":{"name":"kube-public","selfLink":"/api/v1/namespaces/kube-public","uid":"f3ffee51-a93a-47fb-935e-62ac86fb151f","resourceVersion":"35","creationTimestamp":"2020-06-03T23:22:18Z"},"spec":{"finalizers":["kubernetes"]},"status":{"phase":"Active"}},{"metadata":{"name":"kube-system","selfLink":"/api/v1/namespaces/kube-system","uid":"41d28d3b-3e56-4df8-94d8-fb2846843c02","resourceVersion":"32","creationTimestamp":"2020-06-03T23:22:18Z"},"spec":{"finalizers":["kubernetes"]},"status":{"phase":"Active"}},{"metadata":{"name":"kubeless","selfLink":"/api/v1/namespaces/kubeless","uid":"89ea767e-8d5d-4d6b-b0b4-3a8108e2ed14","resourceVersion":"1779","creationTimestamp":"2020-06-03T23:35:28Z"},"spec":{"finalizers":["kubernetes"]},"status":{"phase":"Active"}},{"metadata":{"name":"kubernetes-dashboard","selfLink":"/api/v1/namespaces/kubernetes-dashboard","uid":"7b8fe8c1-e578-406e-acbb-85f692b1fe52","resourceVersion":"291845","creationTimestamp":"2020-06-08T14:27:29Z","annotations":{"kubectl.kubernetes.io/last-applied-configuration":"{\"apiVersion\":\"v1\",\"kind\":\"Namespace\",\"metadata\":{\"annotations\":{},\"name\":\"kubernetes-dashboard\"}}\n"}},"spec":{"finalizers":["kubernetes"]},"status":{"phase":"Active"}}]}
[.(*NamespaceService).List]:094:[Inf] Returning []namespaces: []whisk.Namespace(nil)
[cli/commands.getNamespace]:561:[Err] Client.Namespaces.List() failed: %!s()
runtime error: index out of range
Application exited unexpectedly
```
On the documentation webpage (https://openwhisk.apache.org/documentation.html), it tells me to also have the --namespace argument but I get unknown flag: --namespace so I asked on the openwhisk slack channel and someone told me to drop the --namespace flag since it is not used anymore. However, towards the end of the debug message output, it seems like there is no namespace set and I'm not sure how to fix that problem.
Could I get some help?
Guía de contribución
Línea de trabajo
Empieza por cli/commands.getNamespace y NamespaceService.List, y después inspecciona el análisis de la respuesta indicado por whisk.parseSuccessResponse. Reproduce el problema con `wsk property get --debug` usando la respuesta de namespace mostrada y sigue el motivo por el que la solicitud correcta no devuelve ningún namespace. Se considera terminado cuando el comando gestiona esta respuesta sin un panic en tiempo de ejecución e informa de las propiedades configuradas.
Escrito por el modelo de indexación a partir del texto del issue.
Evaluación
- Stack tecnológico
- go
- Área
- backend, cli
- Tipo de issue
- Error
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Estado de actividad
- Estancado
- Claridad
- Bastante claro
- Aptitud para principiantes
- 35/100