ITRS-Group / cordial

Cordial comprises a set of interrelated programs, integrations, libraries and packages for Geneos, principally written in Go.
Other
7 stars 0 forks source link

geneos init FATAL error related to chdir on webserver package #108

Closed gadvincula closed 1 year ago

gadvincula commented 1 year ago

Hi,

Scenario: I've got my gateway, netprobe, licd and webserver packages downloaded on my server. Upon executing geneos init command (shown below), a FATAL error related to a directory was returned.

[geneos@gcatcen002 ~]$ geneos init all -n gateway3 -L /tmp/geneos.lic -A /home/geneos/downloads/ /home/geneos/gateway3 licd "gateway3" added, port 7041 imported "/tmp/geneos.lic" to localhost:/home/geneos/gateway3/licd/licds/gateway3/geneos.lic gateway "gateway3" added, port 7039 netprobe "localhost" added, port 7036 2023-05-29T05:14:43-07:00 FATAL: tools/geneos/cmd/add.go:154 cmd.addInstance() > error="chdir /home/geneos/gateway3/packages/webserver/active_prod/config: no such file or directory"

I used the -A option to point to the local directory which contains all my geneos components packages.

[geneos@gcatcen002 webserver]$ ls -l /home/geneos/downloads/ total 415920 -rwxrwxr-x. 1 geneos geneos 27942063 Feb 8 00:17 geneos-gateway-6.2.0-el8-linux-x64.tar.gz -rwxrwxr-x. 1 geneos geneos 1835615 Dec 13 23:11 geneos-licd-6.1.0-el8-linux-x64.tar.gz -rwxrwxr-x. 1 geneos geneos 271622414 Feb 8 00:18 geneos-netprobe-6.2.0-el8-linux-x64.tar.gz -rwxr-xr-x. 1 geneos geneos 124491229 May 29 05:08 geneos-web-server-6.3.0-linux-x64.tar.gz

The /home/geneos/gateway3/packages/webserver/ was created by the geneos init command but not its subdirectories.

[geneos@gcatcen002 webserver]$ ll /home/geneos/gateway3/packages/ total 0 drwxrwxr-x. 2 geneos geneos 6 May 29 05:14 downloads drwxrwxr-x. 2 geneos geneos 6 May 29 05:14 fa2 drwxrwxr-x. 2 geneos geneos 6 May 29 05:14 fileagent drwxrwxr-x. 2 geneos geneos 6 May 29 05:14 gateway drwxrwxr-x. 2 geneos geneos 6 May 29 05:14 licd drwxrwxr-x. 2 geneos geneos 6 May 29 05:14 netprobe drwxrwxr-x. 2 geneos geneos 6 May 29 05:14 webserver [geneos@gcatcen002 webserver]$ ll /home/geneos/gateway3/packages/webserver total 0 [geneos@gcatcen002 webserver]$ ll /home/geneos/gateway3/packages/webserver/active_prod /home/geneos/gateway3/packages/webserver/active_prod/config ls: cannot access /home/geneos/gateway3/packages/webserver/active_prod: No such file or directory ls: cannot access /home/geneos/gateway3/packages/webserver/active_prod/config: No such file or directory [geneos@gcatcen002 webserver]$

By the way the gateway, netprobe and licd components were installed successfully

[geneos@gcatcen002 webserver]$ geneos ls Type Name Host Port Version Home gateway gateway3 localhost 7039 active_prod:unknown /home/geneos/gateway3/gateway/gateways/gateway3 licd gateway3 localhost 7041 active_prod:unknown /home/geneos/gateway3/licd/licds/gateway3 webserver gateway3 localhost 8080 active_prod:unknown /home/geneos/gateway3/webserver/webservers/gateway3 netprobe localhost localhost 7036 active_prod:unknown /home/geneos/gateway3/netprobe/netprobes/localhost

pgalbavy-itrs commented 1 year ago

I suspect this is because there is no "-el8" version of the webserver and while this works for downloads (it falls back to the latest available) for local archives it ignores any without -el8.

Will look at this today and try to get a fix into v1.5.2 for later this week.

In the meantime you can install just the web server and try the -T option:

geneos package install -L ./geneos-web-server* -T webserver:6.3.0

With -T you have to point to the exact archive as the -T overrides the extraction of type and version from the file names. Not tried on el8 though.

gadvincula commented 1 year ago

"geneos install -L ./geneos-web-server* -T webserver:6.3.0"

The "./geneos-web-server*" is your license file in that command?

pgalbavy-itrs commented 1 year ago

No. It is just the web server for an existing installation.

Perhaps the docs are not clear on how geneos works in new installations as it is designed to follow the older standards for directory trees.

You should only use init once per system to create the base install and then use add and package install to update things. I was going to highlight the directory names you have above - they are unusual - but was not sure if it was intentional. Normally you have a GENEOS_HOME and then install components under that and do not have other trees.

