user60353: OSX Sierra
it seems all the other command bitcoin-cli working on my Mac,
except,  
bitcoin-cli getinfo only always returns an error.

$ bitcoin-cli getinfo 
  error code: -28
  error message:
  Rewinding blocks...

Why does it happen?

user75988: use bitcoin-cli -getinfo instead of getinfo

user51005: Wait a few minutes and the error will be gone.
The source code defines error 28 as

Client still warming up


60353: <p>OSX Sierra</p>

<p>it seems all the other command bitcoin-cli working on my Mac,
except,  </p>

<p><strong>bitcoin-cli getinfo</strong> only always returns an error.</p>

<blockquote>
  <p>$ bitcoin-cli getinfo 
  error code: -28<br>
  error message:<br>
  Rewinding blocks...</p>
</blockquote>

<p>Why does it happen?</p>
 75988: <p>use <code>bitcoin-cli -getinfo</code> instead of <code>getinfo</code></p>
 51005: <p>Wait a few minutes and the error will be gone.</p>

<p>The <a href="https://github.com/bitcoin/bitcoin/blob/62f2d769e45043c1f262ed45babb70fe237ad2bb/src/rpc/protocol.h#L30" rel="nofollow noreferrer">source code</a> defines error 28 as</p>

<blockquote>
  <p>Client still warming up</p>
</blockquote>
