Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Confusing experience for 1st timers #1798

Closed
kontsevoy opened this issue Mar 20, 2018 · 0 comments · Fixed by #1806
Closed

Confusing experience for 1st timers #1798

kontsevoy opened this issue Mar 20, 2018 · 0 comments · Fixed by #1806
Assignees

Comments

@kontsevoy
Copy link
Contributor

kontsevoy commented Mar 20, 2018

Problem

Teleport daemon is not reporting errors properly without -d (debug) flag. This makes it impossible for new users to troubleshoot effectively.

Here's an example:

Get a fresh machine without /var/lib/teleport and execute:

$ teleport start

It will print "Initializing teleport" and will exit.
Try the same thing with -d and you'll notice:

$ teleport start -d
DEBU             "Access: null\nAdvertiseIP: \"\"\nAuth:\n  Authorities: null\n  ClusterConfig:\n    kind: cluster_config\n    metadata:\n      name: cluster-config\n    spec:\n      audit: {}\n      cluster_id: \"\"\n      proxy_checks_host_keys: \"no\"\n      session_recording: proxy\n    version: v3\n  ClusterName: null\n  EnableProxyProtocol: true\n  Enabled: true\n  LicenseFile: /var/lib/teleport/license.pem\n  Limiter:\n    Clock: null\n    MaxConnections: 1000\n    MaxNumberOfUsers: 250\n    Rates: null\n  NoAudit: false\n  Preference:\n    kind: \"\"\n    metadata:\n      name: \"\"\n    spec:\n      second_factor: otp\n      type: local\n    version: \"\"\n  Roles: null\n  SSHAddr:\n    addr: 0.0.0.0:3025\n    network: tcp\n  StaticTokens:\n    kind: static_tokens\n    metadata:\n      name: static-tokens\n    spec:\n      static_tokens: []\n    version: v2\n  StorageConfig:\n    Params:\n      data_dir: /var/lib/teleport\n      path: /var/lib/teleport\n    Type: bolt\nAuthServers:\n- addr: 0.0.0.0:3025\n  network: tcp\nCachePolicy:\n  Enabled: true\n  NeverExpires: false\n  RecentTTL: null\n  TTL: 0\nCiphers:\n- aes128-ctr\n- aes192-ctr\n- aes256-ctr\n- aes128-gcm@openssh.com\n- arcfour256\n- arcfour128\nClusterConfiguration: null\nConsole: 0\nDataDir: /var/lib/teleport\nDebug: true\nDiagnosticAddr:\n  addr: \"\"\nHostUUID: \"\"\nHostname: luna\nIdentities: null\nIdentity: null\nKEXAlgorithms:\n- curve25519-sha256@libssh.org\n- ecdh-sha2-nistp256\n- ecdh-sha2-nistp384\n- ecdh-sha2-nistp521\n- diffie-hellman-group14-sha1\n- diffie-hellman-group1-sha1\nKeygen: null\nMACAlgorithms:\n- hmac-sha2-256-etm@openssh.com\n- hmac-sha2-256\n- hmac-sha1\n- hmac-sha1-96\nOIDCConnectors: null\nPIDFile: \"\"\nPresence: null\nProvisioner: null\nProxy:\n  DisableReverseTunnel: false\n  DisableTLS: false\n  DisableWebInterface: false\n  DisableWebService: false\n  EnableProxyProtocol: true\n  Enabled: true\n  Limiter:\n    Clock: null\n    MaxConnections: 1000\n    MaxNumberOfUsers: 250\n    Rates: null\n  PublicAddr:\n    addr: \"\"\n  ReverseTunnelListenAddr:\n    addr: 0.0.0.0:3024\n    network: tcp\n  SSHAddr:\n    addr: 0.0.0.0:3023\n    network: tcp\n  TLSCert: \"\"\n  TLSKey: \"\"\n  WebAddr:\n    addr: 0.0.0.0:3080\n    network: tcp\nReverseTunnels: null\nSSH:\n  Addr:\n    addr: 0.0.0.0:3022\n    network: tcp\n  CmdLabels: null\n  Enabled: true\n  Labels: null\n  Limiter:\n    Clock: null\n    MaxConnections: 1000\n    MaxNumberOfUsers: 250\n    Rates: null\n  Namespace: \"\"\n  PermitUserEnvironment: false\n  Shell: /bin/bash\nToken: \"\"\nTrust: null\n" common/teleport.go:148

ERROR REPORT:
Original Error: *os.PathError mkdir /var/lib/teleport: permission denied
Stack Trace:
	/home/ekontsevoy/go/src/github.com/gravitational/teleport/lib/service/service.go:335 github.com/gravitational/teleport/lib/service.NewTeleport
	/home/ekontsevoy/go/src/github.com/gravitational/teleport/tool/teleport/common/teleport.go:171 github.com/gravitational/teleport/tool/teleport/common.OnStart
	/home/ekontsevoy/go/src/github.com/gravitational/teleport/tool/teleport/common/teleport.go:151 github.com/gravitational/teleport/tool/teleport/common.Run
	/home/ekontsevoy/go/src/github.com/gravitational/teleport/tool/teleport/main.go:29 main.main
	/opt/go/src/runtime/proc.go:204 runtime.main
	/opt/go/src/runtime/asm_amd64.s:2338 runtime.goexit
User Message: initializing teleport

The list of issues

Priority 1 Issue

Most importantly, the true error message is burried inside and not bubbled up to stderr without -d. I suspect that other possible start errors are getting "eaten" the same way. Lets never forget, that -d is not something users should be normally using, i.e. errors must show up nicely without -d.

Bonus point

Notice how the "DEBUG" message is long, crazily detailed and escaped, i.e. newlines are replaced with \n. Why?

  • We already have "ERROR REPORT" whose purpose is to basically print stack dump.
  • The output seems excessive, unreadable and will make a toll on our support (try copy/pasting this into anything, even in this ticket it's a long/unreadable line)

Do we do this often? If we do, why not keep newlines as-is. And if not, why bother printing it at all, is "ERROR REPORT" not enough?

@kontsevoy kontsevoy added this to the 2.5.3 "Portland" milestone Mar 20, 2018
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants