ttscoff / Slogger

Social logging script for Day One
757 stars 160 forks source link

Launchd task not running #204

Closed MarwoodChap closed 10 years ago

MarwoodChap commented 11 years ago

Hi,

I'm working on a pretty clean install of Mountain Lion.

I've installed Slogger as per the readme.md (I think!), and used the install script to setup the launchd task.

Checking with launchctl shows the task exists, and the machine seems to be otherwise awake at that time - growl caches alerts for example. However launchd Slogger seems to be reporting an error code (1?). The relevant line from launchctl list:

-   1   com.brettterpstra.Slogger

I'm not sure if the plist is correct. I've uploaded a copy of it to http://cl.ly/RG9T

When I run slogger from the command line I get this:

Jamess-MacBook-Pro:slogger-master marwood$ ./slogger
Initializing Slogger v2.1 (2.1.0.6)...
Faraday: you may want to install system_timer for reliable timeouts
/Library/Ruby/Gems/1.8/gems/faraday-0.8.7/lib/faraday/request/multipart.rb:4: warning: already initialized constant DEFAULT_BOUNDARY
  17:47:13         AppNetLogger: Getting App.net posts for 1 feeds
  17:47:14         FlickrLogger: Getting Flickr images for 30993871@N00
  17:47:15         FlickrLogger: No new Flickr images found
  17:47:15     FoursquareLogger: Getting FourSquare checkins
  17:47:16      GoodreadsLogger: Logging read books from Goodreads
  17:47:20     InstapaperLogger: Getting Instapaper posts for 1 accounts
  17:47:21               DayOne: =====[ Saving entry to entries/764EFEDACCB840CD9438F3121DD51A10 ]
  17:47:21         LastFMLogger: Getting Last.fm playlists for labete
  17:47:22           MisoLogger: Logging MisoLogger posts for http://gomiso.com/feeds/user/james6t/checkins.rss
/Users/marwood/Documents/Slogger-master/plugins/misologger.rb:77:in `do_log': undefined method `items' for nil:NilClass (NoMethodError)
    from /Users/marwood/Documents/Slogger-master/slogger.rb:257:in `run_plugins'
    from /Users/marwood/Documents/Slogger-master/slogger.rb:244:in `each'
    from /Users/marwood/Documents/Slogger-master/slogger.rb:244:in `run_plugins'
    from /Users/marwood/Documents/Slogger-master/slogger.rb:388
    from ./slogger:18:in `require'
    from ./slogger:18

Any help or pointers gratefully received

— James

larryhynes commented 11 years ago

Hi James

I guess the launchd script returning an error code of 1 could be a result of the MisoLogger error. The .plist looks OK, maybe start by moving the MisoLogger plugin to the disabled plugins directory and seeing how slogger runs then i.e. try to get slogger to run an error-free run. At the moment slogger is failing at the MisoLogger plugin which would cause it to return an error.

You can download Lingon from the Mac App store if you want to fiddle with the launchd task, it will let you play with the time the job runs, handy for testing.

If you want to get rid of the Faraday warning you can try running sudo gem install system_timer, it should get rid of it.

MarwoodChap commented 11 years ago

Awesome, thanks Larry. I'll give those a try.

On 8 Sep 2013, at 18:23, Larry Hynes notifications@github.com wrote:

Hi James

I guess the launchd script returning an error code of 1 could be a result of the MisoLogger error. The .plist looks OK, maybe start by moving the MisoLogger plugin to the disabled plugins directory and seeing how slogger runs then i.e. try to get slogger to run an error-free run. At the moment slogger is failing at the MisoLogger plugin which would cause it to return an error.

You can download Lingon from the Mac App store if you want to fiddle with the launchd task, it will let you play with the time the job runs, handy for testing.

If you want to get rid of the Faraday warning you can try running sudo gem insall system_timer, it should get rid of it.

— Reply to this email directly or view it on GitHub.

larryhynes commented 11 years ago

There seems to be a problem with your Miso feed. We'll get back to that once you get the launchd job running!

