Tethys 2.0 uninstall apps issue

54 views
Skip to first unread message

shawncrawley

unread,
Jun 14, 2017, 7:12:05 PM6/14/17
to Tethys Platform

I'm trying to migrate an existing app to Tethys 2.0. This mainly includes updating my current usage of persistent stores to the app_settings style. Anyway, I installed the app so I could troubleshoot where it breaks, and at this point it is breaking with this error:

File "/home/shawn/tethysdev/tethysapp-citywater/tethysapp/epanet/model.py", line 21, in <module>
    db_engine = EpanetApp.get_persistent_store_database('epanet')
  File "/home/shawn/tethys/src/tethys_apps/base/app_base.py", line 768, in get_persistent_store_database
    raise TethysAppSettingDoesNotExist('PersistentStoreDatabaseSetting named "{0}" does not exist.'.format(name))
tethys_apps.exceptions.TethysAppSettingDoesNotExist: PersistentStoreDatabaseSetting named "epanet" does not exist.

This is expected, since I haven't gone into the admin setting interface yet to setup these connections and plug them in. However, the server will not even start due to this error, thus preventing me from fixing it. I did the natural thing and attempted to uninstall the app, but it looks like the "tethys uninstall" command calls the app harvester for some reason, and so this command is breaking on the same error. This doesn't seem like a very good idea: having to have bug free code before you can uninstall an app. Am I missing something here?

alansnow21

unread,
Jun 14, 2017, 7:47:25 PM6/14/17
to Tethys Platform
I agree that we need to rethink this. I have run into the same problem.

Scott Christensen

unread,
Jun 14, 2017, 10:35:52 PM6/14/17
to alansnow21, Tethys Platform
A few of thoughts that will hopefully be helpful:
  1. In order to install/uninstall your app currently you need to remove any global imports of your persistent store settings. Only import those settings within a function. The new 'as_session_maker' option should make that fairly reasonable (@alansnow21 or @swainn could explain/help with that better than I could). 
  2. The plan is to catch the settings does not exist error and have it log a warning instead of it raising an error. That should prevent this situation from happening. I don't remember if this was going to make it into 2.0, but maybe we had better make sure that it does.
  3. Neither of the previous thoughts really solve the heart of the problem, as you've pointed out, that if, for whatever reason, an app has buggy code that shouldn't prevent it from being uninstalled. We'll have to discuss that soon and find a way to resolve.

On Wed, Jun 14, 2017 at 6:47 PM alansnow21 <alans...@gmail.com> wrote:
I agree that we need to rethink this. I have run into the same problem.

--
You received this message because you are subscribed to the Google Groups "Tethys Platform" group.
To unsubscribe from this group and stop receiving emails from it, send an email to tethysplatfor...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/tethysplatform/7dea172d-0a7d-45a0-845e-e0dfcda889c9%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
Scott D. Christensen, PhD
Research Civil Engineer
Information Technology Laboratory  
US Army Corps of Engineers
 

Prasanna dahal

unread,
Sep 22, 2017, 5:06:09 AM9/22/17
to Tethys Platform
I was also trying to migrate my app from Tethys 1.x to 2, and ran into same issue. Could not uninstall until I saw this suggestions from @sdc50. I wanted to share the experience- I had a few more syntax errors going from Tethys 1 to 2 which prevented uninstall, hence needed to remove almost all the imports- not just the global imports of my persistent store settings. Basically commented all the global imports (had issues with sdk.gizmos), and that was able to successfully uninstall after that.

Thanks,
Prasanna Dahal
Graduate Research Assistant
UWRL, Utah State University
Reply all
Reply to author
Forward
0 new messages