keybase / client

Keybase Go Library, Client, Service, OS X, iOS, Android, Electron
BSD 3-Clause "New" or "Revised" License
8.9k stars 1.23k forks source link

Keybase Install Error - macOS Sierra 10.12.6 #8999

Open Jolg42 opened 7 years ago

Jolg42 commented 7 years ago

My log ID is: 7c5c9f526a3659472f071d1c

screenshot 2017-10-12 at 15 38 04 screenshot 2017-10-12 at 15 38 22
ll ~/Library/LaunchAgents                                                                                                                                            
drwxr-xr-x  13 j42  staff   442B Oct 12 15:38 .
drwx------+ 88 j42  staff   2.9K Aug 22 00:05 ..

No .plist named keybase, and my .plist have -rw-r--r-- 1 j42 staff rights

Anything I could do to help you?

maxtaco commented 7 years ago

Yeah, it looks like you do have the right permissions. Let me ask you another question: does your macOS want to reboot to upgrade, and maybe you canceled the reboot?

maxtaco commented 7 years ago

And a third annoying question I might ask is: does a reboot solve the problem?

Jolg42 commented 7 years ago

Hi! @maxtaco So it's actually not the first time I try to install the Keybase app and it did the same thing last time. I didn't cancel any upgrade :( and will not switch to HighSierra until mid next year ~.

maxtaco commented 7 years ago

Well it's an issue that has been reported to us that we can't repro. The causes are usually as stated above.

The problem is that launchctl pretends as if it worked, and then doesn't do anything. We are stumped.

Can you run: launchctl print-disabled system

Jolg42 commented 7 years ago

As a developer myself I know it can be hard to debug some specific issues too 😇

disabled services = {
    "com.apple.ManagedClientAgent.enrollagent" => true
    "com.apple.screensharing" => true
    "com.apple.ftpd" => true
    "com.crashplan.engine" => false
    "com.openssh.sshd" => true
    "at.obdev.littlesnitchd" => false
    "com.apple.mdmclient.daemon.runatboot" => true
    "com.cleverfiles.cfbackd" => false
    "limit.maxproc" => false
    "com.microsoft.office.licensing.helper" => false
    "com.apple.mrt" => false
    "com.apple.stackshot" => false
    "com.apple.bootpd" => true
    "org.apache.httpd" => true
    "limit.maxfiles" => false
    "com.apple.mtmfs" => true
    "com.paragon.NTFS.launch" => false
    "com.bjango.istatmenus.daemon" => false
    "org.ntp.ntpd" => false
    "com.apple.pacemaker" => true
    "com.bjango.istatmenusdaemon" => false
    "com.apple.ftp-proxy" => true
    "org.macosforge.xquartz.privileged_startx" => false
    "com.citrix.ctxusbd" => false
}
maxtaco commented 7 years ago

ok, we came up empty there, thanks for your help. how about this?

grep launchd /var/log/system.log | grep keybase

Thank you!

Jolg42 commented 7 years ago
Oct 12 15:33:57 Moon com.apple.xpc.launchd[1] (keybase.updater): This service is defined to be constantly running and is inherently inefficient.
Oct 12 15:34:27 Moon com.apple.xpc.launchd[1] (keybase.service): This service is defined to be constantly running and is inherently inefficient.
Oct 12 15:35:22 Moon com.apple.xpc.launchd[1] (keybase.updater): This service is defined to be constantly running and is inherently inefficient.
Oct 12 15:35:52 Moon com.apple.xpc.launchd[1] (keybase.service): This service is defined to be constantly running and is inherently inefficient.
Oct 12 15:36:22 Moon com.apple.xpc.launchd[1] (keybase.kbfs): This service is defined to be constantly running and is inherently inefficient.
Oct 12 15:36:28 Moon com.apple.xpc.launchd[1] (keybase.updater): This service is defined to be constantly running and is inherently inefficient.
Oct 12 15:36:58 Moon com.apple.xpc.launchd[1] (keybase.service): This service is defined to be constantly running and is inherently inefficient.
Oct 12 15:37:28 Moon com.apple.xpc.launchd[1] (keybase.kbfs): This service is defined to be constantly running and is inherently inefficient.
hmeine commented 7 years ago

I am having the exact same problem (log ID 4d73ea3f68d28b91490fff1c). No hits at all in /var/log/system.log. Less disabled entries:

disabled services = {
    "org.pqrs.karabiner.karabiner_grabber" => false
    "com.cisco.anyconnect.vpnagentd" => false
    "com.apple.ftpd" => true
    "com.openssh.sshd" => false
    "com.apple.mtmfs" => false
    "org.ntp.ntpd" => false
    "com.apple.locate" => false
    "com.apple.backupd-auto" => false
    "org.macosforge.xquartz.privileged_startx" => false
}

Uptime only 24 days (sudden reboot IIRC); no reboot canceled. Also still on Sierra (10.12.6).

patrickxb commented 7 years ago

Hi @Jolg42 thanks for all your help with this. Still stumped. This might shed some light:

ps ax | grep -i keybase

to see if there are any processes hanging around and getting in the way.

And the permissions on ~/Library/Group Containers/keybase/Library/Caches and ~/Library/Group Containers/keybase/Library/Caches/Keybase

Thanks for all your help, we'd love to figure this out!!!

patrickxb commented 7 years ago

@hmeine for you, it looks like the permissions on ~/Library/LaunchAgents are probably set to root.

Jolg42 commented 7 years ago
ps ax | grep -i keybase                                                                                                                                              
12370 s007  R+     0:00.00 grep -i keybase
ll ~/Library/Group\ Containers/keybase/Library/Caches                                                                                                                
total 0
drwx------  3 j42  staff   102B Sep 25 16:12 .
drwx------  3 j42  staff   102B Sep 25 16:12 ..
drwx------  2 j42  staff    68B Sep 25 16:12 Keybase
ll ~/Library/Group\ Containers/keybase/Library/Caches/Keybase                                                                                                        
total 0
drwx------  2 j42  staff    68B Sep 25 16:12 .
drwx------  3 j42  staff   102B Sep 25 16:12 ..
patrickxb commented 7 years ago

@Jolg42 thanks again...you're helping us check off some theories, but we still haven't figured it out.

If you are still willing to keep trying stuff, this is our next thought. To try to see if launchctl will work manually.

I made a keybase.service.plist file for j42 and put it here:

https://keybase.pub/patrick/keybase.service.plist

If you download that and put it in ~/Library/LaunchAgents then run

launchctl load ~/Library/LaunchAgents/keybase.service.plist

let's see what happens.

If it works, the keybase service will be running. Something like this will show up in ps:

/Applications/Keybase.app/Contents/SharedSupport/bin/keybase -d --log-file=/Users/j42/Library/Logs/keybase.service.log service

If it doesn't work, then it seems like launchd just isn't accepting anything new.

Jolg42 commented 7 years ago
launchctl load ~/Library/LaunchAgents/keybase.service.plist                                                                                                          
/Users/j42/Library/LaunchAgents/keybase.service.plist: Path had bad ownership/permissions

Not working :(

ll /Users/j42/Library/LaunchAgents/keybase.service.plist                                                                                                            
-rw-r--r--  1 j42  staff   1.1K Oct 12 18:08 /Users/j42/Library/LaunchAgents/keybase.service.plist
maxtaco commented 7 years ago

Aha! This is something. Permissions! How about ll ~/Library/ ?

Jolg42 commented 7 years ago
ll ~/Library/                                                                                                                                                        
total 5592
drwx------+  88 j42  staff   2.9K Aug 22 00:05 .
drwxr-xr-x+ 249 j42  staff   8.3K Oct 12 18:12 ..
-rw-r--r--@   1 j42  staff    22K Oct  3 15:55 .DS_Store
.....
patrickxb commented 7 years ago

@Jolg42 can you ls -l /Applications/Keybase.app/Contents/SharedSupport/bin please?

I think the permissions are about the binary it is trying to start.

Jolg42 commented 7 years ago
ls -l /Applications/Keybase.app/Contents/SharedSupport/bin                                                                                                           
total 345152
-rwxr-xr-x@ 1 j42  admin    50M Oct  3 21:40 git-remote-keybase
-rwxr-xr-x@ 1 j42  admin    48M Oct  3 21:40 kbfs
-rwxr-xr-x@ 1 j42  admin   2.9M Oct  3 21:40 kbnm
-rwxr-xr-x@ 1 j42  admin    54M Oct  3 21:40 keybase
-rwxr-xr-x@ 1 j42  admin    14M Oct  3 21:40 updater
patrickxb commented 7 years ago

Ok a few more ls -l for you:

ls -l /tmp
ls -l /private/

I'm looking for the permissions on /tmp which is the working directory specified in the plist. On mac, it usually links to /private/tmp, so want to check the permissions on that directory as well.

I tried changing them on my computer and they caused launchctl to fail silently (like we see in the logs) so this might be the permission problem. When working, mine look like:

> ls -l /tmp
lrwxr-xr-x@ 1 root  wheel  11 Oct 12  2016 /tmp -> private/tmp
> ls -l /private/
total 0
drwxrwxrwt    7 root  wheel   238 Oct 12 10:14 tmp

Thanks again, you've been very helpful and patient!

patrickxb commented 7 years ago

Might as well include permissions on ~/Library/Logs as well...

Jolg42 commented 7 years ago

Here it is

ls -l /tmp                                                                                                                                                           
lrwxr-xr-x@ 1 root  wheel    11B Jun  3 12:07 /tmp -> private/tmp
ll /private/                                                                                                                                                         
total 0
drwxr-xr-x@   6 root  wheel   204B Jun  3 12:08 .
drwxr-xr-x   33 root  wheel   1.2K Oct  9 14:53 ..
drwxr-xr-x  127 root  wheel   4.2K Oct 12 20:27 etc
drwxr-xr-x    2 root  wheel    68B Oct 15  2016 tftpboot
drwxrwxrwt   61 root  wheel   2.0K Oct 12 20:27 tmp
drwxr-xr-x   26 root  wheel   884B Jul 21 19:09 var
ll ~/Library/Logs/                                                                                                                                                  
total 1851440
drwxrwxrwx+ 200 j42   staff   6.6K Oct 12 14:45 .
drwx------+  88 j42   staff   2.9K Aug 22 00:05 ..
......
patrickxb commented 7 years ago

Thanks, you're a trooper...still haven't found anything wrong with your permissions!

~/Library/Application Support

and

~/Library/Application Support/Keybase

do you own those as well?

Jolg42 commented 7 years ago

Some permissions again 😃

ll ~/Library/Application\ Support                                                                                                                                    
total 248
drwx------@ 244 j42  staff   8.1K Oct 12 18:16 .
drwx------+  88 j42  staff   2.9K Aug 22 00:05 ..
....
ll ~/Library/Application\ Support/Keybase/                                                                                                                           
total 64
drwxr-xr-x   17 j42  staff   578B Oct 12 18:11 .
drwx------@ 244 j42  staff   8.1K Oct 12 18:16 ..
-rw-r--r--@   1 j42  staff   6.0K Jul 20 21:01 .DS_Store
drwx------    7 j42  staff   238B Sep  6 20:10 GPUCache
lrwxr-xr-x    1 j42  staff     8B Sep  6 20:11 Keybase -> /keybase
drwx------    2 j42  staff    68B Sep  6 20:10 Local Storage
-rw-------    1 j42  staff    69B Sep  6 20:10 Preferences
-rw-r--r--    1 j42  staff   212B Oct 12 18:11 app-state.json
-rw-------    1 j42  staff   281B Mar 13  2016 config.json
-rw-r--r--    1 j42  staff     2B Oct 12 18:11 finder_position.config
drwx------    4 j42  staff   136B Sep 25 16:12 kbfs_block_cache
drwx------    2 j42  staff    68B Sep 25 16:12 kbfs_journal
drwx------    4 j42  staff   136B Sep 25 16:12 kbfs_sync_cache
drwxr-xr-x    7 j42  staff   238B Sep 25 16:12 keybase.chat.leveldb
drwxr-xr-x   15 j42  staff   510B Sep 25 16:12 keybase.leveldb
-rw-------    1 j42  staff   692B Mar 13  2016 secretkeys.jolg42.mpack
drwxr-xr-x    7 j42  staff   238B Sep 25 16:12 synced_tlf_config
maxtaco commented 7 years ago

@Jolg42 forgot to ask, can you echo $USER?

maxtaco commented 7 years ago

and I have a theory! Maybe permissions are not too closed, but rather too open. How about:

chmod 0770 ~/Library/Logs
maxtaco commented 7 years ago

For me I have:

[max@piave ~/src/keybase/keybase ] ls -las ~/Library/Logs/ | head
total 2401888
     0 drwx------+ 74 max  staff       2516 Oct 12 14:34 .
     0 drwx------@ 64 max  staff       2176 Dec 30  2016 ..
Jolg42 commented 7 years ago
echo $USER                                                                                                                                                           
j42

After chmod 0770 ~/Library/Logs

ls -las ~/Library/Logs/ | head                                                                                                                                       
total 1851480
    0 drwxrwx---+ 200 j42   staff   6.6K Oct 12 14:45 .
    0 drwx------+  88 j42   staff   2.9K Aug 22 00:05 ..

Launched the app but still stuck...!

screenshot 2017-10-12 at 21 01 24 screenshot 2017-10-12 at 21 01 55
patrickxb commented 7 years ago

Still shooting in the dark, but:

ls -l /usr/local/bin/keybase

maybe that's not a symlink to the one in the application bundle.

hmeine commented 7 years ago

@patrickxb Wow, that was a quick correct diagnosis from very few information; I guess you have a lot of bad experience with that already. :-( FWIW, in my case the culprit could be LastPass:

ll ~/Library/LaunchAgents
total 16
-rw-r--r--  1 root    staff  444 30 Mai 09:12 com.lastpass.LastPassHelper.plist
-rw-r--r--@ 1 hmeine  staff  677 26 Jul 10:13 org.virtualbox.vboxwebsrv.plist
patrickxb commented 7 years ago

@hmeine yes, we've seen it before. And LastPass has been the culprit before. Fortunately, this error shows up in the logs, so it's easy to diagnose...

Jolg42 commented 7 years ago

@patrickxb

ls -l /usr/local/bin/keybase                                                                                                                                         
lrwxr-xr-x  1 j42  admin    60B Sep  6 20:10 /usr/local/bin/keybase -> /Applications/Keybase.app/Contents/SharedSupport/bin/keybase
patrickxb commented 7 years ago

Urgh.

Well, we could try this:

sudo fs_usage | grep -i keybase > ~/keybase_fs_usage

in another terminal window, try the launchctl load ~/Library/LaunchAgents/keybase.service.plist

should see every file it's trying to access...

maxtaco commented 7 years ago

Note the ^edit^ to the above

roens commented 7 years ago

FWIW, I'm experiencing this trouble also. New computer, trying to install/setup keybase. I downloaded & installed (copied) the app, v1.0.33. My log ID is: 0fd432590a077e115d5eeb1c

I've tried your LaunchAgent plist (changing the username to my own, and Keybase.app path to where I've got it: in Utilities)… and after loading that, then had the background process running!

[mario:~] $ pgrep -fl keyb
1767 /Applications/Utilities/Keybase.app/Contents/SharedSupport/bin/keybase -d --log-file=/Users/mario/Library/Logs/keybase.service.log service

Once that was running, keybase CLI commands no longer were producing errors, and I was able to login… and then add the computer to my account.

However, I'm still unable to use the desktop app. It just gives the error that @Jolg42 first reported on this issue.

abl commented 7 years ago

Brand new machine, same issue - my log id: 23fb3e7c31f1141e5f84a11c

I also have LastPass installed. Will be rebooting shortly to see if that changes anything. :)

maxtaco commented 7 years ago

@roens which error is that?

maxtaco commented 7 years ago

@abl, any update? CAn you check those permissions?

patrickxb commented 7 years ago

@Jolg42 there's one other thing that might help if this is indeed a permissions issue:

find ~/Library \! -user j42 -print

This should find all the files in ~/Library or below that you don't own. There are a few subdirectories that Keybase tries to write to (Logs, Application Support, Group Containers, Caches, LaunchAgents).

If that command has any output that you think might be related to the above directories or has keybase in it, that could be the issue.

roens commented 7 years ago

@maxtaco, sorry, the error I was referring to as still seeing is the "Keybase Install Error" that @Jolg42 initially shared screenshot of.

maxtaco commented 7 years ago

@roens what are the permissions on your LaunchAgents directory?

ls -lsa ~/Library | grep LaunchAgents
Jolg42 commented 7 years ago

Hi @patrickxb

find ~/Library \! -user j42 -print

Didn't output anything related to Keybase.

But more surprisingly, I just tried to open the Keybase app a few minutes ago and it works!🎉

The only change I noticed is that when it wasn't working my Mac Notifications were off, they seems to be on again... They annoy me a lot, I tried to put Do Not Disturb Mode on, it works for a while but every day it's going off magically.. It's weird because each time I set it like this screenshot 2017-10-20 at 17 37 08 And normally it should not change, and everyday it goes back to the 22:00 to 07:00 default.

At least Keybase works now 😉

patrickxb commented 7 years ago

@Jolg42 I'm glad it's working...I wish we figured out why it wasn't.

I can't imagine it has anything to do with notifications, but at this point anything is possible.

Just for posterity, would you mind doing another keybase log send so maybe we can see what fixed it?

Thanks!!!

Jolg42 commented 7 years ago

@patrickxb Indeed...!

Log ID 192ea988e22eede951f49d1c

And thanks again for your help 👍

roens commented 7 years ago

@maxtaco…

[mario:~] $ ls -lsa ~/Library | grep LaunchAgents
0 drwxr-xr-x    4 root   staff    136 Oct 14 18:31 LaunchAgents/
maxtaco commented 7 years ago

@roens that is your problem. Some program like LastPass corrupted the permissions on your machine. You can do this to fix it:

sudo chown $USER:staff ~/Library/LaunchAgents

Assuming you're not root.. That should fix it...

roens commented 7 years ago

@maxtaco… 🎉 Indeed, you are correct. Sorry for the hassle, and thanks for the help! I'm now able to use the Keybase gui app on this computer.

naturaln0va commented 7 years ago

@maxtaco I was having this issue on macOS High Sierra (10.13) and this fix helped me. Thanks!

sudo chown $USER:staff ~/Library/LaunchAgents
maxtaco commented 7 years ago

ok thanks for the info @naturaln0va

our next installer with perform this fix if the user allows it (since it requires privilege escalation).