Friday, July 8, 2011

Microsoft Azure One of the request inputs is not valid

I am working on a Microsoft Azure project and ran into the error "one of the request inputs is not valid" when I tried to extract multiple messages from the queue. I did some searching around to see if I could find a solution to this problem but nothing helped.

Suggested solutions on the internet

There are a number of solutions that are suggested for this error but in my case they did not apply. Listed below are two most common solutions to try if you ran into this problem:
1. This error is caused by an invalid name for the queue. Now, my queue was called "gpcresult" which means there was nothing wrong with my queue's name. If I had used any uppercase letters or a special symbol I would accept I made a mistake but gpcresult is a perfectly valid name. So this solution did not help me.
2. The timeout value was too low and thus expired before I actually went to delete the message. In my case the error was when I tried to grab the message and not when deleting. You, on the other hand, might have a problem when you try to delete. In that case just increase the time out by passing timespan as second parameter to your queue.GetMessages(queuereference, TimeSpan(1,0,0)) function.

However, none of the above two solutions helped me. Nevertheless, they put me on a track that lead to the solution.

The solution to my problem

As they say - when everything else fails read the instructions. That is what I did. I went back and started reading the description of Get Messages function. It was before long that I read about timeout settings. It seems the default value is 30 seconds which was too low for my project as processing the message would take longer. Moreover, the maximum value is 2 hours while I was using 3 hours to be on the safe side. This resulted in my HTTP request being invalid and hence the error. You can also use fiddler to monitor your HTTP traffic which will give you details of your requests and response. Hopefully this will come handy to someone.

No comments:

Post a Comment