[SOLVED] Installation Script Failing with "Installation canceled!" | FWCloud Forum

[SOLVED] Installation Script Failing with "Installation canceled!"

pengels

New member
Hello!

I'm trying to install FWCloud via the script on a CentOS 7 machine, but it keeps failing without providing useful error messages. Do you have any suggestions? Are there log files anywhere? I've verified that the fwcloud user can use mysql:


Code:
[fwcloud@mysystem~]$ mysql -u root
Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 48
Server version: 5.5.68-MariaDB MariaDB Server

Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

MariaDB [(none)]>


Code:
root@mysystem ~ $ curl -k -s https://raw.githubusercontent.com/soltecsis/fwcloud-installer/main/fwcloud-in[127/127$
h -o ./fwcloud-installer.sh && sudo bash ./fwcloud-installer.sh && rm -f ./fwcloud-installer.sh
#################################################################################
#                                                                               #
#  Copyright 2020 SOLTECSIS SOLUCIONES TECNOLOGICAS, SLU                        #
#    https://soltecsis.com                                                      #
#    info@soltecsis.com                                                         #                           [121/127]
#                                                                               #
#                                                                               #
#  This file is part of FWCloud (https://fwcloud.net).                          #
#                                                                               #
#  FWCloud is free software: you can redistribute it and/or modify              #
#  it under the terms of the GNU Affero General Public License as published by  #
#  the Free Software Foundation, either version 3 of the License, or            #
#  (at your option) any later version.                                          #
#                                                                               #
#  FWCloud is distributed in the hope that it will be useful,                   #
#  but WITHOUT ANY WARRANTY; without even the implied warranty of               #
#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the                #
#  GNU General Public License for more details.                                 #
#                                                                               #
#  You should have received a copy of the GNU General Public License            #
#  along with FWCloud.  If not, see <https://www.gnu.org/licenses/>.            #
#                                                                               #
#################################################################################

(*) Linux distribution.
Detected supported Linux distribution: CentOS Linux 7 (Core)


This shell script will install/update FWCloud on your system.
Projects fwcloud-websrv, fwcloud-ui, fwcloud-api and fwcloud-updater will be installed.
Do you want to continue? [Y/n]

(*) HTTP/HTTPS proxy.
As part of the install procedure we will download system packages and NodeJS modules.
If this system requires a HTTP/HTTPS proxy you have to specify its URL.
Are you behind an HTTP/HTTPS proxy? [y/N]

(*) Searching for required packages.
PACKAGE: lsof ... FOUND

PACKAGE: git ... FOUND

PACKAGE: curl ... FOUND

PACKAGE: OpenSSL ... FOUND

PACKAGE: OpenVPN ... FOUND

PACKAGE: osslsigncode ... NOT FOUND. Installing ...
Loaded plugins: fastestmirror, rhnplugin
This system is receiving updates from RHN Classic or Red Hat Satellite.
Loading mirror speeds from cached hostfile
No package osslsigncode available.
Error: Nothing to do
DONE

Setting up Node.js repository ... DONE
PACKAGE: Node.js ... FOUND

(*) Database engine.
FWCloud needs a MariaDB or MySQL database engine.
MariaDB ... FOUND

(*) Checking FWCloud TCP ports.
TCP port 3030 for fwcloud-websrv ... OK
TCP port 3131 for fwcloud-api ... OK                                                                         [60/127]
TCP port 3132 for fwcloud-updater ... OK

