Persist.load should try the old file if the current file is empty

Bug #809210 reported by Thomas Herve on 2011-07-12
22
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Landscape Client
Medium
Thomas Herve

Bug Description

Right now, there is a simple return if the current file is empty. If we failed to write the content, we won't try to load the old file even if it's valid.

Andreas Hasenack (ahasenack) wrote :

Just to note that bug #788605 was the original one about this and contains some discussion. It's not marked as a duplicate just yet.

Thomas Herve (therve) on 2011-07-13
Changed in landscape-client:
status: In Progress → Fix Committed
Andreas Hasenack (ahasenack) wrote :

Verified with a special build I did of the client with only this patch, at https://launchpad.net/~landscape/+archive/client-bug-809210/+packages

I tried the forced reboot scenario of bug #788605, but couldn't reach a conclusion yet as I couldn't reproduce that specific problem reliably. Not with a stored script, nor with issuing that command at the console. I used ec2 instances, but not cloud registration, i.e., I used them as regular computers.

tags: added: verified
David Ayers (ayers) wrote :

My eight month old notebook seems to have been subject to power consumption and now battery issues so now I'm seeing this issue quite often as it powers off far to quickly on the first warning before I'm able to shut the system down.

If it would help, I would attempt to test this package yet I'd need instructions on how to do it correctly to be able to revert again in case that's needed.

Andreas Hasenack (ahasenack) wrote :

Hello David,

you can test the packages from this PPA: https://launchpad.net/~landscape/+archive/client-bug-809210/+packages as they are the 11.02 release plus just the patch for this issue.

If you need to revert, just downgrade the packages back to the 11.02 version, it should work just fine.

David Ayers (ayers) wrote :

Hello Andreas,
thanks a lot for packaging! I'm currently on maverick due to natty's kernel's power management issues so I could only test this with a fresh USB-Stick install. I can do that latest on Thursday since I'm currently traveling with expensive foreign prepaid UMTS connections.
But I'll get back to you on Thursday unless I do come by some hot-spot with time to install natty.
Thanks again!

Andreas Hasenack (ahasenack) wrote :

David, FYI that PPA has maverick packages too.

Thanks for helping!

David Ayers (ayers) wrote :

Thanks! I've installed the Maverick package of the PPA can confirm that since then the battery outages have not lead to my registration being lost!

Thanks!

Hello Thomas, or anyone else affected,

Accepted landscape-client into lucid-proposed, the package will build now and be available in a few hours. Please test and give feedback here. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation how to enable and use -proposed. Thank you in advance!

tags: added: verification-needed
Andreas Hasenack (ahasenack) wrote :

Verified with landscape-client-11.07.1.1-0ubuntu0.10.04.0 from lucid-proposed:

root@ls1-lucid:/var/lib/landscape/client# apt-cache policy landscape-client
landscape-client:
  Installed: 11.07.1.1-0ubuntu0.10.04.0
  Candidate: 11.07.1.1-0ubuntu0.10.04.0
  Version table:
 *** 11.07.1.1-0ubuntu0.10.04.0 0
        500 http://us.archive.ubuntu.com/ubuntu/ lucid-proposed/main Packages
        100 /var/lib/dpkg/status
     11.02-0ubuntu0.10.04.1 0
        500 http://security.ubuntu.com/ubuntu/ lucid-updates/main Packages
     1.5.0.1-0ubuntu0.10.04.0 0
        500 http://us.archive.ubuntu.com/ubuntu/ lucid/main Packages

I made sure the old file had valid content and corrupted the main one. Then restarted landscape-client. The old file was used correctly, and the client continued working normally and was still registered with the landscape server:

root@ls1-lucid:/var/lib/landscape/client# /etc/init.d/landscape-client stop
 * Stopping landscape-client daemon [ OK ]
root@ls1-lucid:/var/lib/landscape/client# cp broker.bpickle broker.bpickle.old
root@ls1-lucid:/var/lib/landscape/client# > broker.bpickle
root@ls1-lucid:/var/lib/landscape/client# l broker.bpickle*
-rw------- 1 landscape landscape 0 2011-07-27 21:57 broker.bpickle
-rw------- 1 landscape landscape 865 2011-07-27 21:57 broker.bpickle.old
root@ls1-lucid:/var/lib/landscape/client# /etc/init.d/landscape-client start
 * Starting the landscape-client daemon [ OK ]
root@ls1-lucid:/var/lib/landscape/client# l broker.bpickle*
-rw------- 1 landscape landscape 865 2011-07-27 21:58 broker.bpickle
-rw------- 1 landscape landscape 0 2011-07-27 21:57 broker.bpickle.old
root@ls1-lucid:/var/lib/landscape/client#

root@ls1-lucid:/var/lib/landscape/client# tail /var/log/landscape/broker.log -n 4
2011-07-27 21:59:10,086 INFO [MainThread] Starting urgent message exchange with https://staging.landscape.canonical.com/message-system.
2011-07-27 21:59:11,511 INFO [Dummy-1 ] Sent 13486 bytes and received 150 bytes in 1.42s.
2011-07-27 21:59:11,516 INFO [MainThread] Switching to normal exchange mode.
2011-07-27 21:59:11,518 INFO [MainThread] Message exchange completed in 1.43s.

tags: added: verification-done
removed: verification-needed
Jonathan Davies (jpds) wrote :

I can also confirm that the fixed lucid-proposed package works as expected.

David Ayers (ayers) wrote :

I currently have:
ayers@schiefer:~$ LANG=C apt-cache policy landscape-client
landscape-client:
  Installed: 11.02-0ubuntu0.10.10.1
  Candidate: 11.02-0ubuntu0.10.10.1
  Version table:
 *** 11.02-0ubuntu0.10.10.1 0
        900 http://at.archive.ubuntu.com/ubuntu/ maverick-updates/main amd64 Packages
        100 /var/lib/dpkg/status
     1.5.5.1-0ubuntu0.10.10.0 0
        500 http://at.archive.ubuntu.com/ubuntu/ maverick/main amd64 Packages
installed and the issue is reoccuring. I have re-registered the my notebook twice in last 3 days due to battery/power management issues.

I'm not sure what to set the status to: confirmed?

Andreas Hasenack (ahasenack) wrote :

The fix was only released to lucid, sorry. I'll try to get it out for the other releases soon.

Martin Pitt (pitti) wrote :

Hello Thomas, or anyone else affected,

Accepted landscape-client into maverick-proposed, the package will build now and be available in a few hours. Please test and give feedback here. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation how to enable and use -proposed. Thank you in advance!

tags: removed: verification-done
tags: added: verification-needed
Martin Pitt (pitti) wrote :

Hello Thomas, or anyone else affected,

Accepted landscape-client into natty-proposed, the package will build now and be available in a few hours. Please test and give feedback here. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation how to enable and use -proposed. Thank you in advance!

Andreas Hasenack (ahasenack) wrote :

Verified for Maverick and Natty using the package in proposed in the same way the verification for Lucid was done above. Works fine.

Changed in landscape-client:
status: Fix Committed → Fix Released
David Ayers (ayers) wrote :

I can confirm that the packages in maverick-proposed fix the issue for me. I have tested it with a broken battery.

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

Other bug subscribers