Users tab doesn't work as expected

Bug #1508110 reported by Alex Moldovan on 2015-10-20
18
This bug affects 3 people
Affects Status Importance Assigned to Milestone
Landscape Client
High
Benji York
landscape-client (Ubuntu)
High
Andreas Hasenack
Precise
High
Unassigned
Trusty
High
Unassigned
Wily
High
Unassigned

Bug Description

Computer users tab doesn't show users anymore. For example:
https://landscape.canonical.com/account/amorphous/computer/55947/users

On a different computer is shows only some users but not the main ones. On this computer there should be the user alex(1000) for example:
https://landscape.canonical.com/account/amorphous/computer/96132/users

However, creating new users works and they do show up:
https://landscape.canonical.com/account/amorphous/computer/94231/users

[Impact]

Computers registered with landscape no longer send their users list to the server, leaving the computer users tab empty. This is a regression.

[Test Case]
1. Install landscape-client on a computer (vm, lxc, etc)
2. Register with landscape.canonical.com or an LDS server
3. On the client computer, tail -f /var/log/landscape/broker.log, watch for exchanges with the server
4. On the server, select the client computer and go to the "users" tab.
5. With the broken version of landscape-client, the users tab will remain empty even after several exchanges. With the fixed version, that tab will populate after a few minutes.

[Regression Potential]
The feature isn't working already, so there is no new regression in that area. The patch is very localized, has unit tests and was manually tested as well.

It has been observed in a previous non-approved version of the patch that it triggered server resynchronization requests every 5 minutes for the user listing. You could say this is a potential regression², but it was caught by QA and the fix was rejected.

[Other Info]
Free trial accounts can be obtained on https://landscape.canonical.com to test this. Alternatively, you can also download LDS and install it yourself as it has free license seats included (see https://help.landscape.canonical.com for instructions).
Sometimes you may get a false test result in the sense that the broken client will send the users list to the server, but this has been rare.

Related branches

Changed in landscape:
status: New → Confirmed
Andreas Hasenack (ahasenack) wrote :

