-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
576 lines (556 loc) · 22.1 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
<!DOCTYPE html>
<html lang="en">
<head>
<link rel="stylesheet" href="node_modules/reveal.js/dist/reveal.css">
<link rel="stylesheet" href="node_modules/reveal.js/dist/theme/beige.css">
<link rel="stylesheet" href="node_modules/reveal.js/plugin/highlight/monokai.css">
<link rel="stylesheet" href="css/styles.css"/>
<title>Taskserver Troubleshooting Guide</title>
</head>
<body>
<div class="reveal">
<div class="slides">
<section>
<h1>Taskserver Troubleshooting</h1>
<p>
Searching for failures with your Taskserver setup.
</p>
</section>
<section>
<section>
<h2>Troubleshooting Sync</h2>
</section>
<section>
<h2>Sync Problems</h2>
<p>
Here is a list of problems you may encounter, with the most common ones listed first.
</p>
<p>
The single most common problem has been that the Taskserver Setup Instructions were not properly followed.
Please review the steps you took.
</p>
</section>
<section>
<h2>Versions</h2>
<p>
It is always a good idea to make sure that you are using the latest release of Taskwarrior and Taskserver, not just because bugs are fixed that may help you, but also because the solutions below are geared toward the current releases.
</p>
<p>
If you upgrade from an older release of Taskserver, you will need to follow the <a href="http://taskwarrior.org/docs/taskserver/upgrade.html">upgrade instructions</a>.
</p>
</section>
<section>
<h2>'task sync' showed task list</h2>
<p>
You have a version of Taskwarrior older than <code>2.3.0</code>, which means there was no <code>sync</code> command, and you are seeing a list filtered by the search term 'sync'.
Upgrading is the only solution.
</p>
</section>
<section>
<h2>Taskwarrior without GnuTLS</h2>
<p>
You are using version <code>2.3.0</code> or later, but the Taskwarrior binary was compiled without <a href="http://www.gnutls.org">GnuTLS</a> support.
</p>
<p>
If you installed Taskwarrior using your OS's package manager, you may be suffering from an out of date package.
Prod your OS's package maintainer for an update.
</p>
</section>
<section>
<h2>GnuTLS and recent releases</h2>
<p>
Recent releases make GnuTLS support opt-out instead of opt-in, so upgrading to the latest version may help.
Otherwise, you will need to build Taskwarrior from the <a href="http://taskwarrior.org/download/task-latest.tar.gz">latest source tarball</a>, following the instructions in the <code>INSTALL</code> file.
If you are a developer, do that.
If you are not, then installing a development environment is probably not something
you want to do, in which case contact your OS's package maintainer.
</p>
</section>
<section>
<h2>Verify GnuTLS support</h2>
<p>
Verify that your Taskwarrior was built with GnuTLS support by running <code>task diagnostics</code>:
</p>
<pre><code data-trim class="bash">
$ task diagnostics | grep libgnutls
libgnutls: 3.3.18
</code></pre>
</section>
<section>
<h2>nodename nor servname provided</h2>
<p>
This means the Taskwarrior setting <code>taskd.server=<host>:<port></code> refers to a host name that cannot be seen by Taskwarrior.
</p>
<ul>
<li>Is it spelled correctly?</li>
<li>Is the domain correct?</li>
<li>Is there a valid DNS resolution for the name?</li>
<li>Is there a firewall between Taskwarrior and Taskserver that is not letting through <code><port></code> traffic?</li>
</ul>
</section>
<section>
<h2>Could not connect</h2>
<p>
Taskserver may not be running on <code><host></code>.
</p>
<p>
Check with <code>ps -leaf | grep taskd</code>.
</p>
<p>
Sometimes the error message is misleading, please check "Handshake failed" as well.
</p>
</section>
<section>
<h2>Unable to use port</h2>
<p>
By default, port <code>53589</code> is used, but whichever you chose must be open on the server.
</p>
<p>
If you are unable to open firewall ports, you can use an SSH Tunnel to route port <code>53589</code> traffic over port <code>22</code>:
</p>
<pre><code data-trim class="bash">
$ ssh -L localport:dsthost:dstport [email protected]
</code></pre>
</section>
<section>
<h2>Handshake failed</h2>
<p>
There are many reasons that the TLS handshake can fail.
</p>
<p>
Please do the following on your client:
</p>
<pre><code data-trim class="bash">
$ openssl s_client -CAfile .task/ca.cert.pem -host HOST -port PORT
</code></pre>
<p>
The result should be something like <code>Verify return code: 0 (ok)</code>.
</p>
</section>
<section>
<h2>Handshake errors</h2>
<ul>
<li><strong>Certificate fails validation, Handshake failed</strong></li>
<li><strong>Could not connect to <host> <port></strong></li>
</ul>
<p>
When you generated certificates, you modified a <code>vars</code> file, in particular the <code>CN=<name></code> setting.
That name must match the output of <code> hostname -f</code> on the server for the certificate to validate.
</p>
<pre><code data-trim class="bash">
$ certtool -i < server.cert.pem | grep Subject:
$ openssl x509 -noout -in server.cert.pem -subject
</code></pre>
</section>
<section>
<h2>Naming</h2>
<p>
Additionally, that name must also be used in the <code>taskd.server=<host>:<port></code> setting for Taskwarrior.
Otherwise you'll need <code>taskd.trust=ignore hostname</code>.
</p>
<p>
If you are using a self-signed certificate, did you specify it using the <code>taskd.ca</code> setting?
</p>
</section>
<section>
<h2>Ciphers</h2>
<p>
Setting <code>taskd.ciphers</code> can force the use of different ciphers.
Use <code>gnutls-cli --list</code> to see a list of installed ciphers, and confirm that there is overlap between client and server.
There needs to be a cipher that is available to both, otherwise they cannot communicate.
</p>
</section>
<section>
<h2>Certificate still valid?</h2>
<p>
Certificates have expiration dates, and if you followed our instructions, you created a certificate that is valid for one year.
Check your certificate with this command:
</p>
<pre><code data-trim class="bash">
$ certtool -i --infile ~/.task/<YOUR NAME>.cert.pem
</code></pre>
<p>
If your certificate has expired, you need a new one.
You may also need to regenerate expired server certificates.
</p>
</section>
<section>
<h2>Note on validation dates</h2>
<p>
Note that creating certificates that never expire is a bad idea.
Certificates may be compromised.
A certificate that is considered secure today, may not be considered secure in a year.
Is the key length you chose something that will remain suitable in the future? Will the algorithms you chose remain secure?
For these reasons, choose an expiration date that lets you reevaluate your choices in the relatively near future.
</p>
</section>
<section>
<h2>Note on GnuTLS security</h2>
<p>
As a <a href="http://gnutls.org/security.html">security product</a>, it is imperative that you keep your GnuTLS up to date.
</p>
<p>
As with many security products, GnuTLS is maintained by a responsible and quick-responding team that takes security very seriously.
Benefit from their diligence by keeping your GnuTLS up to date.
</p>
</section>
<section>
<h2>GnuTLS outdated?</h2>
<p>
We have received reports of issues with older GnuTLS releases.
Specifically, version 2.12.20 has problems validating certificates under certain conditions.
Newer releases have addressed memory leaks that were able to take down Taskserver.
</p>
<p>
Please keep in mind that you have to recompile Taskserver completely to benefit from the new version.
</p>
</section>
<section>
<h2>Recompile Taskserver</h2>
<p>
Upgrading GnuTLS does nothing to upgrade taskd -- it has to be rebuilt from scratch, which means:
</p>
<pre><code data-trim class="bash">
$ cd taskd.git
$ rm CMakeCache.txt
$ cmake -DCMAKE_BUILD_TYPE=release .
$ make
$ sudo make install
</code></pre>
<p>
This can then be verified using <code>taskd diagnostics</code>.
</p>
</section>
<section>
<h2>Ancestor not found</h2>
<p>
You skipped the important step of running:
</p>
<pre><code data-trim class="bash">
$ task sync init
</code></pre>
<p>
This performs an initial upload of your tasks, and sets up a local sync key, which identifies the last sync transaction.
</p>
<p>
Please note that older Taskwarrior versions (before 2.5.1) only sync the <strong>pending</strong> tasks and not all tasks.
</p>
</section>
</section>
<section>
<section>
<h2>Debugging</h2>
</section>
<section>
<h2>Hostname and IP address</h2>
<p>
There is a difference between <em>hostname</em> and <em>IP address</em>, honestly.
We are referencing the hostname throughout the documentation because you need a valid hostname for the certificate and working name resolution for the client to connect to the server.
</p>
<p>
<strong>So please use the hostname where you are advised to do it!</strong>
</p>
</section>
<section>
<h2>Diagnostics</h2>
<p>
You may wish to try and debug the problem yourself.
You will probably not.
But if you do, here is how.
</p>
<p>
Both Taskwarrior and Taskserver have a <code>diagnostics</code> command, the purpose of which is to show you relevant troubleshooting details.
Additionally it will indicate problems directly, for example, it will tell you if your cert/key files are not readable.
The output from <code>diagnostics</code> is intended to be included in bug reports, and doing so saves you a lot of time, because it's the first thing we'll ask for.
</p>
</section>
<section>
<h2>task diagnostics</h2>
<pre><code data-trim class="bash">
$ task diagnostics
...
$ taskd diagnostics
...
</code></pre>
Read the output of the <code>diagnostics</code> commands carefully, there may be several types of problems mentioned, which need to be addressed before going further.
</section>
<section>
<h2>Taskserver Debug Mode</h2>
<p>
The next step would be to run the server in debug mode.
First shutdown your Taskserver, then launch it interactively:
</p>
<pre><code data-trim class="bash">
$ taskdctl stop
...
$ taskd server
...
</code></pre>
<p>
You can hit <code>Ctrl-C</code> to stop this server.
For highly verbose output, try this:
</p>
<pre><code data-trim class="bash">
$ taskd server --debug --debug.tls=2
...
</code></pre>
</section>
<section>
<h2>Taskwarrior Debug Mode</h2>
<p>
Similarly, Taskwarrior has a verbose debug mode, and debug TLS mode:
</p>
<pre><code data-trim class="bash">
$ task rc.debug=1 rc.debug.tls=2 sync
...
</code></pre>
</section>
</section>
<section>
<h2>Tools</h2>
</section>
<section>
<section>
<h2>Server tools</h2>
</section>
<section>
<h2>IP Address</h2>
<p>
Show the IP addresses (and network interfaces) on the system.
</p>
<pre><code data-trim class="bash">
$ ifconfig -a
eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 192.168.1.100 netmask 255.255.255.0 broadcast 192.168.1.255
ether 52:54:a2:01:25:9d txqueuelen 1000 (Ethernet)
RX packets 42091 bytes 46300226 (44.1 MiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 17689 bytes 2606921 (2.4 MiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
lo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536
inet 127.0.0.1 netmask 255.0.0.0
loop txqueuelen 0 (Local Loopback)
RX packets 120 bytes 43540 (42.5 KiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 120 bytes 43540 (42.5 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
$ ip addr list
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000
link/ether 52:54:a2:01:25:9d brd ff:ff:ff:ff:ff:ff
inet 192.168.1.100/24 brd 192.168.1.255 scope global eth0
valid_lft forever preferred_lft forever
</code></pre>
</section>
<section>
<h2>Ports</h2>
<p>
Shows which process listen on the port, shows the user and – more important – the IP address / interface the server runs on.
</p>
<pre><code data-trim class="bash">
$ lsof -i TCP:53589 -s TCP:LISTEN # as taskserver user or with sudo
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
taskd 1167 taskserver 4u IPv4 16682 0t0 TCP taskd.example.net:53589 (LISTEN)
$ netstat -tl | grep 53589
tcp 0 0 taskd.example.net:53589 0.0.0.0:* LISTEN
</code></pre>
</section>
<section>
<h2>Certificate</h2>
<p>
Shows the hostname from "General Reachability" (Client section) after <code>CN=</code>
</p>
<pre><code data-trim class="bash">
$ openssl x509 -noout -in server.cert.pem -subject
subject= /CN=taskd.example.net/O=My own IT
$ certtool -i --infile=server.cert.pem | grep Subject:
Subject: CN=taskd.example.net,O=My own IT
</code></pre>
</section>
<section>
<h2>taskd diagnostics</h2>
<p>
Shows server diagnostic data.
</p>
<pre><code data-trim class="bash">
$ taskd diagnostics --data /path/to/taskserver/data/
taskd 1.2.0
Platform: Linux
Hostname: taskd.example.net
Compiler
...
Build Features
...
Configuration
TASKDDATA: /path/to/taskserver/data
root: /path/to/taskserver/data/, readable, writable
config: /path/to/taskserver/data//config, readable, writable546 bytes
CA: /path/to/taskserver/data/ca.cert.pem, readable, 2017 bytes
Certificate: /path/to/taskserver/data/server.cert.pem, readable, 2004 bytes
Key: /path/to/taskserver/data/server.key.pem, readable, 10996 bytes
CRL: /path/to/taskserver/data/server.crl.pem, readable, 1080 bytes
Log: /path/to/taskserver/data/taskd.log (found)
PID File: /path/to/taskserver/data/taskd.pid (missing)
Server: taskd.example.net:53589
Max Request: 1048576 bytes
Ciphers:
Trust: strict
</code></pre>
</section>
</section>
<section>
<section>
<h2>Client Tools</h2>
</section>
<section>
<h2>General Reachability</h2>
<p>
Show if the hostname is reachable (if ping is not blocked).
</p>
<pre><code data-trim class="bash">
$ ping taskd.example.net
PING taskd.example.net (192.168.1.100) 56(84) bytes of data.
64 bytes from taskd.example.net (192.168.1.100): icmp_seq=1 ttl=64 time=0.118 ms
64 bytes from taskd.example.net (192.168.1.100): icmp_seq=2 ttl=64 time=0.066 ms
64 bytes from taskd.example.net (192.168.1.100): icmp_seq=3 ttl=64 time=0.064 ms
64 bytes from taskd.example.net (192.168.1.100): icmp_seq=4 ttl=64 time=0.065 ms
^C
--- taskd.example.net ping statistics ---
4 packets transmitted, 4 received, 0% packet loss, time 3000ms
rtt min/avg/max/mdev = 0.064/0.078/0.118/0.023 ms
$ nmap -sP taskd.example.net
Starting Nmap 6.40 ( http://nmap.org ) at 2016-05-15 11:24 CEST
Nmap scan report for taskd.example.net (192.168.1.100)
Host is up (0.00012s latency).
Nmap done: 1 IP address (1 host up) scanned in 0.01 seconds
</code></pre>
</section>
<section>
<h2>Port Reachability</h2>
<p>
Shows if the port is reachable by client (or locally).
</p>
<pre><code data-trim class="bash">
$ telnet taskd.example.net 53589
Trying 192.168.1.100...
Connected to taskd.example.net.
Escape character is '^]'.
^CConnection closed by foreign host.
$ sudo nmap -p 53589 taskd.example.net
Starting Nmap 7.12 ( https://nmap.org ) at 2016-05-15 11:28 CEST
Nmap scan report for taskd.example.net (192.168.1.100)
Host is up (0.036s latency).
PORT STATE SERVICE
53589/tcp open unknown
Nmap done: 1 IP address (1 host up) scanned in 0.18 seconds
$ openssl s_client -host taskd.example.net -port 53589
CONNECTED(00000003)
...
</code></pre>
</section>
<section>
<h2>Hostname resolution</h2>
<p>
Shows the ip address of hostname.
Should match one of the IP addresses found in "IP Address" (Server section) and the server should be bound to that address see "Ports" (Server Section).
</p>
<pre><code data-trim class="bash">
$ host taskd.example.net
taskd.example.net has address 192.168.1.100
$ nslookup taskd.example.net # checks only nameservers
Server: 192.168.178.1
Address: 192.168.178.1#53
Non-authoritative answer:
Name: taskd.example.net
Address: 192.168.1.100
</code></pre>
</section>
<section>
<h2>task diagnostics</h2>
<p>
Shows client diagnostic data.
</p>
<pre><code data-trim class="bash">
task diagnostics
task 2.6.0
Platform: Linux
...
Compiler
...
Build Features
...
Configuration
File: /home/user/.taskrc (found), 2428 bytes, mode 100664
Data: /home/user/.task (found), dir, mode 40775
Locking: Enabled
GC: Enabled
$EDITOR: vim
Server: taskd.example.net:53589
CA: ~/.task/ca.cert.pem, readable, 3741 bytes
Trust: strict
Certificate: ~/.task/Dirk_Deimeke.cert.pem, readable, 3724 bytes
Key: ~/.task/Dirk_Deimeke.key.pem, readable, 25364 bytes
Ciphers: NORMAL
Creds: My own IT/Dirk Deimeke/************************************
Hooks
...
Tests
...
</code></pre>
</section>
</section>
<section>
<section>
<h1>Getting Help</h1>
</section>
<section>
<h2>Getting Help</h2>
<p>
As a last resort, ask for help.
But please make sure you have carefully reviewed your setup, and gone through the checks above before asking.
No one wants to lead you through the steps above to discover that you didn't.
</p>
<p>
We'll ask you to provide the <code>diagnostics</code> output for both Taskwarrior and Taskserver, then we're going to go through the steps above, because this is our checklist also.
</p>
</section>
<section>
<h2>Getting Help (1)</h2>
<p>
There are several ways of getting help:
</p>
<ul>
<li>We have an <a href="https://taskwarrior.org/support/faq.html">FAQ</a> covering a lot of questions.</li>
<li>Email us at <a href="mailto:[email protected]">[email protected]</a>, then wait patiently for a volunteer to respond.</li>
<li>Join us IRC in the <a href="https://botbot.me/freenode/taskwarrior/">#taskwarrior</a> channel on Freenode.net, and get a quick response from the community, where, as you have anticipated, we will walk you through the checklist above.</li>
</ul>
</section>
<section>
<h2>Getting Help (2)</h2>
<p>
There are several ways of getting help:
</p>
<ul>
<li>Even though Twitter is no means of support, you can get in touch with <a href="https://twitter.com/taskwarrior">@taskwarrior</a>.</li>
<li>We have a <a href="https://groups.google.com/forum/\#!forum/taskwarrior-user">User Mailinglist</a> which you can join anytime to discuss about Taskwarrior and techniques.</li>
<li>The <a href="https://groups.google.com/forum/\#!forum/taskwarrior-dev">Developer Mailinglist</a> is focussing on a more technical oriented audience.</li>
</ul>
</section>
</section>
</div>
<div class='footer'>
Taskwarrior Academy
</div>
</div>
<script src="node_modules/reveal.js/dist/reveal.js"></script>
<script src="node_modules/reveal.js/plugin/highlight/highlight.js"></script>
<script>
Reveal.initialize({
plugins: [ RevealHighlight ]
});
</script>
</body>
</html>