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

Create a troubleshooting guide for Application Connector #5312

Merged
merged 34 commits into from
Aug 27, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
cc15a56
Create application connector troubleshooting overview and application…
Aug 13, 2019
4690060
Fix file name
Aug 13, 2019
6f4ce85
Fix missing indent
Aug 13, 2019
1da031c
Fix missing newline
Aug 13, 2019
5561615
.
Aug 13, 2019
7d97ae7
troubleshooting
Aug 13, 2019
e86301b
troubleshooting
Aug 13, 2019
3210cde
troubleshooting
Aug 13, 2019
8bd98c0
troubleshooting
Aug 13, 2019
f314d30
troubleshooting
Aug 13, 2019
da6e324
troubleshooting
Aug 13, 2019
42e2b7a
Minor formatting fixes
Aug 13, 2019
b89f34f
created application registry troubleshooting draft
Aug 13, 2019
bdf9ff4
Update application registry troubleshooting; \n Create connector serv…
Aug 13, 2019
7d56798
Minor formatting fixes
Aug 13, 2019
659c28d
Minor rephrasing
Aug 13, 2019
e03d230
Remove a comment line
majakurcius Aug 13, 2019
62d9cf1
Apply minor fixes from code review
majakurcius Aug 19, 2019
98ddb19
Apply changes as per review suggestions
Aug 19, 2019
5f53441
Clarify target URL
Aug 19, 2019
321e550
Clarify target URL
Aug 19, 2019
0a4fdaf
Clarified Access Service;\n Rephrased file titles as per suggestions;…
Aug 20, 2019
f91e3e2
Update docs/application-connector/10-04-connector-service-troubleshoo…
majakurcius Aug 20, 2019
1b5435e
Update docs/application-connector/10-04-connector-service-troubleshoo…
majakurcius Aug 20, 2019
92e6e33
Update docs/application-connector/10-04-connector-service-troubleshoo…
majakurcius Aug 20, 2019
18e9cd9
Fixed the title; \n While -> When; \n Fixed 'may'
Aug 20, 2019
502d2a2
Apply review suggestions
Aug 21, 2019
d5f0c65
Apply suggestions from code review
majakurcius Aug 26, 2019
7756d12
Update docs/application-connector/10-02-application-gateway-troublesh…
majakurcius Aug 26, 2019
f58fd19
Service re-registration recreates Access Service, 10-02, line 42
Aug 26, 2019
6c6f609
Minor changes per review suggestions
Aug 27, 2019
54c4698
Restructured App Gateway Troubleshooting as per review suggestions
Aug 27, 2019
9c9e371
Restructure App Gateway Troubleshooting as per review suggestions
Aug 27, 2019
130c047
Apply suggestions from code review
majakurcius Aug 27, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions docs/application-connector/10-01-overview.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
title: Overview
type: Troubleshooting
---

The troubleshooting section aims to identify the most common recurring problems with the Application Connector, as well as the most suitable solutions to these problems.

