403 Forbidden

Apr 21, 2010 at 5:24 PM

Okay I downloaded the latest and greatest LinqToTwitter source, was messing around with the web demo

and I get this when trying to post an update to my twitter account

 

Server Error in '/LinqToTwitterWebFormsDemo' Application.

The remote server returned an error: (403) Forbidden.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.Net.WebException: The remote server returned an error: (403) Forbidden.

Source Error:

Line 235:            var req = this.Consumer.PrepareAuthorizedRequest(new MessageReceivingEndpoint(requestUrl, HttpDeliveryMethods.PostRequest), this.AccessToken);
Line 236:            this.InitializeRequest(req);
Line 237:            return (HttpWebResponse)req.GetResponse();
Line 238:        }
Line 239:        #endregion


Source File: C:\Users\Dan\Documents\Development\LinqToTwitter\LinqToTwitter\OAuth\OAuthAuthorization.cs    Line: 237

Stack Trace:

[WebException: The remote server returned an error: (403) Forbidden.]
   System.Net.HttpWebRequest.GetResponse() +5373789
   LinqToTwitter.OAuthAuthorization.Post(Uri requestUrl, IDictionary`2 args) in C:\Users\Dan\Documents\Development\LinqToTwitter\LinqToTwitter\OAuth\OAuthAuthorization.cs:237
   LinqToTwitter.TwitterExecute.ExecuteTwitter(String url, Dictionary`2 parameters, IRequestProcessor requestProcessor) in C:\Users\Dan\Documents\Development\LinqToTwitter\LinqToTwitter\LinqToTwitter\TwitterExecute.cs:473
   LinqToTwitter.TwitterContext.UpdateStatus(String status, Decimal latitude, Decimal longitude, String placeID, Boolean displayCoordinates, String inReplyToStatusID) in C:\Users\Dan\Documents\Development\LinqToTwitter\LinqToTwitter\LinqToTwitter\TwitterContext.cs:876
   LinqToTwitter.TwitterContext.UpdateStatus(String status) in C:\Users\Dan\Documents\Development\LinqToTwitter\LinqToTwitter\LinqToTwitter\TwitterContext.cs:731
   _Default.postUpdateButton_Click(Object sender, EventArgs e) in c:\Users\Dan\Documents\Development\LinqToTwitter\LinqToTwitterWebFormsDemo\Default.aspx.cs:98
   System.Web.UI.WebControls.Button.OnClick(EventArgs e) +111
   System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) +110
   System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +10
   System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +13
   System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +36
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1565

 

Any ideas why?

Coordinator
Apr 23, 2010 at 2:41 AM

You're using the sample application.  I just ran the sample application successfully on my system, so it seems your situation is not immediatly reproducible. 

Let's examine the error message some more.  It appears that the problem occurred when when reading Twitter's response.  Since Twitter returned a 403, .NET surfaced the error as an exception.  The 403 Forbidden is like a permissions error that says you're trying to do something that Twitter won't permit you to do.  To get more information, you can examine the exception when it's raised in the VS debugger.  Sometimes you get more information from Twitter in one of the headers that helps pinpoint the problem.

Other places to look include your Application settings with Twitter.  I recently heard from someone that they had their application set to Web, but tried to run it on desktop. Of course their error was different, but I'm just brainstorming and hoping that I can point you in the right direction.  Make sure your OAuth tokens are specified correctly in Web.config and check to make sure you haven't exchanged the key and secret.  There's also a possibility that Twitter is just having a hiccup or a bad day.  You could also download Fiddler2 to see the response the Twitter is sending back and see if there is any message to help you pinpoint what they don't like.  Also, onsider whether Twitter is blocking you for some reason - not saying they are, but only trying to think of all the strange possibilities.

Another thought that might be fun. Reproduce the problem with Microsoft Test Manager and send me the .iTrace file.  I'll see if I can load it into VS 2010 Intellitrace and take a look.  Or, you can reproduce the problem in VS 2010 with Intellitrace turned on and then send me the Intellitrace log file.  If this isn't possible for one reason or another, no problem, I just thought it might be an interesting way to try to get a reproduction. Also, I might inadvertently have access to your OAuth keys, so you would have to think before doing this. Of course, all of this is shot if the problem was with Twitter or something strange with your network connection.

Well, I've talked a lot and haven't solved your problem, but hopefully there's a nugget or two in here that might help.

Good luck,

Joe

Apr 23, 2010 at 2:29 PM
Well through some digging this is what is being returned The remote server returned an error: (417) Expectation Failed.
 
Fiddler didn't show the response for some reason...

