You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/content/docs/cloudflare-one/connections/connect-networks/troubleshoot-tunnels/diag-logs.mdx
+73-70Lines changed: 73 additions & 70 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -8,11 +8,14 @@ head:
8
8
content: Tunnel diagnostic logs
9
9
---
10
10
11
-
Cloudflare Tunnel generates a set of diagnostic logs that can be used to troubleshoot issues with `cloudflared`. A diagnostic report covers a single instance of `cloudflared`.
11
+
import {Details} from"~/components";
12
+
13
+
Cloudflare Tunnel generates a set of diagnostic logs that can be used to troubleshoot issues with `cloudflared`. A diagnostic report collects data from a single instance of `cloudflared` running on the local machine.
12
14
13
15
## Get diagnostic logs
14
16
15
17
The steps for getting diagnostic logs depend on your `cloudflared` deployment environment.
18
+
16
19
### Prerequisites
17
20
18
21
- Access to the `cloudflared` host being diagnosed
@@ -24,115 +27,115 @@ These instructions apply to remotely-managed and locally-managed tunnels running
24
27
25
28
1. (Linux only) Allow the `cloudflared` user to create RAW and PACKET sockets without root permissions:
If multiple instances of `cloudflared` are running on the same host, specify the [metrics server address](/cloudflare-one/connections/connect-networks/monitor-tunnels/metrics/#check-the-metrics-server-address) for the instance you want to diagnose:
40
+
If multiple instances of `cloudflared` are running on the same host, specify the [metrics server IP and port](/cloudflare-one/connections/connect-networks/monitor-tunnels/metrics/#check-the-metrics-server-address) for the instance you want to diagnose. For example:
38
41
39
-
```sh
40
-
cloudflared tunnel diag --metrics 127.0.0.1:20241
41
-
```
42
+
```sh
43
+
cloudflared tunnel diag --metrics 127.0.0.1:20241
44
+
```
42
45
43
46
This command will output the status of each diagnostic task and place a `cloudflared-diag-YYYY-MM-DDThh-mm-ss.zip` file in your working directory.
44
47
45
48
### Docker
46
49
47
-
`cloudflared` reads diagnostic data from the `cloudflared`[metrics server](/cloudflare-one/connections/connect-networks/monitor-tunnels/metrics/#check-the-metrics-server-address). Therefore, the metrics server must be exposed from the Docker container and reachable from the host machine.
50
+
`cloudflared` reads diagnostic data from the [tunnel metrics server](/cloudflare-one/connections/connect-networks/monitor-tunnels/metrics/). Therefore, the metrics server must be exposed from the Docker container and reachable from the host machine.
48
51
49
-
Run the following commands on the`cloudflared` host:
52
+
1. Determine the tunnel's [metrics server IP and port](/cloudflare-one/connections/connect-networks/monitor-tunnels/metrics/#check-the-metrics-server-address). In Docker environments, the default IP and port is `0.0.0.0:20241`.
50
53
51
-
1. Verify that you can reach the metrics server address. For example, if the metrics server is listening at `0.0.0.0:20241`, run the following command:
54
+
2. On the host machine, verify that you can reach the metrics server address. For example, if the metrics server is listening at `0.0.0.0:20241`, run the following command:
2. If the metrics server is not reachable, deploy the container again and expose the port:
75
+
3. If the metrics server is unreachable, deploy the container again with port forwarding enabled. The diagnostic feature will try to request information from the Docker instance using ports `20241` to `20245`. You will need to forward one of these diagnostic ports to the metrics port.
73
76
74
-
```sh
75
-
docker run -d -p 20241:20241 docker.io/cloudflare/cloudflared tunnel ...
76
-
```
77
+
```sh
78
+
docker run -d -p <diagnostic_port>:<metrics_port> docker.io/cloudflare/cloudflared tunnel ...
79
+
```
77
80
78
-
3. Take note of the container ID and then run the diagnostic:
81
+
-`<diagnostic_port>` is any port in the range `20241` to `20245`.
82
+
-`<metrics_port>` is the metrics port for the `cloudflared` instance you want to diagnose (obtained in Step 1).
This command will output the status of each diagnostic task and place a `cloudflared-diag-YYYY-MM-DDThh-mm-ss.zip` file in your working directory.
90
96
91
97
### Kubernetes
92
98
93
-
`cloudflared` reads diagnostic data from the `cloudflared`[metrics server](/cloudflare-one/connections/connect-networks/monitor-tunnels/metrics/#check-the-metrics-server-address). You must use port forwarding to expose the metrics server running in a Kubernetes cluster.
99
+
The diagnostic feature will request data from the [tunnel metrics server](/cloudflare-one/connections/connect-networks/monitor-tunnels/metrics/#check-the-metrics-server-address) using ports `20241` to `20245`. You will need to use port forwarding to allow the local `cloudflared` instance to connect to the metrics server on one of these ports.
94
100
95
-
Run the following commands on the `cloudflared` host:
96
101
97
-
1.Forward a local port to the `cloudflared` metrics server port:
102
+
1.Determine the tunnel's [metrics server IP and port](/cloudflare-one/connections/connect-networks/monitor-tunnels/metrics/#check-the-metrics-server-address). In Kubernetes deployments, the default IP and port is `0.0.0.0:20241`.
If you are managing the tunnel directly on the host:
126
-
127
-
1. Enable debug logging when you start the tunnel:
128
-
129
-
```sh
130
-
cloudflared tunnel --loglevel debug --logfile cloudflared.log run <UUID>
131
-
```
133
+
This command will output the status of each diagnostic task and place a `cloudflared-diag-YYYY-MM-DDThh-mm-ss.zip` file in your working directory.
132
134
133
135
## cloudflared-diag files
134
136
135
137
The `cloudflared-diag-YYYY-MM-DDTHH-MM-SS.zip` archive contains the files listed below. The data in a file either applies to the `cloudflared` instance being diagnosed (`diagnosee`) or the instance that triggered the diagnosis (`diagnoser`). For example, if your tunnel is running in a Docker container, the diagnosee is the Docker instance and the diagnoser is the host machine instance. The diagnosee and diagnoser could also be the same instance.
0 commit comments