screen shot 2013-09-08 at 18 34 50

MarwoodChap commented 11 years ago

I think I've fixed the Miso feed - I had the wrong RSS feed. I've also installed system_timer.

Just d/loading Lingon to try the launched job

— James

On 8 Sep 2013, at 18:23, Larry Hynes notifications@github.com wrote:

Hi James

I guess the launchd script returning an error code of 1 could be a result of the MisoLogger error. The .plist looks OK, maybe start by moving the MisoLogger plugin to the disabled plugins directory and seeing how slogger runs then i.e. try to get slogger to run an error-free run. At the moment slogger is failing at the MisoLogger plugin which would cause it to return an error.

You can download Lingon from the Mac App store if you want to fiddle with the launchd task, it will let you play with the time the job runs, handy for testing.

If you want to get rid of the Faraday warning you can try running sudo gem insall system_timer, it should get rid of it.

— Reply to this email directly or view it on GitHub.

MarwoodChap commented 11 years ago

Right, I've removed the Miso plugin (It still didn't like it), and another RSS plugin that wasn't working. I've also downloaded Lingon 3 so I can schedule the job. It is still reporting an error (1), and when I run slogger from the terminal I get this

Jamess-MacBook-Pro:slogger-master marwood$ ./slogger
Initializing Slogger v2.1 (2.1.0.6)...
/Library/Ruby/Gems/1.8/gems/faraday-0.8.7/lib/faraday/request/multipart.rb:4: warning: already initialized constant DEFAULT_BOUNDARY
  18:50:38         AppNetLogger: Getting App.net posts for 1 feeds
  18:50:40         FlickrLogger: Getting Flickr images for 30993871@N00
  18:50:41         FlickrLogger: No new Flickr images found
  18:50:41     FoursquareLogger: Getting FourSquare checkins
  18:50:42      GoodreadsLogger: Logging read books from Goodreads
  18:50:45     InstapaperLogger: Getting Instapaper posts for 1 accounts
  18:50:45               DayOne: =====[ Saving entry to entries/E3A8BEF88161447D97E7D410ADB4FF79 ]
  18:50:45         LastFMLogger: Getting Last.fm playlists for labete
  18:50:47      OmniFocusLogger: Logging OmniFocus for completed tasks
  18:50:47        TwitterLogger: Getting Twitter timeline for marwoodchap
  18:50:49        TwitterLogger: Getting Twitter favorites for marwoodchap
  18:50:50               DayOne: =====[ Saving entry to entries/02040CC8150F45348D49F73BCA7B2DA9 ]
  18:50:50        TwitterLogger: Getting Twitter timeline for howfatisjames
  18:50:52        TwitterLogger: Getting Twitter favorites for howfatisjames

Is it that DEFAULT_BOUNDARY error that is stopping this from working? The entries seem to make it to Day One fine from the command line.

Thanks,

— James

On 8 Sep 2013, at 18:41, James Marwood james@thatmarwoodchap.com wrote:

I think I've fixed the Miso feed - I had the wrong RSS feed. I've also installed system_timer.

Just d/loading Lingon to try the launched job

— James

On 8 Sep 2013, at 18:23, Larry Hynes notifications@github.com wrote:

Hi James

I guess the launchd script returning an error code of 1 could be a result of the MisoLogger error. The .plist looks OK, maybe start by moving the MisoLogger plugin to the disabled plugins directory and seeing how slogger runs then i.e. try to get slogger to run an error-free run. At the moment slogger is failing at the MisoLogger plugin which would cause it to return an error.

You can download Lingon from the Mac App store if you want to fiddle with the launchd task, it will let you play with the time the job runs, handy for testing.

If you want to get rid of the Faraday warning you can try running sudo gem insall system_timer, it should get rid of it.

— Reply to this email directly or view it on GitHub.

larryhynes commented 11 years ago

You might try using Lingon to change the launchd task to just /Users/marwood/Documents/Slogger-master/slogger and seeing what happens. So it will look like this, just with a different time, for testing purposes:

