After deployment module - HTTP ERROR 500

Hi
8.0 version of SuiteCRM. I created a simple module (document type) in the constructor.
After deployment CRM stops working with an error HTTP ERROR 500.

no information in the logs
public/legacy/suitecrm.log
logs/prod/prod.log

After a long test, the logs sometimes show the following information about missing tables. After checking directly from the database, the tables exist and the queries given in the log return the correct result.

Some times i have “This operation is completed successfully” some times “An error has occurred during deploy process, your package may not have installed correctly” but it always shows error 500

Example 1

public/legacy/suitecrm.log
Sun Dec 5 17:17:43 2021 [37411][1][FATAL] Mysqli_query failed.
Sun Dec 5 17:17:43 2021 [37411][1][FATAL] Error searching relationships table… Query Failed: SELECT relationship_name FROM relationships WHERE deleted=0 AND relationship_name = ‘aor_conditions_created_by’: MySQL error 1146: Table ‘test_suitecrm8.relationships’ doesn’t exist
Sun Dec 5 17:17:43 2021 [37411][1][FATAL] Exception handling in /home/test/domains/test.hekko24.pl/public_html/public/legacy/include/MVC/Controller/SugarController.php:397
Sun Dec 5 17:17:43 2021 [37411][1][FATAL] Exception in Controller: Database failure. Please refer to suitecrm.log for details.

Example 2

Sun Dec 5 17:32:22 2021 [76090][1][FATAL] Mysqli_query failed.
Sun Dec 5 17:32:22 2021 [76090][1][FATAL] Query Failed: SELECT DISTINCT meetings.id , meetings.parent_id , meetings.status , meetings.recurring_source , meetings.name , meetings.parent_type , meetings.date_start , meetings.assigned_user_id , meetings.date_entered FROM meetings LEFT JOIN meetings_cstm ON meetings.id = meetings_cstm.id_c LEFT JOIN meetings_users m_u on m_u.meeting_id = meetings.id where ((meetings.status IN (‘Planned’)
)) AND meetings.deleted=0 AND (meetings.assigned_user_id = ‘1’ OR (m_u.user_id = ‘1’ AND m_u.deleted=0)) ORDER BY meetings.date_entered DESC LIMIT 0,6: MySQL error 1146: Table ‘test_suitecrm8.meetings’ doesn’t exist

Before deployed i changed chmod all in /public
find . -type d -print0 | xargs -0 chmod 0755
find . -type f -print0 | xargs -0 chmod 0644

immediately after installation, I changed the permissions of the entire CRM because they were set to folders as standard 770 and files to 755. And with such permissions, new modules are also created. Is there a way to change file and directory permission settings somewhere?

If I do not change the permissions for the new module, the jst log file is empty. The problem appears both when deploying via Module Builder and by Publish in Module Builder and later importing the module to CRM

Hey there, you should be able to change the default file permissions on the config.php

‘default_permissions’=> array( ‘dir_mode’=>1517, ‘file_mode’=>420, ‘user’=>‘www-data’, ‘group’=>‘www-data’, ),

There is additional pointers on setting permissions specifically for SuiteCRM 8 (here)

On another note, after you deploy your module package, ensure you run your Repair & Rebuild from Admin to it correctly create the tables and relationships. :slight_smile:

After Repair & Rebuild same. So HTTP ERROR 500 error and no information in the logs.

This is a new CRM instance. Only one simple basic module is added. Does anyone work properly adding modules in SuiteCRM 8?

It’s strange that there are no error logs.

In your earlier post you said that you are able to create new module via module builder IF you have set the permissions after you do a fresh installation yes? (explained in your example 2).

Let’s ask for the basic set up here so we don’t miss something obvious.

What OS you running, PHP, and MySQL (or flavour)?
Can you ensure that you can confirm that errors do appear (in any capacity) to your PHP error.log so that we can rule out that errors are just being outputted else where.

You may have to change the permissions in the legacy folder (as that is where the modulebuilder resides) specifically as appose to the /public.

My problem path

  1. I am installing CRM
  2. I change permissions for all directories and files to 755 and 644 (because after installation directories set to 770 and files to 755)
  3. I create a simple modul using the module wizard with one basic element even without any additional fields.
  4. Again, I change the permissions for all directories and files to 755 and 644 (because new items are set to directories to 770 and files to 755)
  5. I am installing the module.
    After installation, if I did step 4, information appears in the logs (example 1 or 2) if I do not do krou 4, there is no information in the logs

Permissions don’t mean anything without ownerships. You need to make sure that the owner of all the files and directories is the same user that your web server is using to run.

It could be www-data, or apache, or a bunch of other possibilities.

In Admin / Schedulers, the cron instructions at the bottom will contain your web server user name.