Modify

Opened 22 months ago

Closed 22 months ago

Last modified 22 months 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 22 months ago.
patch-bugreport-longer-error-message.patch (17.4 KB) - added by michael2402 22 months ago.
patch-bugreport-longer-error-message.2.patch (17.9 KB) - added by michael2402 22 months ago.

Download all attachments as: .zip

Change History (21)

Changed 22 months ago by michael2402

Changed 22 months ago by michael2402

comment:1 Changed 22 months ago by michael2402

Description: modified (diff)

comment:2 Changed 22 months ago by Don-vip

Component: CoreCore bugreport
Milestone: 16.03

comment:3 Changed 22 months ago by Don-vip

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 22 months ago by Don-vip (previous) (diff)

comment:4 Changed 22 months ago by michael2402

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 22 months ago by michael2402 (previous) (diff)

comment:5 Changed 22 months ago by stoecker

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

comment:6 Changed 22 months ago by michael2402

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 Changed 22 months ago by stoecker

For me it works now.

Changed 22 months ago by michael2402

comment:8 Changed 22 months ago by michael2402

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 Changed 22 months ago by Don-vip

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 Changed 22 months ago by Don-vip

By the way Trac 1.0.10 is out.

comment:11 Changed 22 months ago by stoecker

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

comment:12 Changed 22 months ago by Don-vip

Sure: Link

Last edited 22 months ago by stoecker (previous) (diff)

comment:13 Changed 22 months ago by stoecker

Fixed encoding.

comment:14 Changed 22 months ago by Don-vip

Resolution: fixed
Status: newclosed

In 10055/josm:

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

comment:15 Changed 22 months ago by Don-vip

In 10062/josm:

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

comment:16 Changed 22 months ago by Don-vip

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 Changed 22 months ago by Don-vip

In 10067/josm:

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

comment:18 Changed 22 months ago by Don-vip

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.

Add Comment


E-mail address and name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.