Error -34018 (errSecDefault) #52
Comments
As an additional information, we have the same problem in our project, which doesn't use SSKeychain. We started experiencing the problem with iOS7 only with the test runs. Right now, about a month later, we discovered that we have the same problem with an iPad mini 1 running iOS 6.1. But it works with an iPhone 4S running the same OS version. If you have any ideas, I'd be interested. I'm also open to contributing to this issue, as we're experiencing the same problem, but this will be planning-constrained. iPhone 5S, iOS7: fail |
Are you guys using access groups or iCloud syncing? Error |
Nope, none of the two. |
👍 Just started seeing the same issue consistently after upgrading to iOS 7.1 SDK. By the way, this only happens in a testing environment running the app through KIF on a device. If I run normally, it works just fine and it also works fine on the simulator during test. This seemed to fix it for me during test: http://stackoverflow.com/a/22305193/308315 |
PRs welcome :) |
👍 Happening to me as well on iOS 7.1.1, but very sporadically, can't find a way to recreate it myself. |
I'm experiencing this as well when trying to get previously stored items. They weird thing is that it seems to be happening semi-randomly. In our case it seems related to trying to access the keychain in code inside a |
@rsanchezsaez hah! That'll do it :) |
@soffes: How do you mean? That accessing the keychain inside a |
Oh, I thought you meant it was only happening sometimes because you were only executing the code once |
No, the code is ran once per application lifetime, but sometimes we get the bug and sometimes we don't (we have experienced the bug on several application runs, both in Debug and Release mode). :-) |
I am seeing -34018 "errSecDefault" on occasion, has anyone figured out what is going on or how to avoid it? |
I am also seeing the -34018 intermittently.
|
Same here, on iOS 8.1 on iPhone 6. :/ |
So, I was getting this error after accessing the Keychain around 100 times or so. Initially the keychain worked fine but then at some point it would just stop working and I couldn't access using sskeychain. Any chance it is connected to too many queries on the keychain in a short period of time? |
I'm also getting this issue intermittently now on iPhone 5s, iOS 7.1.1. It's weird.. I'm getting the error both on retrieve and save. It seems to be occurring on launch or re-launch of the app. I wonder if it's hitting the keychain too often? |
Does anyone know if the iOS Keychain is thread-safe? I'm actually hitting the iOS Keychain from multiple threads, usually in parallel, so I'm not sure if this is what is causing the |
@ccwasden That's an interesting thought. That might be true. Or a frequency issue, like 100 requests/hour. I still run into this once in a while, but I now built a cache around it. That's the only thing I can think of, since no one else seems to have any resolution. |
We are seeing this randomly as well, haven't been able to figure it out yet. The most frustrating part is that sometimes quitting the app and running it again solves the problem. I've also only seen it when debugging and never in "release" builds so far. |
Hi - we use SSKeychain in our project right now and get this error a lot - debug only though. Ussually it happens when updating code from git repo at first launch of debug version of the app (this one is actually fixable with the code signing script from http://stackoverflow.com/questions/20344255/secitemadd-and-secitemcopymatching-returns-error-code-34018-errsecmissingentit/22305193#22305193 ) Second thing is that when we use UIImagePicker to capture some photos. We try to access the keychain when UIImagePicker is visible and we can do it with no problem. But right after the image picker control is dismissed, this error starts to occur. |
@chrisballinger @maqoo Thanks for the updates! I haven't yet incorporated downloading remote logs from my app yet, so I haven't see if there are any issues from release versions. |
I also have this problem. |
This is not an issue with SSKeychain. It is an issue with Keychain. Like the readme says:
Good luck everyone. |
I'm glad to see I'm not the only one. When my app gets this, it basically "logs out" the user. I am going to have to re-think what I do when I see this. |
Experiencing exactly the same and only in debug. Note that if you're accessing the keychain in the background you should have something like this in your didFinishLaunchingWithOption [SSKeychain setAccessibilityType:kSecAttrAccessibleAfterFirstUnlock]; |
Following |
Glad I'm not alone, sad this is an issue. |
I found that this was a problem when I repeated the use of the key in the same period. |
@xinGGG Can you please explain further? |
I tried to distribute the app I was working on via TestFlight and found the same issue. Grr. |
|
|
Anybody know if this is fixed in iOS 10? |
@danielgalasko Can you post a Gist that shows how to correctly throw the exception if it encounters this error? |
Following as well |
I have same problem about this issue |
got a workaround by enabling keychain sharing in app capabilities |
@lagapollo Are you sure that actually works? |
My app had been working on iOS8 and iOS9, but stopped working with iOS 10. Using the 'fix' provided by @lagapollo works but seems unnecessary.. is this a bug? |
Seems there is a bug, https://openradar.appspot.com/27844971
|
workaround from @lagapollo worked for me in iOS10 |
Make sure you enable keychain sharing in the capabilities screen. |
Except there are no capabilities for test targets, so if you're trying to write to the keychain in a unit test/test target... you'll get this issue too. Any ideas for fixing that? |
As long as there is an Entitlements file, the simulator will work correctly. You do not need to enable Keychain Sharing (but toggling it on and off creates the entitlements file). |
So that explain why my app works well without enabling Keychain Sharing. 2016-09-20 3:36 GMT+08:00 phatmann notifications@github.com:
|
Following.... |
From the Xcode 8.1 GM release notes, this is mentioned under Known Issues
|
following... |
Following |
Getting the same on Mac OS but not sure if I'm doing it right. SAMKeychainQuery *q = [SAMKeychainQuery new];
q.synchronizationMode = SAMKeychainQuerySynchronizationModeYes;
q.service = @"myService";
q.account = @"myAccount";
q.password = @"pass";
NSError* error = nil;
[q save:&error];
if (error != nil) {
NSLog(@"Err: %@", [error localizedDescription]);
} |
Sometimes I'd see the following error
But I have no idea what errSecDefault (code -34018) means nor how to resolve it. Any ideas?
The text was updated successfully, but these errors were encountered: