YunoHost-Apps / dolibarr_ynh

Dolibarr ERP & CRM is a modern software to manage your organization's activity. This is an integration of Dolibarr in YunoHost
https://www.dolibarr.org/
GNU Affero General Public License v3.0
12 stars 18 forks source link

Dolibarr installation fail : ERROR 1146 (42S02) at line 1: Table 'dolibarr.llx_const' doesn't exist #65

Closed Caribou22 closed 2 years ago

Caribou22 commented 2 years ago

Describe the bug

A clear and concise description of what the bug is.

Context

Steps to reproduce

On the webadmin of a fresh install of Yunohost (which was not up to date at the first try) : try to install the official Dolibarr package and it failed. I got this error during the install process :

_Dolibarr installation fail : ERROR 1146 (42S02) at line 1: Table 'dolibarr.llxconst' doesn't exist

Updated through CLI (SSH) and retried to install the package on the webadmin : same error.

Tried to install the package through CLI (SSH). Same error :

sudo yunohost app install dolibarr
Choose the domain where this app should be installed [this-is-my-domain.nohost.me] (default: this-is-my-domain.nohost.me): this-is-my-domain.nohost.me
Choose the path where this app should be installed (default: /dolibarr): 
Choose an administrator user for this app [anthony | quentin] (default: anthony): 
Info: Installing dolibarr...
Info: [....................] > Validating installation parameters...
Info: [....................] > Storing installation settings...
Info: [....................] > Creating a MySQL database...
Info: [....................] > Setting up source files...
Info: [++++++++............] > Download source files...
Info: [########+...........] > Configuring system user...
Info: [#########...........] > Configuring PHP-FPM and install dependencies...
Info: [#########...........] > Configuring NGINX web server...
Info: [#########...........] > Configuring permissions...
Info: [#########...........] > Finalizing installation...
Info: [#########...........] > Generate fileconf
Info: [#########+..........] > installation - step 1
Info: [##########++++++++..] > installation - step 2 (may take a while)...
Info: [##################..] > installation - step 4
Info: [##################+.] > installation - step 5
Info: [###################.] > configuring LDAP
Warning: ERROR 1146 (42S02) at line 1: Table 'dolibarr.llx_const' doesn't exist
Error: Unable to install dolibarr: An error occurred inside the app installation script
Info: The operation 'Install the 'dolibarr' app' could not be completed. Please share the full log of this operation using the command 'yunohost log share 20210926-213942-app_install-dolibarr' to get help
Warning: Here's an extract of the logs before the crash. It might help debugging the error:
Info: DEBUG - + for arg in "${@:2}"
Info: DEBUG - + POST_data='testpost=ok&action=set&'
Info: DEBUG - + for arg in "${@:2}"
Info: DEBUG - + POST_data='testpost=ok&action=set&pass=**********&'
Info: DEBUG - + for arg in "${@:2}"
Info: DEBUG - + POST_data='testpost=ok&action=set&pass=**********&pass_verif=**********&'
Info: DEBUG - + '[' -n 'testpost=ok&action=set&pass=**********&pass_verif=**********&' ']'
Info: DEBUG - + POST_data='--data testpost=ok&action=set&pass=**********&pass_verif=**********'
Info: DEBUG - + sleep 2
Info: DEBUG - + local cookiefile=/tmp/ynh-dolibarr-cookie.txt
Info: DEBUG - + touch /tmp/ynh-dolibarr-cookie.txt
Info: DEBUG - + chown root /tmp/ynh-dolibarr-cookie.txt
Info: DEBUG - + chmod 700 /tmp/ynh-dolibarr-cookie.txt
Info: DEBUG - + curl --silent --show-error --insecure --location --header 'Host: this-is-my-domain.nohost.me' --resolve this-is-my-domain.nohost.me:443:127.0.0.1 --data 'testpost=ok&action=set&pass=**********&pass_verif=**********' https://localhost/dolibarr/install/step5.php --cookie-jar /tmp/ynh-dolibarr-cookie.txt --cookie /tmp/ynh-dolibarr-cookie.txt
Info: DEBUG - + echo '[###################.] > configuring LDAP'
Info: INFO - [###################.] > configuring LDAP
Info: DEBUG - + ynh_mysql_connect_as --user=dolibarr --password=********** --database=dolibarr
Info: DEBUG - + database=dolibarr
Info: DEBUG - + mysql --user=dolibarr --password=********** --batch dolibarr
Info: WARNING - ERROR 1146 (42S02) at line 1: Table 'dolibarr.llx_const' doesn't exist
Info: DEBUG - + ynh_exit_properly
Warning: Removing the app following the installation failure...
Info: [+...................] > Loading installation settings...
Info: [#+++++++++++........] > Removing the MySQL database...
Info: [############+.......] > Removing app main directory...
Info: [#############++.....] > Removing NGINX web server configuration...
Info: [###############+....] > Removing PHP-FPM configuration...
Info: [################+...] > Removing logrotate configuration...
Info: '/etc/dolibarr' wasn't deleted because it doesn't exist.
Info: [#################+..] > Removing the dedicated system user...
Info: [####################] > Removal of dolibarr completed
Error: The operation 'Install the 'dolibarr' app' could not be completed. Please share the full log of this operation using the command 'yunohost log share 20210926-213942-app_install-dolibarr' to get help

Logs

https://paste.yunohost.org/raw/recadumoja

Thank you in advance,

Best regards.

Caribou22

mastereur commented 2 years ago

Hello,

Can you send the files located in /var/log/dolibarr? At first sight, it seems that this is a problem when creating the database with the dolibarr installer.

Thanks

Caribou22 commented 2 years ago

Hello,

When the installation fails, the folder /var/log/dolibarr is deleted, but I managed to get the log files before the installer deleted them ! :) Here they are : install.zip

I installed in command line.

The failed installation gave me this other log : https://paste.yunohost.org/raw/onesafokoq

mastereur commented 2 years ago

Thanks for the logs, install2.html says "504 Gateway Time-out" which means that the database creation is too long.

I already increased the max timeout to 600 seconds for a response https://github.com/YunoHost-Apps/dolibarr_ynh/blob/master/conf/nginx.conf#L27

On this topic: https://forum.yunohost.org/t/time-out-error-fastcgi/10355 it is mentioned that the system may not have enough RAM.

Do you have enough free RAM on your Raspberry Pi 2?

Caribou22 commented 2 years ago

Here is my memory on the Rpi 2 which cannot install Dolibarr :

free -m
              total        used        free      shared  buff/cache   available
Mem:            923         216          63          18         642         624
Swap:            99           4          95

I will try to monitor the RAM consumtion during a dolibarr install and send it to you. (Maybe with Monitorix ?) I already installed Dolibarr on another Pi 2 with Yunohost, so that is strange. same hardware, same software, different results :/

That is the free memory of my other Rpi 2 which has a working Dolibarr :

free -m
              total        used        free      shared  buff/cache   available
Mem:            923         334          27         107         560         418
Swap:            99          99           0
Caribou22 commented 2 years ago

I already increased the max timeout to 600 seconds for a response https://github.com/YunoHost-Apps/dolibarr_ynh/blob/master/conf/nginx.conf#L27

I forked the project to increase to 1600 : https://github.com/Caribou22/dolibarr_ynh/commit/3429c13426b26681c3819a608055b43ebc6b1cc1

The installation from my fork WORKED ! :D (No errors. The log : https://paste.yunohost.org/raw/emacirakud )

But i cannot use it. The dolibarr from the user interface says : ERR_TOO_MANY_REDIRECTS

Maybe because I installed an unofficial package. (It did not ask me a user ad dolibarr administrator for example) I guess that the most important is that the installation did not fail. =)

So what can I do now to install properly your official package ?

Thanks a a lot.

mastereur commented 2 years ago

Perfect,

This means that your RPi2 is not processing the requests fast enough. I have already done installations with the command, it works with the request of the mandatory fields.

Did you launch it with the command ? : sudo yunohost app install https://github.com/Caribou22/dolibarr_ynh

In answer to the question, yes once installed, the updates should be available.

Caribou22 commented 2 years ago

I used the web admin to install my custom Dolibarr. I tried the CLI also :

sudo yunohost app install https://github.com/Caribou22/dolibarr_ynh
Choose the domain where this app should be installed [this-is-my-domain.nohost.me] (default: this-is-my-domain.nohost.me): 
Choose the path where this app should be installed (default: /dolibarr): 
Choose an administrator user for this app [anthony | quentin] (default: anthony): 
Info: Installing dolibarr...
Info: [....................] > Validating installation parameters...
Info: [....................] > Storing installation settings...
Info: [....................] > Creating a MySQL database...
Info: [....................] > Setting up source files...
Info: [++++++++............] > Download source files...
Info: [########+...........] > Configuring system user...
Info: [#########...........] > Configuring PHP-FPM and install dependencies...
Info: [#########...........] > Configuring NGINX web server...
Info: [#########...........] > Configuring permissions...
Info: [#########...........] > Finalizing installation...
Info: [#########...........] > Generate fileconf
Info: [#########+..........] > installation - step 1
Info: [##########++++++++..] > installation - step 2 (may take a while)...
Info: [##################..] > installation - step 4
Info: [##################+.] > installation - step 5
Info: [###################.] > configuring LDAP
Info: LDAP user update ok
Info: [###################.] > configuring config file
Info: [###################.] > Configuring log rotation...
Info: [###################.] > Configuring permissions...
Info: [###################.] > Reloading NGINX web server...
Info: [####################] > Installation of dolibarr completed
Success! Installation completed

The installation finished, but the dolibarr URL is not reachable again :/ The error I get is : "ERR_TOO_MANY_REDIRECTS"

Otherwise, I successfully installed a second instance of Dolibarr on my other Raspberry Pi 2 which still have one dolibarr, using the official Yunohost package. I don't understand why it is problematic on one Rpi but not on the other.

Edit : I am now suspecting a bad quality SD card. It could explain the issue and the general slowness of Yunohost on that Rpi. I will clone on a A1 class card and tell you if it works better !

Caribou22 commented 2 years ago

The issue was due to the SD card. Changing the card to a Sandisk class A1 and cloning the system made the installation of Dolibarr work !

Strangely, the first SD card was a Kingston micro sd xc class 10, so not a bad card i thought

mastereur commented 2 years ago

Hello,

Sorry for the delay. It's great, so it seems that it finally comes from a hardware problem. The difference between a class 10 and a class A1 SD card is not that big but should be enough for this case.