amazon-archives / awsmobile-cli

CLI experience for Frontend developers in the JavaScript ecosystem.
Apache License 2.0
142 stars 35 forks source link

awsmobile configure -> Error: The header content contains invalid characters #117

Closed utterly-calm closed 6 years ago

utterly-calm commented 6 years ago

Followed below steps:

backend awsmobile project creation error { NetworkingError: The header content contains invalid characters at validateHeader (_http_outgoing.js:494:11) at ClientRequest.setHeader (_http_outgoing.js:498:3) at new ClientRequest (_http_client.js:173:14) at Object.request (http.js:38:10) at Object.request (https.js:239:15) at features.constructor.handleRequest (C:\Users\manus\AppData\Roaming\npm\node_modules\awsmobile-cli\node_modules\aws-sdk\lib\http\node.js:42:23) at executeSend (C:\Users\manus\AppData\Roaming\npm\node_modules\awsmobile-cli\node_modules\aws-sdk\lib\event_listeners.js:304:29) at Request.SEND (C:\Users\manus\AppData\Roaming\npm\node_modules\awsmobile-cli\node_modules\aws-sdk\lib\event_listeners.js:318:9) at Request.callListeners (C:\Users\manus\AppData\Roaming\npm\node_modules\awsmobile-cli\node_modules\aws-sdk\lib\sequential_executor.js:101:18) at Request.emit (C:\Users\manus\AppData\Roaming\npm\node_modules\awsmobile-cli\node_modules\aws-sdk\lib\sequential_executor.js:77:10) message: 'The header content contains invalid characters', code: 'NetworkingError', region: 'us-east-1', hostname: 'mobile.us-east-1.amazonaws.com', retryable: true, time: 2018-04-28T15:26:56.753Z }

Node.js version: 8.11.1 awsmobile version: 1.1.1 npm version: 6.0.0 yarn version: 1.6.0 OS: Windows 10 VSCode: 1.22.2

"dependencies": {
    "amazon-cognito-identity-js": "^2.0.3",
    "aws-amplify": "^0.3.3",
    "aws-amplify-react": "^0.1.43",
    "aws-sdk": "^2.228.1",
    "react": "^16.3.2",
    "react-dom": "^16.3.2",
    "react-scripts": "1.1.4"
  },

StackOverflow link

UnleashedMind commented 6 years ago

We are still investigating the issue. The reason you see us-east-1 is because, although the resources managed by the mobile hub can be in other regions, the mobile hub api itself is only in us-east-1.

elorzafe commented 6 years ago

Hi @manu1222 I saw that issue before. Could be that your firewall is trying to filter packages from this host mobile.us-east-1.amazonaws.com?

utterly-calm commented 6 years ago

Hi @elorzafe ,@UnleashedMind,

It's working fine now.

I disabled firewall and copied creds using chrome developer tool and it worked. Then I re-enabled the firewall and tried again and it still worked. I thought problem was that I was copying the creds from AWS console itself, but then I tried to create a new user and copied from AWS console instead of chrome developer tool, and it also worked i.e everything is working now.

I also tried to create a new project by following https://github.com/aws-samples/aws-mobile-react-sample#getstarted and it also went well.

So, I can't recreate it now. Not sure what was the issue.