4 / 4
May 2024

Hello, I have been working through the SwiftUI Quick Start, but when I try the Device Sync part, I get this error:

Info: Connection[2]: Session[2]: Received: ERROR “Permission denied (BIND, IDENT, QUERY, REFRESH)” (error_code=206, is_fatal=false, error_action=ApplicationBug)

I have looked at where this is happening via the debugger (Xcode), and it is at this call:

@AsyncOpen(appId: "my-app-id", timeout: 4000) var asyncOpen

The login code never gets called.

I have set up a default role with the preset readAndWriteAll, which gives full access to everyone. I have tried it in Development and with No Environment.

Has anyone seen this before? Any ideas? Thanks!

Hi, just to make sure, did you replace the appId in the code with the appId for your application?

If so, can you send the link to your application in the app services UI? That error means that the user does not have read permission. One thing that can trip people up is the concept of the draft. When you created a ReadAllWriteAll role did you deploy the draft for that?

Best,
Tyler

Hi Tyler,

First, I read your articles on Flexible Sync in Medium. Thanks for those! They were very helpful.

I have replaced my appId with the actual appId.

Here is a link to the app: App Services

Your response got me looking at the AtlasUI more and I noticed that the two classes that are on there from the SwiftUI Quick Start, Item Group and Items, were somehow under the todo app, which was in the Swift Quick Start. I changed the permissions for it, and then it worked.

Then I broke it. I tried to remove that todo app, and ended up removing the schema, so now I get a different error, “Info: Connection[1]: Session[1]: Received: ERROR “Invalid query: failed to parse query: query contains table not in schema: “Item”” (error_code=226, is_fatal=true, error_action=ApplicationBug)”.

I was under the impression that you could generate a schema in development mode by running the app, but no luck. I need to figure out how to get the old collections out and get them under the Quick Start app which I’ve called TryRealm - that one does not show up anywhere on the dashboard. I will also want to do this for my real app when I get to that point.

I’ve looked around all through the dashboard and can’t figure out how to delete the todo app, nor how to put in a new app, which I though I could do from the client by just running it.

Sorry, Realm and Atlas are both new to me and there is a lot there to figure out and get working correctly.

Thanks, Steve

Hi,

I am glad to hear that you found those helpful. Looking at your application it seems like you may have resolved the issue on your own. Ill still respond with a few helpful tidbits:

  1. You can either define collection rules or a default rule. The default rule will apply to any collection that does not have a collection rule defined
  2. All tables must have schemas in app services to be synced
  3. Developerment mode can be used to upload the schema from the device to the cloud. Generally adding new fields and tables should work automatically, but when making changes to both the SDK schemas and the cloud schemas, sometimes it is best to wipe the simulator and restart it. This will re-exchange schemas and force the cloud schema to be an exact copy of the SDK schema

Best,
Tyler