question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Switching default keychain

See original GitHub issue

Describe the bug

Ultimately, I’m trying to use match/gym to build apps through a self-hosted runner.

I’ve tried many combinations of the following:

bundle exec fastlane run create_keychain
bundle exec fastlane run unlock_keychain

However, the result of security default-keychain is always /Library/Keychain/System. I can only change the system default with sudo

Has anyone been able to work though a similar issue? I’ve found a lot of similar or outdated issues, but they all point to things like “use setup_ci” or unlock the keychain, but I think the crux of the problem here is the inability to change the default keychain.

Alternatively, I’m able to see valid certs with

security find-identity -v -p codesigning mykeychain

but unable to see them with

security find-identity -v -p codesigning

Is there a way for me to get xcodebuild to use the specific keychain?

To Reproduce See above

Expected behavior

$ security default-keychain mykeychain
$ security default-keychain
/path/to/mykeychain

Runner Version and Platform

OSX - tar xzf ./actions-runner-linux-x64-2.165.2.tar.gz

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:3
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
raphaelcruzeirocommented, Dec 4, 2020

I’m experiencing this issue as well @TingluoHuang. What is interesting here is that this works the first time I install the the runner but stops working after the machine is rebooted (reinstalling the runner makes it work again).

When the problem starts occurring, security default-keychain returns only the system keychain if it’s being ran by the runner. If I ssh to the machine under the same user, security default-keychain returns the correct keychain. The only workaround I found so far is to reinstall the runner.

1reaction
sebalopezcommented, Mar 16, 2021

I read elsewhere on SO having only the latest should be enough, though it in any case its emission last month seems to be related to this issue. Devilishly hard to debug indeed.

Read more comments on GitHub >

github_iconTop Results From Across the Web

If you need to update your keychain password on Mac
If you need to update your keychain password on Mac · In the Keychain Access app on your Mac, choose Keychain Access >...
Read more >
How to set default keychain via cli in mac?
I got this error after deleting the default keychain expecting that MacOS will pick the available one as default but it did not....
Read more >
Easy Ways How You Can Change Keychain Password on ...
How to Change The Default iCloud Keychain Password · 1. Open Keychain Access using Spotlight. · 2. Then, click on "Edit" from the...
Read more >
How to change Keychain password on Mac - iGeeksBlog
Open Keychain Access. · Click Keychain Access in the Menu bar. · Select Preferences from the following menu. · Click the Reset Default...
Read more >
How to Resolve Mac OS X Keychain Problems
Click General, then click Reset My Default Keychain. Authenticate with your account login password. Quit Keychain Access. Restart your computer.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found