screen shot 2013-09-08 at 19 02 17

larryhynes commented 11 years ago

I just checked my own setup and I get the same DEFAULT_BOUNDARY message but my launchd job works fine. I updated the Faraday gem too and it made no difference.

MarwoodChap commented 11 years ago

Success!

I think it must have been the reference to usr/bin

Thanks for your help here Larry - very much appreciated!

On 8 Sep 2013, at 19:15, Larry Hynes notifications@github.com wrote:

I just checked my own setup and I get the same DEFAULT_BOUNDARY message but my launchd job works fine. I updated the Faraday gem too and it made no difference.

— Reply to this email directly or view it on GitHub.

larryhynes commented 11 years ago

Hey, great stuff! You're welcome.

bkjunior commented 11 years ago

Hi there -- I'm noticing the same issue too. I've done the checks to make sure it's pointing to the correct Ruby installation, but I keep getting the (com.brettterpstra.Slogger[83878]) Exited with code: 1 in console. It will run when I issue the command from the command line. Any thoughts?

larryhynes commented 11 years ago

Hi. I would suggest the same steps as above, using Lingon to edit the launchd task. Have you tried that?

bkjunior commented 11 years ago

I have, yes.

nicki9knuckles commented 11 years ago

I am having the same problem, it's running when using terminal, but not with launchd. How do I find out if the launchd task is using the correct Ruby installation?

nicki9knuckles commented 11 years ago

Here is the contents of my plist file:

`<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">

Label com.brettterpstra.Slogger ProgramArguments /Users/nicholas/Documents/Slogger/slogger StartCalendarInterval Hour 23 Minute 50 ` I DO know that it's using a newer version of ruby when it runs in the terminal but I don't know how to set that in the task. When in Terminal, and I switch to my Slogger folder it says: `$ cd ~/Documents/Slogger/ RVM used your Gemfile for selecting Ruby, it is all fine - Heroku does that too, you can ignore these warnings with 'rvm rvmrc warning ignore /Users/nicholas/Documents/Slogger/Gemfile'. To ignore the warning for all files run 'rvm rvmrc warning ignore allGemfiles'.`
larryhynes commented 11 years ago

@nicki9knuckles You should be able to tell RVM to use the system ruby in your slogger folder by running rvm use system in your slogger folder from the terminal.

larryhynes commented 11 years ago

I'm a bit stumped as to why both your launchd tasks are failing, and I have to go out now. I'll hopefully come back to this tomorrow.

nicki9knuckles commented 11 years ago

Ah, but I actually think I want the reverse @larryhynes. My system ruby is 1.8 but I think some of the plugins require ruby 1.9, which is what I have it it set to in my Gemfile and why it does work when I use it in Terminal. My guess about why the launchd task is failing is because when it runs, it isn't switching to Ruby 1.9. Just a guess though.

bkjunior commented 11 years ago

bump any more thoughts on this? Thanks!

larryhynes commented 11 years ago

Not really! Slogger should run on the system Ruby, 1.8. If you're using rvm or rbenv to manage your rubies, or you're running 1.9.x, you may have to amend the launchd task to something like /Users/your-user-name/.rbenv/versions/full-path-to-your-ruby-install/ slogger. I'm afraid the only thing I can suggest is lots of plain old fiddling around until it works, I can't really discern a particular error here.

dombarnes commented 11 years ago

Found a similar issue on 10.9 as the system version of Ruby is 2.0 so I had to set a local rbenv version to run it manually as it doesn't work on v2.0. The LaunchAgent will use the system ruby by default.

A warning for anyone waiting to upgrade.

AngeloStavrow commented 10 years ago

I will chime in with my own findings on this issue. Note: I have only the most basic inkling about Ruby, so maybe some of what I'm posting here makes about as much sense as a soup sandwich.

I'm running 10.9 and I can run Slogger just fine from the command line using system Ruby:

$ ruby -v; ./slogger
ruby 2.0.0p247 (2013-06-27 revision 41674) [x86_64-darwin12.3.0]
Initializing Slogger v2.1 (2.1.0.6)...
  09:15:23         AppNetLogger: Getting App.net posts for 1 feeds
  09:15:23           BlogLogger: Logging posts for feeds http://angelostavrow.com/atom.xml, http://angelostavrow.tumblr.com/rss
  09:15:27         FlickrLogger: Getting Flickr images for 60015010@N07
  09:15:28         FlickrLogger: No new Flickr images found
  09:15:28         GithubLogger: Logging Github activity for AngeloStavrow
  09:15:28     InstapaperLogger: Getting Instapaper posts for 1 accounts
  09:15:28         LastFMLogger: Getting Last.fm playlists for AngeloStavrow
  09:15:30       PinboardLogger: Getting Pinboard bookmarks for 1 feeds
  09:15:31        TwitterLogger: Getting Twitter timeline for AngeloStavrow
  09:15:32        TwitterLogger: Getting Twitter favorites for AngeloStavrow
  09:15:32               DayOne: =====[ Saving entry to entries/67D22B78004D4E0CB6DFA981C3A0CAD3 ]

I have Lingon X installed and it reports that launchd should run Slogger every night at 23:45—this is verified by runlog.txt:

[Thu Nov 14 23:45:18 2013] Slogger v2.1 (2.1.0.6) {:config_file=>"/Users/astavrow/scripts/Slogger/slogger_config", :develop=>false, :onlyrun=>false, :timespan=>1, :quiet=>false, :max_retries=>3, :since_last_run=>false, :undo=>false}
[Fri Nov 15 23:45:06 2013] Slogger v2.1 (2.1.0.6) {:config_file=>"/Users/astavrow/scripts/Slogger/slogger_config", :develop=>false, :onlyrun=>false, :timespan=>1, :quiet=>false, :max_retries=>3, :since_last_run=>false, :undo=>false}

But nothing ever updates in Day One despite these log entries.

As far as I know, everything is being run using system ruby. The contents of Gemfile are:

source 'https://rubygems.org'

gem 'feed-normalizer'
gem 'twitter'
gem 'twitter_oauth'
gem 'json'

So that probably isn't an issue.

Maybe the launchd task is setup wrong? Any hints on how to check/troubleshoot this?

dombarnes commented 10 years ago

Angelo, Is Slogger and Day One looking at the same place for data, I.e iCloud or Dropbox. Maybe Slogger is writing the entries to one place and Day One is looking at another? Check your config file and Day One prefs.

On 16 Nov 2013, at 14:22, Angelo Stavrow notifications@github.com wrote:

I will chime in with my own findings on this issue. Note: I have only the most basic inkling about Ruby, so maybe some of what I'm posting here makes about as much sense as a soup sandwich.

I'm running 10.9 and I can run Slogger just fine from the command line using system Ruby:

$ ruby -v; ./slogger ruby 2.0.0p247 (2013-06-27 revision 41674) [x86_64-darwin12.3.0] Initializing Slogger v2.1 (2.1.0.6)... 09:15:23 AppNetLogger: Getting App.net posts for 1 feeds 09:15:23 BlogLogger: Logging posts for feeds http://angelostavrow.com/atom.xml, http://angelostavrow.tumblr.com/rss 09:15:27 FlickrLogger: Getting Flickr images for 60015010@N07 09:15:28 FlickrLogger: No new Flickr images found 09:15:28 GithubLogger: Logging Github activity for AngeloStavrow 09:15:28 InstapaperLogger: Getting Instapaper posts for 1 accounts 09:15:28 LastFMLogger: Getting Last.fm playlists for AngeloStavrow 09:15:30 PinboardLogger: Getting Pinboard bookmarks for 1 feeds 09:15:31 TwitterLogger: Getting Twitter timeline for AngeloStavrow 09:15:32 TwitterLogger: Getting Twitter favorites for AngeloStavrow 09:15:32 DayOne: =====[ Saving entry to entries/67D22B78004D4E0CB6DFA981C3A0CAD3 ] I have Lingon X installed and it reports that launchd should run Slogger every night at 23:45—this is verified by runlog.txt:

