Timekpr-next on Debian / Crostini / ChromeOS Linux subsystem

Bug #2091244 reported by Douglas Held
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Timekpr-nExT
Incomplete
Undecided
Eduards Bezverhijs

Bug Description

Steps to reproduce

1. Install the Debian-type Linux subsystem (Crostini, Penguin) on a Chromebook

uname -a
Linux penguin 6.6.50-05090-g02ec56928355 #1 SMP PREEMPT_DYNAMIC Fri, 8 Nov 2024 00:13:13 +0000 x86_64 GNU/Linux

2. sudo apt update && sudo apt install timekpr-next
The version of timekpr-next is 0.5.4-1

3. Set logging to 3 in /etc/timekpr.conf

4. sudo timekpra

Expected results
1. Graphical utility opens reliably

Actual result
1. Graphical utility opens. At the bottom is printed:
Connected UNEXPECTED ERROR: "org.freedesktop.DBus.Python.ValueError: Traceback (most recen

2. Close the application window

3. The terminal has printed:
(timekpra.py:665): Gtk-CRITICAL **: 17:45:08.819: gtk_widget_get_visible: assertion 'GTK_IS_WIDGET (widget)' failed

4. cat /var/log/timekpr.log | grep -i dbus
dbus python 1.3.2
...
got 0 sessions: dbus.Array([], signature=dbus.Signature('(so)'), variant_level=1), start loop

Revision history for this message
Eduards Bezverhijs (mjasnik) wrote (last edit ):

Please try to use the latest version from my ppa. The link is on the main project page.

If it does not work, please attach whole log file (zipped) and user config file to this bug report. Instructions where to find them are in the project readme.

Changed in timekpr-next:
status: New → Incomplete
assignee: nobody → Eduards Bezverhijs (mjasnik)
Revision history for this message
Douglas Held (spam-c) wrote :

Thank you! I apologise for the title. Originally I was troubleshooting Minecraft, then after reboot had this additional error.
I will uninstall and try the version from the PPA.

Revision history for this message
Douglas Held (spam-c) wrote :

sudo apt install software-properties-common
sudo apt install python3-launchpadlib
sudo add-apt-repository ppa:mjasnik/ppa

I get an error, 404 Not Found [IP: 185.125.190.80 443]
E: The repository 'https://paa.launchpadcontent.net/mjasnik/ppa/ubuntu bookwork Release' does not have a Release file.

Revision history for this message
Douglas Held (spam-c) wrote :

s/paa/ppa/
s/bookwork/bookworm/

In my situation I am hand-typing the error messages...
I believe the problem is it is looking for the "bookworm" Debian release and not finding it in the repo.

I have looked for any manual installation instructions and not found them. I wouldn't mind to ./configure, make, and make install if that is an option.

Douglas Held (spam-c)
summary: - Accounting for Minecraft on Crostini / ChromeOS
+ Timekpr-next on Debian / Crostini / ChromeOS Linux subsystem
Revision history for this message
Eduards Bezverhijs (mjasnik) wrote :

I’ll try to build debian package in coming days, but I think you can download latest from ubuntu and use it.

For example, you can try this one: https://code.launchpad.net/~mjasnik/+archive/ubuntu/ppa/+files/timekpr-next_0.5.7-1ubuntu1~ppa1~ubuntu22.04.1_amd64.deb

Revision history for this message
Douglas Held (spam-c) wrote :

Thank you! I installed it.

The software does not seem to be detecting on Linux on the Chromebook. Would you like to have a look? https://www.youtube.com/watch?v=PiIO8-a4m5Q

Note, I created timestamps in the video description for each demonstrated state or event.

Revision history for this message
Douglas Held (spam-c) wrote :

The DBus error is no longer demonstrated - this enables me to report the additional problem, which is that the process is not tracked. Would you like for me to open a new issue record?

Revision history for this message
Douglas Held (spam-c) wrote :

Another problem I noticed: I tried to open timekprc - the graphical client?

Perhaps there is a GTK subsystem that needs to be installed. The windowing system is Wayland.

Again, I am happy to move this to a separate ticket. I do not know if it is related.

eleanor@penguin:~$ timekprc

(timekprc.py:1998): Gtk-CRITICAL **: 17:03:43.580: gtk_widget_get_scale_factor: assertion 'GTK_IS_WIDGET (widget)' failed

(timekprc.py:1998): Gtk-CRITICAL **: 17:03:44.134: gtk_widget_get_scale_factor: assertion 'GTK_IS_WIDGET (widget)' failed
ERROR:dbus.connection:Unable to set arguments ('Timekpr', 0, 'dialog-warning', 'Timekpr-nExT PlayTime notification', 'You have 0 hours 1 minute 0 seconds of PlayTime left', [], {'urgency': dbus.Byte(1, variant_level=1)}, 10000) according to signature None: <class 'ValueError'>: Unable to guess signature from an empty list
ERROR:dbus.connection:Unable to set arguments ('Timekpr', 0, 'dialog-information', 'Timekpr-nExT notification', 'You have 2 hours 56 minutes 16 seconds left', [], {'urgency': dbus.Byte(0, variant_level=1)}, 3000) according to signature None: <class 'ValueError'>: Unable to guess signature from an empty list
ERROR:dbus.connection:Unable to set arguments ('Timekpr', 0, 'dialog-warning', 'Timekpr-nExT notification', 'Feature "screensaver", which is used to detect idle time, cannot be enabled!\nIdle / inactive time might not be accounted when screen is locked!', [], {'urgency': dbus.Byte(1, variant_level=1)}, 3000) according to signature None: <class 'ValueError'>: Unable to guess signature from an empty list

Revision history for this message
Eduards Bezverhijs (mjasnik) wrote (last edit ):

I have watched a video, thanks for providing one.

First of all, the bash script you created and ran will not ever detect as PT activity, because "java" is not not a process name in that case, it's "bash" - because bash runs your script. I won't delve into details for this right now, because your installation has more pressing issues than this.

It seems that time accounting does not work at all, you can see that in first tab "Info & today", all spent values are 0.
All the time goes to inactive, which it should not. I did not see that you have unlimited intervals selected so I suspect something goes seriously wrong on this ChromeOS + Debian hybrid.

Since time accounting itself does not work, PT will not work too, because time accounting is the same for normal time as well as PT. At some point in your video, when you open the real minecraft, you can see that actual activity count is 1, because real minecraft process name is actually java, so that works just fine and the global issue is time accounting itself.

You tried to open timekprc, that's the "icon" and even that spits out bunch of DBUS errors, which it never does on normal installation.

I do not have ChromeOS, I don't know basically anything about it, however, I can look at log files to check what's going on.
So please attach log files and config files to this bug report, let's see whether this is fixable at all.
And please do not cut anything from log files, I would like to get the full log files from the start. Zip them if they are "fat" :)

Revision history for this message
Douglas Held (spam-c) wrote :

OK, thank you. With the new install I think logging == 1 so I repeated the key steps with logging at the higher level and attach here:
https://drive.google.com/file/d/11HBrREtjbNpaSngaJ9TaAQ0E7C-jtsCT/view?usp=drive_link

I don't understand the context very completely; the architecture is described here: https://www.youtube.com/watch?v=_k6zdvM9rUA
ChromeOS runs a VM called Termina
Termina has LXD to run containers
LXD loads an LXC container called "penguin", which has the Debian and Wayland image.

Maybe the broken part relates to what your python process is (or is not) able to see from this container.

Revision history for this message
Douglas Held (spam-c) wrote :

I have here, a simple test of three different types of process accounting from Python3 (thanks, Chatgpt)

You can see that some of the methods succeed, while some of the methods can capture the times. On this particular system.

Revision history for this message
Eduards Bezverhijs (mjasnik) wrote :

>> I have here, a simple test of three different types of process accounting from Python3 (thanks, Chatgpt)
>> You can see that some of the methods succeed, while some of the methods can capture the times. On this particular system.

Sorry, this is completely unrelated to the issue at hand, like not even remotely related.

Revision history for this message
Eduards Bezverhijs (mjasnik) wrote :

I had a look at log file, there are no good news there...

The issue is that this hybrid environment reports that your linux session is in "lingering" state, so it is not active really and neither is logged in really, usually on normal linux installations this means that someone logged out and session stays in this lingering state for some time.

Here is the description of user states from official documentation:
"offline" (user not logged in at all)
"lingering" (user not logged in, but some user services running)
"online" (user logged in, but not active, i.e. has no session in the foreground)
"active" (user logged in, and has at least one active session, i.e. one session in the foreground)
"closing" (user not logged in, and not lingering, but some processes are still around)

The next thing is that user has idle hint too, your hybrid installation reports that the user is idle.

These do not determine whether we need to account time, these are indicators that this does not look good.

There is one issue that can not be solved - there are NO sessions reported for this user. This does not look like a normal desktop session which timekpr relies on.

So even if I make the user to be detected as active (and not ruining it for the normal installations at the same time) and the time will be accounted, timekpr will not be able to do much because there are no sessions that can be terminated or locked. If this is running in a VM, probably timekpr does not see anything outside that VM either.

So because of this I am not sure really what will actually work there at all. Maybe processes that are in the VM can be killed.
So this looks pretty much impossible to solve to have proper timekpr functionality in this hybrid installation.

So, I'll mark this bug as invalid after some time.

Edit: consolidated answer into one comment.

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

Other bug subscribers

Related questions

Bug attachments

Remote bug watches

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