rockstor / rockstor-core

Linux/BTRFS based Network Attached Storage(NAS)
http://rockstor.com/docs/contribute_section.html
GNU General Public License v3.0
553 stars 137 forks source link

[t] Indicate Tailscale install requirement #2845

Closed FroggyFlox closed 2 months ago

FroggyFlox commented 3 months ago

Our attempt at having the Tailscale repos and its package pre-installed in our installer has unfortunately had to be stopped: https://github.com/rockstor/rockstor-installer/pull/173. This means we now need to ship our installer without the repo and package needed for the included Tailscale service (https://rockstor.com/docs/interface/system/services.html#tailscale).

We unfortunately do not surface the need for the user to first install the repo and the Tailscale package before configuring the service. This might have already misled a Testing channel user, unfortunately: https://forum.rockstor.com/t/unknown-internal-error-doing-a-post-to-api-sm-services-tailscaled-config/9418/2.

We should thus, to begin, surface this information to the user trying to configure the Tailscale service. This could be:

Any other idea(s) is welcome, of course.

FroggyFlox commented 3 months ago

An accompanying issue in our rockstor-doc repo has been created: https://github.com/rockstor/rockstor-doc/issues/471

phillxnet commented 2 months ago

We now have our planned doc entry/how-to for installing the Tailscale repo & program, via:

https://github.com/rockstor/rockstor-doc/pull/484

Which predominantly added the following Tailscale how-to:

Tailscale install: https://rockstor.com/docs/howtos/tailscale_install.html

This issue could be addressed, at least initially, by:

  • 3: simple banner reminding the user to install the package first, along with a link to our docs showing how to.

Or a custom error message indicating the same.

The problem, as I see it, with checking for a Tailscale repo (1., 2.); is that some folks may take a non-packaged approach to the Tailscale program install: especially give the dated docs situation referenced in the give howto. So I think, give our DIY nature, it is entirely appropriate that we leave the Tailscale install itself up-to the user: with the given Howto guide that we now have.

phillxnet commented 2 months ago

As-is, if we attempt to submit a default Tailscale config (dialog presented on Enable attempt, or via spanner icon) without a Tailscale install, we get the following failure:

[10/Jul/2024 13:01:13] ERROR [system.osi:288] non-zero code(5) returned by command: ['/usr/bin/systemctl', 'stop', 'tailscaled']. output: [''] error: ['Failed to stop tailscaled.service: Unit tailscaled.service not loaded.', '']
[10/Jul/2024 13:01:13] ERROR [storageadmin.middleware:34] Exception occurred while processing a request. Path: /api/sm/services/tailscaled/config method: POST
[10/Jul/2024 13:01:13] ERROR [storageadmin.middleware:35] Error running a command. cmd = /usr/bin/systemctl stop tailscaled. rc = 5. stdout = ['']. stderr = ['Failed to stop tailscaled.service: Unit tailscaled.service not loaded.', '']
Traceback (most recent call last):
  File "/opt/rockstor/.venv/lib/python3.11/site-packages/django/core/handlers/base.py", line 197, in _get_response
    response = wrapped_callback(request, *callback_args, **callback_kwargs)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/rockstor/.venv/lib/python3.11/site-packages/django/views/decorators/csrf.py", line 56, in wrapper_view
    return view_func(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/rockstor/.venv/lib/python3.11/site-packages/django/views/generic/base.py", line 104, in view
    return self.dispatch(request, *args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/rockstor/.venv/lib/python3.11/site-packages/rest_framework/views.py", line 509, in dispatch
    response = self.handle_exception(exc)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/rockstor/.venv/lib/python3.11/site-packages/rest_framework/views.py", line 469, in handle_exception
    self.raise_uncaught_exception(exc)
  File "/opt/rockstor/.venv/lib/python3.11/site-packages/rest_framework/views.py", line 480, in raise_uncaught_exception
    raise exc
  File "/opt/rockstor/.venv/lib/python3.11/site-packages/rest_framework/views.py", line 506, in dispatch
    response = handler(request, *args, **kwargs)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib64/python3.11/contextlib.py", line 81, in inner
    return func(*args, **kwds)
           ^^^^^^^^^^^^^^^^^^^
  File "/opt/rockstor/src/rockstor/smart_manager/views/tailscaled_service.py", line 98, in post
    systemctl(self.name, "stop")
  File "/opt/rockstor/src/rockstor/system/services.py", line 107, in systemctl
    return run_command(arg_list, log=True)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/rockstor/src/rockstor/system/osi.py", line 290, in run_command
    raise CommandException(cmd, out, err, rc)
system.exceptions.CommandException: Error running a command. cmd = /usr/bin/systemctl stop tailscaled. rc = 5. stdout = ['']. stderr = ['Failed to stop tailscaled.service: Unit tailscaled.service not loaded.', '']

And a generic Web-UI message:

Houston, we've had a problem. Unknown internal error doing a POST to /api/sm/services/tailscaled/config

phillxnet commented 2 months ago

Closing as: Fixed by #2867