On Thu, Apr 22, 2010 at 9:41 PM, JoeMayo <notifications@codeplex.com> wrote:

From: JoeMayo

You're using the sample application.  I just ran the sample application successfully on my system, so it seems your situation is not immediatly reproducible. 

Let's examine the error message some more.  It appears that the problem occurred when when reading Twitter's response.  Since Twitter returned a 403, .NET surfaced the error as an exception.  The 403 Forbidden is like a permissions error that says you're trying to do something that Twitter won't permit you to do.  To get more information, you can examine the exception when it's raised in the VS debugger.  Sometimes you get more information from Twitter in one of the headers that helps pinpoint the problem.

Other places to look include your Application settings with Twitter.  I recently heard from someone that they had their application set to Web, but tried to run it on desktop. Of course their error was different, but I'm just brainstorming and hoping that I can point you in the right direction.  Make sure your OAuth tokens are specified correctly in Web.config and check to make sure you haven't exchanged the key and secret.  There's also a possibility that Twitter is just having a hiccup or a bad day.  You could also download Fiddler2 to see the response the Twitter is sending back and see if there is any message to help you pinpoint what they don't like.  Also, onsider whether Twitter is blocking you for some reason - not saying they are, but only trying to think of all the strange possibilities.

Another thought that might be fun. Reproduce the problem with Microsoft Test Manager and send me the .iTrace file.  I'll see if I can load it into VS 2010 Intellitrace and take a look.  Or, you can reproduce the problem in VS 2010 with Intellitrace turned on and then send me the Intellitrace log file.  If this isn't possible for one reason or another, no problem, I just thought it might be an interesting way to try to get a reproduction. Also, I might inadvertently have access to your OAuth keys, so you would have to think before doing this. Of course, all of this is shot if the problem was with Twitter or something strange with your network connection.

Well, I've talked a lot and haven't solved your problem, but hopefully there's a nugget or two in here that might help.

Good luck,

Joe

Read the full discussion online.

To add a post to this discussion, reply to this email (LinqToTwitter@discussions.codeplex.com)

To start a new discussion for this project, email LinqToTwitter@discussions.codeplex.com

You are receiving this email because you subscribed to this discussion on CodePlex. You can unsubscribe on CodePlex.com.

Please note: Images and attachments will be removed from emails. Any posts to this discussion will also be available online at CodePlex.com




--
Dan Swatik
http://www.danswatik.com
Apr 23, 2010 at 2:33 PM
Actually this is definatly a different error than I was getting .. not sure what is going on.as the expect100Continue is set to false ..


 
On Fri, Apr 23, 2010 at 9:29 AM, Danny Swatik <dswatik@gmail.com> wrote:
Well through some digging this is what is being returned The remote server returned an error: (417) Expectation Failed.
 
Fiddler didn't show the response for some reason...

On Thu, Apr 22, 2010 at 9:41 PM, JoeMayo <notifications@codeplex.com> wrote:

From: JoeMayo

You're using the sample application.  I just ran the sample application successfully on my system, so it seems your situation is not immediatly reproducible. 

Let's examine the error message some more.  It appears that the problem occurred when when reading Twitter's response.  Since Twitter returned a 403, .NET surfaced the error as an exception.  The 403 Forbidden is like a permissions error that says you're trying to do something that Twitter won't permit you to do.  To get more information, you can examine the exception when it's raised in the VS debugger.  Sometimes you get more information from Twitter in one of the headers that helps pinpoint the problem.

Other places to look include your Application settings with Twitter.  I recently heard from someone that they had their application set to Web, but tried to run it on desktop. Of course their error was different, but I'm just brainstorming and hoping that I can point you in the right direction.  Make sure your OAuth tokens are specified correctly in Web.config and check to make sure you haven't exchanged the key and secret.  There's also a possibility that Twitter is just having a hiccup or a bad day.  You could also download Fiddler2 to see the response the Twitter is sending back and see if there is any message to help you pinpoint what they don't like.  Also, onsider whether Twitter is blocking you for some reason - not saying they are, but only trying to think of all the strange possibilities.

Another thought that might be fun. Reproduce the problem with Microsoft Test Manager and send me the .iTrace file.  I'll see if I can load it into VS 2010 Intellitrace and take a look.  Or, you can reproduce the problem in VS 2010 with Intellitrace turned on and then send me the Intellitrace log file.  If this isn't possible for one reason or another, no problem, I just thought it might be an interesting way to try to get a reproduction. Also, I might inadvertently have access to your OAuth keys, so you would have to think before doing this. Of course, all of this is shot if the problem was with Twitter or something strange with your network connection.

