Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Spatial Dataset Service created w/ CLI does not work until manually saved in admin pages #763

Closed
swainn opened this issue Feb 2, 2022 · 1 comment
Assignees
Labels

Comments

@swainn
Copy link
Member

swainn commented Feb 2, 2022

Tethys Version: 3.4.1

If the tethys services create command is used to create a spatial dataset service like so:

tethys services create spatial -t GeoServer -n tethys_geoserver -c admin:geoserver@http://localhost:8181/geoserver/rest/ -p https://www.example.com:8181/geoserver/rest/

attempting to retrieve the engine returns None, which can result in errors like the following:

2022-02-02 16:24:10,875 ERROR    Internal Server Error: /apps/sirba-forecast/sirba_forecast/
Traceback (most recent call last):
  File "/opt/conda/envs/tethys/lib/python3.7/site-packages/django/core/handlers/exception.py", line 34, in inner
    response = get_response(request)
  File "/opt/conda/envs/tethys/lib/python3.7/site-packages/django/core/handlers/base.py", line 115, in _get_response
    response = self.process_exception_by_middleware(e, request)
  File "/opt/conda/envs/tethys/lib/python3.7/site-packages/django/core/handlers/base.py", line 113, in _get_response
    response = wrapped_callback(request, *callback_args, **callback_kwargs)
  File "./tethys_apps/decorators.py", line 34, in wrapper
    return controller(request, *args, **kwargs)
  File "/opt/conda/envs/tethys/lib/python3.7/site-packages/django/contrib/auth/decorators.py", line 21, in _wrapped_view
    return view_func(request, *args, **kwargs)
  File "/opt/conda/envs/tethys/lib/python3.7/site-packages/tethysapp_sirba_forecast-0.0.1-py3.7.egg/tethysapp/sirba_forecast/controllers.py", line 197, in home
    response = geoserver_engine.list_workspaces()
AttributeError: 'NoneType' object has no attribute 'list_workspaces'

However, this can be fixed by opening the Spatial Dataset Service in the admin pages and saving it again. tethys services create seems to be missing some important step.

This issue can be reproduced using the following docker-compose: https://github.com/Aquaveo/tethys_portal_docker_sirba

@swainn swainn added the bug label Feb 2, 2022
@swainn swainn self-assigned this Feb 2, 2022
@swainn
Copy link
Member Author

swainn commented Feb 2, 2022

The tethys service create command is assigning the wrong value for engine here:

password=service_password, engine=service_type)

It needs to assign values as is done here:

ENGINE_CHOICES = (

swainn added a commit that referenced this issue Feb 2, 2022
@swainn swainn mentioned this issue Feb 2, 2022
swainn added a commit that referenced this issue Feb 2, 2022
swainn added a commit that referenced this issue Feb 3, 2022
* Fix for Spatial Dataset Service created w/ CLI does not work until manually saved in admin pages #763

* Fix lint
swainn added a commit that referenced this issue Feb 3, 2022
* Fix for Spatial Dataset Service created w/ CLI does not work until manually saved in admin pages #763

* Fix lint
@swainn swainn closed this as completed Apr 22, 2022
swainn added a commit that referenced this issue Oct 7, 2022
* Fix for Spatial Dataset Service created w/ CLI does not work until manually saved in admin pages #763

* Fix lint
swainn added a commit that referenced this issue Oct 7, 2022
* Fix for Spatial Dataset Service created w/ CLI does not work until manually saved in admin pages #763

* Fix lint
swainn added a commit to swainn/tethys that referenced this issue Oct 8, 2022
* Fix for Spatial Dataset Service created w/ CLI does not work until manually saved in admin pages tethysplatform#763

* Fix lint
swainn added a commit to swainn/tethys that referenced this issue Oct 8, 2022
* Fix for Spatial Dataset Service created w/ CLI does not work until manually saved in admin pages tethysplatform#763

* Fix lint
swainn added a commit to swainn/tethys that referenced this issue Oct 8, 2022
* Fix for Spatial Dataset Service created w/ CLI does not work until manually saved in admin pages tethysplatform#763

* Fix lint
swainn added a commit to swainn/tethys that referenced this issue Oct 8, 2022
* Fix for Spatial Dataset Service created w/ CLI does not work until manually saved in admin pages tethysplatform#763

* Fix lint
swainn added a commit that referenced this issue Oct 9, 2022
* Fix for Spatial Dataset Service created w/ CLI does not work until manually saved in admin pages #763

* Fix lint
swainn added a commit that referenced this issue Oct 13, 2022
* Fix for Spatial Dataset Service created w/ CLI does not work until manually saved in admin pages #763

* Fix lint
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant