Please see this problem described in SE.
Caused by me pasting a trailing blank into CiviCRM API key
closed