Slogger icon indicating copy to clipboard operation
Slogger copied to clipboard

Slogger "Exited with code: 1"

Open bjornkri opened this issue 12 years ago • 16 comments

I mentioned this here, but this seems to be a separate issue since slogger runs fine for me from the command line.

But when I do launchctl start com.bjornkri.Slogger, which contains the exact same command as I run from the command line (/usr/bin/ruby /Volumes/Belbo/Development/personal/Slogger/slogger), I get the following in console:

08/11/13 10:17:22,316 com.apple.launchd.peruser.501[285]: (com.bjornkri.Slogger[49922]) Exited with code: 1

This started happening after upgrading to Mavericks.

bjornkri avatar Nov 08 '13 09:11 bjornkri

Same here. Mavericks, even reinstalled Slogger. Script work OK from the command line, but Exited with code: 1 from Launchd

crlvll avatar Nov 14 '13 17:11 crlvll

Same symptoms here. When I run slogger from a remote ssh command line I get the following... Related?

$ ./slogger -t 2
Initializing Slogger v2.1 (2.1.0.6)...
  22:19:27               DayOne: =====[ Saving entry to entries/27D08A3345EC4F63BD289762FE27DFEE ]
  22:19:27  FacebookIFTTTLogger: Logging FacebookIFTTTLogger posts at /Users/alastair/Dropbox/AppData/ifttt/facebook/facebook.md.txt
/Users/alastair/Library/Slogger/plugins/facebookifttt.rb:87:in `=~': invalid byte sequence in US-ASCII (ArgumentError)
        from /Users/alastair/Library/Slogger/plugins/facebookifttt.rb:87:in `block in do_log'
        from /Users/alastair/Library/Slogger/plugins/facebookifttt.rb:86:in `each_line'
        from /Users/alastair/Library/Slogger/plugins/facebookifttt.rb:86:in `do_log'
        from /Users/alastair/Library/Slogger/slogger.rb:257:in `block in run_plugins'
        from /Users/alastair/Library/Slogger/slogger.rb:244:in `each'
        from /Users/alastair/Library/Slogger/slogger.rb:244:in `run_plugins'
        from /Users/alastair/Library/Slogger/slogger.rb:388: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 ./slogger:18:in `<main>'

randomphrase avatar Nov 25 '13 04:11 randomphrase

Does your launchd plist look a bit like this? https://github.com/ttscoff/Slogger/issues/204#issuecomment-28878050

dombarnes avatar Nov 25 '13 08:11 dombarnes

Pretty much:

<?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/alastair/Library/Slogger/slogger</string>
        </array>
        <key>StartCalendarInterval</key>
        <dict>
                <key>Hour</key>
                <integer>23</integer>
                <key>Minute</key>
                <integer>50</integer>
        </dict>
</dict>
</plist>

randomphrase avatar Nov 25 '13 18:11 randomphrase

I'm having the same issue. Did any body get it going?

cobbenterprises avatar Dec 09 '13 02:12 cobbenterprises

I'm having a similar issue, tried adding / removing the job to launchctl through the install script a few time, but still get this as soon as I start it:

Dec 23 16:29:38 imac2013 com.apple.launchd.peruser.501217: Exited with code: 1 Dec 23 16:29:38 imac2013 com.apple.launchd.peruser.501217: Throttling respawn: Will start in 10 seconds Dec 23 16:29:49 imac2013 com.apple.launchd.peruser.501217: Exited with code: 1 Dec 23 16:29:49 imac2013 com.apple.launchd.peruser.501217: Throttling respawn: Will start in 10 seconds

arcterex avatar Dec 24 '13 00:12 arcterex

I'm also having the same issue... 4/1/2014 11:50:11.366 pm com.apple.launchd.peruser.501[166]: (com.brettterpstra.Slogger[12445]) Exited with code: 1
If I run the command direct in the terminal in runs correctly.

notverypc avatar Jan 05 '14 19:01 notverypc

OK... So I'm not sure how, but the launchd is now working correctly.. Typical!!

notverypc avatar Jan 05 '14 23:01 notverypc

Hmmm so I had the restart my MacBook and now I get the same error as before..

notverypc avatar Jan 08 '14 19:01 notverypc

Just as a data point, it seems that adding the following to the launchd plist seems to fix the problem:

<key>EnvironmentVariables</key>
<dict>
  <key>LANG</key>
  <string>en_US.UTF-8</string>
</dict>

randomphrase avatar Feb 12 '14 02:02 randomphrase

@randomphrase That might have done it! I'm not going to declare success just yet, but it did just run via launchctl.... I'll make sure it's still running tomorrow though before I throw a random dance party :)

alanleftofthedot avatar Feb 12 '14 18:02 alanleftofthedot

@randomphrase Where in the file did you place it? Could you please post a full updated plist for me? Thanks!

cobbenterprises avatar Feb 12 '14 18:02 cobbenterprises

@cobbenterprises mine looks like this:

<?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>EnvironmentVariables</key>
        <dict>
                <key>LANG</key>
                <string>en_US.UTF-8</string>
        </dict>
        <key>Label</key>
        <string>com.brettterpstra.Slogger</string>
        <key>ProgramArguments</key>
        <array>
                <string>/usr/bin/ruby</string>
                <string>/Users/alan/bin/Slogger/slogger</string>
        </array>
        <key>StartCalendarInterval</key>
        <dict>
                <key>Hour</key>
                <integer>22</integer>
                <key>Minute</key>
                <integer>30</integer>
        </dict>
</dict>
</plist>

<!-- @@@@LingonWhatStart:/usr/bin/ruby /Users/alan/bin/Slogger/slogger@@@@LingonWhatEnd -->

Then I load it in Lingon, load it, save it, and then quit Lingon.

alanleftofthedot avatar Feb 12 '14 18:02 alanleftofthedot

@alanleftofthedot Glad that fix worked for you

randomphrase avatar Feb 12 '14 20:02 randomphrase

Looks like it's running for me now as well. Thanks for the help!

cobbenterprises avatar Feb 17 '14 15:02 cobbenterprises

Same here!

notverypc avatar Feb 19 '14 22:02 notverypc