(*) Installing/updating from GitHub repositories.
We are going to install/update the next FWCloud projects:
fwcloud-websrv   [INSTALL]  (https://github.com/soltecsis/fwcloud-websrv.git)
fwcloud-ui       [INSTALL]  (https://github.com/soltecsis/fwcloud-ui.git)
fwcloud-api      [INSTALL]  (https://github.com/soltecsis/fwcloud-api.git)
fwcloud-updater  [INSTALL]  (https://github.com/soltecsis/fwcloud-updater.git)
These repositories will be installed/updated into the directory: /opt/fwcloud
Is it right? [Y/n]

Installing fwcloud-websrv ...
Cloning into 'websrv'...
remote: Enumerating objects: 178, done.
remote: Counting objects: 100% (178/178), done.
remote: Compressing objects: 100% (120/120), done.
remote: Total 178 (delta 102), reused 123 (delta 55), pack-reused 0
Receiving objects: 100% (178/178), 137.96 KiB | 0 bytes/s, done.
Resolving deltas: 100% (102/102), done.

Installing fwcloud-ui ...
Cloning into 'ui'...
remote: Enumerating objects: 4864, done.
remote: Counting objects: 100% (876/876), done.
remote: Compressing objects: 100% (531/531), done.
remote: Total 4864 (delta 667), reused 526 (delta 343), pack-reused 3988
Receiving objects: 100% (4864/4864), 143.17 MiB | 29.24 MiB/s, done.
Resolving deltas: 100% (3828/3828), done.
Submodule 'fwcloud-ui-doc-dist' (https://github.com/soltecsis/fwcloud-ui-doc-dist.git) registered for path 'fwcloud-u
i-doc-dist'
Cloning into 'fwcloud-ui-doc-dist'...
remote: Enumerating objects: 720, done.
remote: Counting objects: 100% (720/720), done.
remote: Compressing objects: 100% (479/479), done.
remote: Total 720 (delta 231), reused 688 (delta 203), pack-reused 0
Receiving objects: 100% (720/720), 21.90 MiB | 0 bytes/s, done.
Resolving deltas: 100% (231/231), done.
Submodule path 'fwcloud-ui-doc-dist': checked out 'b1c364f671e907af69a1709831dfe3799d52965d'

Installing fwcloud-api ...
Cloning into 'api'...
remote: Enumerating objects: 28662, done.
remote: Counting objects: 100% (370/370), done.
remote: Compressing objects: 100% (246/246), done.
remote: Total 28662 (delta 182), reused 217 (delta 86), pack-reused 28292
Receiving objects: 100% (28662/28662), 22.47 MiB | 34.19 MiB/s, done.
Resolving deltas: 100% (18015/18015), done.

Installing fwcloud-updater ...
Cloning into 'updater'...
remote: Enumerating objects: 384, done.
remote: Counting objects: 100% (384/384), done.
remote: Compressing objects: 100% (259/259), done.
remote: Total 384 (delta 233), reused 224 (delta 104), pack-reused 0
Receiving objects: 100% (384/384), 176.40 KiB | 0 bytes/s, done.
Resolving deltas: 100% (233/233), done.

(*) Setting up permissions.
Creating fwcloud user/group and setting up permissions.

(*) Installing required Node.js modules.
websrv

> @nestjs/core@7.5.5 postinstall /opt/fwcloud/websrv/node_modules/@nestjs/core
> opencollective || exit 0

added 924 packages from 643 contributors and audited 928 packages in 12.602s

58 packages are looking for funding
  run `npm fund` for details

found 18 high severity vulnerabilities
  run `npm audit fix` to fix them, or `npm audit` for details

api
added 883 packages from 1338 contributors and audited 964 packages in 10.826s

14 packages are looking for funding
  run `npm fund` for details

found 5 vulnerabilities (4 low, 1 high)
  run `npm audit fix` to fix them, or `npm audit` for details

updater

> @nestjs/core@7.5.4 postinstall /opt/fwcloud/updater/node_modules/@nestjs/core
> opencollective || exit 0

added 1097 packages from 650 contributors and audited 1103 packages in 13.763s

57 packages are looking for funding
  run `npm fund` for details

found 18 high severity vulnerabilities
  run `npm audit fix` to fix them, or `npm audit` for details
DONE

(*) TypeScript code compilation.
Compiling websrv (please wait) ... DONE
Compiling api (please wait) ... DONE
Compiling updater (please wait) ... DONE

(*) FWCloud database.
Next we are going to create the fwcloud database.
The next data will be used for it.
      Host: localhost
  Database: fwcloud
      User: fwcdbusr
  Password: RZYHUBj31yav95hr
Is it right? [Y/n]
WARNING: Database 'fwcloud' already exists.
If you continue the existing database will be destroyed.
Do you want to continue? [y/N]

(*) Generating .env file for fwcloud-api.
DONE

(*) Creating database schema and initial data.
Database schema ... Installation canceled!
 
Last edited:

pengels

New member
I did some more digging. This is failing on line 831 of the installation script:


Code:
  echo -e "\e[32m\e[1m(*) Creating database schema and initial data.\e[21m\e[0m"
  cd "${REPODIR}/api"
  echo -n "Database schema ... "
  su - fwcloud -c "cd \"$REPODIR/api\"; node fwcli migration:run" >/dev/null
  if [ "$?" != 0 ]; then
    echo -e "\e[31mInstallation canceled!\e[39m"
    exit 1
  fi

When I manually cd to that dir and run the node fwcli migration:run, I get this message:


Code:
root@mysystem ~ $ cd /opt/fwcloud/api/
root@mysystem api $ node fwcli migration:data
Starting compilation...[not required]

2021-04-23 09:35:53|ERROR|[FAILED QUERY]: INSERT INTO `customer` VALUES (1,"SOLTECSIS, S.L.","C/Carrasca, 7 - 03590 Altea (Alicante) - Spain","+34 966 446 046","info@soltecsis.com","https://soltecsis.com","2019-05-06 10:22:12","2019-05-06 10:22:12",1,1)
2021-04-23 09:35:53|ERROR|[QUERY ERROR]: Error: ER_NO_SUCH_TABLE: Table 'fwcloud.customer' doesn't exist
✖ Unexpected error: ER_NO_SUCH_TABLE: Table 'fwcloud.customer' doesn't exist
root@mysystem api $

I'm not sure where to go from here.
 

Carles Munyoz

Administrator
Staff member
Hi,
We are trying to reproduce the problem.

Meanwhile try the next:
  1. Drop the fwcloud database.
  2. Remove the /opt/fwcloud directory.
  3. Try to run agin the install script.
Please, let me know if it solves the problem.
 

pengels

New member
Thank you for your quick response!

I ran these commands and got the same result.

MariaDB [(none)]> drop database fwcloud;
Query OK, 1 row affected (0.00 sec)

rm -rf /opt/fwcloud/

curl -k -s https://raw.githubusercontent.com/soltecsis/fwcloud-installer/main/fwcloud-installer.sh -o ./fwcloud-installer.sh && sudo bash ./fwcloud-installer.sh && rm -f ./fwcloud-installer.sh

Ended up with this:

(*) Creating database schema and initial data.
Database schema ... Installation canceled!
 

Carles Munyoz

Administrator
Staff member
Please, may you run the next command and show me its output ?
Bash:
su - fwcloud -c "cd \"/opt/fwcloud/api\"; node fwcli migration:run"
 

pengels

New member
root@mysystem ~ $ su - fwcloud -c "cd \"/opt/fwcloud/api\"; node fwcli migration:run"
Starting compilation...[not required]

2021-04-23 10:53:54|ERROR|[FAILED QUERY]: CREATE TABLE `ca` (`id` int NOT NULL AUTO_INCREMENT, `fwcloud` int NOT NULL, `cn` varchar(255) NOT NULL, `days` int(11) UNSIGNED NOT NULL, `comment` varchar(255) NULL, `status` tinyint(1) NOT NULL DEFAULT 0, `created_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP, `updated_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, `created_by` int NOT NULL DEFAULT 0, `updated_by` int NOT NULL DEFAULT 0, UNIQUE INDEX `IDX_a124acbc4f214cc328782ff7fd` (`id`, `cn`), PRIMARY KEY (`id`)) ENGINE=InnoDB
2021-04-23 10:53:54|ERROR|[QUERY ERROR]: Error: ER_INVALID_DEFAULT: Invalid default value for 'created_at'
✖ Unexpected error: ER_INVALID_DEFAULT: Invalid default value for 'created_at'
root@mysystem ~ $
 

pengels

New member
These are the mariadb packages installed on the machine

mariadb.x86_64 1:5.5.68-1.el7
mariadb-libs.x86_64 1:5.5.68-1.el7
mariadb-server.x86_64 1:5.5.68-1.el7

root@mysystem ~ $ mysql
Welcome to the MariaDB monitor. Commands end with ; or \g.
Your MariaDB connection id is 91
Server version: 5.5.68-MariaDB MariaDB Server

Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

MariaDB [(none)]>
 

Carles Munyoz

Administrator
Staff member
It is failing in the tables creation procedure due that your MariaDB database engine version doesn't supports DEFAULT CURRENT_TIMESTAMP for datetime columns.

Your MariaDB version is quite old.
Is this a production server ?
If not, can you upgrade to MariaDB 10 as explained here ?

Another option is use Centos 8.
FWCloud-Installer goes like a charm in Centos 8.

Please, if none of the proposed solutions is valid for you, let me know and we can try another things like removing the DEFAULT CURRENT_TIMESTAMP in the tables creation procedure.
 
Last edited:

pengels

New member
That worked! Thank you.

The default version of mariadb for CentOS 7 is that old version I had before. mariadb101u is also available in the centos7-base repos at this time, and that seems to have worked. I'll include the output below so you can check for Cent7 in your script and maybe specify mariadb101u in your package list. It wouldn't be an issue you install the packages one at a time instead of something like "yum install nodejs openssl lsof" etc, but if you do install all the package manager packages in a big group, it would likely fail.

Code:
(*) Database engine.
FWCloud needs a MariaDB or MySQL database engine.
PACKAGE: MariaDB ... NOT FOUND. Installing ...
Loaded plugins: fastestmirror, rhnplugin
This system is receiving updates from RHN Classic or Red Hat Satellite.
Loading mirror speeds from cached hostfile
Resolving Dependencies
--> Running transaction check
---> Package mariadb-server.x86_64 1:5.5.68-1.el7 will be installed                                         [186/287]
--> Processing Dependency: mariadb(x86-64) = 1:5.5.68-1.el7 for package: 1:mariadb-server-5.5.68-1.el7.x86_64
--> Processing Dependency: mariadb-libs(x86-64) = 1:5.5.68-1.el7 for package: 1:mariadb-server-5.5.68-1.el7.x86_64
--> Processing Dependency: perl-DBD-MySQL for package: 1:mariadb-server-5.5.68-1.el7.x86_64
--> Processing Dependency: perl-DBI for package: 1:mariadb-server-5.5.68-1.el7.x86_64
--> Processing Dependency: perl(DBI) for package: 1:mariadb-server-5.5.68-1.el7.x86_64
--> Processing Dependency: perl(Data::Dumper) for package: 1:mariadb-server-5.5.68-1.el7.x86_64
--> Running transaction check
---> Package mariadb.x86_64 1:5.5.68-1.el7 will be installed
---> Package mariadb-libs.x86_64 1:5.5.68-1.el7 will be installed
---> Package perl-DBD-MySQL.x86_64 0:4.023-6.el7 will be installed
---> Package perl-DBI.x86_64 0:1.627-4.el7 will be installed
--> Processing Dependency: perl(RPC::PlClient) >= 0.2000 for package: perl-DBI-1.627-4.el7.x86_64
--> Processing Dependency: perl(RPC::PlServer) >= 0.2001 for package: perl-DBI-1.627-4.el7.x86_64
---> Package perl-Data-Dumper.x86_64 0:2.145-3.el7 will be installed
--> Running transaction check
---> Package perl-PlRPC.noarch 0:0.2020-14.el7 will be installed
--> Processing Dependency: perl(Net::Daemon) >= 0.13 for package: perl-PlRPC-0.2020-14.el7.noarch
--> Processing Dependency: perl(Net::Daemon::Test) for package: perl-PlRPC-0.2020-14.el7.noarch
--> Processing Dependency: perl(Net::Daemon::Log) for package: perl-PlRPC-0.2020-14.el7.noarch
--> Processing Dependency: perl(Compress::Zlib) for package: perl-PlRPC-0.2020-14.el7.noarch
--> Running transaction check
---> Package perl-IO-Compress.noarch 0:2.061-2.el7 will be installed
--> Processing Dependency: perl(Compress::Raw::Zlib) >= 2.061 for package: perl-IO-Compress-2.061-2.el7.noarch
--> Processing Dependency: perl(Compress::Raw::Bzip2) >= 2.061 for package: perl-IO-Compress-2.061-2.el7.noarch
---> Package perl-Net-Daemon.noarch 0:0.48-5.el7 will be installed
--> Running transaction check
---> Package perl-Compress-Raw-Bzip2.x86_64 0:2.061-3.el7 will be installed
---> Package perl-Compress-Raw-Zlib.x86_64 1:2.061-4.el7 will be installed
--> Processing Conflict: 1:mariadb101u-common-10.1.35-1.ius.centos7.x86_64 conflicts mariadb-libs < 1:10.1.35-1.ius.c
entos7
--> Processing Conflict: 1:mariadb101u-10.1.35-1.ius.centos7.x86_64 conflicts mariadb < 1:10.1.35-1.ius.centos7
--> Processing Conflict: 1:mariadb101u-libs-10.1.35-1.ius.centos7.x86_64 conflicts mariadb-libs < 1:10.1.35-1.ius.cen
tos7
--> Processing Conflict: 1:mariadb101u-errmsg-10.1.35-1.ius.centos7.x86_64 conflicts mariadb-libs < 1:10.1.35-1.ius.c
entos7
--> Processing Conflict: 1:mariadb101u-config-10.1.35-1.ius.centos7.x86_64 conflicts mariadb-libs < 1:10.1.35-1.ius.c
entos7
--> Processing Conflict: 1:mariadb101u-server-10.1.35-1.ius.centos7.x86_64 conflicts mariadb-server < 1:10.1.35-1.ius
.centos7
--> Finished Dependency Resolution
--> Finding unneeded leftover dependencies
Found and removing 0 unneeded dependencies
Error: mariadb101u conflicts with 1:mariadb-5.5.68-1.el7.x86_64
Error: mariadb101u-server conflicts with 1:mariadb-server-5.5.68-1.el7.x86_64
Error: mariadb101u-common conflicts with 1:mariadb-libs-5.5.68-1.el7.x86_64
Error: mariadb101u-config conflicts with 1:mariadb-libs-5.5.68-1.el7.x86_64
Error: mariadb101u-errmsg conflicts with 1:mariadb-libs-5.5.68-1.el7.x86_64
Error: mariadb101u-libs conflicts with 1:mariadb-libs-5.5.68-1.el7.x86_64
You could try using --skip-broken to work around the problem
** Found 1 pre-existing rpmdb problem(s), 'yum check' output follows:
libgudev1-219-57.el7.x86_64 has missing requires of systemd-libs = ('0', '219', '57.el7')
DONE

Starting mariadb service ... DONE
Enabling mariadb service at boot ... DONE

Code:
root@mysystem~ $ mysql -u root
Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 13
Server version: 10.1.35-MariaDB MariaDB Server

Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

MariaDB [(none)]>
 

Carles Munyoz

Administrator
Staff member
Great! I'm glad that we finally managed to solve the problem.
Thank you very much for your comments, we will consider it.

Please, if you have another problem don't hesitate in contacting us again.
 
Top