swinful / cnode_stakepool

Ansible Role for Cardano Relay Node on FreeBSD
BSD 3-Clause "New" or "Revised" License
3 stars 0 forks source link

Error during playbook run #2

Closed reqlez closed 3 years ago

reqlez commented 3 years ago

Hi.

Thanks a lot for this! However, I did get an error during this step: this is on fresh Freebsd 12.2 image on Azure.

Now i'm not sure if this is supposed to be run with root user or something, but i ran it with another user inside the 12.2 vm that has sudo rights. No need for password entry during sudo i confirmed that, plus it got all the way to this step before failing. Was I supposed to create a user ahead of time? the cnode_daemon user ?

TASK [cnode_stakepool : Ensure directories exists] **** failed: [hostnamehere] (item=/usr/local/cnode_relay) => {"ansible_loop_var": "item", "changed": false, "gid": 0, "group": "wheel", "item": "/usr/local/cnode_relay", "mode": "0755", "msg": "chown failed: failed to look up user cnode_daemon", "owner": "root", "path": "/usr/local/cnode_relay", "size": 512, "state": "directory", "uid": 0} failed: [hostnamehere] (item=/usr/local/cnode_relay/git) => {"ansible_loop_var": "item", "changed": false, "gid": 0, "group": "wheel", "item": "/usr/local/cnode_relay/git", "mode": "0755", "msg": "chown failed: failed to look up user cnode_daemon", "owner": "root", "path": "/usr/local/cnode_relay/git", "size": 512, "state": "directory", "uid": 0} failed: [hostnamehere] (item=/usr/local/cnode_relay/conf) => {"ansible_loop_var": "item", "changed": false, "gid": 0, "group": "wheel", "item": "/usr/local/cnode_relay/conf", "mode": "0755", "msg": "chown failed: failed to look up user cnode_daemon", "owner": "root", "path": "/usr/local/cnode_relay/conf", "size": 512, "state": "directory", "uid": 0} failed: [hostnamehere] (item=/usr/local/cnode_relay/private) => {"ansible_loop_var": "item", "changed": false, "gid": 0, "group": "wheel", "item": "/usr/local/cnode_relay/private", "mode": "0755", "msg": "chown failed: failed to look up user cnode_daemon", "owner": "root", "path": "/usr/local/cnode_relay/private", "size": 512, "state": "directory", "uid": 0} failed: [hostnamehere] (item=/usr/local/cnode_relay/scripts) => {"ansible_loop_var": "item", "changed": false, "gid": 0, "group": "wheel", "item": "/usr/local/cnode_relay/scripts", "mode": "0755", "msg": "chown failed: failed to look up user cnode_daemon", "owner": "root", "path": "/usr/local/cnode_relay/scripts", "size": 512, "state": "directory", "uid": 0} failed: [hostnamehere] (item=/usr/local/cnode_relay/db) => {"ansible_loop_var": "item", "changed": false, "gid": 0, "group": "wheel", "item": "/usr/local/cnode_relay/db", "mode": "0755", "msg": "chown failed: failed to look up user cnode_daemon", "owner": "root", "path": "/usr/local/cnode_relay/db", "size": 512, "state": "directory", "uid": 0} failed: [hostnamehere] (item=/var/run/cnode_relay) => {"ansible_loop_var": "item", "changed": false, "gid": 0, "group": "wheel", "item": "/var/run/cnode_relay", "mode": "0755", "msg": "chown failed: failed to look up user cnode_daemon", "owner": "root", "path": "/var/run/cnode_relay", "size": 512, "state": "directory", "uid": 0} failed: [hostnamehere] (item=/var/log/cnode_relay) => {"ansible_loop_var": "item", "changed": false, "gid": 0, "group": "wheel", "item": "/var/log/cnode_relay", "mode": "0755", "msg": "chown failed: failed to look up user cnode_daemon", "owner": "root", "path": "/var/log/cnode_relay", "size": 512, "state": "directory", "uid": 0}

