5
$\begingroup$

When I tried to add a picture to a new MO question, I got the error in the title. The data size is below 1 MB as a jpg image, but above 3 MB as a png. I noticed however that the image doesn't lie within the dashed outline of the upload dialog (where you put the image via drag and drop).

Question What can be the cause of the problem when trying to upload the jpg, resp. what can I try to get it uploaded?

I tagged the question also as a bug, but it doesn't mean it actually is one.

$\endgroup$
9
  • $\begingroup$ Unless recently something has changed, images are not uploaded to MO, but only linked to. -- To which site did you try to upload the image? $\endgroup$
    – Stefan Kohl Mod
    Commented Jan 28, 2017 at 17:09
  • $\begingroup$ @StefanKohl I tried to upload the image from my computer. $\endgroup$ Commented Jan 28, 2017 at 17:26
  • $\begingroup$ @StefanKohl I tried to upload to Mathoverflow by clicking on the picture icon above the edit box and then copy pasted the file into the appearing upload box. I didn't specify anything else. $\endgroup$ Commented Jan 28, 2017 at 17:34
  • 2
    $\begingroup$ @ManfredWeis Images "uploaded to MathOverflow" are actually uploaded to Stack Exchange's Imgur account. It is possible (I'm not sure how probable) that Imgur is giving you the error. Can you provide a screenshot of the error, or it's full text? $\endgroup$
    – user642796
    Commented Jan 28, 2017 at 18:02
  • 1
    $\begingroup$ @arjafi I can do that, where should I send the screenshot? $\endgroup$ Commented Jan 28, 2017 at 18:51
  • $\begingroup$ When I tried the same again to reproduce the error, it worked now. So thank you Stefan and Arjafi for your effort to get the issue resolved. $\endgroup$ Commented Jan 28, 2017 at 18:56
  • $\begingroup$ @ManfredWeis I just realised the difficulty you might have uploading a screenshot of the error.... I'm glad this has been resolved for you. Hopefully it was just a random glitch that won't reoccur. $\endgroup$
    – user642796
    Commented Jan 28, 2017 at 19:09
  • 3
    $\begingroup$ It seems that some other users in SE network experienced similar error. Here is a thread from a related meta: This error is a teapot? And perhaps related on main meta: Stack Overflow returning HTTP error code 418 (I'm a teapot)?. I am not sure whether there is some useful information, but at least there is a screenshot. $\endgroup$ Commented Jan 29, 2017 at 6:45
  • $\begingroup$ I think that the tag (images) might be suitable for this question. (I do not have enough reputation to edit on meta, which is why I am making this suggestion in a comment instead.) $\endgroup$ Commented Jan 29, 2017 at 6:46

1 Answer 1

12
$\begingroup$

The "teapot" error is one of the various responses we return if something looks very suspicious at the http/form level - most likely because of an XSRF check failure. On mathoverflow, this is usually from bots that spend their entire life trying to edit one post (seriously, it is always the same post - I have no idea why, there's nothing particularly unusual about this one post). But yes, I can see that you got that error 3 times on the 28th.

(edit: removed a paragraph relating to profile images, I went a bit mad there)

I am investigating. It looks like it is generally working; I've tried to repeat your steps using the same browser as you (slightly different OS), and it worked fine.


Update: I have identified a scenario that could theoretically cause this result and which would be consistent with your recorded activity. Could you please try to indicate exactly which options you used on the image upload? Did you:

  • paste an image
  • click and select an image from your file system
  • drag and drop (and what: a file? an image?)
  • provide a url
  • other...?

OK, I'm 98.2% sure of what happened, have a working repro that causes the problem locally, and am in the process of pushing a fix. Basically, the XSRF protection for the image upload form would not be updated in the scenario:

  • start writing / editing a post
  • show the image upload form, close it
  • do "stuff" on other pages - searching, etc (you searched, according to our http logs; searching is good - I applaud you) that causes your XSRF token to be rotated
  • reopen the image upload form, and do something that causes the non-ajax submit to be used (basically, anything that doesn't have a preview)
  • attempt to submit it

In that rather convoluted scenario (which matches exactly what I can see from your logs), the old XSRF token (the one from when you first showed the image upload form) would be used, and it would be rejected. However, when you get to submit the actual post, the correct XSRF token will have been used (via some evil browser magic).

As I say: I'm almost certain that this is what bit you, and a fix will be deployed today. Note that rotating XSRF tokens is a rare event, so you might also want to think about purchasing a lottery ticket for managing to achieve such an unlikely sequence of events. And then maybe reconsider it because you presumably (as a user here) have a working knowledge of how probability works.

$\endgroup$
3
  • $\begingroup$ Marc, I clicked and selected an image... $\endgroup$ Commented Jan 30, 2017 at 12:33
  • $\begingroup$ @ManfredWeis from your local file system? or from the internet? $\endgroup$ Commented Jan 30, 2017 at 12:39
  • $\begingroup$ @ManfredWeis see additional update; I'm going to count this "fixed", I think $\endgroup$ Commented Jan 30, 2017 at 13:18

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .