detect errors and give information about possible causes

Bug #1055522 reported by Rolf Leggewie
56
This bug affects 9 people
Affects Status Importance Assigned to Milestone
pastebinit
Triaged
Wishlist
Unassigned
pastebinit (Debian)
Confirmed
Unknown

Bug Description

many users are confused when pastebinit silently fails which actually happens fairly frequently. paste.debian.net is more finicky because the maintainers there have a number of (plausible) rules of what they consider an acceptable paste. The problem is the lack of a feedback channel from the web service through pastebinit to the user. Eventually pastebinit should have proper error handling, but until that is implemented and in the spirit of the 80/20 rule I suggest the following.

1) detects if there is no valid (AKA empty) pasteid, meaning an error of some sort has occured
2) Instead of simply giving the user the pastebin baseurl pastebinit fails and gives an explanation of known causes

For paste.debian.net these are

a) either the file has only 1 line (it works with 2 lines or more)
b) or the document is too big (>153599 bytes )
c) or the username is >10 characters

Setting to High priority because of the number of reports we get for this and the potential to confuse our users.

Rolf Leggewie (r0lf)
description: updated
Revision history for this message
YannUbuntu (yannubuntu) wrote :

Step1) :
detects if there is no valid (AKA empty) pasteid, meaning an error of some sort has occurred. --> In this case, pastebinit should return an error code (eg FAILURE='exit 1', SUCCESS='exit 0'), so that it can be easily read by other programs (eg Boot-Repair) that need to know if Pastebinit failed or not, but which don't need more details about why it failed. IMO, this can be implemented in a first step (before Step2 below).

Step2):
instead of simply giving the user the pastebin baseurl pastebinit fails and gives an explanation of known causes --> we found 3 rules for Debian.paste, but these rules may change, and the rules may be different with other pastebins. So this is IMO a good idea, but it may take time to discover all the rules of each pastebin, and we may need to check&update the rules regularly in the future.

Changed in pastebinit (Debian):
status: Unknown → Confirmed
Revision history for this message
Adam Stokes (adam-stokes) wrote :

wrt paste.debian.net we'd need to look in the response body for an error "<div class=status> \nCould not add your entry to the paste database:<br><br>\n<b>Thanks to some spammers you need to provide at least 3 or two linebreaks</b><br>\n\n</div>" as the response code is 200 whether or not the paste succeeded. Furthermore, I suggest we interface with debian paste's api rather than attempting to submit directly through the website. The clients page for debian is a bit misleading as it states pastebinit uses the xmlrpc already

http://paste.debian.net/paste.pl?show_template=clients

However, that is not the case. So without a proper response I don't see another way to detect for error other than parsing the response body

Revision history for this message
Stéphane Graber (stgraber) wrote :

Marking as wishlist. To fix this properly, we'll need to wait until a major rewrite of pastebinit where each pastebin is defined in python (rather than an .ini file) and so can easily define a set of standard errors it supports.

Changed in pastebinit:
importance: High → Wishlist
Revision history for this message
Rolf Leggewie (r0lf) wrote :

Stéphane, considering how long this has been lingering, the impact it has on users and the availability of an easy stop-gap measure, I disagree with your assessment. Again, think 80/20.

"detects if there is no valid (AKA empty) pasteid, meaning an error of some sort has occured" <- that should be easy enough to accomplish and would go a long way in eliminating a bulk of the impact of this problem. Can we please look more seriously into such a stop-gap measure?

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.