Well, I've talked a lot and haven't solved your problem, but hopefully there's a nugget or two in here that might help.

Good luck,

Joe

Read the full discussion online.

To add a post to this discussion, reply to this email (LinqToTwitter@discussions.codeplex.com)

To start a new discussion for this project, email LinqToTwitter@discussions.codeplex.com

You are receiving this email because you subscribed to this discussion on CodePlex. You can unsubscribe on CodePlex.com.

Please note: Images and attachments will be removed from emails. Any posts to this discussion will also be available online at CodePlex.com




--
Dan Swatik
http://www.danswatik.com



--
Dan Swatik
http://www.danswatik.com
Apr 23, 2010 at 2:43 PM
Well, apparently something must have happened with my keys I had twitter regenerate a new set of API keys for me, and wham it works fine now... can we all say FAIL

On Fri, Apr 23, 2010 at 9:33 AM, Danny Swatik <dswatik@gmail.com> wrote:
Actually this is definatly a different error than I was getting .. not sure what is going on.as the expect100Continue is set to false ..


 
On Fri, Apr 23, 2010 at 9:29 AM, Danny Swatik <dswatik@gmail.com> wrote:
Well through some digging this is what is being returned The remote server returned an error: (417) Expectation Failed.
 
Fiddler didn't show the response for some reason...

On Thu, Apr 22, 2010 at 9:41 PM, JoeMayo <notifications@codeplex.com> wrote:

From: JoeMayo

You're using the sample application.  I just ran the sample application successfully on my system, so it seems your situation is not immediatly reproducible. 

Let's examine the error message some more.  It appears that the problem occurred when when reading Twitter's response.  Since Twitter returned a 403, .NET surfaced the error as an exception.  The 403 Forbidden is like a permissions error that says you're trying to do something that Twitter won't permit you to do.  To get more information, you can examine the exception when it's raised in the VS debugger.  Sometimes you get more information from Twitter in one of the headers that helps pinpoint the problem.

Other places to look include your Application settings with Twitter.  I recently heard from someone that they had their application set to Web, but tried to run it on desktop. Of course their error was different, but I'm just brainstorming and hoping that I can point you in the right direction.  Make sure your OAuth tokens are specified correctly in Web.config and check to make sure you haven't exchanged the key and secret.  There's also a possibility that Twitter is just having a hiccup or a bad day.  You could also download Fiddler2 to see the response the Twitter is sending back and see if there is any message to help you pinpoint what they don't like.  Also, onsider whether Twitter is blocking you for some reason - not saying they are, but only trying to think of all the strange possibilities.

Another thought that might be fun. Reproduce the problem with Microsoft Test Manager and send me the .iTrace file.  I'll see if I can load it into VS 2010 Intellitrace and take a look.  Or, you can reproduce the problem in VS 2010 with Intellitrace turned on and then send me the Intellitrace log file.  If this isn't possible for one reason or another, no problem, I just thought it might be an interesting way to try to get a reproduction. Also, I might inadvertently have access to your OAuth keys, so you would have to think before doing this. Of course, all of this is shot if the problem was with Twitter or something strange with your network connection.

Well, I've talked a lot and haven't solved your problem, but hopefully there's a nugget or two in here that might help.

Good luck,

Joe

Read the full discussion online.

To add a post to this discussion, reply to this email (LinqToTwitter@discussions.codeplex.com)

To start a new discussion for this project, email LinqToTwitter@discussions.codeplex.com

You are receiving this email because you subscribed to this discussion on CodePlex. You can unsubscribe on CodePlex.com.

Please note: Images and attachments will be removed from emails. Any posts to this discussion will also be available online at CodePlex.com




--
Dan Swatik
http://www.danswatik.com



--
Dan Swatik
http://www.danswatik.com



--
Dan Swatik
http://www.danswatik.com
Coordinator
Apr 23, 2010 at 8:34 PM

Dan,

Thanks for continued feedback.  It's helpful to build a knowledgebase of problems that people can encounter and actionable solutions.

Joe

Jun 29, 2010 at 5:47 PM

Hi Joe,

My app was getting error 403 Forbidden

Follow your tips, in Fiddler2, twitter API was returning:

 

<?xml version="1.0" encoding="UTF-8"?>

<hash>  
   <request>/1/statuses/update.xml?status=My Message Status;in_reply_to_status_id=A Number</request>  
   <error>Status is a duplicate.</error>
</hash>

I hope this can help.

[]´s

 

Juliano Oliveira