Permission Denied when loading my own Dependency

What I’m trying to do:
Load a Dependency I’ve created. It loads in one of my Apps, but not another.

I compared the anvil.yaml files of both calling Apps, and failed to find any relevant difference in how these were configured. I’m baffled.

The Dependency was cloned from the third App, but all 3 have had substantial edits since then.

I tried again, running the IDE in Edge, instead of Chrome. Same result: one App loads and runs the Dependency, the other doesn’t.

The successful App has the same database layout as the Dependency. The unsuccessful App has a different database layout.

The Dependency’s database layout shouldn’t matter. Should it?

What error or message are you getting?

Do you have dependencies that depend on different versions of the same dependency?

Something like this:

App1
 + Dep1 Production
     + Dep3 Production
 + Dep2 Production
     + Dep3 Development

No, I don’t have Dep1 and Dep2; just Dep1.

My Dep1 does have a Dep3. Which works fine when running Dep1 as an actual App. (I do that to test work-in-progress on Dep1.) And when running my App1.

It’s my App2, which also uses my Dep1, which complains:

image
This is utterly baffling, because I own all the Dependencies! I own App1, and App2, and Dep1, and Dep3.

I suspect that something else is happening at App2 startup, which is being treated as a Permissions error, but is actually something else gone wrong.

Maybe no one expected Dep1 to have its own database. But Dep1 is supposed to be a higher-level database layer, incorporating database-level integrity checks, e.g., prevent Foreign Keys from dangling. So it’s quite natural for it to have its own test data, and its own GUI.

Have you added to the depending apps all the services their dependencies use?

Good thinking! Maybe we should work up a checklist, for future Dependency builders/users…

Alas, in this case, App1 and App2 have exactly the same services defined.

services:
- source: /runtime/services/tables.yml
  client_config: {enable_v2: true}
  server_config: {}
- source: /runtime/services/anvil/users.yml
  client_config: {allow_signup: false, enable_automatically: false, use_email: true, confirm_email: false, require_secure_passwords: true, allow_remember_me: false, remember_me_days: 30}
  server_config: {user_table: users}

So if this was the issue, then both of them should fail.

Could you please shoot the app IDs over to support@anvil.works?

Thanks, Meredydd. Will do.

Edit: Done!

Well, that was interesting! Turns out that you did a series of operations that put Anvil in a funny state. I’ve fixed this directly in the database for now, so your app is now working, and we will provide a more general fix soon

In the meantime, for anyone else who is experiencing this problem: Please post in this thread!

2 Likes

Verified! Can’t thank you enough!

Edit: I unchecked this as a solution so that others would have an easier time posting.