Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Missing notification after 1.8 upgrade #222

Closed
3 tasks done
sashkab opened this issue May 26, 2017 · 22 comments
Closed
3 tasks done

Missing notification after 1.8 upgrade #222

sashkab opened this issue May 26, 2017 · 22 comments

Comments

@sashkab
Copy link

sashkab commented May 26, 2017

Please check everything that applies to your issue:

  • I looked in closed issues and it has not already been answered
  • My issue appeared with a terminal-notifier update
  • I'm using a tool that uses terminal-notifier (guard-notifier, node-notifier...)

To help us debug your issue please include:

  • the macOS version you use: 10.12.5
  • terminal-notifier version: 1.8
  • how did you install terminal-notifier: homebrew
  • step-by-step reproduction instructions:

I call it through the script, which is started via crontab. It calls terminal-notifier with following function. Calling it from Terminal has no differences -- message doesn't appear. It used to work, but around 1.8 time it was gone...

def notification(title='', subtitle='', message=''):¬
    """ Uses terminal-notifier for showing notifications."""¬
    with open('/dev/null') as nullr = check_output(['terminal-notifier', '-title', title,·¬
                          '-subtitle', subtitle, '-message', message'-dropdownLabel', 'Close', '-actions', 'Close,Install Updates',¬
                        ], stdin=nullreturn decode(r).strip()¬

Thanks!

@sashkab
Copy link
Author

sashkab commented May 26, 2017

Only log I see in the console when I ran terminal-notifier is this:

$ terminal-notifier -message xxxx -title xxxxx
default	22:04:14.694762 -0400	CommCenter	#I CSIAppInfo.ApplicationActivationObserver: handleLSNotitifcation_sync: Application exited: <private>

@dchenbecker
Copy link

I appear to have the same behavior with 1.8.0 on OSX 10.12.4. I downgraded to 1.7.2 using gem install terminal-notifier -v 1.7.2 and it's working again. I tried a dtruss to get more details but I didn't see anything obvious

@dchenbecker
Copy link

I should also note that I had originally installed via homebrew

@ecielam
Copy link

ecielam commented Jun 21, 2017

This is happening for me as well. Downgrading to 1.7.2 per @dchenbecker works again.

@sashkab
Copy link
Author

sashkab commented Jun 25, 2017

Interesting observation: today I restarted my mac and upon reboot I've received hundreds of missed notifications. Since then all notifications seems to be working. I have suggestion to check if you have running instance of the terminal-notifier and kill it if you do. Why, you'd ask -- because I've received crash email from one of the crontab job, which suggests that terminal-notifier was running for about 35 days...

@JayBrown
Copy link

JayBrown commented Jul 2, 2017

I had temporary success when adding -sender Finder, but that stopped working after some time; then I switched to -sender SystemEvents, which also only worked for a short time.

I still have the v1.7 application in my /Applications folder, and all my shell scripts that use the app's executable are working fine. The scripts that use the new 1.8 binary in /usr/local/bin directly, don't work at all. This needs a fix.

OS X 10.11.6, homebrew installation

@JayBrown
Copy link

This might not have been a terminal-notifier bug, but one of the Notification Center. Because since yesterday everything has been working again, and the interesting thing is that when it first started working again, all of a sudden the 20 previous notifications that had not been displayed before, all popped up at once. I tested it manually with the other -sender commands that I had used (SystemEvents, Finder etc.), and there everything was. Don't know what kind of a bug this is. We'll see how long it lasts. ;)

@JayBrown
Copy link

Aaaaaaaand… now it stopped working again.

@julienXX
Copy link
Owner

julienXX commented Jul 16, 2017

Hahaha I really love this kind of bugs 😭

@JayBrown
Copy link

JayBrown commented Jul 17, 2017

You think I should just reset the whole Notification Center settings in $(getconf DARWIN_USER_DIR)/com.apple.notificationcenter/db and try again? This almost smells like MacVoodoo.

@julienXX
Copy link
Owner

@JayBrown well you could try maybe it will solve the issue but I guess it rooted elsewhere.

@JayBrown
Copy link

JayBrown commented Aug 8, 2017

Found a solution: use the above getconf command to print the /db directory, cd there, ls, and there should be the Notification Center database, just called "db". If it's there, run sqlite3 db 'select * from app_info', then look (or grep) for "terminal-notifier", "julienxx", and any entries that do not use the standard reverse URL scheme, e.g. for "System Events", if you used the -sender "System Events" option with terminal-notifier. The first db column is the ID assigned to the app. Then, for every relevant app-ID, you need to run sqlite3 db 'delete from app_info where app_id = <ID>' while replacing "<ID>" with the actual ID. Then run sudo killall usernoted, and then terminal-notifier works again. If necessary, you just need to change its settings again in the Notification Center preference pane.

I'll monitor this in the next weeks, because I'm running the latest terminal-notifier from /usr/local/bin, but also still have some scripts that call the executable in the original .app bundle of previous terminal-notifier versions. Currently, they're working fine side by side, but maybe that's only temporary.

@laurikimmel
Copy link

Followed @JayBrown's instructions above and now it works again.

Small correction - sqlite3 needs DB file as first argument when deleting rows. Correct command is

sqlite3 db 'delete from app_info where app_id = <ID>'

Btw. after running terminal-notifier few times, previously deleted row

42|fr.julienxx.${PRODUCT_NAME:rfc1034identifier}|14|5|41

is back in DB.

Maybe row

24|nl.superalloy.oss.terminal-notifier|8534|5|20

was the only offender.

@JayBrown
Copy link

It's been running fine so far. The weird thing, however, is that terminal-notifier is selecting some random app icon from my /Applications directory as the secondary icon, in this case the icon of the app gfxCardStatus. Seems to be another bug. :)

snap

@julienXX
Copy link
Owner

julienXX commented Nov 1, 2017

Could you please try the updated 2.0.0 release?

@sashkab
Copy link
Author

sashkab commented Nov 2, 2017

Need to rewrite my scripts for use 2.0.0 release. That explains why this stopped working again. 😠

@JayBrown
Copy link

JayBrown commented Nov 2, 2017

Really? Rewrite? It's not yet on homebrew, but I'll test it soon.

@sashkab
Copy link
Author

sashkab commented Nov 2, 2017

Really? Rewrite?

Get rid of all the actions, I've configured and got used to.

It's not yet on homebrew, but I'll test it soon.

It's pending PR -- Homebrew/homebrew-core#20149, FYI.

@JayBrown
Copy link

JayBrown commented Nov 3, 2017

I've now tested v2.0.0 with my default notify function by simply running the script, and it seems to look good. No weird inline app icons anymore (see below; it's just the Terminal icon again). What's interesting, though, is that calling /usr/local/bin/terminal-notifier directly also works from within a script, not only the standard method of calling the .app executable: the upper notification is /usr/local/bin/, the lower is executable in /usr/local/Cellar/terminal-notifier. Was this behavior planned? I thought that v2.0.0 would return to the exlusive .app method. (?)

snap

Now I have to go through my dozens of scripts to see if they need tweaking. Oh crap. :D

@julienXX
Copy link
Owner

julienXX commented Nov 3, 2017

@JayBrown maybe homebrew changed the way they package bundle apps. Glad to know it's working :)

@JayBrown
Copy link

JayBrown commented Nov 3, 2017

Tested it again, this time with a self-contained script running via Automator (macOS Services), and calling the binary did not work. So I assume that the .app executable should be called. If however you run a script directly on the command line, e.g. in iTerm, then calling the binary seems to work.

@julienXX
Copy link
Owner

julienXX commented Nov 4, 2017

I'm closing this issue for now, feel free to re-open if needed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants