Realm-cocoa: Permission denied

Created on 14 Dec 2017  路  5Comments  路  Source: realm/realm-cocoa

Forum thread

https://forums.realm.io/t/permission-denied-when-using-asyncopenwithconfiguration/780/9

Goals

Access a realm that was made readonly to everyone through the "*" wildcard

Expected Results

Should be able to access the readonly realm when logged in with any user without throwing an error

Actual Results

Error from Realm Server:

Error from Realm iOS framework:

2017-12-13 22:02:59.282599-0500 ALPSRealmDemo[541:84570] Sync: Connection[1]: Received: ERROR(error_code=206, message_size=33, try_again=0, session_ident=1)
2017-12-13 22:02:59.283055-0500 ALPSRealmDemo[541:84570] Sync: Connection[1]: Connection closed due to error reported by server: Permission denied (BIND, REFRESH) (206)

Steps to Reproduce

run the xcode projects

Code Sample

https://github.com/yodellabs/RealmBug-objc

Version of Realm and Tooling

Realm framework version: ? 3.0.2

Realm Object Server version: ? 2.2.0

Xcode version: 9.2

iOS/OSX version: ? iOS 11.2.1

Dependency manager + version: cocoa pods 1.2.1

O-Community T-Help

Most helpful comment

Agree with @sipersso , one full day to discover finally that "Permission denied (BIND, REFRESH)" was due to a simple property added on device schema, which to effect to try writing on a read only permission realm. Without this issue, I was unable to find real cause !
Please add this in documentation if not implemented.
Thanks !

All 5 comments

It looks like this issue is the same or very similar to issue #4485.

https://github.com/realm/realm-cocoa/issues/4485

I have a repository here that demonstrates the issue.

https://github.com/yodellabs/RealmBug-objc

I've not had an opportunity to look at your sample project, but if you're seeing a permission denied error in response to an "upload" message when opening a read-only Realm using +asyncOpenWithConfiguration:callbackQueue:callback:, two possibilities come to mind:

  1. Your local schema doesn't match the server schema, and so the local schema is modified and these are the changes that are being uploaded. The solution here is to double-check that the schema on the server and your app match.
  2. The local copy of the synced Realm has some changes that were made by an earlier version of your app that the server is continuing to reject. This should only crop up in a development situation where you're changing things (the schema, how you're opening the Realm, etc). The solution here would be to remove the local copy of the synced Realm, and try again.

If neither of these solve your problem, let me know and I'll see if I can reproduce what you're seeing.

Closing this issue due to no response. Feel free to reopen if additional information can be provided.

I just wasted many hours on this. In my case I definitely think there is a schema mismatch. Wouldn't it be a good thing if this was included in the error message? I mean, you get permission denied because of that you are trying to modify the schema. It would be great if this was mentioned in the logs.

Agree with @sipersso , one full day to discover finally that "Permission denied (BIND, REFRESH)" was due to a simple property added on device schema, which to effect to try writing on a read only permission realm. Without this issue, I was unable to find real cause !
Please add this in documentation if not implemented.
Thanks !

Was this page helpful?
0 / 5 - 0 ratings