HPE_INVALID_CONSTANT
See original GitHub issueI’m getting [Error: Parse Error] bytesParsed: 0, code: ‘HPE_INVALID_CONSTANT’ when I run this:
'use strict';
var ses = require('node-ses'),
client = ses.createClient({ key: '*****', secret: '*****', amazon: 'https://email-smtp.us-east-1.amazonaws.com' });
client.sendemail({
to: 'test@test.com',
from: 'reminders@test.com',
subject: 'Sending email through Node and Amazon SES Test',
message: 'Did you get this?',
altText: 'Did you get this?'
}, function (err, data, res) {
console.log('res= ' + res);
if (err) {
console.log(err);
}
console.log(data);
});
Any thoughts?
Issue Analytics
- State:
- Created 8 years ago
- Comments:5
Top Results From Across the Web
What does this error mean: HPE_INVALID_CONSTANT?
The HPE_INVALID_CONSTANT means Http Parse Error and the invalid constant means that the response is malformed. So the parser can't parse it!
Read more >What does this error mean: HPE_INVALID_CONSTANT?
In this error HPE means (Http Parse Error), and not the HPE company. This error comes from Node.js, and usually indicates Node.js couldn't...
Read more >HPE_INVALID_CONSTANT Errors with HTTP/TCP · Issue #4863
HPE_INVALID_CONSTANT means that the start of the response is invalid (i.e. doesn't start with "HTTP".) I am skeptical about this being a bug ......
Read more >Hpe_invalid constant - General - Node-RED Forum
Any ideas community? Well it means that there is something wrong with the response from the server - normally it means the header...
Read more >Data retrieval - getting HPE_INVALID_CONSTANT
Hello Support, New IoTaWatt owner here, and first time poster… It looks like I'm having some trouble retrieving data from the unit, ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
The issue is likely due to the fact that the amazon server url you used is the one for the SMTP API, not the HTTP API. (You receive SMTP responses that cant be understood by node hence the error). So you should fix your server url, replace
email-smtp
by justemail
.I just spent a lot of hours on this issue in my project since no tool can help you at this point. I just found by testing my credentials with postman and searching for the errors postman managed to print. These were SMTP errors that gave a clue of what was going on.
Not off hand. Try googling that error code or generating a stack trace to see which code is generating that error. Re-open if it appears to be a bug in node-ses. You can try using
console.trace
instead ofconsole.log
for that purpose.https://nodejs.org/api/console.html#console_console_trace_message