PLAY RECAP **** hostnamehere : ok=14 changed=12 unreachable=0 failed=1 skipped=0 rescued=0 ignored=0

reqlez commented 3 years ago

okay i'm a dumb ass... i set the variable to the non root user that i setup ahead of time and it worked lol instead of cnode_daemon example

However, I do see this deprecation warning here... not sure if this is going to stop working later.

ok: [hostnamehere] => (item={'name': 'security.bsd.unprivileged_read_msgbuf', 'value': 0}) [DEPRECATION WARNING]: Invoking "{{ ansible_pkg_mgr }}" only once while using a loop via squash_actions is deprecated. Instead of using a loop to supply multiple items and specifying name: "{{ item }}", please use name: '{{ required_packages }}' and remove the loop. This feature will be removed from ansible-base in version 2.11. Deprecation warnings can be disabled by setting deprecation_warnings=False in ansible.cfg.

reqlez commented 3 years ago

okay now it's complaining that there is no mainnet-config.json under the templates folder...

just did wget https://raw.githubusercontent.com/input-output-hk/cardano-node/master/configuration/cardano/mainnet-config.json insde the templates folder, going to re-run and see.

reqlez commented 3 years ago

And now getting error: (item=relay-topology_pull.sh) => {"ansible_loop_var": "item", "changed": false, "item": "relay-topology_pull.sh", "msg": "AnsibleUndefinedVariable: 'cnode_producer' is undefined"}

i added variable cnode_producer: IPADDRESS into the playbook.yaml ( maybe we need reference to add this into playbook ) however, now that i'm looking at it, that command is using DIG and that is not part of base system any longer, might need to specify that bind-tools is required as a pre-req

reqlez commented 3 years ago

I went ahead and pkg install bind-tools however, the script does call for a FQDN i guess versus IP address. I think there should be an option in the variable where you can specify if the cnode_producer is ip or fqdn maybe a cnode_producer_type variable is needed ? where it can be a choice of ip or fqdn ? or you can parse variable input and see if it is an ip or fqdn just by parsing ? also, I think people should be able to pick a port as well, and not assume that their BP is at default 6000 port.

reqlez commented 3 years ago

and one more issue i found, running that script the topologypull.sh errors out: Cannot 'restart' cnode_relay. Set cnode_relay_enable to YES in /etc/rc.conf or use 'onerestart' instead of 'restart'.

maybe missing entry to rc.conf ? should be added ?

reqlez commented 3 years ago

Okay so it seems the node is running ... however, where are all the tools ? i do not see them under /opt/cnode_relay/scripts folder

gLiveView is not there... also cntools.sh not there either.

I tried to wget https://raw.githubusercontent.com/cardano-community/guild-operators/alpha/scripts/cnode-helper-scripts/gLiveView.sh and run it, but then saw this message:

sed: -I or -i may not be used with stdin ./gLiveView.sh: line 123: sha256sum: command not found ./gLiveView.sh: line 123: sha256sum: command not found lsof: WARNING: compiled for FreeBSD release 12.2-RELEASE-p5; this is 12.2-RELEASE-p4. lsof: WARNING: access /home/usernamehere/.lsof_hostnamehere: No such file or directory lsof: WARNING: created device cache file: /home/usernamehere/.lsof_hostnamehere

so one of the things I see, it seems that the image from Azure is 12.2-RELEASE-p4 and these tools need 12.2-RELEASE-p5 ?

reqlez commented 3 years ago

In any case, if you give me some direction on how you were able to get the guild tools working on there, ill see if i can add some PRs to fix some of this stuff. this sha256sum issue i have no idea about, does their .sh file need to be modified ? Because I installed shasum and openssl-devel and i dont see that command anywhere, seems like some kind of end of live syntax stuff. I tired to link sha256sum to shasum -a 256 like this: alias sha256sum="/usr/local/bin/shasum -a 256" it works from command line but the script still complains that sha256sum is not found.

reqlez commented 3 years ago

yea I tried even modifying the command inside the .sh and gLiveView still does not work, it just gets stuck. sLiveView kind of works. I think there are some prereqs missing...