wakeup-settings with "reccurs" in ubuntu 12.04

Bug #990946 reported by Jean-Christophe Sekinger
20
This bug affects 3 people
Affects Status Importance Assigned to Milestone
wakeup
Fix Released
Critical
newbuntu

Bug Description

cannot save wakeup-settings if "reccurs" is selected. then, wakeup doesn't not work

[Impact]
This bug is quite crippling, as it prevents users from setting any recurring alarm, which is how virtually every user will use the application. (e.g., how do you use the alarm clock on your nightstand?)

[Development Fix]
For the development branch, this has been fixed precisely as detailed below using the posted patch. The plan is to include this as version 1.3 for Ubuntu 12.10 along with other feature additions. Presumably, as this is a very minor fix code-wise, it would be released back to precise as version 1.2-0ubuntu2.

[Stable Fix]
The patch is attached in the postings below, and has been confirmed as working by users. The patch is practically a one-liner, and is so small I include the contents here:
39,40c39
< cronstring = re.sub("\*", '"*"', cronstring)
< crontimes.append(re.sub('"', '', cronstring))
---
> crontimes.append(cronstring)

[Test Case]
Steps for reproducing the bug:
1. Open wakeup ($ wakeup-settings), also available through the dash.
2. Click ok to exit the introduction dialog if this is the first time running wakeup
3. Click "Preferences"
4. Under the "General tab" (should be first visible), check "Recurrs".
5. Click "Ok"
6. Click "Apply" in the main window.
7. Enter password to continue
8. Dialog appears saying "Unable to set all alarms. Check time preferences. Unable to set alarms. Some crontimes are invalid." (this is the bug, one cannot set recurrent alarms).

[Regression Potential]
Recurring alarms were of course available in previous releases. Upgrading may break current recurring alarms, as they are maintained by the buggy file setnextalarm.py, and will break the ability to reset or modify any alarms the users already have saved, as well as add any new recurring alarms.

Related branches

Revision history for this message
newbuntu (dsglass) wrote :

I can confirm this. It is due to mistreatment of quoted asterisks in /usr/bin/setalarm. The attached patch fixes the issue.

Apply the patch by running:

sudo patch /usr/bin/setalarm setalarm.diff

Changed in wakeup:
status: New → Fix Released
assignee: nobody → newbuntu (dsglass)
Revision history for this message
Jean-Christophe Sekinger (jc-sekinger) wrote :

it works: merci beaucoup/many thanks

Revision history for this message
newbuntu (dsglass) wrote :

I have done some more careful testing of this patch, and it actually fixes the problem incorrectly. If you keep this patch, it will actually allow you to set alarms, but set them incorrectly. I am deleting this old patch from the thread and adding a new one, which fixes the problem correctly (this one I have tested quite thoroughly). To fix the bug properly, follow these steps:

1. First undo the bad patch supplied previously (now deleted from this thread):
    $ sudo patch -R /usr/bin/setalarm setalarm.diff
2. Apply the new patch:
    $ sudo patch /usr/share/wakeup/setnextalarm.py setnextalarm.patch

Note that the new patch fixes a different file than the old one!

Revision history for this message
newbuntu (dsglass) wrote :

Please respond to confirm that this works for you!

Revision history for this message
Jean-Christophe Sekinger (jc-sekinger) wrote :

I did as you recommanded to do
 I can read the sound within Wakeup (I use $music) and my choices seems to be stored but theres is no sound when the computer is awakening

Revision history for this message
Jean-Christophe Sekinger (jc-sekinger) wrote :

please forget what I wrote "juste avant": your patch works perfectly! Thank You!

newbuntu (dsglass)
Changed in wakeup:
importance: Undecided → Critical
description: updated
Revision history for this message
newbuntu (dsglass) wrote :

