softwaremill / elasticmq

In-memory message queue with an Amazon SQS-compatible interface. Runs stand-alone or embedded.
https://softwaremill.com/open-source/
Apache License 2.0
2.51k stars 194 forks source link

Invalid authorization header #12

Closed jhyle closed 9 years ago

jhyle commented 10 years ago

I cant get it to work! I use just the out-of-the-box setup on both sides, but it throws the error message:

[WARN] [10/22/2013 21:57:55.154] [elasticmq-akka.actor.default-dispatcher-32] [akka://elasticmq/user/IO-HTTP/listener-0/53] Illegal request header: Illegal 'Authorization' header: Invalid input '/', expected CTL, ListSep or EOI (line 1, pos 30): AWS4-HMAC-SHA256 Credential=x/20131022/us-east-1/us-east-1/aws4_request, SignedHeaders=host;user-agent;x-amz-content-sha256;x-amz-date, Signature=542710720863c9fe4d7ca7794d69eb6b8839af0a031f09ee0b67955fe855253f

adamw commented 10 years ago

Which version of elasticmq are you using? Are you using the stand-alone or embedded versions? Do you have any custom settings? In general this is solved in the code by this configuration entry in application.conf:

spray.can.server.parsing.illegal-header-warnings = off

But that configuration in bundled with EMQ so you shouldn't have to do anything

jhyle commented 10 years ago

I'm using the 0.71 standalone version. I found the problem and of course it was me: I had defined https as transport protocol but requested with http. I have now http on both sides (actually deleting my additional config file) and now it is ok.

Unfortunately there is another problem: I successfully create a queue

09:12:59.771 [elasticmq-akka.actor.default-dispatcher-4] INFO o.elasticmq.actor.QueueManagerActor - Creating queue QueueData(PreprocessingOut-test,MillisVisibilityTimeout(30000),PT0S,PT0S,2013-10-24T09:12:59.770+02:00,2013-10-24T09:12:59.770+02:00)

but if it is polled for messages I get an 404 (there are no messages actually) on this URL

http://localhost:9324/594145860020/PreprocessingOut-test

(this happens if I remove the number path too). With the AWS backend I get an empty Result instead. Also the AWS client throws an exception because the text in the 404 messages is not XML.

Please help.

adamw commented 10 years ago

How do you create the queue URL? Normally you should use the value returned by the CreateQueue call. Where does the number - 594145860020 - come from?

As for the invalid 404 messages, that's indeed a bug. I'll look into that.

jhyle commented 10 years ago

Ok, with the URL from the CreateQueue call it works. I am debugging other peoples code... Thanks a lot!