If you cannot find a solution to your problem, do not hesitate to create a [GitHub](https://github.com/kyma-project/kyma/issues) issue or reach out to the **#application-connector** [Slack channel](http://slack.kyma-project.io/) to get direct support from the community.
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
---
title: Error when calling a registered service
type: Troubleshooting
---

If you call a registered service and receive an error, follow these steps to detect the source of the problem:


1. Check the logs

Check the logs from Application Gateway Pod to verify that the call reached Application Gateway.
To fetch these logs, run this command:
```
kubectl -n kyma-integration logs -l app={APP_NAME}-application-gateway -c {APP_NAME}-application-gateway
```
The request that reached the Pod is logged by Application Gateway.

2. Check for Access Service

If the call you tried to make is not in the logs, check if an [Access Service](#architecture-application-connector-components-access-service) exists for the service you are trying to call.
```
kubectl -n kyma-integration get svc app-{APP_NAME}-{SERVICE_ID}
```
3. Re-register the service

If Access Service does not exist, run this command to deregister the service you tried to call:

<div tabs name="deregistration">
<details>
<summary>
With a trusted certificate
</summary>

```
curl -X DELETE https://gateway.{CLUSTER_DOMAIN}/{APP_NAME}/v1/metadata/services/{SERVICE_ID} --cert {CERTIFICATE_FILE} --key {KEY_FILE}
```
</details>
<details>
<summary>
Without a trusted certificate
</summary>

```
curl -X DELETE https://gateway.{CLUSTER_DOMAIN}/{APP_NAME}/v1/metadata/services/{SERVICE_ID} --cert {CERTIFICATE_FILE} --key {KEY_FILE} -k
```
</details>
</div>

Then, register the service and try calling again. Registering the service again recreates the Access Service.
To register a service, see [this tutorial](components/application-connector/#tutorials-register-a-service-register-a-service).


4. Check the API URL

If your call reaches the Application Gateway and the Access Service exists, but you still receive an error, check if the API URL in the service definition matches the API URL of the actual service you are trying to call.
To check the target URL of the API, fetch the Service definition from Application Registry:

<div tabs name="verification">
<details>
<summary>
With a trusted certificate
</summary>

```
curl https://gateway.{CLUSTER_DOMAIN}/{APP_NAME}/v1/metadata/services/{SERVICE_ID} --cert {CERTIFICATE_FILE} --key {KEY_FILE}
```
</details>
<details>
<summary>
Without a trusted certificate
</summary>

```
curl https://gateway.{CLUSTER_DOMAIN}/{APP_NAME}/v1/metadata/services/{SERVICE_ID} --cert {CERTIFICATE_FILE} --key {KEY_FILE} -k
```
</details>
</div>

A successful call returns a `json` response with the service definition that contains the target URL.
Call the target URL directly to verify that the value of `api.targetUrl` is correct.
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
---
title: Certificate-related errors when trying to access Application Registry
type: Troubleshooting
---

## Application Registry - No certificate

If you try to access Application Registry without a client certificate, you get this error:
```
error:1401E410:SSL routines:CONNECT_CR_FINISHED:sslv3 alert handshake failure
```
To access Application Registry you need to pass a client certificate with the HTTP request.
To generate a client certificate, see [this tutorial](#tutorials-get-the-client-certificate).

## Application Registry - Expired certificate

If you try to access Application Registry using an expired client certificate, you get this error:
```
error:1401E415:SSL routines:CONNECT_CR_FINISHED:sslv3 alert certificate expired
```
To access Application Registry you need to pass a valid client certificate with the request.
To generate a new client certificate, see [this tutorial](#tutorials-get-the-client-certificate).

## Application Registry - Invalid subject

If you try to access Application Registry with the wrong certificate, you get this error:
```
{"code":403,"error":"No valid subject found"}
```
Make sure that your certificate is generated for the Application that you are trying to access.
majakurcius marked this conversation as resolved.
Show resolved Hide resolved
To get the certificate subject, run:
```
openssl req -noout -subject -in {PATH_TO_CSR_FILE}
```
You get the certificate subject as a response:
```
subject=/OU=OrgUnit/O=Organization/L=Waldorf/ST=Waldorf/C=DE/CN={APPLICATION_NAME}
```
Check that the common name `CN` matches the name of your Application.
If it does not, generate a new certificate for your Application.

To generate a new client certificate, see [this tutorial](#tutorials-get-the-client-certificate).
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
---
title: Errors when generating or renewing a certificate
type: Troubleshooting
---

## Invalid Certificate Signing Request (CSR)

If you try to generate a client certificate, you may get this error:
```json
{
"code":403,
"error":"CSR: Invalid common name provided."
}
```

This error is caused by applying wrong subject information to your Certificate Signing Request.
To ensure CSR was generated properly, check the values returned by the Connector Service with the call that fetched CSR information:
```json
{
...
majakurcius marked this conversation as resolved.
Show resolved Hide resolved
"certificate":{
"subject":"O=Organization,OU=OrgUnit,L=Waldorf,ST=Waldorf,C=DE,CN=CNAME",
majakurcius marked this conversation as resolved.
Show resolved Hide resolved
"extensions":"",
"key-algorithm":"rsa2048"
}
}
```

Subject values present in CSR should match the subject in the response that you got.

To check the subject of the generated CSR, run this command:
```
openssl req -noout -subject -in {PATH_TO_CSR_FILE}
```
80 changes: 80 additions & 0 deletions docs/application-connector/tmp.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
---
title: Error when calling a registered service
type: Troubleshooting
---

If you call a registered service and receive an error, follow these steps to detect the source of the problem.


1. Check the logs

Check the logs from Application Gateway Pod to verify that the call reached Application Gateway.
To fetch these logs, run this command:
```
kubectl -n kyma-integration logs -l app={APP_NAME}-application-gateway -c {APP_NAME}-application-gateway
```
The request that reached the Pod is logged by Application Gateway.

2. Check for Access Service

If the call you tried to make is not in the logs, check if [Access Service](components/application-connector/#architecture-application-connector-components-access-service) for the service you are trying to call exists.
```
kubectl -n kyma-integration get svc app-{APP_NAME}-{SERVICE_ID}
```
3. Re-register the service

If Access Service does not exist, run this command to deregister the service you tried to call:

<div tabs name="deregistration">
<details>
<summary>
With a trusted certificate
</summary>

```
curl -X DELETE https://gateway.{CLUSTER_DOMAIN}/{APP_NAME}/v1/metadata/services/{SERVICE_ID} --cert {CERTIFICATE_FILE} --key {KEY_FILE}
```
</details>
<details>
<summary>
Without a trusted certificate
</summary>

```
curl -X DELETE https://gateway.{CLUSTER_DOMAIN}/{APP_NAME}/v1/metadata/services/{SERVICE_ID} --cert {CERTIFICATE_FILE} --key {KEY_FILE} -k
```
</details>
</div>

Then, register the service and try calling again. The service re-registration recreates Access Service.
To register a service, see [this tutorial](components/application-connector/#tutorials-register-a-service-register-a-service).


4. Check the API URL

If your call reaches Application Gateway and Access Service exists, but you still receive an error, check if the API URL in the service definition matches the API URL of the actual service you are trying to call.
To check the target URL of the API, fetch the Service definition from Application Registry:

<div tabs name="verification">
<details>
<summary>
With a trusted certificate
</summary>

```
curl https://gateway.{CLUSTER_DOMAIN}/{APP_NAME}/v1/metadata/services/{SERVICE_ID} --cert {CERTIFICATE_FILE} --key {KEY_FILE}
```
</details>
<details>
<summary>
Without a trusted certificate
</summary>

```
curl https://gateway.{CLUSTER_DOMAIN}/{APP_NAME}/v1/metadata/services/{SERVICE_ID} --cert {CERTIFICATE_FILE} --key {KEY_FILE} -k
```
</details>
</div>

A successful call returns a `json` response with the service definition that contains the target URL.
Access the target URL directly to verify that the value of `api.targetUrl` is correct.