pgalbavy-itrs commented 1 year ago

Hmm. Just tried this locally in an EL8 container and could not reproduce:

[geneos@3c048d2d84a6 ~]$ ls -l /tmp/*gz
-rw-rw-r-- 1 geneos geneos  29756874 May 30 07:00 /tmp/geneos-gateway-6.3.1-el8-linux-x64.tar.gz
-rw-rw-r-- 1 geneos geneos   1835615 May 30 07:00 /tmp/geneos-licd-6.1.0-el8-linux-x64.tar.gz
-rw-rw-r-- 1 geneos geneos 277414335 May 30 07:00 /tmp/geneos-netprobe-6.3.1-el8-linux-x64.tar.gz
-rw-rw-r-- 1 geneos geneos 124491229 May 30 07:00 /tmp/geneos-web-server-6.3.0-linux-x64.tar.gz
[geneos@3c048d2d84a6 ~]$ geneos init all -L /tmp/geneos.lic -A /tmp /home/geneos/gateway3
floating template "netprobe.setup.xml.gotmpl" written to /home/geneos/gateway3/floating/templates
gateway template "gateway.setup.xml.gotmpl" written to /home/geneos/gateway3/gateway/templates
gateway template "gateway-instance.setup.xml.gotmpl" written to /home/geneos/gateway3/gateway/templates
san template "netprobe.setup.xml.gotmpl" written to /home/geneos/gateway3/san/templates
installed "geneos-licd-6.1.0-el8-linux-x64.tar.gz" to "/home/geneos/gateway3/packages/licd/6.1.0+el8"
licd /home/geneos/gateway3/packages/licd/active_prod updated to 6.1.0+el8
installed "geneos-gateway-6.3.1-el8-linux-x64.tar.gz" to "/home/geneos/gateway3/packages/gateway/6.3.1+el8"
gateway /home/geneos/gateway3/packages/gateway/active_prod updated to 6.3.1+el8
installed "geneos-netprobe-6.3.1-el8-linux-x64.tar.gz" to "/home/geneos/gateway3/packages/netprobe/6.3.1+el8"
netprobe /home/geneos/gateway3/packages/netprobe/active_prod updated to 6.3.1+el8
installed "geneos-web-server-6.3.0-linux-x64.tar.gz" to "/home/geneos/gateway3/packages/webserver/6.3.0"
webserver /home/geneos/gateway3/packages/webserver/active_prod updated to 6.3.0
licd "3c048d2d84a6" added, port 7041
imported "/tmp/geneos.lic" to localhost:/home/geneos/gateway3/licd/licds/3c048d2d84a6/geneos.lic
gateway "3c048d2d84a6" added, port 7039
netprobe "localhost" added, port 7036
imported "config.xml.min.tmpl" to localhost:/home/geneos/gateway3/webserver/webservers/3c048d2d84a6/config/config.xml
imported "log4j.properties" to localhost:/home/geneos/gateway3/webserver/webservers/3c048d2d84a6/config/log4j.properties
imported "log4j2.properties" to localhost:/home/geneos/gateway3/webserver/webservers/3c048d2d84a6/config/log4j2.properties
imported "logging.properties" to localhost:/home/geneos/gateway3/webserver/webservers/3c048d2d84a6/config/logging.properties
imported "login.conf" to localhost:/home/geneos/gateway3/webserver/webservers/3c048d2d84a6/config/login.conf
imported "security.properties" to localhost:/home/geneos/gateway3/webserver/webservers/3c048d2d84a6/config/security.properties
imported "security.xml" to localhost:/home/geneos/gateway3/webserver/webservers/3c048d2d84a6/config/security.xml
imported "sso.properties" to localhost:/home/geneos/gateway3/webserver/webservers/3c048d2d84a6/config/sso.properties
imported "users.properties" to localhost:/home/geneos/gateway3/webserver/webservers/3c048d2d84a6/config/users.properties
webserver "3c048d2d84a6" added, port 8080
licd "3c048d2d84a6" started with PID 172
gateway "3c048d2d84a6" started with PID 173
webserver "3c048d2d84a6" started with PID 174
netprobe "localhost" started with PID 175

Also, did not see the unarchiving in your output. What version of geneos are you running? v1.5.1 (above) seem "ok" - there were fixes versus v1.4.4 around archives etc.

gadvincula commented 1 year ago

currently running geneos version v1.4.4.

I will download the latest one and test

gadvincula commented 1 year ago

https://github.com/ITRS-Group/cordial/releases/latest/download/geneos <-- this link still points to v1.4.4

pgalbavy-itrs commented 1 year ago

Sorry, but just tried and I get v1.5.1 - it is probably a local browser or proxy cache issue. You can go to the specific release page and download from that link (it's the same for github) but may force your local caches to try again.

gadvincula commented 1 year ago

_"You should only use init once per system to create the base install and then use add and package install to update things. I was going to highlight the directory names you have above - they are unusual - but was not sure if it was intentional. Normally you have a GENEOSHOME and then install components under that and do not have other trees."

Going back to this, I actually have my $HOME set to /home/geneos. Then the "gateway3" subfolder was created automatically after I ran the geneos init command with a gateway name included.

gadvincula commented 1 year ago

I was able to download the latest copy of the binary and reinstalled my gateway, netprobe, licd and webserver components. This time its successful.

[geneos@gcatcen002 ~]$ geneos init all -L /tmp/geneos.lic -A /home/geneos/downloads/ /home/geneos/gateway4 gateway template "gateway.setup.xml.gotmpl" written to /home/geneos/gateway4/gateway/templates gateway template "gateway-instance.setup.xml.gotmpl" written to /home/geneos/gateway4/gateway/templates san template "netprobe.setup.xml.gotmpl" written to /home/geneos/gateway4/san/templates floating template "netprobe.setup.xml.gotmpl" written to /home/geneos/gateway4/floating/templates installed "geneos-licd-6.1.0-el8-linux-x64.tar.gz" to "/home/geneos/gateway4/packages/licd/6.1.0+el8" licd /home/geneos/gateway4/packages/licd/active_prod updated to 6.1.0+el8 installed "geneos-gateway-6.2.0-el8-linux-x64.tar.gz" to "/home/geneos/gateway4/packages/gateway/6.2.0+el8" gateway /home/geneos/gateway4/packages/gateway/active_prod updated to 6.2.0+el8 installed "geneos-netprobe-6.2.0-el8-linux-x64.tar.gz" to "/home/geneos/gateway4/packages/netprobe/6.2.0+el8" netprobe /home/geneos/gateway4/packages/netprobe/active_prod updated to 6.2.0+el8 installed "geneos-web-server-6.3.0-linux-x64.tar.gz" to "/home/geneos/gateway4/packages/webserver/6.3.0" webserver /home/geneos/gateway4/packages/webserver/active_prod updated to 6.3.0 licd "gcatcen002" added, port 7041 imported "/tmp/geneos.lic" to localhost:/home/geneos/gateway4/licd/licds/gcatcen002/geneos.lic gateway "gcatcen002" added, port 7039 netprobe "localhost" added, port 7036 imported "config.xml.min.tmpl" to localhost:/home/geneos/gateway4/webserver/webservers/gcatcen002/config/config.xml imported "log4j.properties" to localhost:/home/geneos/gateway4/webserver/webservers/gcatcen002/config/log4j.properties imported "log4j2.properties" to localhost:/home/geneos/gateway4/webserver/webservers/gcatcen002/config/log4j2.properties imported "logging.properties" to localhost:/home/geneos/gateway4/webserver/webservers/gcatcen002/config/logging.properties imported "login.conf" to localhost:/home/geneos/gateway4/webserver/webservers/gcatcen002/config/login.conf imported "security.properties" to localhost:/home/geneos/gateway4/webserver/webservers/gcatcen002/config/security.properties imported "security.xml" to localhost:/home/geneos/gateway4/webserver/webservers/gcatcen002/config/security.xml imported "sso.properties" to localhost:/home/geneos/gateway4/webserver/webservers/gcatcen002/config/sso.properties imported "users.properties" to localhost:/home/geneos/gateway4/webserver/webservers/gcatcen002/config/users.properties webserver "gcatcen002" added, port 8080 licd "gcatcen002" started with PID 3597 webserver "gcatcen002" started with PID 3598 netprobe "localhost" started with PID 3599 Type Name Host PID Ports User Group Starttime Version Home webserver gcatcen002 localhost 3598 [] geneos geneos 2023-05-30T01:42:34-07:00 active_prod:6.3.0 /home/geneos/gateway4/webserver/webservers/gcatcen002 [geneos@gcatcen002 ~]$ geneos ps Type Name Host PID Ports User Group Starttime Version Home webserver gcatcen002 localhost 3598 [8080 7042] geneos geneos 2023-05-30T01:42:34-07:00 active_prod:6.3.0 /home/geneos/gateway4/webserver/webservers/gcatcen002

pgalbavy-itrs commented 1 year ago

Great!

But, just to go back a step or two, the better way to do this if you already have the directory structure is to just add the gateway itself and not create a full installation for each gateway. License daemons can only run one per server.

  1. First, if required, initialise the base directory:
geneos init

Then install the packages and licd:

geneos package install
geneos add licd perm
geneos import licd ./geneos.lic
geneos start licd

Then add individual gateways as required:

geneos add gateway gateway1
geneos add gateway gateway2
...

Re-running geneos init all will create multiple directory hierarchies and your GENEOS_HOME will point to the last one, but there may still be processes from the other running etc.

pgalbavy-itrs commented 1 year ago

In the meantime I will also close this issue as the upgrade appears to have addressed it.

Thanks for reporting!