FreeTAKTeam / FreeTAKHub-Installation

FreeTAKHub-Installation
Eclipse Public License 2.0
33 stars 29 forks source link

Zero Touch Install - nodered : Set service stater failes #98

Closed Baldag closed 6 months ago

Baldag commented 9 months ago

When trying to install using the Zero-Touch Script on a ubuntu 22.04 server I get the following error when trying too install FTS.

TASK [nodered : Include Ubuntu-specific variables] *****************************
ok: [localhost]

TASK [nodered : Set IPv4] ******************************************************
ok: [localhost]

TASK [nodered : Print IPv4] ****************************************************
ok: [localhost] => {
    "msg": "noderedserver_ipv4 = 127.0.0.1"
}

TASK [nodered : Get public IPv4] ***********************************************
ok: [localhost]

TASK [nodered : Set public IPv4] ***********************************************
ok: [localhost]

TASK [nodered : Install] *******************************************************
included: /root/FreeTAKHub-Installation/roles/nodered/tasks/setup-Ubuntu.yml for                              localhost

TASK [nodered : wait for lock-frontend release] ********************************
ok: [localhost]

TASK [nodered : Install apt dependencies] **************************************
changed: [localhost] => (item=npm)
ok: [localhost] => (item=nodejs)

TASK [nodered : Install packages with npm] *************************************
changed: [localhost] => (item=node-red)
changed: [localhost] => (item=node-red-admin)
changed: [localhost] => (item=node-red-contrib-web-worldmap)

TASK [nodered : Install Node-RED nodes with npm] *******************************
changed: [localhost] => (item=node-red-contrib-config)
changed: [localhost] => (item=node-red-dashboard)
changed: [localhost] => (item=node-red-contrib-credentials)

TASK [nodered : Create flows directory] ****************************************
changed: [localhost]

TASK [nodered : Template unit file] ********************************************
changed: [localhost]

TASK [nodered : Enable service] ************************************************
changed: [localhost]

TASK [nodered : Template settings file] ****************************************
changed: [localhost]

TASK [nodered : Set service state] *********************************************
FAILED - RETRYING: [localhost]: Set service state (20 retries left).
FAILED - RETRYING: [localhost]: Set service state (19 retries left).
FAILED - RETRYING: [localhost]: Set service state (18 retries left).
FAILED - RETRYING: [localhost]: Set service state (17 retries left).
FAILED - RETRYING: [localhost]: Set service state (16 retries left).
FAILED - RETRYING: [localhost]: Set service state (15 retries left).
FAILED - RETRYING: [localhost]: Set service state (14 retries left).
FAILED - RETRYING: [localhost]: Set service state (13 retries left).
FAILED - RETRYING: [localhost]: Set service state (12 retries left).
FAILED - RETRYING: [localhost]: Set service state (11 retries left).
FAILED - RETRYING: [localhost]: Set service state (10 retries left).
FAILED - RETRYING: [localhost]: Set service state (9 retries left).
FAILED - RETRYING: [localhost]: Set service state (8 retries left).
FAILED - RETRYING: [localhost]: Set service state (7 retries left).
FAILED - RETRYING: [localhost]: Set service state (6 retries left).
FAILED - RETRYING: [localhost]: Set service state (5 retries left).
FAILED - RETRYING: [localhost]: Set service state (4 retries left).
FAILED - RETRYING: [localhost]: Set service state (3 retries left).
FAILED - RETRYING: [localhost]: Set service state (2 retries left).
FAILED - RETRYING: [localhost]: Set service state (1 retries left).
fatal: [localhost]: FAILED! => {"attempts": 20, "changed": true, "name": "nodered", "state": "started", 
"status": {"ActiveState": "failed", "Description": "Node-RED graphical event wiring tool", 
"Environment": "\"NODE_OPTIONS=--max_old_space_size=1024\"", "EnvironmentFile": "-/root/.node-red/environment", 
"Group": "root", "Id": "nodered.service", "JournalFile": "/var/log/journal/nodered.service.log", "JournalFilePath": 
"/var/log/journal/nodered.service.log", "KillMode": "control-group", "KillSignal": "SIGINT", 
"LoadState": "loaded", "Names": "nodered.service", "NeedDaemonReload": "no", "NotifySocket": 
"/run/systemd/notify.nodered.service", "RemainAfterExit": "no", "RestartSec": "10s", "SendSIGHUP": "no", 
"SendSIGKILL": "yes", "StartLimitBurst": "5", "StartLimitIntervalSec": "10s", "StatusFile": "/run/nodered.service.status", 
"StatusFilePath": "/run/nodered.service.status", "SubState": "failed", "TimeoutStartUSec": "1min 30s", 
"TimeoutStopUSec": "1min 30s", "UnitFileState": "enabled", "User": "root", "WorkingDirectory": "/root"}}