[Thu Nov 14 23:45:18 2013] Slogger v2.1 (2.1.0.6) {:config_file=>"/Users/astavrow/scripts/Slogger/slogger_config", :develop=>false, :onlyrun=>false, :timespan=>1, :quiet=>false, :max_retries=>3, :since_last_run=>false, :undo=>false} [Fri Nov 15 23:45:06 2013] Slogger v2.1 (2.1.0.6) {:config_file=>"/Users/astavrow/scripts/Slogger/slogger_config", :develop=>false, :onlyrun=>false, :timespan=>1, :quiet=>false, :max_retries=>3, :since_last_run=>false, :undo=>false} But nothing ever updates in Day One despite these log entries.

As far as I know, everything is being run using system ruby. The contents of Gemfile are:

source 'https://rubygems.org'

gem 'feed-normalizer' gem 'twitter' gem 'twitter_oauth' gem 'json' So that probably isn't an issue.

Maybe the launchd task is setup wrong? Any hints on how to check/troubleshoot this?

— Reply to this email directly or view it on GitHub.

AngeloStavrow commented 10 years ago

Hi Dom,

I should have mentioned that both are set up for iCloud. Slogger works fine when I run ./slogger from the Terminal, it's just that something weird is happening when the launchd task fires. It writes to the run log with no errors, but no updates are recorded. So the next morning I have to run ./slogger -t 2 to get yesterday's updates and manually edit the date on whatever tweets it pulls in.

dombarnes commented 10 years ago

Looks like you're missing the string to specify ruby in your launchagent.

See below for my example (/usr/bin/ruby)

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
    <key>Label</key>
    <string>com.brettterpstra.Slogger</string>
<key>ProgramArguments</key>
<array>
    <string>/usr/bin/ruby</string>
    <string>/Users/domster83/projects/Slogger/slogger</string>
</array>
<key>StartCalendarInterval</key>
<dict>
    <key>Hour</key>
    <integer>20</integer>
    <key>Minute</key>
    <integer>00</integer>
</dict>
</dict>
</plist>
bkjunior commented 10 years ago

Thanks for the feedback, dombarnes.

I've been having the same issues and attempted to adjust the launchagent per your recommendations, but I still get this error:

(com.brettterpstra.Slogger[60661]) Exited with code: 1

AngeloStavrow commented 10 years ago

Thanks, Dom. I've added the ruby location to the plist file as well and will see what the result is tomorrow morning!

For the record: on Mavericks, can anyone confirm that we need to log out and then back in for any launchd changes to take?

AngeloStavrow commented 10 years ago

Still no joy with the launchd task.

