Add more logging to restore state errors

This commit is contained in:
Michael Schurter 2017-07-03 11:53:54 -07:00
parent a72ceffd51
commit 11f68bfca2
1 changed files with 9 additions and 1 deletions

View File

@ -299,7 +299,15 @@ func NewClient(cfg *config.Config, consulCatalog consul.CatalogAPI, consulServic
// Restore the state
if err := c.restoreState(); err != nil {
return nil, fmt.Errorf("failed to restore state: %v", err)
logger.Printf("[ERR] client: failed to restore state: %v", err)
logger.Printf("[ERR] client: Nomad is unable to start due to corrupt state. "+
"The safest way to proceed is to manually stop running task processes "+
"and remove Nomad's state dir (%q) before restarting. Lost allocations "+
"will be rescheduled.", c.config.StateDir)
logger.Printf("[ERR] client: Corrupt state is often caused by a bug. Please " +
"report as much information as possible to " +
"https://github.com/hashicorp/nomad/issues")
return nil, fmt.Errorf("failed to restore state")
}
// Register and then start heartbeating to the servers.