Work around whoopsie returning null string during session start

Bug #1309237 reported by John Lenton
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Ubuntu Push Notifications
Fix Released
Critical
John Lenton
ubuntu-push (Ubuntu)
Fix Released
Critical
John Lenton
Trusty
Fix Released
Critical
John Lenton

Bug Description

During session startup, the call to whoopsie_identifier_generate will on some devices leave both buffer and error as NULL.

In particular, running http://pastebin.ubuntu.com/7268480/ on mako (and presumably on manta) as a *session* upstart job, with the upstart script of http://pastebin.ubuntu.com/7268498/ will get a null, null for the first 10 seconds (approximately) on mako:

Rebooting (boot in dmesg -T at Thu Apr 17 14:32:36 2014, first "init:" line at Thu Apr 17 14:32:44 2014), in the upstart logs I get a series of

2014-04-17T14:32:54+0000 (null) :: <nil>

(that's also the first such line ,10s after init)
until suddenly

2014-04-17T14:32:56+0000 (null) :: <nil>
2014-04-17T14:32:56+0000 81dc12[...]cd58 :: <nil>

I don't know what's causing this, as it doesn't make sense from what I can read in the code.

--

The whoopsie bug is now in lp:1311571

--

[Impact]

ubuntu-push-client gets an empty string for the whoopsie identifier, which is rather not unique (so connections from multiple devices will get disconnected).

[Test Case]

You need:

* a computer capable of running the ubuntu push server.
* a device using the stable image and that can talk to the computer over the network

on the computer, do:

mkdir -p test-case-1309237/src/launchpad.net
cd !$
bzr branch lp:ubuntu-push
cd ubuntu-push
make bootstrap
sed -i~ -e 's/127.0.0.1//g' sampleconfigs/dev.json
make run-server-dev

on the device, edit /etc/xdg/ubuntu-push-client/config.json (or copy it to ~phablet/.config/ubuntu-push-client/config.json and edit it there) so that "addr" points to the IP address of the computer, and port 9090; something like

"addr": "192.168.1.1:9090"

(note there is no https:// as the hosts discovery step is being skipped).

Reboot the device. The output of the server will show an empty "registered" (as opposed to "registered" followed by a 256-byte hash).

[Regression potential]

There's a possibility that whoopsie never stops returning a null string, and thus we never progress. Given that for whoopsie to return null seems to imply there is no network device up, that's probably for the best.

Related branches

Revision history for this message
John Lenton (chipaca) wrote :

In the Ubuntu Push client, where we wrap whoopsie from go, we should protect from this by actually checking the string returned and retrying with backoff a bit before failing.

John Lenton (chipaca)
Changed in ubuntu-push:
status: New → In Progress
importance: Undecided → Critical
assignee: nobody → John Lenton (chipaca)
John Lenton (chipaca)
Changed in ubuntu-push:
status: In Progress → Fix Committed
Changed in ubuntu-push (Ubuntu):
status: New → In Progress
assignee: nobody → John Lenton (chipaca)
importance: Undecided → Critical
John Lenton (chipaca)
no longer affects: whoopsie
summary: - Returns null string during session start
+ Work around whoopsie returning null string during session start
John Lenton (chipaca)
description: updated
John Lenton (chipaca)
description: updated
Revision history for this message
Chris Halse Rogers (raof) wrote : Please test proposed package

Hello John, or anyone else affected,

Accepted ubuntu-push into trusty-proposed. The package will build now and be available at http://launchpad.net/ubuntu/+source/ubuntu-push/0.2.1+14.04.20140423.1-0ubuntu1 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 ubuntu-push (Ubuntu Trusty):
status: In Progress → Fix Committed
tags: added: verification-needed
John Lenton (chipaca)
description: updated
Revision history for this message
Pat McGowan (pat-mcgowan) wrote :

Verified on 302 on Manta, whoopsie issue is worked around and startup continues

John Lenton (chipaca)
tags: added: verification-done
removed: verification-needed
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package ubuntu-push - 0.2.1+14.04.20140423.1-0ubuntu1

---------------
ubuntu-push (0.2.1+14.04.20140423.1-0ubuntu1) trusty; urgency=high

  [ Samuele Pedroni ]
  * gave the client the ability to get config from commandline
    ( => easier automated testing) (LP: #1311600)

  [ John Lenton ]
  * Ensure ubuntu-push-client is the only one running in the session.
    (LP: #1309432)
  * Remove supurious numbers in brackets in notifications. (LP: #1308145)
  * Check the server certificate and server name. (LP: #1297969)
  * Loop whoopsie_identifier_generate until it starts working. (LP: #1309237)
  * In the session: set a flag on connect, clear it on successfully
    replying to ping or broadcast messages, check it at the top of
    autoredial. Also track the last autoredial, and set the delay flag if
    autoredial is re-called too quickly. (LP: #1309231)
 -- Ubuntu daily release <email address hidden> Wed, 23 Apr 2014 11:54:00 +0000

Changed in ubuntu-push (Ubuntu Trusty):
status: Fix Committed → Fix Released
Revision history for this message
Colin Watson (cjwatson) wrote : Update Released

The verification of the Stable Release Update for ubuntu-push has completed successfully and the package has now been released to -updates. Subsequently, the Ubuntu Stable Release Updates Team is being unsubscribed and will not receive messages about this bug report. In the event that you encounter a regression using the package from -updates please report a new bug using ubuntu-bug and tag the bug report regression-update so we can easily find any regresssions.

Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package ubuntu-push - 0.2.1+14.04.20140423.1-0ubuntu1

---------------
ubuntu-push (0.2.1+14.04.20140423.1-0ubuntu1) trusty; urgency=high

  [ Samuele Pedroni ]
  * gave the client the ability to get config from commandline
    ( => easier automated testing) (LP: #1311600)

  [ John Lenton ]
  * Ensure ubuntu-push-client is the only one running in the session.
    (LP: #1309432)
  * Remove supurious numbers in brackets in notifications. (LP: #1308145)
  * Check the server certificate and server name. (LP: #1297969)
  * Loop whoopsie_identifier_generate until it starts working. (LP: #1309237)
  * In the session: set a flag on connect, clear it on successfully
    replying to ping or broadcast messages, check it at the top of
    autoredial. Also track the last autoredial, and set the delay flag if
    autoredial is re-called too quickly. (LP: #1309231)
 -- Ubuntu daily release <email address hidden> Wed, 23 Apr 2014 11:54:00 +0000

Changed in ubuntu-push (Ubuntu):
status: In Progress → Fix Released
John Lenton (chipaca)
Changed in ubuntu-push:
status: Fix Committed → Fix Released
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.