rthomas67 / rpi-suitecrm

Setup files to create a docker image/container to run SuiteCRM on a Raspberry Pi under Docker
5 stars 0 forks source link

SilentInstall fails with Uncaught Exception #1

Open lukasvermeer opened 2 years ago

lukasvermeer commented 2 years ago

Hey! Thanks for creating this. Exactly what I needed!

Sadly, I cannot seem to get this to work. SilentInstall fails with an Uncaught Exception, and I am unsure how to diagnose the issue.

Creating SuiteCRM configuration file (config.php)

Creating SuiteCRM application tables, audit tables and relationship metadata
Creating the database suitecrm on suitecrm-mariadb...done

................................................................................................

Creating default SuiteCRM data

     Creating default scheduler jobs...   done

Fatal error: Uncaught Exception in /opt/SuiteCRM-7.11.21/include/utils.php:1892 Stack trace: #0 /opt/SuiteCRM-7.11.21/modules/Administration/repairDatabase.php(195): sugar_die(NULL) #1 /opt/SuiteCRM-7.11.21/modules/Administration/QuickRepairAndRebuild.php(139): include_once('/opt/SuiteCRM-7...') #2 /opt/SuiteCRM-7.11.21/modules/Administration/QuickRepairAndRebuild.php(121): RepairAndClear->repairDatabase() #3 /opt/SuiteCRM-7.11.21/install/suite_install/suite_install.php(64): RepairAndClear->repairAndClearAll(Array, Array, true, false) #4 /opt/SuiteCRM-7.11.21/install/performSetup.php(561): include_once('/opt/SuiteCRM-7...') #5 /opt/SuiteCRM-7.11.21/install.php(827): require('/opt/SuiteCRM-7...') #6 {main} thrown in /opt/SuiteCRM-7.11.21/include/utils.php on line 1892

I have made some alterations to current trunk in failed attempts to solve the issue. Here is the current output of git diff.

diff --git a/container_setup_suitecrm/suitecrm_install.sh b/container_setup_suitecrm/suitecrm_install.sh
index 57028f7..de48780 100755
--- a/container_setup_suitecrm/suitecrm_install.sh
+++ b/container_setup_suitecrm/suitecrm_install.sh
@@ -1,12 +1,15 @@
 #!/usr/bin/qemu-arm-static /bin/sh

-SUITECRM_VERSION=7.10.11
+SUITECRM_VERSION=7.11.21

 # TODO: Find out if there is a way to not hard-code the subdirectories (e.g. 160 and 335 in this one)
-wget --no-verbose https://suitecrm.com/files/160/SuiteCRM-${SUITECRM_VERSION}/335/SuiteCRM-${SUITECRM_VERSION}.zip
+wget --no-verbose https://suitecrm.com/files/162/SuiteCRM-7.11/560/SuiteCRM-${SUITECRM_VERSION}.zip
 unzip -q -d /opt SuiteCRM-${SUITECRM_VERSION}.zip
 ln -s /opt/SuiteCRM-${SUITECRM_VERSION} /opt/suitecrm
 chown -R www-data:www-data /opt/SuiteCRM-${SUITECRM_VERSION}
+chmod -R 755 /opt/SuiteCRM-${SUITECRM_VERSION}
+chmod -R 775 /opt/SuiteCRM-${SUITECRM_VERSION}/cache /opt/SuiteCRM-${SUITECRM_VERSION}/custom /opt/SuiteCRM-${SUITECRM_VERSION}/modules /opt/SuiteCRM-${SUITECRM_VERSION}/themes /opt/SuiteCRM-${SUITECRM_VERSION}/data /opt/SuiteCRM-${SUITECRM_VERSION}/upload
+chmod 775 /opt/SuiteCRM-${SUITECRM_VERSION}/config_override.php 2>/dev/null

 # Several file permissions are not quite right after unzipping,
 # so those need to be fixed.
diff --git a/container_startup/suitecrm-entrypoint.sh b/container_startup/suitecrm-entrypoint.sh
index 954f87d..b90e785 100755
--- a/container_startup/suitecrm-entrypoint.sh
+++ b/container_startup/suitecrm-entrypoint.sh
@@ -54,6 +54,8 @@ if [ ! -f /opt/suitecrm/config.php ]; then
     # (as they would be if the PHP silent install were run without sudo).  This is to avoid
     # permissions problems later when SuiteCRM tries to create files in cache/modules/..., etc.
     cd /opt/suitecrm
+    sudo chown -R www-data:www-data config_si.php
+    sudo chmod -R 755 config_si.php
     php_request_vars="\$_SERVER['SERVER_SOFTWARE'] = 'NGINX';"
     php_request_vars="$php_request_vars \$_SERVER['HTTP_HOST'] = 'localhost';"
     php_request_vars="$php_request_vars \$_SERVER['SERVER_PORT'] = '80';"
diff --git a/docker-compose.yml b/docker-compose.yml
index 02dca1a..807d727 100755
--- a/docker-compose.yml
+++ b/docker-compose.yml
@@ -7,10 +7,10 @@ services:
     ports:
       - '3306:3306'
     volumes:
-      - 'mariadb_sys:/sys/fs/cgroup'
-      - 'mariadb_data:/var/lib/mysql'
+      - '/mnt/Blue/docker/rpi-suitecrm/mariadb_sys:/sys/fs/cgroup'
+      - '/mnt/Blue/docker/rpi-suitecrm/mariadb_data:/var/lib/mysql'
   suitecrm-app:
-    image: 'rthomas67/rpi-suitecrm:v3'
+    image: 'rthomas67/rpi-suitecrm:latest'
     environment:
       - MARIADB_HOST=suitecrm-mariadb
       - MARIADB_ROOT_PASSWORD=suiteCRM999
@@ -20,11 +20,6 @@ services:
       - '11080:80'
       - '11443:443'
     volumes:
-      - 'suitecrm_upload:/opt/suitecrm/upload'
+      - '/mnt/Blue/docker/rpi-suitecrm/suitecrm_upload:/opt/suitecrm/upload'
     depends_on:
       - suitecrm-mariadb
-volumes:
-  mariadb_data:
-    driver: local
-  suitecrm_upload:
-    driver: local

Does anyone have any idea what is going wrong?

lukasvermeer commented 2 years ago

I think I figured it out: the patches in container_setup_patches don't work for this newer version of SuiteCRM.

After disabling them, the install completes successfully.

diff --git a/Dockerfile b/Dockerfile
index 7a02fd8..b21f370 100755
--- a/Dockerfile
+++ b/Dockerfile
@@ -56,9 +56,9 @@ ENV NGINX_HTTPS_PORT_NUMBER="443" \
 EXPOSE 80
 EXPOSE 443

-COPY container_setup_patches ./container_setup_patches/
-RUN chmod +x container_setup_patches/apply_patches.sh \
-    && container_setup_patches/apply_patches.sh
+#COPY container_setup_patches ./container_setup_patches/
+#RUN chmod +x container_setup_patches/apply_patches.sh \
+#    && container_setup_patches/apply_patches.sh