Please attach:
- /var/log/landscape/* from the client
- /etc/nsswitch.conf from the client
- /etc/passwd from the client
- output of "sudo ls -la /etc/passwd" from the client

Alex Moldovan (alexmoldovan) wrote :

ubuntu@gateway:~$ sudo ls -la /etc/passwd
-rw-r--r-- 1 root root 1265 Oct 20 15:33 /etc/passwd

Alex Moldovan (alexmoldovan) wrote :

ubuntu@gateway:~$ sudo ls -la /etc/passwd
-rw-r--r-- 1 root root 1265 Oct 20 15:33 /etc/passwd

Andreas Hasenack (ahasenack) wrote :

And the client logs?

Andreas Hasenack (ahasenack) wrote :

Ops, never mind :)

Adam Blomberg (paradox606) wrote :

Looking at the code, is this db pruning of duplicate user names correct? Seems like if it wasn't it could cause problems with the users list:

https://bazaar.launchpad.net/~landscape/landscape/trunk/annotate/head:/canonical/landscape/schema/patch_37/resource.py

Andreas Hasenack (ahasenack) wrote :

Can you try with landscape-client from this ppa? ppa:landscape/trunk

So far I can confirm the bug with client 14.12, but not with the trunk client.

Adam Blomberg (paradox606) wrote :

Andreas, thank you for the suggestion, I will follow up with the original bug reporter and verify that it resolves their issues.

No, this was meant for you guys to test internally. That ppa I showed you
contains daily builds of the client: it's not a release!

On Fri, Oct 23, 2015 at 12:58 PM, Adam Blomberg <<email address hidden>
> wrote:

> Andreas, thank you for the suggestion, I will follow up with the
> original bug reporter and verify that it resolves their issues.
>
> --
> You received this bug notification because you are subscribed to
> Landscape Project.
> Matching subscriptions: default, everything
> https://bugs.launchpad.net/bugs/1508110
>
> Title:
> Users tab doesn't work as expected
>
> To manage notifications about this bug go to:
> https://bugs.launchpad.net/landscape/+bug/1508110/+subscriptions
>

Adam Blomberg (paradox606) wrote :

Andreas, I just checked on both vivid and wily, and in both cases, the trunk ppa did not resolve the missing enumeration of local users.

Logs attached from my wily laptop still demonstrating the problem.

adam@floki:~$ apt-cache policy landscape-client
landscape-client:
  Installed: 15.06+bzr823-0ubuntu0~ubuntu15.10.1
  Candidate: 15.06+bzr823-0ubuntu0~ubuntu15.10.1
  Version table:
 *** 15.06+bzr823-0ubuntu0~ubuntu15.10.1 0
        500 http://ppa.launchpad.net/landscape/trunk/ubuntu/ wily/main amd64 Packages
        100 /var/lib/dpkg/status
     14.12-0ubuntu1 0
        500 http://us.archive.ubuntu.com/ubuntu/ wily/main amd64 Packages

Adam Blomberg (paradox606) wrote :

Oh, and sorry! I did not mention this to the customer yet! So far I just was testing it on my own systems.
Thanks for the warning!

Andreas Hasenack (ahasenack) wrote :

I had to register again, btw, just upgrading didn't work.

That being said, in one out of 4 systems where I tried, registering again
with the trunk version also didn't work.

On Fri, Oct 23, 2015 at 3:10 PM, Adam Blomberg <email address hidden>
wrote:

> Andreas, I just checked on both vivid and wily, and in both cases, the
> trunk ppa did not resolve the missing enumeration of local users.
>
> Logs attached from my wily laptop still demonstrating the problem.
>
> adam@floki:~$ apt-cache policy landscape-client
> landscape-client:
> Installed: 15.06+bzr823-0ubuntu0~ubuntu15.10.1
> Candidate: 15.06+bzr823-0ubuntu0~ubuntu15.10.1
> Version table:
> *** 15.06+bzr823-0ubuntu0~ubuntu15.10.1 0
> 500 http://ppa.launchpad.net/landscape/trunk/ubuntu/ wily/main
> amd64 Packages
> 100 /var/lib/dpkg/status
> 14.12-0ubuntu1 0
> 500 http://us.archive.ubuntu.com/ubuntu/ wily/main amd64 Packages
>
>
> ** Attachment added: "Client data requested for troubleshooting"
>
> https://bugs.launchpad.net/landscape/+bug/1508110/+attachment/4503342/+files/bug_1508110_landscape_client_floki.tar.xz
>
> --
> You received this bug notification because you are subscribed to
> Landscape Project.
> Matching subscriptions: default, everything
> https://bugs.launchpad.net/bugs/1508110
>
> Title:
> Users tab doesn't work as expected
>
> To manage notifications about this bug go to:
> https://bugs.launchpad.net/landscape/+bug/1508110/+subscriptions
>

Adam Blomberg (paradox606) wrote :

Yes here is the process I followed when trying the PPA trunk version:

on the client: (ui packages were not installed)
sudo apt-get purge landscape-client landscape-common

sudo apt-add-repository ppa:landscape/trunk

sudo apt-get update

[ in landscape, deleted computer before next step ]

sudo apt-get install landscape-client landscape-common

sudo landscape-config
(enabled landscape, enabled scripts, set users to "ALL"), then registered with server at the end.

Alex Moldovan (alexmoldovan) wrote :

Upgrading didn't work in my case, nor reinstalling:
-purged everything
-removed the client from hosted
-reinstalled with new configuration
-registered again
Still doesn't work:
https://landscape.canonical.com/account/amorphous/computer/102857/users

Changed in landscape:
status: Confirmed → Fix Committed
status: Fix Committed → Confirmed
Changed in landscape:
assignee: nobody → Fernando Correa Neto (fcorrea)
importance: Undecided → High
Changed in landscape:
status: Confirmed → In Progress
tags: added: kanban
tags: removed: kanban
Changed in landscape:
status: In Progress → Fix Committed
Adam Blomberg (paradox606) wrote :

Fernando, thank you for the speedy resolution to this issue! Is there a ppa that I could use to try out this fix? Also, when could I expect a release to include this fix that I could share with the customer?

information type: Proprietary → Public
affects: landscape → landscape-client
Changed in landscape-client (Ubuntu):
assignee: nobody → Free Ekanayaka (free.ekanayaka)
importance: Undecided → High
Ursula Junque (ursinha) wrote :

TL;DR Users' list is populated 1h after registration, when plugin syncs the users data. Is this the expected behavior?

I've tested this fix today, steps I took:
1) In an Ubuntu Trusty fresh install, added landscape/trunk PPA. (juju deploy ubuntu, local provider, host wily)
2) Updated packages (apt-get upgrade). I ended up with:
 # dpkg-query -W landscape-client
 landscape-client 15.06+bzr824-0ubuntu0~ubuntu14.04.1
3) Enabled client debug and configured client to register machine in landscape.c.c (enable scripts, ALL, and my personal landscape account, ursinha).

Once confirmed the registration, T+2 minutes I could see the machine info in landscape.c.c, processes and packages, but users tab remained empty. T+60 minutes the users' list was synchronized and then users showed up in the UI. I've manually tweaked the interval and could see it works, but users have to wait for that 1h. If this is the expected behavior I can confirm it fixes the problem.

I prepared the upload to xenial, see attached files.

Andreas Hasenack (ahasenack) wrote :

Candidate xenial package uploaded to ppa:landscape/staging

Changed in landscape-client (Ubuntu):
status: New → In Progress
assignee: Free Ekanayaka (free.ekanayaka) → Andreas Hasenack (ahasenack)
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package landscape-client - 14.12-0ubuntu2

---------------
landscape-client (14.12-0ubuntu2) xenial; urgency=medium

  * Add debian/pathes/fix-users-reporting.patch for fixing a
    regression in users reporting (LP: #1508110)

 -- Free Ekanayaka <email address hidden> Wed, 16 Dec 2015 08:34:00 +0100

Changed in landscape-client (Ubuntu):
status: In Progress → Fix Released
Ursula Junque (ursinha) wrote :

I've been testing this for a while now and the behavior doesn't look deterministic, of ~10 machines I've tested I could see at least 3 behaving oddly, with several "resync" activities and sometimes the users list showing, disappearing and then showing again. I'll wait for the "proper" fix Free said was possible, and then I'll resume the testing. I think we should wait for that to trigger the SRU process with the proper fix.

Changed in landscape-client:
status: Fix Committed → In Progress
Changed in landscape-client (Ubuntu):
status: Fix Released → New
assignee: Andreas Hasenack (ahasenack) → nobody

After debugging it seems the root of the problem is in the landscape.monitor.usermonitor.UserMonitor._reset method which is called upon resynchronization, but doesn't wait for a new session ID to be available (the session ID is obtained asynchronously by the code in landscape.broker.client.BrokerClientPlugin._resynchronize).

The regression was introduced in r705.

This patch fixes the issue:

https://pastebin.canonical.com/147521/

As far as I can see, this is the only plugin affected by this kind of problem, so other plugins should be fine.

Attaching the patch as well for reference, since this is a public bug and the pastebin is private.

It'd be nice to have unit test for it, however I don't think it's strictly necessary.

The attachment "fix-user-monitor-reset.diff" seems to be a patch. If it isn't, please remove the "patch" flag from the attachment, remove the "patch" tag, and if you are a member of the ~ubuntu-reviewers, unsubscribe the team.

[This is an automated message performed by a Launchpad user owned by ~brian-murray, for any issues please contact him.]

tags: added: patch
Changed in landscape-client:
milestone: none → 13.06.1
status: In Progress → Fix Committed
Changed in landscape-client:
milestone: 13.06.1 → 16.01
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package landscape-client - 14.12-0ubuntu4

---------------
landscape-client (14.12-0ubuntu4) xenial; urgency=medium

  * Added patch fix-users-reporting-take2.patch to really fix the problem
    this time. (LP: #1508110)

 -- Andreas Hasenack <email address hidden> Mon, 18 Jan 2016 09:35:00 -0200

Changed in landscape-client (Ubuntu):
status: New → Fix Released
Ursula Junque (ursinha) wrote :

I've tested the fix in wily, vivid, trusty and precise; It worked right away. No resyncs, and adding users in the computer and via landscape UI work as it should.

description: updated
Andreas Hasenack (ahasenack) wrote :

Packages uploaded, pending approval.

Hello Alex, or anyone else affected,

Accepted landscape-client into trusty-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/landscape-client/14.12-0ubuntu3.14.04 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation how to enable and use -proposed. Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested, and change the tag from verification-needed to verification-done. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed. In either case, details of your testing will help us make a better decision.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance!

Changed in landscape-client (Ubuntu Trusty):
status: New → Fix Committed
tags: added: verification-needed
Adam Blomberg (paradox606) wrote :

Martin,

Thank you for sending out the notice of the proposed package!

I just installed it on a fresh system, and the users list appeared 3 minutes after installing and adding to my landscape account.

So far so good here.

Best regards,

-Adam Blomberg

Adam Blomberg (paradox606) wrote :

Experimentally, I tried the following and noted the times for the action to appear in landscape:

Add user from landscape - 3 minutes
Del user from landscape - 4 minutes
Add user outside of landscape - 34 minutes

Alex Moldovan (alexmoldovan) wrote :

Not working: for an old client that I have upgraded to 14.12-0ubuntu3.14.04.
Working: for a new client that was registered while having 14.12-0ubuntu3.14.04 installed.

Andreas Hasenack (ahasenack) wrote :

The fresh install case is working, the upgrade however isn't. It doesn't fix the problem if you experienced it already. We'll take another look.

Changed in landscape-client:
status: Fix Committed → Confirmed
assignee: Fernando Correa Neto (fcorrea) → Free Ekanayaka (free.ekanayaka)
Andreas Hasenack (ahasenack) wrote :

Unsubscribing sru sponsors as the fix will have to be improved.

Changed in landscape-client (Ubuntu Trusty):
status: Fix Committed → Confirmed
status: Confirmed → New
Changed in landscape-client (Ubuntu):
status: Fix Released → Confirmed
tags: added: verification-failed
removed: verification-needed
Benji York (benji) on 2016-01-28
tags: added: bug-squad kanban
Benji York (benji) on 2016-02-03
Changed in landscape-client:
assignee: Free Ekanayaka (free.ekanayaka) → Benji York (benji)
Changed in landscape-client (Ubuntu Precise):
importance: Undecided → High
Changed in landscape-client (Ubuntu Trusty):
importance: Undecided → High
Changed in landscape-client (Ubuntu Vivid):
importance: Undecided → High
Changed in landscape-client (Ubuntu Wily):
importance: Undecided → High
Changed in landscape-client:
status: Confirmed → Fix Committed
Benji York (benji) on 2016-02-11
tags: removed: bug-squad kanban
Changed in landscape-client (Ubuntu):
assignee: nobody → Andreas Hasenack (ahasenack)
status: Confirmed → In Progress
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package landscape-client - 14.12-0ubuntu6

---------------
landscape-client (14.12-0ubuntu6) xenial; urgency=medium

  * Trigger a resync of user information upon upgrades. (LP: #1508110)
  * Create data directory ahead of time. (LP: #1546743)

 -- Andreas Hasenack <email address hidden> Wed, 02 Mar 2016 11:09:48 -0300

Changed in landscape-client (Ubuntu):
status: In Progress → Fix Released
no longer affects: landscape-client (Ubuntu Vivid)
Changed in landscape-client:
milestone: 16.01 → 16.03
status: Fix Committed → Fix Released

The version of landscape-client in the proposed pocket of Trusty that was purported to fix this bug report has been removed because the bugs that were to be fixed by the upload were not verified in a timely (105 days) fashion.

tags: added: lds-squad
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers