Failed uploads

Bug #215964 reported by Angus Helm
4
Affects Status Importance Assigned to Milestone
RescueTime Linux Uploader
Fix Released
High
Unassigned

Bug Description

I started using the rescuetime uploader in Linux earlier today and I've got 8 files in ~/.rescuetime/failed, and 1 file in ~/.rescuetime/finished. I've had no internet connection problems that I know of. My Dashboard shows very little data.

Is this a problem? Is there anything I can do to get the data uploaded, or to help out diagnosing the problem?

Revision history for this message
Angus Helm (angus.helm) wrote :

Could you try installing and using the attached uploader? When it fails to upload, it should leave a stacktrace in ~/.rescuetime/debuglog

Please send me that file.

Revision history for this message
BrendonD (brendon-makingtheinvisiblevisible) wrote :

I'm downloading the uploader that you attached now.

Some more info:

I tried modifying uploader.py in various ways to see what happened (using print statements), and the behaviour I witnessed was weird. I could be totally wrong, but I noticed the following:

1. If I added the window_title attribute using join(), the same problem occurred. (I created a new string containing "", and called join on that with 'out' as the first in the sequence)
2. If I used join() to create the string for the line containing the window_title attribute, it was fully formed, but when added to 'out' using 'out +=', the whole string did not seem to get added, the same problem ocurred.
3. If the window_title contained "OpenOffice", I added some arbitrary text to the string, using 'out +=', but that extra text never got appended to the end of 'out'.

The whole thing didn't really make sense to me, I hope your debug version can fill in some blanks. I'm dying to find out what's behind all this.

I'll add this data to the bug, since it wasn't in my first post:

Problem:
The file ends at the end of the window_title string, before the closing "</attribute>"
It only seems to occur when reporting OpenOffice.org

Revision history for this message
BrendonD (brendon-makingtheinvisiblevisible) wrote :

I've attached the first debuglog.

Revision history for this message
Angus Helm (angus.helm) wrote :

*facepalm*. Ugh, I can't believe I forgot this, but could you please remove the "raise Exception('hello')" line in the print_out function?

Also, if you edit your ~/.rescuetime/preferences file, you can set the "upload interval minutes" to 5 or something to try and generate the error faster.

Revision history for this message
BrendonD (brendon-makingtheinvisiblevisible) wrote :

Thanks for the help Angus, much appreciated.

After removing the "hello" exception, I got a few failed uploads, but no debuglog.

This fits with the earlier testing that I did, "out += ..." seems to fail silently, or only partially work, without throwing an exception.

Revision history for this message
Angus Helm (angus.helm) wrote :

That is incredibly bizarre. String concatenation failing with not even an exception thrown? You said you tried it with join(), correct? But it failed to connect the join()ed string to out? Could you try printing type(out) type(self.window_title) and type(escape_xml(self.window_title))

Also, I should have asked this before, but what Python version and Linux distro are you running? I'm trying to find out if there's possibly a concatenation bug between unicode and normal strings or something in an older Python version, but I'm not finding anything.

Revision history for this message
BrendonD (brendon-makingtheinvisiblevisible) wrote :

Well, it appears, there may be a flaw in my original testing, I got some different results from some more testing. I've attached the changed uploader.py, and the failed upload that it produced. I just changed the print_out method, here are the results from the print statements:

out2: <attribute name="window_title" type="string">Weekly Timetable - OpenOffice.org Writer</attribute>
type: <type 'str'>
Last 50 chars of out: ly Timetable - OpenOffice.org Writer</attribute>
type: <type 'str'>
Last 150 chars of out: type="string">Weekly Timetable - OpenOffice.org Writer</attribute>
  <attribute name="end_time" type="string">2008-04-15 20:01:00.790422</attribute>

The problem may be elsewhere.

Revision history for this message
BrendonD (brendon-makingtheinvisiblevisible) wrote :

Here is the modified uploader.py, I couldn't figure out how to attach two files.

I'm using python 2.5.1 on Xubuntu 7.10

Revision history for this message
BrendonD (brendon-makingtheinvisiblevisible) wrote :

Whoops, wrong file, here I go again.

Revision history for this message
Angus Helm (angus.helm) wrote :

That encoded.data file definitely has a weird char at the end of the window_title attribute. I'll have to look into how to go about removing any characters like that in the encode_url function.

Revision history for this message
BrendonD (brendon-makingtheinvisiblevisible) wrote :

Good spotting, I didn't have a hex editor or similar installed on my Linux machine (I do now), so I didn't see it. Thanks for your work so far, much appreciated.

Revision history for this message
Angus Helm (angus.helm) wrote :

Alright, sorry for taking so long with fixing this. I've checked a fix into bzr, if you're willing to test it. If not, I'm going to push out a release this weekend, so hopefully it should be fixed soon. Thanks for your patience with this.

Revision history for this message
BrendonD (brendon-makingtheinvisiblevisible) wrote :

I'm testing it now, thanks for the fix. You've been pretty quick really, it's only 3 or 4 days since you figured out the problem.

Thanks for your perseverence.

Revision history for this message
BrendonD (brendon-makingtheinvisiblevisible) wrote :

After my use of the new version over the weekend, it seems to work well, I now have OpenOffice appearing in my dashboard, and only 1 or 2 failed uploads, possibly for something unrelated.

Overall, it is a great improvement. Thanks.

Angus Helm (angus.helm)
Changed in rescuetime-linux-uploader:
importance: Undecided → High
status: New → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Related questions

Remote bug watches

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