Yesterday I deleted the task (which wasn't doing anything more than adding a line to runlog.txt, anyhow) and re-ran ./install.rb. Last night it didn't even fire the task.

Not sure where to look for further troubleshooting. Thoughts?

EDIT: It looks like it's an "Exited with code: 1" error for me as well.

arcterex commented 10 years ago

Bump.... still having this on my 10.9 fresh install on a new iMac. No Brew, RVM or anything other than the default system ruby (2.0.0p247). As soon as I add the job and tail /var/log/system.log I see it exiting with code 1, but running from the command line works just fine.

ttscoff commented 10 years ago

Anything showing up in console.app -> All Messages?

On 23 Dec 2013, at 18:38, Alan Bailward wrote:

Bump.... still having this on my 10.9 fresh install on a new iMac. No Brew, RVM or anything other than the default system ruby (2.0.0p247).
As soon as I add the job and tail /var/log/system.log I see it exiting with code 1, but running from the command line works just fine.


Reply to this email directly or view it on GitHub: https://github.com/ttscoff/Slogger/issues/204#issuecomment-31152385

arcterex commented 10 years ago

Actually I think I might have solved it (as soon as I posted to a public forum asking for help of course)... I bought and loaded up lingon and it looked like there was a space after the string for the command line. In the UI the command line was "/usr/bin/ruby /Users/alan/bin/Slogger/slogger " (no quotes of course, but selecting the string showed a space after "slogger" which I deleted and re-saved the file. Nothing showing up in the logs or tailing system.log at this point. Of course I re-added it with the space and it didn't cause the issue either. I couldn't replicate the extra space by unloading, deleting the file, and re-running install.txt, but there are no messages now, so I'll see in the morning what happens :) Maybe somehow the bad file got in and I'm guessing the install.rb doesn't delete the old file before re-adding it, so it could be that for whatever reason mine was left in a bad state (assuming that launchctl was complaining about the extra space.

ttscoff commented 10 years ago

Yeah, if the file exists it leaves it as is because I don't want to overwrite anyone's customization of the file. Hopefully this is fixed and this thread can be of help to others in the future.

-Brett

On 23 Dec 2013, at 18:49, Alan Bailward wrote:

Actually I think I might have solved it (as soon as I posted to a public forum asking for help of course)... I bought and loaded up lingon and it looked like there was a space after the string for the command line. In the UI the command line was "/usr/bin/ruby /Users/alan/bin/Slogger/slogger " (no quotes of course, but selecting the string showed a space after "slogger" which I deleted and re-saved the file. Nothing showing up in the logs or tailing system.log at this point. Of course I re-added it with the space and it didn't cause the issue either. I couldn't replicate the extra space by unloading, deleting the file, and re-running install.txt, but there are no messages now, so I'll see in the morning what happens :) Maybe somehow the bad file got in and I'm guessing the install.rb doesn't delete the old file before re-adding it, so it could be that for whatever reason mine was left in a bad state (assuming that launchctl was complaining about the extra space.


Reply to this email directly or view it on GitHub: https://github.com/ttscoff/Slogger/issues/204#issuecomment-31152686

bkjunior commented 10 years ago

The error I get when launchd runs is

(com.brettterpstra.Slogger[1262]) Exited with code: 1

When I run the same command from the command line, however, it runs fine.

/usr/bin/ruby /Users/username/Dropbox/Slogger/slogger

arcterex commented 10 years ago

Still happening to me as well. I thought it was fixed, but looking at Console.app there is a failure for the last two days. Runs fine from the command line of course. Any ideas anyone, or how to debug?

dombarnes commented 10 years ago

May try enabling debug mode and are what errors it's reporting? http://obscuredclarity.blogspot.co.uk/2011/02/debugging-launchd-configuration-on-mac.html

On 26 Dec 2013, at 19:18, Alan Bailward notifications@github.com wrote:

Still happening to me as well. I thought it was fixed, but looking at Console.app there is a failure for the last two days. Runs fine from the command line of course. Any ideas anyone, or how to debug?

— Reply to this email directly or view it on GitHub.

AngeloStavrow commented 10 years ago

Still no luck for me either. I've tried rm-ing the plist, deleting the task in Lingon and re-running ./install.rb, but I still can't automate Slogger. It keeps exiting with code 1 per the Console.

Also, no issues running

$ usr/bin/ruby /Users/<username>/scripts/Slogger/slogger

Enabling debug mode per @dombarnes's suggestion doesn't show me anything other than the exited with code: 1 message.

Curiously, re-running ./install.rb always ends with Setting up launchd... com.brettterpstra.Slogger: Already loaded, even after having deleted the task and logged off and back in. Does this give anyone any ideas?

ttscoff commented 10 years ago

You might have to do a launchctl unload to make sure the job is cleared.

You might have some luck with adding a stdout/stderr file to the job to see what the script is actually outputting:

<key>StandardErrorPath</key>
<string>/tmp/test.stderr</string>
<key>StandardOutPath</key>
<string>/tmp/test.stdout</string>

Set to whatever paths you want to check for output.

By the way, if it does happen to be a Ruby version issue, there's a copy of 1.8.7 in the 10.9 install:

/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby

On 10.9 you could use that instead of /usr/bin/ruby in the launchd command to run it with 1.8.7 instead of 2.0. You'd still have to make sure that your bundle install was handling the right environment, for which rvm is still easier...

On 27 Dec 2013, at 10:12, Angelo Stavrow wrote:

Still no luck for me either. I've tried rm-ing the plist, deleting the task in Lingon and re-running ./install.rb, but I still can't automate Slogger. It keeps exiting with code 1 per the Console.

Also, no issues running

$ usr/bin/ruby /Users//scripts/Slogger/slogger

Enabling debug mode per @dombarnes's suggestion doesn't show me anything other than the exited with code: 1 message.

Curiously, re-running ./install.rb always ends with Setting up launchd... com.brettterpstra.Slogger: Already loaded, even after having deleted the task and logged off and back in. Does this give anyone any ideas?


Reply to this email directly or view it on GitHub: https://github.com/ttscoff/Slogger/issues/204#issuecomment-31268425

arcterex commented 10 years ago

Adding the debug to the job to output stderr/stdout I see this in the stderr:

/Users/alan/bin/Slogger/slogger.rb:372:in `read': Is a directory - / (Errno::EISDIR)
    from /Users/alan/bin/Slogger/slogger.rb:372:in `block in <top (required)>'
    from /Users/alan/bin/Slogger/slogger.rb:371:in `open'
    from /Users/alan/bin/Slogger/slogger.rb:371:in `<top (required)>'
    from     /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:45:in     `require'
    from     /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:45:in `require'
    from /Users/alan/bin/Slogger/slogger:18:in `<main>'

Again note that the job with the same command line works from the command line (/usr/bin/ruby /Users/alan/bin/Slogger/slogger)

dombarnes commented 10 years ago

@arcterex Line 372 in slogger.rb is when its getting the location to save the D1 files to. What is your storage setting in slogger_config?

arcterex commented 10 years ago

@dombarnes Storage is set to "icloud"

felciano commented 10 years ago

@arcterex any luck getting this resolved? I'm seeing a similar error, although my storage is set to DropBox, and it looks like getting rid of the stray space at the end of the command has fixed it

arcterex commented 10 years ago

Nope, still not running properly. I’ve resorted to just sshing in and running ./slogger -s every couple of days :(

On Feb 11, 2014, at 9:39 PM, Ramon Felciano notifications@github.com wrote:

@arcterex any luck getting this resolved? I'm seeing a similar error, although my storage is set to DropBox, and it looks like getting rid of the stray space at the end of the command has fixed it

— Reply to this email directly or view it on GitHub.

ehaselwanter commented 10 years ago

I did have the same error and it drove me crazy. With the hint about the log files I was able to fix it.

cat ~/Library/LaunchAgents/com.brettterpstra.slogger.plist
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
    <key>Label</key>
    <string>com.brettterpstra.Slogger</string>
    <key>ProgramArguments</key>
    <array>
        <string>/usr/bin/ruby</string>
        <string>/Users/ehaselwanter/Slogger/slogger</string>
    </array>
    <key>StartCalendarInterval</key>
    <dict>
        <key>Hour</key>
        <integer>19</integer>
        <key>Minute</key>
        <integer>03</integer>
    </dict>
    <key>StandardErrorPath</key>
    <string>/tmp/test.stderr</string>
    <key>StandardOutPath</key>
    <string>/tmp/test.stdout</string>
</dict>
</plist>

For me the third parameter in the dict was the real problem. I removed it at it ran successfully.

robwest commented 10 years ago

I also got the line 372 error just as @arcterex did. I redirected stdout for the launchd task using LaunchControl (like Lingon, but I like it better!) to discover this. I found that the command line to execute the slogger script as installed by the install.rb script was specified like this:

/usr/bin/ruby /Users/robwest/Documents/dev/Slogger/slogger ""

I thought that was weird, so I changed it to:

/usr/bin/ruby /Users/robwest/Documents/dev/Slogger/slogger

And... Success!

I don't know if that's your issue, but that's what I just figured out, like 10 minutes ago.

ttscoff commented 10 years ago

Found the reason for the blank flag in there. Fixed in the latest release (2.1.0.11).