PLAY RECAP *********************************************************************
localhost                  : ok=100  changed=43   unreachable=0    failed=1    s                             kipped=12   rescued=0    ignored=0
Baldag commented 9 months ago

I'm getting the following error in the nodered logs: ´´´ /usr/local/lib/node_modules/node-red/node_modules/@node-red/runtime/lib/flows/Flow.js:797 if (sendEvent?.destination?.node) { ^

SyntaxError: Unexpected token '.' at wrapSafe (internal/modules/cjs/loader.js:915:16) at Module._compile (internal/modules/cjs/loader.js:963:27) at Object.Module._extensions..js (internal/modules/cjs/loader.js:1027:10) at Module.load (internal/modules/cjs/loader.js:863:32) at Function.Module._load (internal/modules/cjs/loader.js:708:14) at Module.require (internal/modules/cjs/loader.js:887:19) at require (internal/modules/cjs/helpers.js:74:18) at Object. (/usr/local/lib/node_modules/node-red/node_modules/@node-red/runtime/lib/flows/ind> at Module._compile (internal/modules/cjs/loader.js:999:30) at Object.Module._extensions..js (internal/modules/cjs/loader.js:1027:10)

´´´

dirkkolb commented 9 months ago

It is because of a newer node-red version. I fixed it by going back to an older version:

sudo apt-get -y install npm sudo npm install -g --unsafe-perm node-red@2.2.2

Run it before calling the zero-touch installer!

Baldag commented 9 months ago

That got me past that issue. Now I get:

ERROR: Ansible requires Jinja2 3.0 or newer on the controller. Current version: 2.11.2

But when I upgrade to 3+ too be able too run ansible I get:


ERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts.
freetakserver 2.0.69 requires Jinja2==2.11.2, but you have jinja2 3.1.2 which is incompatible.```
Baldag commented 9 months ago

I got past the above issue by installation everything and not just --core.

But when I try too start fts.service I get the foolowing error:

freetak@freetak:/usr/local/lib/python3.11/dist-packages/FreeTAKServer-UI$ sudo python3 -m FreeTAKServer.controllers.services.FTS
Traceback (most recent call last):
  File "<frozen runpy>", line 198, in _run_module_as_main
  File "<frozen runpy>", line 88, in _run_code
  File "/usr/local/lib/python3.11/dist-packages/FreeTAKServer/controllers/services/FTS.py", line 39, in <module>
    from FreeTAKServer.core.services.federation.federation import (
  File "/usr/local/lib/python3.11/dist-packages/FreeTAKServer/core/services/federation/federation.py", line 12, in <module>
    from FreeTAKServer.core.services.federation.external_data_handlers import (
  File "/usr/local/lib/python3.11/dist-packages/FreeTAKServer/core/services/federation/external_data_handlers.py", line 1, in <module>
    from FreeTAKServer.core.services.federation.handlers import HandlerBase
  File "/usr/local/lib/python3.11/dist-packages/FreeTAKServer/core/services/federation/handlers.py", line 11, in <module>
    from FreeTAKServer.core.services.federation.federation_service_base import FederationServiceBase
  File "/usr/local/lib/python3.11/dist-packages/FreeTAKServer/core/services/federation/federation_service_base.py", line 12, in <module>
    from FreeTAKServer.core.serializers.protobuf_serializer import ProtobufSerializer
  File "/usr/local/lib/python3.11/dist-packages/FreeTAKServer/core/serializers/protobuf_serializer.py", line 5, in <module>
    from FreeTAKServer.core.serializers.xml_serializer import XmlSerializer
  File "/usr/local/lib/python3.11/dist-packages/FreeTAKServer/core/serializers/xml_serializer.py", line 5, in <module>
    from lxml.etree import Element   # pylint: disable=no-name-in-module
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
ModuleNotFoundError: No module named 'lxml.etree'
brothercorvo commented 6 months ago

thjis should be solved and I will close the issue