-
Notifications
You must be signed in to change notification settings - Fork 55
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
"Logs not found; cannot show summary!" #37
Comments
I'm seeing the same message. The error seems to stem from here. Looking at the single log file found by that pattern, there are no lines with "taps" in them in the last ten lines of the file, I need to set Perhaps that line could be rewritten like this to search for a line with "taps" in it from the end of the file? tail -r ~/Library/Logs/com.github.domt4.homebrew-autoupdate/*.out | grep -m1 taps |
Thanks for submitting this issue! I'd noticed this on my own machine and was hoping someone else would confirm. The issue as @antonagestam touches on is that the command used to read the logs trips over once the log has multiple successful executions to read from. A fix for this should be coming very soon. Is the new style of notification behaving as expected for you both beside the misreading of the logs? Appearing in the notification centre, executing a little submarine alert noise when it runs, no other issues? I'm looking at rolling it out by default to everyone but trying to baby-step it to make sure all is working okay first. |
Yeah, all of those behaviors with regards to notifications have been working fine for me 🙂 |
Follow up to previous commit. For some reason `tac` doesn't want to play nicely inside the AppleScript environment and keeps throwing bad exit codes, so reverting to using `tail`. Ref: #37
Great, thanks for your work and help! 😀 |
@DomT4 ok... so after the most recent fix for this issue, I don't get any notification at all 😞 I've confirmed that:
The only thing I can think of is that there were no updates to be made? Not sure if there's a notification to be expected at that point (would make sense for there not to be). But I've had cask apps specifically ask if I want to upgrade over the past few weeks, even though that should ostensibly never happen if |
@babramczyk Are you still having the issue? I removed the The other issue that might be clogging up the pipeline here is that for some reason using an AppleScript applet to send the notifications seems to require on a degree of accessibility privileges being granted to the app. I'm not sure if those are actually needed or if I can refine the permissions to a degree or whether it's simply something Apple has decided might be needed with every AppleScript and so folds them in by default. I'll try and look into that more. There is a known issue with Casks increasingly needing |
@DomT4 I'm pretty sure I'm still having the issue. I haven't seen a notification from the app in weeks. And there are still times where an app prompts me to install an update when ostensibly Regardless, I'm not seeing any notifications (either on boot or every 24 hours) |
FWIW, just did |
Looking into it a bit now. Will hopefully have some progress/information for you later tonight 😬. |
Some discovered issues:
|
Made some changes locally, which I need to test before pushing remotely, and then update the notification app again & push a new codesigned version. Hopefully tomorrow evening sometime. Changes below, if you want to test them out yourself or suggest anything. diff --git a/lib/autoupdate.rb b/lib/autoupdate.rb
index 6bac077..9222ad2 100644
--- a/lib/autoupdate.rb
+++ b/lib/autoupdate.rb
@@ -1,3 +1,4 @@
+require "date"
require "fileutils"
require "pathname"
require "autoupdate/core"
diff --git a/lib/autoupdate/start.rb b/lib/autoupdate/start.rb
index 3ef1a94..80e3f04 100644
--- a/lib/autoupdate/start.rb
+++ b/lib/autoupdate/start.rb
@@ -15,7 +15,7 @@ module Autoupdate
auto_args = "update"
# Spacing at start of lines is deliberate. Don't undo.
if ARGV.include? "--upgrade"
- auto_args << " && #{Autoupdate::Core.brew} upgrade -v"
+ auto_args << " && #{Autoupdate::Core.brew} upgrade --formula -v"
auto_args << " && #{Autoupdate::Core.brew} upgrade --cask -v" if (HOMEBREW_PREFIX/"Caskroom").exist?
auto_args << " && #{Autoupdate::Core.brew} cleanup" if ARGV.include? "--cleanup"
end
@@ -56,11 +56,9 @@ module Autoupdate
# we can't write to later, so need to ensure a future `start` command
# doesn't silently fail.
if File.writable?(Autoupdate::Core.logs)
- log_err = "#{Autoupdate::Core.logs}/#{Autoupdate::Core.name}.err"
- log_std = "#{Autoupdate::Core.logs}/#{Autoupdate::Core.name}.out"
+ log_out = "#{Autoupdate::Core.logs}/#{Autoupdate::Core.name}.out"
elsif File.writable?(Autoupdate::Core.fallback_logs)
- log_err = "#{Autoupdate::Core.fallback_logs}/#{Autoupdate::Core.name}.err"
- log_std = "#{Autoupdate::Core.fallback_logs}/#{Autoupdate::Core.name}.out"
+ log_out = "#{Autoupdate::Core.fallback_logs}/#{Autoupdate::Core.name}.out"
else
puts <<~EOS
#{Autoupdate::Core.logs} does not seem to be writable.
@@ -121,9 +119,9 @@ module Autoupdate
</array>
#{debug}
<key>StandardErrorPath</key>
- <string>#{log_err}</string>
+ <string>#{log_out}</string>
<key>StandardOutPath</key>
- <string>#{log_std}</string>
+ <string>#{log_out}</string>
<key>StartInterval</key>
<integer>#{interval}</integer>
<key>LowPriorityBackgroundIO</key>
diff --git a/lib/autoupdate/status.rb b/lib/autoupdate/status.rb
index bff4cd5..e6ed109 100644
--- a/lib/autoupdate/status.rb
+++ b/lib/autoupdate/status.rb
@@ -15,11 +15,42 @@ module Autoupdate
!File.exist?(Autoupdate::Core.plist)
end
+ def date_of_last_modification
+ if File.exist?(Autoupdate::Core.location/"brew_autoupdate")
+ birth = File.birthtime(Autoupdate::Core.location/"brew_autoupdate").to_s
+ date = DateTime.parse(birth)
+ formatted_string = date.strftime("%D")
+ else
+ formatted_string = "Unable to determine date of command invocation. Please report this."
+ end
+ formatted_string
+ end
+
def status
if autoupdate_running?
- puts "Autoupdate is installed and running."
+ puts <<~EOS
+ Autoupdate is installed and running.
+
+ Autoupdate was initialised on #{date_of_last_modification}.
+ EOS
elsif autoupdate_installed_but_stopped?
- puts "Autoupdate is installed but stopped."
+ puts <<~EOS
+ Autoupdate is installed but stopped.
+
+ Autoupdate was initialised on #{date_of_last_modification}.
+ EOS
elsif autoupdate_not_configured?
puts "Autoupdate is not configured. Use `brew autoupdate --start` to begin."
else |
Does this change just affect notifications? Or does it try to address some apps not updating at all? (like what happened for Spotify for me above) |
No, it has the potential to cause issues with app updates. Do you know if Spotify was the only Cask update or did you have multiple updates pending? |
Not sure if there were other updates pending, just tested Spotify as an example. I have a pending |
Mind running |
If you don't see anything within 24hours (ish) try the same set of commands but with |
FYI, running Going to run it with |
As a side note, I’ve been running into something where when I initially Not sure if this happens always, or just when starting the service, but I can keep an eye on it. |
Hey @babramczyk, how are things going your end? I changed my interval locally to hourly to keep an eye on things and it's been pretty smooth sailing for me since the last set of changes. Anything different for you? I don't think the Cask thing is related to this tool; I can't think of any reason this tool would cause that to happen, it doesn't really interact with the upgrade process directly enough to cause that sort of issue 🤔. |
Hey! 👋 Pretty smooth sailing here as well.
|
Glad to hear things have been smooth on your side for a while @babramczyk! Can I double check WRT the notification that you're on Big Sur? Do you run any sort of program that restricts what can run/execute AppleScripts/etc? Things like FS Protection for Mac with its included "DeepGuard" feature can silently block the notification sometimes. |
Not that I know of, no. FWIW, I run plenty of other apps that I assume are triggering notifications and running AppleScript (Alfred, other cli tools). Not sure if that’s applicable or not. And yes, I’m on Big Sur. |
What happens if you execute |
Interesting. Looks like it has gotten stuck somewhere in the past, potentially. Can you execute the following for me please:
If the latter doesn't exist that's fine, I merged the logs into one a while back so depends how recently you invoked the command afresh. |
Here’s the out file: https://gist.github.com/babramczyk/83108ba0ce0d5c0e29b6224b24a7f1fb. No I noticed in that logfile that the Bartender app is quitting a lot, and it seems like autoupdate is the reason. Lines up with the behavior from other apps, where every time autoupdate upgrades them they move to the end of my dock and macos asks me “X is an app downloaded by homebrew-cask, are you sure you want to open it?” Hmmm… maybe this just isn’t suited for cask auto-updates. It’s a bummer though, since I’d love to take the friction out of the status quo of upgrading apps where you get disrupted by some modal asking you to upgrade (when you’re already busy doing something else). |
It looks like a lot of the errors you're hitting are related to If you're willing to try I'd definitely be interested in seeing what happens if you set up |
Got it. Just set |
@DomT4 here’s the results so far from Looks like things are working! I’m still getting confirmation dialogs for some apps after updating, but I’m still not sure if it happens after autoupdate installs a new version for the first time (I’m going to start keeping a list, and I’ll let you know if it happens multiple times for the same app). If it does, it might be a dealbreaker for using autoupdate for casks, but it also might be unavoidable from a technical perspective. But very happy with the askpass solution!! 😀 |
Correction: I see from logs that error started to appear with run ended at 9:44. The system was rebooted around 14:50 with very small downtime. So these two events somehow correlate. Latest run from 16:24:27 has same message with My current time is 16:37. |
I finally figured out why this was happening in my notifications! The AppleScript at This can be fixed by using the default
Also I figured out that I can run it immediately with |
Getting this error in the macOS notification when rebooting and autoupdate is running.
Anything I can do to fix this? Or some trace/logs I can look at to look into it?
The text was updated successfully, but these errors were encountered: