Leantime / leantime

Leantime is a goals focused project management system for non-project managers. Building with ADHD, Autism, and dyslexia in mind.
https://leantime.io
GNU Affero General Public License v3.0
4.58k stars 594 forks source link

installation issues #1093

Closed ballinger closed 1 year ago

ballinger commented 2 years ago

hi, i am stuck installing leantime. browsing to https://lean.domain.org/install prints: No database connection, check your database credentials in your configuration file. i have been trying to figure this out with the community of my OS without any luck so far. he was able to get this running without any issues, so i guess the package versions should be fine. any help would be very appreciated

https://community.nethserver.org/t/leantime-install/20825/22

what works: reach a dummy index.html which is inside of the public folder. login into mariadb with user and pass

OS: nethserver (based on centos) installation method manual/ non docker mysql Ver 15.1 Distrib 5.5.68-MariaDB, for Linux (x86_64) using readline 5.1 PHP 5.4.16 (cli) (built: Apr 1 2020 04:07:17)

# install steps
    ## apache virtual host
    * neth ui -> applications -> webserver -> virtual host
    * create virtual host
        FQDN -> lean.domain.org
        require SSL encrypted connection -> on
        Version of PHP -> 8.0
    * copy web root path
        /var/lib/nethserver/vhost/960374bb5e54059/

    ### pkg
        cd /tmp
        wget https://leantime.io/download?wpdmdl=7413 -O leantime.zip
        unzip leantime.zip -d /var/lib/nethserver/vhost/960374bb5e54059/
        rm leantime.zip

    #### config    
        cd /var/lib/nethserver/vhost/960374bb5e54059/config
        cp configuration.sample.php configuration.php

        chown -R apache:apache /var/lib/nethserver/vhost/960374bb5e54059/
        chmod 755 -R /var/lib/nethserver/vhost/960374bb5e54059/

    #### rand security key
        head /dev/urandom | tr -dc A-Za-z0-9 | head -c 32 ; echo ''

        vi /var/lib/nethserver/vhost/960374bb5e54059/config/configuration.php

        sitename: lean.domain.com
        dbHost: 127.0.0.1
        dbUser: leantime
        dbPass: KeePass
        dbDatabase: leantime
        dbPort -> 3313
        seassion password -> rand security key

    ### create db
    * https://wiki.nethserver.org/doku.php?id=mariadb103
    yum install nethserver-rh-mariadb103 --enablerepo=stephdl

    mysql103
    create database leantime;
    create user 'leantime'@'localhost' identified by 'keepass';
    grant all privileges on leantime.* to 'leantime'@'localhost';

    flush privileges;
    exit

system info

systemctl status rh-mariadb103-mariadb -l
● rh-mariadb103-mariadb.service - MariaDB 10.3 database server
   Loaded: loaded (/etc/systemd/system/rh-mariadb103-mariadb.service; enabled; vendor preset: disabled)
   Active: active (running) since Fri 2022-10-28 00:13:05 CEST; 35min ago
     Docs: man:mysqld(8)
           https://mariadb.com/kb/en/library/systemd/
  Process: 8023 ExecStartPost=/usr/bin/scl enable $RH_MARIADB103_SCLS_ENABLED -- /opt/rh/rh-mariadb103/root/usr/libexec/mysql-check-upgrade (code=exited, status=0/SUCCESS)
  Process: 7945 ExecStartPre=/usr/bin/scl enable $RH_MARIADB103_SCLS_ENABLED -- /opt/rh/rh-mariadb103/root/usr/libexec/mysql-prepare-db-dir %n (code=exited, status=0/SUCCESS)
  Process: 7915 ExecStartPre=/usr/bin/scl enable $RH_MARIADB103_SCLS_ENABLED -- /opt/rh/rh-mariadb103/root/usr/libexec/mysql-check-socket (code=exited, status=0/SUCCESS)
  Process: 7908 ExecStartPre=/usr/bin/scl enable $RH_MARIADB103_SCLS_ENABLED -- /usr/bin/scl_enabled rh-mariadb103 (code=exited, status=0/SUCCESS)
 Main PID: 7988 (mysqld)
   Status: "Taking your SQL requests now..."
    Tasks: 30
   Memory: 77.6M
   CGroup: /system.slice/rh-mariadb103-mariadb.service
           └─7988 /opt/rh/rh-mariadb103/root/usr/libexec/mysqld --basedir=/opt/rh/rh-mariadb103/root/usr

Oct 28 00:13:05 tank.domain.com systemd[1]: Starting MariaDB 10.3 database server...
Oct 28 00:13:05 tank.domain.com scl[7945]: Database MariaDB is probably initialized in /var/opt/rh/rh-mariadb103/lib/mysql already, nothing is done.
Oct 28 00:13:05 tank.domain.com scl[7945]: If this is not the case, make sure the /var/opt/rh/rh-mariadb103/lib/mysql is empty before running mysql-prepare-db-dir.
Oct 28 00:13:05 tank.domain.com mysqld-scl-helper[7988]: 2022-10-28  0:13:05 0 [Note] /opt/rh/rh-mariadb103/root/usr/libexec/mysqld (mysqld 10.3.35-MariaDB) starting as process 7988 ...
Oct 28 00:13:05 tank.domain.com mysqld-scl-helper[7988]: 2022-10-28  0:13:05 0 [Warning] Could not increase number of max_open_files to more than 1024 (request: 32186)
Oct 28 00:13:05 tank.domain.com mysqld-scl-helper[7988]: 2022-10-28  0:13:05 0 [Warning] Changed limits: max_open_files: 1024  max_connections: 151 (was 151)  table_cache: 421 (was 2000)
Oct 28 00:13:05 tank.domain.com systemd[1]: Started MariaDB 10.3 database server.
mysql103
MariaDB [(none)]> show databases;
+--------------------+
| Database           |
+--------------------+
| information_schema |
| leantime           |
| mysql              |
| performance_schema |
| phpmyadmin         |
+--------------------+
5 rows in set (0.011 sec)
MariaDB [(none)]> SELECT User, Host FROM mysql.user;
+------------+-----------+
| User       | Host      |
+------------+-----------+
| root       | 127.0.0.1 |
| root       | ::1       |
| admin      | localhost |
| leantime   | localhost |
| phpmyadmin | localhost |
| root       | localhost |
+------------+-----------+
6 rows in set (0.002 sec)
MariaDB [(none)]> SHOW GRANTS FOR leantime@localhost;
+-----------------------------------------------------------------------------------------------------------------+
| Grants for leantime@localhost                                                                                   |
+-----------------------------------------------------------------------------------------------------------------+
| GRANT USAGE ON *.* TO `leantime`@`localhost` IDENTIFIED BY PASSWORD '*8DECC4B56279D57A5F513FFB14EBD453434BA8D1' |
| GRANT ALL PRIVILEGES ON `leantime`.* TO `leantime`@`localhost`                                                  |
+-----------------------------------------------------------------------------------------------------------------+
2 rows in set (0.002 sec)
    sysctl -a 2>/dev/null | grep disable_ipv6
    net.ipv6.conf.all.disable_ipv6 = 0
    net.ipv6.conf.aqua0.disable_ipv6 = 0
    net.ipv6.conf.br-899e5d1b78e8.disable_ipv6 = 0
    net.ipv6.conf.default.disable_ipv6 = 0
    net.ipv6.conf.docker0.disable_ipv6 = 0
    net.ipv6.conf.enp0s31f6.disable_ipv6 = 0
    net.ipv6.conf.enp5s0.disable_ipv6 = 0
    net.ipv6.conf.lo.disable_ipv6 = 0
    net.ipv6.conf.veth0b39f3b.disable_ipv6 = 0
    net.ipv6.conf.vethfb0daa2.disable_ipv6 = 0
    lsof -i -P -n | grep 3313
    mysqld    28752      mysql   21u  IPv6 193442      0t0  TCP *:3313 (LISTEN)

    <VirtualHost *:443>
        DocumentRoot "/var/lib/nethserver/vhost/960374bb5e54059"
        ServerName lean.domain.org

    # Handle request with additional PHP-FPM backend from SCLo/Remi repositories
    <FilesMatch .php$>
      SetHandler "proxy:unix:/var/run/rh-php80-php-fpm/960374bb5e54059-php80.sock|fcgi://localhost"
    </FilesMatch>

        # 20forcessl_redirect enabled
        RewriteEngine On
        RewriteCond %{HTTPS} !=on
        RewriteRule (.*) https://%{SERVER_NAME}$1 [R,L]

        #
        #  20ssl_engine
        #
        SSLEngine on

            #25IndexesOption
            <LocationMatch "^/">
                Options +Indexes
            </LocationMatch>

        # 30directory -- basic directory setup
        <Directory /var/lib/nethserver/vhost/960374bb5e54059>
          AllowOverride All
          Options FollowSymLinks
          Options +Indexes
          Options +Includes

          <RequireAll>
            # access public
            Require all granted

            # authentication disabled

          </RequireAll>
        </Directory>

    </VirtualHost>

    <VirtualHost *:80>
        DocumentRoot "/var/lib/nethserver/vhost/960374bb5e54059"
        ServerName lean.domain.org

    # Handle request with additional PHP-FPM backend from SCLo/Remi repositories
    <FilesMatch .php$>
      SetHandler "proxy:unix:/var/run/rh-php80-php-fpm/960374bb5e54059-php80.sock|fcgi://localhost"
    </FilesMatch>

        # 20forcessl_redirect enabled
        RewriteEngine On
        RewriteCond %{HTTPS} !=on
        RewriteRule (.*) https://%{SERVER_NAME}$1 [R,L]

            #25IndexesOption
            <LocationMatch "^/">
                Options +Indexes
            </LocationMatch>

        # 30directory -- basic directory setup
        <Directory /var/lib/nethserver/vhost/960374bb5e54059>
          AllowOverride All
          Options FollowSymLinks
          Options +Indexes
          Options +Includes

          <RequireAll>
            # access public
            Require all granted

            # authentication disabled

          </RequireAll>
        </Directory>

    </VirtualHost>
diderich commented 2 years ago

The issue (probably) is that Leantime requires php 8.0 to run with multiple modules enabled, notably PDO. You can see your version with php -v and the modules installed with php -m.

ballinger commented 2 years ago

mhhh...ok. got php8 installed, couldnt find a list of required php packages. maybe i am missing one. also i created the virtualhost through nethservers ui, and there i could tick on php8.0

php80 -v
PHP 8.0.23 (cli)

php80 -m
[PHP Modules]
apcu
bcmath
bz2
calendar
Core
ctype
curl
date
dom
enchant
exif
fileinfo
filter
ftp
gd
gettext
gmp
hash
iconv
imagick
imap
intl
json
ldap
libsmbclient
libxml
mbstring
mysqli
mysqlnd
openssl
pcntl
pcre
PDO
pdo_mysql
pdo_pgsql
pdo_sqlite
pgsql
Phar
posix
readline
Reflection
session
shmop
SimpleXML
smbclient
soap
sockets
sodium
SPL
sqlite3
standard
sysvmsg
sysvsem
sysvshm
tidy
tokenizer
xml
xmlreader
xmlwriter
xsl
Zend OPcache
zip
zlib

[Zend Modules]
Zend OPcache

yum info php80-php-pdo.x86_64
Name        : php80-php-pdo
Arch        : x86_64
Version     : 8.0.23

yum info php80
Name        : php80
Arch        : x86_64
Version     : 1.0
ballinger commented 2 years ago

i downgraded to 2.9 to see what the updater tells me. `Creating a backup in the 'backup' folder

Something went wrong with the database backup. Exiting the update. ` i created the db user before with localhost instead of 127.0.0.1 which had the same result. the db is only reachable with 127 not localhost. is that somewhere hardwired? ive set it in the config file..

`MariaDB [(none)]> show databases; +--------------------+ | Database | +--------------------+ | information_schema | | leantime | | mysql | | performance_schema | | phpmyadmin | +--------------------+ 5 rows in set (0.001 sec)

MariaDB [(none)]> SELECT User, Host FROM mysql.user; +------------+-----------+ | User | Host | +------------+-----------+ | leantime | 127.0.0.1 | | root | 127.0.0.1 | | root | ::1 | | admin | localhost | | phpmyadmin | localhost | | root | localhost | +------------+-----------+ 6 rows in set (0.000 sec)

MariaDB [(none)]> SHOW GRANTS FOR leantime@localhost; ERROR 1141 (42000): There is no such grant defined for user 'leantime' on host 'localhost' MariaDB [(none)]> SHOW GRANTS FOR leantime@127.0.0.1; +-----------------------------------------------------------------------------------------------------------------+ | Grants for leantime@127.0.0.1 | +-----------------------------------------------------------------------------------------------------------------+ | GRANT USAGE ON . TO leantime@127.0.0.1 IDENTIFIED BY PASSWORD '8DECC4B56279D57A5F513FFB14EBD453434BA8D1' | | GRANT ALL PRIVILEGES ON leantime. TO leantime@127.0.0.1 | +-----------------------------------------------------------------------------------------------------------------+ 2 rows in set (0.008 sec) `

ballinger commented 2 years ago

purged the db and user and recreated it with localhost instead of 127.0.0.1 which errors when logging into the leantime db from the terminal so i took the mysql backup line from the updater... replacing localhost with 127.0.0.1 works with mysqldump. as far as i understand the updater script it should fetch the host from the config file where i set host to 127 not localhost.

`Creating a backup in the 'backup' folder

Something went wrong with the database backup. Exiting the update. mysqldump -h 127.0.0.1 -P 3313 -u leantime -p --no-tablespaces leantime | gzip -c > /tmp/test.sql Enter password:

ls /tmp/test.sql /tmp/test.sql mysqldump -h localhost -P 3313 -u leantime -p --no-tablespaces leantime | gzip -c > /tmp/test.sql Enter password: mysqldump: Got error: 1045: "Access denied for user 'leantime'@'localhost' (using password: YES)" when trying to connect`

marcelfolaron commented 1 year ago

@phulstaert Can you take a look at this?

phulstaert commented 1 year ago

If I remember correctly, when you use "localhost", it will create a socket connection; when using 127.0.0.1, it will use TCP/IP. If only 127.0.0.1 works, something is wrong with the socket configuration. This usually is on the server side...

When understanding that "localhost" and "127.0.0.1" have a different function, it should also be clear that rights on the server using @localhost or @127.0.0.1 are different. You should not see localhost as a domain that gets resolved to 127.0.0.1

I'll see if I am able to look at this issue in more detail later this day or maybe tomorrow.

ballinger commented 1 year ago

great, thank you!

ballinger commented 1 year ago

hello, i finally managed to connect to the db by setting db_host to 127.0.0.1:3313 so the setup page does not throw me any db errors any more, but i get a blank page after setting up the initial user... what might that be? i checked the db and it got 32 new rows after the initial setup.

ballinger commented 1 year ago

looks like a HTTP ERROR 500 ... what now?

marcelfolaron commented 1 year ago

Any errors in resources/logs/error.log ?

On Mon, Nov 14, 2022 at 9:33 AM ballinger @.***> wrote:

looks like a HTTP ERROR 500 ... what now?

— Reply to this email directly, view it on GitHub https://github.com/Leantime/leantime/issues/1093#issuecomment-1313844158, or unsubscribe https://github.com/notifications/unsubscribe-auth/ALG4EFSZF2XIGKC7FOUAT7TWIJES7ANCNFSM6AAAAAARSFYBLQ . You are receiving this because you commented.Message ID: @.***>

ballinger commented 1 year ago

nope... nothing

marcelfolaron commented 1 year ago

Just to check the exact point of failure: Does the installation finish or does it fail when you click install?

On Mon, Nov 14, 2022 at 9:36 AM ballinger @.***> wrote:

nope... nothing

— Reply to this email directly, view it on GitHub https://github.com/Leantime/leantime/issues/1093#issuecomment-1313851547, or unsubscribe https://github.com/notifications/unsubscribe-auth/ALG4EFVV6N76BUUGVIA2DHLWIJFAXANCNFSM6AAAAAARSFYBLQ . You are receiving this because you commented.Message ID: @.***>

ballinger commented 1 year ago

it got stuck after filling out the fields. browsing to the url then gives me a blank page

ballinger commented 1 year ago

ill reinstall it, - think it moved to the next page after the initial setup page and got stuck there

ballinger commented 1 year ago

yep. just to confirm. reinstalled all from scratch. opened the setup webpage, filled out the form, next page tells me This script will set up your database and create an administrator account and hangs there. opening a new tab and opening the url brings me to the login page, after entering user/pass i get a error500 nothing in the error logs...

ballinger commented 1 year ago

the login page is not reachable if i enter all smtp settings with use smtp=true. if i leave all smtp settings and turn off "use smtp" then i also get a blank page. erasing all smtp entries gets me back to the login page, which brings me to a blank page again after entering user/pass... no entries in the error logs...

marcelfolaron commented 1 year ago

Do you have any other logs in apache/nginx/mysql ? The installation script should have installed 34 tables (instead of just 32) so it seems one of the scripts fails somewhere. Can you also set the $debug flag to 1 in your configuration file?

ballinger commented 1 year ago

hmm dont see anything really inside httpd, mariadb, rh-mariad103 and the firewall logs.. enabled the debug flag. should that print anything into the leant. logs? cause its still empty. did the web install thing this tim in chromium... thats what i see in the console.

POST https://lean.domain.org/install 500 (Internal Server Error) jquery-migrate.js:23 JQMIGRATE: Migrate is installed with logging active, version 1.4.1 DevTools failed to load source map: Could not load content for https://lean.domain.org/css/bootstrap-grid.min.css.map: HTTP error: status code 404, net::ERR_HTTP_RESPONSE_CODE_FAILURE

32 rows again. MariaDB [leantime]> show tables; +------------------------+ | Tables_in_leantime | +------------------------+ | zp_account | | zp_action_tabs | | zp_audit | | zp_calendar | | zp_canvas | | zp_canvas_items | | zp_clients | | zp_comment | | zp_dashboard_widgets | | zp_file | | zp_gcallinks | | zp_lead | | zp_message | | zp_modulerights | | zp_note | | zp_projects | | zp_punch_clock | | zp_read | | zp_relationuserproject | | zp_roles | | zp_settings | | zp_sprints | | zp_stats | | zp_submodulerights | | zp_tickethistory | | zp_tickets | | zp_timesheets | | zp_user | | zp_wiki | | zp_wiki_articles | | zp_wiki_categories | | zp_wiki_comments | +------------------------+ 32 rows in set (0.000 sec)

marcelfolaron commented 1 year ago

the debug flag should print or write to the error.log file. It's odd that you don't have any errors at all. Are you using the release package or the code downloaded from the master branch?

On Tue, Nov 15, 2022 at 1:58 PM ballinger @.***> wrote:

hmm dont see anything really inside httpd, mariadb, rh-mariad103 and the firewall logs.. enabled the debug flag. should that print anything into the leant. logs? cause its still empty. did the web install thing this tim in chromium... thats what i see in the console.

POST https://lean.domain.org/install 500 (Internal Server Error) jquery-migrate.js:23 JQMIGRATE: Migrate is installed with logging active, version 1.4.1 DevTools failed to load source map: Could not load content for https://lean.domain.org/css/bootstrap-grid.min.css.map: HTTP error: status code 404, net::ERR_HTTP_RESPONSE_CODE_FAILURE

— Reply to this email directly, view it on GitHub https://github.com/Leantime/leantime/issues/1093#issuecomment-1315736002, or unsubscribe https://github.com/notifications/unsubscribe-auth/ALG4EFSSLGB27Z6KXUDMXALWIPMNPANCNFSM6AAAAAARSFYBLQ . You are receiving this because you commented.Message ID: @.***>

ballinger commented 1 year ago

to the resources/logs/error.log i suppose... its empty... no idea. i am using the latest compiled version / release pkg. i am mainly still using the install steps from the 1st post... besides from the dbhost: 127.0.0.1:3313 and no port entry. cd /tmp wget https://leantime.io/download?wpdmdl=7413 -O leantime.zip unzip leantime.zip -d /var/lib/nethserver/vhost/06ea5931db29453/

i find it weird that it does not matter if i set smtp to true or false. it still reads the smtp settings and i get a blank page.. if i remove all those settings the login/install page work again.

marcelfolaron commented 1 year ago

Oh please use the latest version for the install and try again.

https://leantime.io/download/?wpdmdl=8678 (Also on our website)

On Tue, Nov 15, 2022 at 3:11 PM ballinger @.***> wrote:

to the resources/logs/error.log i suppose... its empty... no idea. i am using the latest compiled version / release pkg. i am mainly still using the install steps from the 1st post... besides from the dbhost: 127.0.0.1:3313 and no port entry. cd /tmp wget https://leantime.io/download?wpdmdl=7413 -O leantime.zip unzip leantime.zip -d /var/lib/nethserver/vhost/06ea5931db29453/

i find it weird that it does not matter if i set smtp to true or false. it still reads the smtp settings and i get a blank page.. if i remove all those settings the login/install page works again.

— Reply to this email directly, view it on GitHub https://github.com/Leantime/leantime/issues/1093#issuecomment-1315811100, or unsubscribe https://github.com/notifications/unsubscribe-auth/ALG4EFU3QR4IWSDUFLIECVTWIPU5ZANCNFSM6AAAAAARSFYBLQ . You are receiving this because you commented.Message ID: @.***>

ballinger commented 1 year ago

oh man... thank you guys so much for your patience! i thought that url just always leads to the latest... ^^ for some reason the htaccess file was missing... i created it and all is good. installer went through fine. im logged in. finally :)

marcelfolaron commented 1 year ago

Glad it worked. I need to add some redirects.

On Tue, Nov 15, 2022 at 3:42 PM ballinger @.***> wrote:

oh man... thank you guys so much for your patience! i thought that url just always leads to the latest... ^^ for some reason the htaccess file was missing... i created it and all is good. installer went through fine. im logged in. finally :)

— Reply to this email directly, view it on GitHub https://github.com/Leantime/leantime/issues/1093#issuecomment-1315839000, or unsubscribe https://github.com/notifications/unsubscribe-auth/ALG4EFTDVMMXJIFUWHD6PT3WIPYSHANCNFSM6AAAAAARSFYBLQ . You are receiving this because you commented.Message ID: @.***>

ballinger commented 1 year ago

just to finish this off. all is working, my leantime centos/nethserver install guide for what its worth.

LEANTIME

apache virtual host

pkg

config

cd /var/lib/nethserver/vhost/23b8d530ea6c4b9/config
cp configuration.sample.php configuration.php

rights

chown -R apache:apache /var/lib/nethserver/vhost/23b8d530ea6c4b9/
chmod 755 -R /var/lib/nethserver/vhost/23b8d530ea6c4b9/

config

rand security key

head /dev/urandom | tr -dc A-Za-z0-9 | head -c 32 ; echo ''

vi /var/lib/nethserver/vhost/23b8d530ea6c4b9/config/configuration.php

sitename: leantime
dbHost: 127.0.0.1:3313
dbUser: leantime
dbPass: KeePass
dbDatabase: leantime
seassion password -> rand security key
dbPort: 3313

public $email = 'mail@domain.org';                                   //Return email address

create db

login db103

mysql103 mysql103 --user leantime -p

create db

mysql103 create database leantime; create user 'leantime'@'localhost' identified by 'keepass'; grant all privileges on leantime.* to 'leantime'@'localhost'; flush privileges; exit

prune db

DROP DATABASE leantime; DROP USER 'leantime'@'localhost';

content

show databases; SELECT User, Host FROM mysql.user; SHOW GRANTS FOR leantime@localhost;

use leantime; show tables; show columns from leantime.zp_account;

system

systemctl -l status rh-mariadb103-mariadb lsof -i -P -n | grep 3313 sysctl -a 2>/dev/null | grep disable_ipv6

systemctl -l restart httpd rh-mariadb103-mariadb

docker

git clone https://github.com/Leantime/docker-leantime.git cd docker-leantime docker-compose up -d