Modify

Opened 9 years ago

Closed 9 years ago

Last modified 9 years ago

#12652 closed enhancement (fixed)

[Patch] Do not ...snip... bug report messages after 6000 characters.

Reported by: michael2402 Owned by: team
Priority: normal Milestone: 16.04
Component: Core bugreport Version:
Keywords: Cc: stoecker

Description (last modified by michael2402)

A URL get parameter is restricted to 2000 characters (server/client dependent). JOSM increases that limit by using GZIP but strips all stack traces after 6000 characters. There are several cases where this is not enough and JOSM did not send along the interesting "Caused by..." line.

#12603 contains the server side code for this. That patch is already applied so this code is ready to be used.

This is what it looks like if an error occurred while opening the browser window:

Attachments (3)

patch-bugreport-longer-error-message-1.png (34.5 KB ) - added by michael2402 9 years ago.
patch-bugreport-longer-error-message.patch (17.4 KB ) - added by michael2402 9 years ago.
patch-bugreport-longer-error-message.2.patch (17.9 KB ) - added by michael2402 9 years ago.

Download all attachments as: .zip

Change History (21)

comment:1 by michael2402, 9 years ago

Description: modified (diff)

comment:2 by Don-vip, 9 years ago

Component: CoreCore bugreport
Milestone: 16.03

comment:3 by Don-vip, 9 years ago

Cc: stoecker added

it does not work:

INFO: POST https://josm.openstreetmap.de/josmticket -> 500 (15.6 kB)
DEBUG: RESPONSE: {null=[HTTP/1.1 500 Internal Server Error], Strict-Transport-Security=[max-age=16070400; includeSubDomains], Cache-Control=[must-revalidate], Server=[Apache/2.4.7 (Ubuntu)], Connection=[close], Expires=[Fri, 01 Jan 1999 00:00:00 GMT], Content-Length=[16008], X-Clacks-Overhead=[GNU Terry Pratchett], Date=[Sat, 19 Mar 2016 18:53:06 GMT], Content-Type=[text/html;charset=utf-8]}
WARNING: org.openstreetmap.josm.tools.bugreport.BugReportSender$BugReportSenderException: Error in server response but server did not tell us what happened.
org.openstreetmap.josm.tools.bugreport.BugReportSender$BugReportSenderException: Error in server response but server did not tell us what happened.
	at org.openstreetmap.josm.tools.bugreport.BugReportSender.retrieveDebugToken(BugReportSender.java:113)
	at org.openstreetmap.josm.tools.bugreport.BugReportSender.pasteDebugText(BugReportSender.java:92)
	at org.openstreetmap.josm.tools.bugreport.BugReportSender.run(BugReportSender.java:60)
Last edited 9 years ago by Don-vip (previous) (diff)

comment:4 by michael2402, 9 years ago

That's bad, this means that something is wrong with the python script. This is what it should look like.

[java] INFO: POST https://josm.openstreetmap.de/josmticket (642 B) ...
[java] INFO: POST https://josm.openstreetmap.de/josmticket -> 200
[java] INFO: Öffne URL: https://josm.openstreetmap.de/josmticket?pdata_stored=ac4a1d656daa4075bac5c82c

For me, it worked this time and the times before that. If you encounter this again, can you try to dump the complete server response by adding this in BugReportSender after Response connection = client.connect();? There should be a python error message.

            System.out.println(new Scanner(connection.getContentReader()).useDelimiter("\\A").next());
Last edited 9 years ago by michael2402 (previous) (diff)

comment:5 by stoecker, 9 years ago

There was an UTF-8 issue. Does it work now?

comment:6 by michael2402, 9 years ago

There is still a problem with this...

     [java]   File "/home/josm/trac/plugins/JOSM.py", line 361, in process_request
     [java]     req.session['preparedticket'] = pdata.encode('utf-8')
     [java] UnicodeDecodeError: 'ascii' codec can't decode byte 0xe4 in position 480: ordinal not in range(128)

There seems to be an issue with the database storing that text.

I'll try to read into postgres code and find a fix that changes the encoding tomorrow... For the post parameters I added this later on:

 xxx.decode('utf-8', errors='ignore')

comment:7 by stoecker, 9 years ago

For me it works now.

comment:8 by michael2402, 9 years ago

I updated the patch. The only change is to use UTF-8 to encode the base64 string.

Base64#encode(String) can only handle ascii.

comment:9 by Don-vip, 9 years ago

There's still one problem, in the About action we still have a link to https://josm.openstreetmap.de/josmticket?gdata=<...>

It fails:

Erreur impliquant Genshi (UnicodeDecodeError - '/usr/local/lib/python2.7/dist-packages/Trac-1.0.9-py2.7.egg/trac/ticket/templates/ticket.html', line 251, char -1)

It needs to be fixed for older JOSM clients.

comment:10 by Don-vip, 9 years ago

By the way Trac 1.0.10 is out.

comment:11 by stoecker, 9 years ago

Can you please supply the full link, as here it works fine.

comment:12 by Don-vip, 9 years ago

Sure: Link

Last edited 9 years ago by stoecker (previous) (diff)

comment:13 by stoecker, 9 years ago

Fixed encoding.

comment:14 by Don-vip, 9 years ago

Resolution: fixed
Status: newclosed

In 10055/josm:

fix #12652 - Do not ...snip... bug report messages after 6000 characters (patch by michael2402, modified)

comment:15 by Don-vip, 9 years ago

In 10062/josm:

see #12652 - about dialog: replace old bug report link with new bug report button, remove unused code

comment:16 by Don-vip, 9 years ago

In 10064/josm:

see #12652, see #11924 - re-add a unit test in BugReportExceptionHandler, empty test class causes an error with Java 9

comment:17 by Don-vip, 9 years ago

In 10067/josm:

see #12652 - rework bug report classes to improve unit tests coverage

comment:18 by Don-vip, 9 years ago

Milestone: 16.0316.04

Milestone renamed

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain team.
as The resolution will be set.
The resolution will be deleted. Next status will be 'reopened'.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.