This has been fixed in the source package (https://launchpad.net/wakeup). I am including a debdiff here.

Revision history for this message
Eric Draven (evileric3) wrote :

hell im just to much of a ubuntu noob to figure out how to properly get this to work i swear there needs to be a step by step guide just for this

Revision history for this message
newbuntu (dsglass) wrote :

Here are step-by-step instructions to fix this bug:

1. Install wakeup from the Ubuntu Software Center
2. Download setnextalarm.patch from this web page
3. Open a terminal and run: sudo patch /usr/share/wakeup/setnextalarm.py setnextalarm.patch

Revision history for this message
Rufo Tamales (velazquezz86) wrote :

Hi, i'am completely new to Ubuntu or GNU/Linux for that matter as i just installed it a few hours ago. I don't quite understand the "download setnetxtalarm.patch" from this web page. I click on the setnextalarm.patch link and it sends me to a plain text page, do i have to save it as is? I saved the page as setnextalarm.patch and run the command on step 3 but terminal says "sudo: patch: command not found" , please help me D:

Revision history for this message
newbuntu (dsglass) wrote :

It sounds like for whatever reason you do not have patch installed. You can install it by typing "sudo apt-get install patch" or installing patch from the software center. Then yes, save the setnextalarm.patch file. Open up a terminal in the folder where you have the patch file saved, and run the command in step 3: "sudo patch /usr/share/wakeup/setnextalarm.py setnextalarm.patch" (without the quotes).

Revision history for this message
Rufo Tamales (velazquezz86) wrote :

I've donde that and now the problems are :
1. ""Unable to set all alarms. Check time preferences" still appears.
2. FUrthermore Wakeup closes unexpectly (not always D: )
3. SOmetimes, when i use de "Play" option, the volume it's very low, despite configuring it on preferences at 100 %
I am still unable to use Wakeup :C
Maybe i can give you guys a hardware config report if you provide a command line for it (if it's necesary, maybe it is a hardware problem) , i 'am using a lenovo t420, my ubuntu version i'ts the 64 bit 12.04 lts. THanks for your time

Revision history for this message
newbuntu (dsglass) wrote :

Hi Rufo, sorry for the delay. It would be very helpful if you could run wakeup from a command line by typing "wakeup-settings" (without the quotes) and post the output when the error comes up.

Revision history for this message
Dario Kresan (dspezzk) wrote :

Hey, patching solved the "Unable to set all alarms. Check time preferences. Unable to set alarms. Some crontimes are invalid." error. But now get the same error as Rufo. Which is the first part of the first error. "Unable to set all alarms. Check time preferences.". When i run "wakeup-settings" from the command line i get this.

no crontab for root
Traceback (most recent call last):
  File "/usr/share/wakeup/setnextalarm.py", line 63, in <module>
    curcron = subprocess.check_output(['sudo', 'crontab', '-l'])
  File "/usr/lib/python2.7/subprocess.py", line 544, in check_output
    raise CalledProcessError(retcode, cmd, output=output)
subprocess.CalledProcessError: Command '['sudo', 'crontab', '-l']' returned non-zero exit status 1

I'm new to linux and stuff like this, so I'm sorry if its a issue on my side. :)

Revision history for this message
newbuntu (dsglass) wrote :

Thanks for confirming the patch. The error you are seeing has also been reported (https://bugs.launchpad.net/wakeup/+bug/998927). This is solved in version 1.3, but you can do a quick workaround by just opening a terminal and typing "sudo crontab -e" to create a root crontab and/or "crontab -e" to create your user crontab.

Revision history for this message
Jean-Christophe Sekinger (jc-sekinger) wrote :

I changed my computer and put a 64 bits version of ubuntu. Wakeup doesn't work any more. Even with the patch applied. You are talking about a 1.3 version of wakeup: wher can I find a package (I can't compile it) Will it work on the ubuntu 12.04 64 bits?
Many thanks for your work!

Revision history for this message
newbuntu (dsglass) wrote :

Yes, it should work on 64-bit, you can find version 1.3 now in the quantal repositories or at https://launchpad.net/ubuntu/+source/wakeup/1.3-0ubuntu2/+build/3875909/+files/wakeup_1.3-0ubuntu2_all.deb. If you continue to have issues, please open a separate bug, this page refers to a bug that has since been fixed.

Revision history for this message
Jean-Christophe Sekinger (jc-sekinger) wrote :

ok! Many thanks!

Revision history for this message
Dragan Radakovic (dradak1) wrote :

Well done - only if can be suggested that "Recurrs" option allowe you to pick the day/s (for Every ->Day) option.

Thanks,

Dragan

Revision history for this message
newbuntu (dsglass) wrote :

That feature is available under every->week

Revision history for this message
Robert Moyer (moyerbatman) wrote :

latest version in repository is 1.2 not 1.3 I have not been able to downloadthe patch too.I'm probobly doing something wrong...I give up-what is the secret handshake?

Revision history for this message
newbuntu (dsglass) wrote :

You can download version 1.3 from the link in comment #17. Even though it is in the quantal repository it will work on some older Ubuntu distributions.

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.