After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 596617 - Freshly started activities have enormously large durations
Freshly started activities have enormously large durations
Status: RESOLVED FIXED
Product: hamster-applet
Classification: Deprecated
Component: general
2.28.x
Other Linux
: Normal normal
: ---
Assigned To: hamster-applet-maint
hamster-applet-maint
Depends on:
Blocks:
 
 
Reported: 2009-09-28 15:30 UTC by Mac Ryan
Modified: 2009-10-27 19:25 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Screencast demo of the bug (771.08 KB, video/ogg)
2009-09-28 15:30 UTC, Mac Ryan
Details

Description Mac Ryan 2009-09-28 15:30:26 UTC
Created attachment 144181 [details]
Screencast demo of the bug

BACKGROUND INFORMATION:
* Ubuntu Jaunty 9.04 64 bit - with all available updates (as of 28/9/09)
* I was using 2.26 and updated to 2.28 keeping the original DB
* I installed from source, following directions given @
http://projecthamster.wordpress.com/building-and-running/

SHORT DESCRIPTION:
It is impossible to start the tracker: it is only possible to add tasks that
have been already completed.

ADDITIONAL INFO:
Hamster fails at starting the logger: upon entering a task and pressing "Start
Tracking" a new "already finished" task is added to the day, and the indicator
remains still on "No Activity".
   Futhermore, the finishing time of such entries is anterior to the starting
time, resulting in bizarre amounts of time spent on the task (i.e.: 22751h).
   The checkbox "in progress" available by editing such task is also not
working (it is possible to select it, but it won't affect the task).

See attached demo.
Comment 1 Toms Bauģis 2009-09-28 15:35:45 UTC
cheers, will look into it!
Comment 2 Mac Ryan 2009-09-28 15:53:27 UTC
Just two additional pieces of info:

1. I noticed that the end time for any task I try to enter is constantly 14:57. This is also approximatively the time I installed the new version of Hamster, today (might it be somehow related?)

2. If after I insert the task "A" and let it stay in the log with it's crazy billions of hours, but after some time I enter a new "B" task, the "A" task gets correctly updated to the values that make it display the correct amount of time spent on the task (i.e. between the "A" and "B" insertion).

Just thought to share for completness.
Comment 3 Toms Bauģis 2009-09-28 22:45:36 UTC
I'm looking into this right now and I think something much simpler is going on here. But first let's try to get some data:
Could you please install sqlite3:

# sudo apt-get install sqlite3


And run these two commands in shell

# sqlite3 ~/.gnome2/hamster-applet/hamster.db 'select * from facts order by start_time desc limit 10';

# sqlite3 ~/.gnome2/hamster-applet/hamster.db 'select * from facts order by end_time desc limit 10';

Please upload the output as attachment to this bug
Comment 4 Toms Bauģis 2009-09-28 22:58:45 UTC
Hahah, actually i managed to replicate the bug by adding an activity in the future.
Your output from the first command will be something like this

1569|155|2010-09-28 23:52:48||
1570|23|2009-09-28 23:53:00|2010-09-28 23:52:48|
1568|23|2009-09-28 23:31:00|2009-09-28 23:52:46.370847|

Notice the first row - it is in future and without end time.
You can remove such records by calling 'delete from activities where id = ...' in sqlite. It could be that there will be quite a few invalid (by invalid i mean start time in the future) records like these, so please remove them all.

After that remove/add to panel hamster.

I will make hamster more pickier when it chooses last activity.

Please confirm that the diagnose has been correct.
Comment 5 Toms Bauģis 2009-09-29 00:27:22 UTC
Commited changes that will fix this problem, but will not modify data.
So, please

git pull --rebase

followed by 
make install

I would also suggest to manually remove the invalid entries with time in future, because otherwise they will start to pop up in a year or so :)

Thanks for the report, Mac!
I will keep the bug open for now to remind me that i should revisit the no-end-time thing.
Comment 6 Mac Ryan 2009-09-29 09:32:25 UTC
Well... thanks to you Tom for this super-timely and super-effectie support... I was already planning to get back to the 2.26 waiting for the issue to be solved in the weeks to come... but you made wonders instead! :)

The problem was exactly what you mentioned, and visiting my DB allowed me to spot plenty of broken record both in the past (as far as 1932) and in the future. Probably because of the missing start/end date, these records where not showing in the "statistics" tab, as indeed yesterday I deleted manually (i.e. from hamster inteface) all of those I could see.

As soon as the DB was sanitised all worked perfectly. However I could not update hamster following the suggested procedure (this is not a major issue though, as hamster seems to work as it should, now):

git --rebase outputs:

remote: Counting objects: 12, done.
remote: Compressing objects: 100% (7/7), done.
remote: Total 7 (delta 6), reused 0 (delta 0)
Unpacking objects: 100% (7/7), done.
From git://git.gnome.org/hamster-applet
   06b3616..7063b16  gnome-2-28 -> origin/gnome-2-28
   5adcf00..d7e753d  master     -> origin/master
First, rewinding head to replay your work on top of it...
Fast-forwarded master to d7e753d132683998833fb9a9fb20bc3b2cbef4ae.

But make install outputs:

Making install in hamster
make[1]: Entering directory `/home/mac/ham-tmp/hamster-applet/hamster'
make  install-recursive
make[2]: Entering directory `/home/mac/ham-tmp/hamster-applet/hamster'
Making install in keybinder
make[3]: Entering directory `/home/mac/ham-tmp/hamster-applet/hamster/keybinder'
make[4]: Entering directory `/home/mac/ham-tmp/hamster-applet/hamster/keybinder'
make[4]: Nothing to be done for `install-exec-am'.
test -z "/usr/lib/python2.6/dist-packages/hamster/keybinder" || /bin/mkdir -p "/usr/lib/python2.6/dist-packages/hamster/keybinder"
 /bin/bash ../../libtool   --mode=install /usr/bin/install -c  '_keybinder.la' '/usr/lib/python2.6/dist-packages/hamster/keybinder/_keybinder.la'
libtool: install: /usr/bin/install -c .libs/_keybinder.so /usr/lib/python2.6/dist-packages/hamster/keybinder/_keybinder.so
/usr/bin/install: cannot remove `/usr/lib/python2.6/dist-packages/hamster/keybinder/_keybinder.so': Permission denied
make[4]: *** [install-_keybinderLTLIBRARIES] Error 1
make[4]: Leaving directory `/home/mac/ham-tmp/hamster-applet/hamster/keybinder'
make[3]: *** [install-am] Error 2
make[3]: Leaving directory `/home/mac/ham-tmp/hamster-applet/hamster/keybinder'
make[2]: *** [install-recursive] Error 1
make[2]: Leaving directory `/home/mac/ham-tmp/hamster-applet/hamster'
make[1]: *** [install] Error 2
make[1]: Leaving directory `/home/mac/ham-tmp/hamster-applet/hamster'
make: *** [install-recursive] Error 1

Again many many thanks... Hamster is a small utility that makes life much easier, and this version is actually very very nice! :)
Comment 7 Toms Bauģis 2009-09-29 09:35:49 UTC
Sorry, it should be

sudo make install


You are encouraged to file bugs if you find anything else or enhancement requests if you don't :)
Comment 8 Cosimo Cecchi 2009-10-08 15:52:03 UTC
*** Bug 592730 has been marked as a duplicate of this bug. ***
Comment 9 Brendan P 2009-10-14 06:58:19 UTC
(In reply to comment #4)
> Hahah, actually i managed to replicate the bug by adding an activity in the
> future.
> Your output from the first command will be something like this
> 
> 1569|155|2010-09-28 23:52:48||
> 1570|23|2009-09-28 23:53:00|2010-09-28 23:52:48|
> 1568|23|2009-09-28 23:31:00|2009-09-28 23:52:46.370847|
> 
> Notice the first row - it is in future and without end time.
> You can remove such records by calling 'delete from activities where id = ...'
> in sqlite. It could be that there will be quite a few invalid (by invalid i
> mean start time in the future) records like these, so please remove them all.
> 
> After that remove/add to panel hamster.
> 
> I will make hamster more pickier when it chooses last activity.
> 
> Please confirm that the diagnose has been correct.


Morning,

Firstly thanks for a great app, been very useful for me as I work from home and it keeps me in line (so far as I know how much time I'm spending on work etc).

I've come across this error when upgrading to Ubuntu 9.10 (karmic, beta) yesterday. 2.28 is the default in karmic.

I rand the sqlite commands and confirmed I have future entries like this bug describes. However I'm having trouble deleted using the command above.

$ sqlite3 ~/.gnome2/hamster-applet/hamster.db 'select * from facts order by
start_time desc limit 10';
331|1|2027-05-31 11:03:00|2027-05-31 11:30:00|
758|11|2018-11-27 15:15:00|2018-11-27 15:30:00|
16|11|2015-02-27 12:01:00|2015-02-27 12:30:00|
736|34|2014-09-22 07:23:00|2014-09-22 07:30:00|
843|34|2009-10-14 07:11:00|2009-10-14 07:34:22|
842|10|2009-10-13 13:40:22.988777|2009-10-13 14:07:50.792122|
841|19|2009-10-13 12:20:24.285549|2009-10-13 12:34:29.284232|
840|10|2009-10-13 11:30:36.492452|2009-10-13 12:20:24.285549|
839|13|2009-10-13 11:10:36.998010|2009-10-13 11:30:36.492452|
838|33|2009-10-13 10:19:30.092968|2009-10-13 11:10:36.998010|

$ sqlite3 ~/.gnome2/hamster-applet/hamster.db 'delete from activities where id = 331'

This command does nothing, and if I search the db again it's still listed. Any thoughts/suggestions as to what I'm doing wrong?

Thanks again.

All the best
Brendan
Comment 10 Toms Bauģis 2009-10-14 07:39:15 UTC
the deletion statement looks fine. although unlikely, it could be that application on commit is performing a full write from memory. maybe try removing hamster from panel before trying to do the deletes. 

there is also an "sqlite manager" addon for firefox (can be installed via tools -> add-ons in firefox) that comes with a user interface, could not get it running on my box though, but i think if it runs for you, maybe it will help to get rid of the records
Comment 11 Brendan P 2009-10-14 08:11:04 UTC
Thanks for the input.

No luck on removing it from the panel and trying the delete command. Tried logging out, back in and then trying again but no go. Will try the FF plugin next.

Cheers
B
Comment 12 Brendan P 2009-10-14 08:24:24 UTC
Good news, the FF extension worked well. Was able to browse the table and sort by date, removing any future/past dates that where way out.

All working 100% now, thanks again for great app.

For those interested, the extension can be found here:
https://addons.mozilla.org/en-US/firefox/addon/5817

Cheers
Brendan
Comment 13 Toms Bauģis 2009-10-27 19:25:11 UTC
the fix has been pushed to the 2.28 branch, so i'm marking this as fixed.