serverless: Serverless Error: The header content contains invalid characters

This is a Bug Report

Description

On running a test deployment received the error message

 Error --------------------------------------------------
 
     ServerlessError: ServerlessError: The header content
     contains invalid characters

The expected behavior was either a successful deployment or at least an error message from AWS about the relating to the configuration.

  • What was the config you used?
  • What stacktrace or error message from your provider did you see?

Additional Data

  • Serverless Framework Version you’re using: 1.6.1
  • Operating System: darwin
  • Stack Trace:
Error: ServerlessError: ServerlessError: The header content contains invalid characters
    at module.exports.logError (/usr/local/lib/node_modules/serverless/lib/classes/Error.js:87:11)
    at BbPromise.resolve.then.catch.e (/usr/local/lib/node_modules/serverless/bin/serverless:26:3)
    at runCallback (timers.js:651:20)
    at tryOnImmediate (timers.js:624:5)
    at processImmediate [as _immediateCallback] (timers.js:596:5)
From previous event:
    at __dirname (/usr/local/lib/node_modules/serverless/bin/serverless:24:9)
    at Object.<anonymous> (/usr/local/lib/node_modules/serverless/bin/serverless:27:4)
    at Module._compile (module.js:571:32)
    at Object.Module._extensions..js (module.js:580:10)
    at Module.load (module.js:488:32)
    at tryModuleLoad (module.js:447:12)
    at Function.Module._load (module.js:439:3)
    at Module.runMain (module.js:605:10)
    at run (bootstrap_node.js:418:7)
    at startup (bootstrap_node.js:139:9)
    at bootstrap_node.js:533:3
  • Provider Error messages:
ServerlessError: ServerlessError: The header content
     contains invalid characters

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Comments: 20 (8 by maintainers)

Most upvoted comments

Well, it seems the problem occurs if you have some sort of special characters in you access key secret. I had a “+” in it. I was able to successfully generate another one without any special characters i.e. all alphabets and it worked then.

Yeah, I just regenerated a secret access key without a “/” in it and it works now.