I cloned an app.
This app had secrets.
I added a dependency app which also has secrets.
I deleted the main (cloned) app’s secrets as I wanted to use the dependency ones.
When I run the app I get :
anvil.secrets.SecretError: This app's secrets have been cleared. Please reset their values in the App Secrets config.
<running on the server>
called from /downlink/anvil/secrets.py, line 5
called from library_mysql_tmx_api.DBBase.py, line 12
called from Decorators, line 11
called from Decorators, line 37
called from Stats, line 78
called from Stats, line 75
called from Main, line 19
They definitely haven’t been cleared in the dependency app (library_mysql_tmx_api). I can see them.
Could the fact I had the secrets service from the original cloning be causing an issue?
Or do I have to reference the secrets differently when used this way?
The dependency app DBBase class refers to the secrets service in the dependency app itself, like this :
self.dbhost = anvil.secrets.get_secret('db_host')
self.dbport = anvil.secrets.get_secret('db_port')
self.username = anvil.secrets.get_secret('db_username')
self.password = anvil.secrets.get_secret('db_password')
If it’s imported do I have to explicitly reference the dependency app?
(edit 1,767) - I think it is trying to refer to the main app. In fact, it definitely is. Nah, see answer below
If I re-add the secrets service it throws a whole load of other issues of course, but it shows that it’s referring to the local app and not the library.
How do I sort this out? Help!