User is not force logged out - TypeError: 'float' object cannot be interpreted as an integer

Bug #1996105 reported by Aryeh
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Timekpr-nExT
Invalid
Undecided
Eduards Bezverhijs

Bug Description

On Wednesday child_account should be allowed to use account between 16:30-17:20 and also 18:00-20:00. Account is correctly logged out at 17:20, but not at 20:00. There is also an error in the logs at about 19:59.

I'm using version 0.5.2 on ubunutu desktop 22.04

2022-11-09 19:59:03.610780: sending tln: 57
2022-11-09 19:59:03.610887: ---=== ERROR working on users ===---
2022-11-09 19:59:03.611310: Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/timekpr/server/interface/dbus/daemon.py", line 133, in executeTimekprWorker
    self.checkUsers()
  File "/usr/lib/python3/dist-packages/timekpr/server/interface/dbus/daemon.py", line 258, in checkUsers
    timeLeftArray = self._timekprUserList[rUserName].getTimeLeft()
  File "/usr/lib/python3/dist-packages/timekpr/server/user/userdata.py", line 603, in getTimeLeft
    self._timekprUserNotification.processTimeLeft(pForceNotifications, timeValues)
  File "/usr/lib/python3/dist-packages/timekpr/common/utils/notifications.py", line 139, in processTimeLeft
    self.timeLeftNotification(notifUrgency, max(pTimeValues[cons.TK_CTRL_LEFT], 0), max(pTimeValues[cons.TK_CTRL_LEFTD], 0), pTimeValues[cons.TK_CTRL_LIMITD])
  File "/usr/lib/python3/dist-packages/dbus/decorators.py", line 325, in emit_signal
    message.append(signature=signature, *args)
TypeError: 'float' object cannot be interpreted as an integer

Revision history for this message
Aryeh (agielchinsky) wrote :
Aryeh (agielchinsky)
description: updated
Revision history for this message
Eduards Bezverhijs (mjasnik) wrote (last edit ):

This issue was spotted and fixed in the beginning of this year after a python version update in some linux distributions.
The fix is incorporated in 0.5.3+ version of timekpr which is not yet packaged in debian and as a result not in ubuntu too.

Please install version from my PPA, latest at this point is 0.5.4 and this should fix it.

Pls report back whether it's all ok.

Changed in timekpr-next:
status: New → Triaged
assignee: nobody → Eduards Bezverhijs (mjasnik)
Revision history for this message
Aryeh (agielchinsky) wrote :

I removed the original (0.5.2) and installed your PPA and now it doesn't limit users at all. When I click on the SU icon it tries to connect, and then says "Failed to connect".

When I run sudo timekpra I get this 5 times:

```
FAILED to obtain connection to timekpr.
Please check that timekpr daemon is working and you have sufficient permissions to access it (either superuser or timekpr group)
connection failed, 1 attempts left, will retry in 3 seconds
FAILED to obtain connection to timekpr.
Please check that timekpr daemon is working and you have sufficient permissions to access it (either superuser or timekpr group)
```

Here are some other things I checked based on https://answers.launchpad.net/timekpr-next/+question/691218:

sudo systemctl status timekpr
○ timekpr.service
     Loaded: masked (Reason: Unit timekpr.service is masked.)
     Active: inactive (dead)

sudo systemctl enable timepkr
Failed to enable unit: Unit file timepkr.service does not exist.

sudo systemctl start timekpr
Failed to start timekpr.service: Unit timekpr.service is masked.

/var/log/timekpr.log logs stop after I installed the new version.

ls /run/systemd/system/
netplan-ovs-cleanup.service systemd-networkd.service.wants

dbus-send --system --print-reply --dest=org.freedesktop.DBus /org/freedesktop/DBus org.freedesktop.DBus.ListNames | grep login1
      string "org.freedesktop.login1"

Revision history for this message
Aryeh (agielchinsky) wrote :

I left the old config files in place. Are they compatible with the new version (0.5.2 - > 0.5.4)?

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

Config files are compatible and are upgraded as needed, no worries.

However, ofc it won't limit anything, because it appears that timekpr is masked and that's not smth it does by itself.

I would suggest to reload daemon, unmask timekpr and start it, that would be:
sudo systemctl daemon-reload
sudo systemctl unmask timekpr
sudo systemctl start timekpr

Revision history for this message
Aryeh (agielchinsky) wrote : Re: [Bug 1996105] Re: User is not force logged out - TypeError: 'float' object cannot be interpreted as an integer

That did it! It's working now. Thank you for your help and for making this
software.

On Thu, Nov 10, 2022 at 10:40 PM Eduards Bezverhijs <
<email address hidden>> wrote:

> Config files are compatible and are upgraded as needed, no worries.
>
> However, ofc it won't limit anything, because it appears that timekpr is
> masked and that's not smth it does by itself.
>
> I would suggest to reload daemon, unmask timekpr and start it, that would
> be:
> sudo systemctl daemon-reload
> sudo systemctl unmask timekpr
> sudo systemctl start timekpr
>
> --
> You received this bug notification because you are subscribed to the bug
> report.
> https://bugs.launchpad.net/bugs/1996105
>
> Title:
> User is not force logged out - TypeError: 'float' object cannot be
> interpreted as an integer
>
> Status in Timekpr-nExT:
> Triaged
>
> Bug description:
> On Wednesday child_account should be allowed to use account between
> 16:30-17:20 and also 18:00-20:00. Account is correctly logged out at
> 17:20, but not at 20:00. There is also an error in the logs at about
> 19:59.
>
> I'm using version 0.5.2 on ubunutu desktop 22.04
>
> 2022-11-09 19:59:03.610780: sending tln: 57
> 2022-11-09 19:59:03.610887: ---=== ERROR working on users ===---
> 2022-11-09 19:59:03.611310: Traceback (most recent call last):
> File
> "/usr/lib/python3/dist-packages/timekpr/server/interface/dbus/daemon.py",
> line 133, in executeTimekprWorker
> self.checkUsers()
> File
> "/usr/lib/python3/dist-packages/timekpr/server/interface/dbus/daemon.py",
> line 258, in checkUsers
> timeLeftArray = self._timekprUserList[rUserName].getTimeLeft()
> File "/usr/lib/python3/dist-packages/timekpr/server/user/userdata.py",
> line 603, in getTimeLeft
> self._timekprUserNotification.processTimeLeft(pForceNotifications,
> timeValues)
> File
> "/usr/lib/python3/dist-packages/timekpr/common/utils/notifications.py",
> line 139, in processTimeLeft
> self.timeLeftNotification(notifUrgency,
> max(pTimeValues[cons.TK_CTRL_LEFT], 0),
> max(pTimeValues[cons.TK_CTRL_LEFTD], 0), pTimeValues[cons.TK_CTRL_LIMITD])
> File "/usr/lib/python3/dist-packages/dbus/decorators.py", line 325, in
> emit_signal
> message.append(signature=signature, *args)
> TypeError: 'float' object cannot be interpreted as an integer
>
> To manage notifications about this bug go to:
> https://bugs.launchpad.net/timekpr-next/+bug/1996105/+subscriptions
>
>

Revision history for this message
Aryeh (agielchinsky) wrote :

That did it! It's working now. Thank you for your help and for making this software.

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

Thanks.

Changed in timekpr-next:
status: Triaged → Invalid
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

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