Slight problems (bugs) with email module

Hello to all, this is my first post.

I already installed v7.9 and upgraded to 7.10, self-hosted on apache running on a Gentoo server with PHP 7.1 and MySQL, and I started using it just for one user, myself. I access it from firefox, chromium and android chrome. I think it will very useful to my activity, thank you to all that make it available to me.

However, I’m having troubles mostly with email; I think these are probably just annoying small bugs.

  1. At first, I couldn’t see the messages on the email window and, looking for a fix to ‘undefined’ and patching like here: https://suitecrm.com/suitecrm/forum/installation-upgrade-help/17827-undefined#60201 the emails suddenly started to show. I think the patch solved it, although intended for something else, or then it was a coincidence.

  2. On this email window, If I click on the folder icon, a pop-up (better said pop-down) shows up very partially because it is hidden behind the top menu bar.

  3. But I can manage to click and unfold the two group accounts that I have. But (surprise), when I click “INBOX foo@example.com”, all the messages vanish and I see “No results found… Perhaps change your search criteria and try again?”
    But, if I then click “Sent emails”, I recover all my received emails. This is wrong, isn’t it?

  4. When I open a message, open Action and click import, the body message shows up with the full html source. But, if I close it and reopen, the appearance is correct.

I think I noticed more problem but this is just off the top of my head for the moment.

Thanks,
jss

If your installation is broken and too many things don’t work, or if you still see some “undefineds” in your screens, then you probably didn’t set your permissions correctly.

Can you please post here the instructions found at the bottom of the screen in Admin / Schedulers?

And post the results of this command, given from your SuiteCRM root directory:

ls -al

That will give me a quick glance at your permissions. Thanks

1 Like

Thank you for helping.

I guess this is what you’re asking for:
In order to run SuiteCRM Schedulers, edit your web server user’s crontab file with this command:
sudo crontab -e -u apache
… and add the following line to the crontab file:

          • cd /var/www/mosteiro.mooo.com/htdocs/crm; php -f cron.php > /dev/null 2>&1 
            

and:
$ ls -al
total 98076
drwxr-xr-x 21 apache apache 4096 Feb 28 02:00 .
drwxr-xr-x 7 root root 4096 Feb 27 21:02 …
-rw-r–r-- 1 apache apache 411 Feb 27 21:08 bower.json
drwxrws— 2 apache apache 4096 Feb 26 19:15 build
drwxrwxr-x 16 apache apache 4096 Feb 16 12:43 cache
-rwxr-xr-x 1 apache apache 3587 Feb 27 21:08 campaign_tracker.php
-rwxr-xr-x 1 apache apache 3094 Feb 27 21:08 CODE_OF_CONDUCT.md
-rwxr-xr-x 1 apache apache 1027 Feb 27 21:08 composer.json
-rwxr-xr-x 1 apache apache 114330 Feb 27 21:08 composer.lock
-rwxrwxr-x 1 apache apache 991 Feb 28 00:36 config_override.php
-rwxr-xr-x 1 apache apache 12072 Feb 27 21:44 config.php
-rwxr-xr-x 1 apache apache 5052 Jan 17 19:09 cron.php
-rwxr-xr-x 1 apache apache 2446 Jan 17 19:09 crossdomain.xml
drwxrwxr-x 10 apache apache 4096 Feb 26 19:15 custom
drwxrwxr-x 3 apache apache 4096 Jan 17 19:13 data
-rwxr-xr-x 1 apache apache 2386 Feb 27 21:08 dictionary.php
-rwxr-xr-x 1 apache apache 12566 Feb 27 21:08 download.php
-rwxr-xr-x 1 apache apache 2390 Feb 27 21:08 emailmandelivery.php
-rwxr-xr-x 1 apache apache 4918 Feb 27 21:08 export.php
-rwxr-xr-x 1 apache apache 967627 Jan 17 19:09 files.md5
-rw-r–r-- 1 apache apache 1689 Feb 27 21:08 .gitignore
-rwxr-xr-x 1 apache apache 2808 Feb 27 21:08 HandleAjaxCall.php
-rwxr-xr-x 1 apache apache 3743 Feb 28 02:00 .htaccess
-rwxr-xr-x 1 apache apache 3514 Jan 18 14:21 .htaccess.original
-rwxr-xr-x 1 apache apache 2367 Feb 27 21:08 ical_server.php
drwxr-xr-x 58 apache apache 4096 Feb 26 19:15 include
-rwxr-xr-x 1 apache apache 2374 Feb 27 21:08 index.php
drwxr-xr-x 6 apache apache 4096 Jan 18 01:32 install
-rwxr-xr-x 1 apache apache 55559 Jan 18 02:28 install.log
-rwxr-xr-x 1 apache apache 31893 Feb 27 21:08 install.php
-rwxr-xr-x 1 apache apache 2275 Feb 27 21:08 json_server.php
drwxr-xr-x 3 apache apache 4096 Jan 17 19:11 jssource
drwxrws— 7 apache apache 4096 Feb 26 19:15 lib
-rwxr-xr-x 1 apache apache 34539 Jan 17 19:09 LICENSE.txt
-rwxr-xr-x 1 apache apache 2313 Jan 17 19:09 log_file_restricted.html
-rwxr-xr-x 1 apache apache 2376 Jan 17 19:09 maintenance.php
drwxr-xr-x 2 apache apache 4096 Feb 26 19:15 metadata
drwxr-xr-x 3 apache apache 4096 Jan 17 19:13 ModuleInstall
drwxrwxr-x 119 apache apache 4096 Feb 26 19:15 modules
-rwxr-xr-x 1 apache apache 2886 Feb 27 21:08 pdf.php
-rwxr-xr-x 1 apache apache 304 Feb 27 21:08 php_version.php
drwxrws— 2 apache apache 4096 Feb 26 19:15 public
-rwxr-xr-x 1 apache apache 3837 Feb 27 21:08 README.md
-rwxr-xr-x 1 apache apache 73 Jan 17 19:09 robots.txt
-rwxr-xr-x 1 apache apache 3588 Jan 17 19:09 run_job.php
drwxr-xr-x 12 apache apache 4096 Jan 17 19:13 service
drwxr-xr-x 2 apache apache 4096 Jan 17 19:11 soap
-rwxr-xr-x 1 apache apache 4088 Feb 27 21:08 soap.php
-rwxr-xr-x 1 apache apache 5327 Jan 17 19:09 SugarSecurity.php
-rwxr-xr-x 1 apache apache 154 Feb 27 21:08 sugar_version.json
-rwxr-xr-x 1 apache apache 2296 Feb 27 21:08 sugar_version.php
-rw-r–r-- 1 apache apache 10603193 Feb 28 00:36 suitecrm_1.log
-rw-r–r-- 1 apache apache 10516618 Feb 28 00:12 suitecrm_2.log
-rw-r–r-- 1 apache apache 10769112 Feb 28 00:07 suitecrm_3.log
-rw-r–r-- 1 apache apache 10553640 Feb 27 23:59 suitecrm_4.log
-rw-r–r-- 1 apache apache 10690238 Feb 27 23:41 suitecrm_5.log
-rw-r–r-- 1 apache apache 10509486 Feb 27 23:17 suitecrm_6.log
-rw-r–r-- 1 apache apache 10617642 Feb 27 23:03 suitecrm_7.log
-rw-r–r-- 1 apache apache 10673409 Feb 27 22:45 suitecrm_8.log
-rw-r–r-- 1 apache apache 10915913 Feb 27 22:21 suitecrm_9.log
-rw-r–r-- 1 apache apache 976421 Mar 1 16:40 suitecrm.log
-rwxr-xr-x 1 apache apache 168 Feb 27 21:08 suitecrm_version.php
drwxrwxr-x 6 apache apache 4096 Jan 17 19:14 themes
-rw-r–r-- 1 apache apache 839 Feb 27 21:08 .travis.yml
-rwxr-xr-x 1 apache apache 5839 Feb 27 21:08 TreeData.php
-rwxr-xr-x 1 apache apache 2065332 Feb 27 21:11 upgradeWizard.log
drwxrwxr-x 5 apache apache 12288 Feb 28 21:03 upload
-rwxr-xr-x 1 apache apache 2248 Feb 27 21:08 vcal_server.php
-rwxr-xr-x 1 apache apache 2976 Feb 27 21:08 vCard.php
drwxrws— 18 apache apache 4096 Feb 26 19:15 vendor
drwxr-xr-x 2 apache apache 4096 Jan 17 19:13 XTemplate
drwxr-xr-x 8 apache apache 4096 Feb 26 19:16 Zend

Thank you again,
Rgds,
jss

Your permissions look right…

Maybe you can try deleting “cache/themes” folder (it will get recreated) or try a few repairs from Admin / Repairs

Then you can check both your logs for any ERROR or FATAL messages, this can bring valuable clues.

Finally, you can confront your experience with the live demo
suitecrm.com/demo

to see if each of those things work there.

1 Like

Thank you for the extended support.

[quote]Maybe you can try deleting “cache/themes” folder (it will get recreated) or try a few repairs from Admin / Repairs
[/quote]
I did both, no change.

[quote]Then you can check both your logs for any ERROR or FATAL messages, this can bring valuable clues.
[/quote]
There are some. In suitecrm.log:

Thu Mar  1 20:50:46 2018 [13742][1][FATAL]  Query Failed: UPDATE schedulers SET
last_run='2018-03-01 20:49:01' WHERE id='3e896e24-f51c-f4c6-adf8-5a6006244780':
MySQL error 1205: Lock wait timeout exceeded; try restarting transaction
# many like the above, about one every minute; didn't have the time to investigate this yet

Some few complains about not reaching IMAP mailbox which are justified by interruptions on net connection caused by my works on something else. Nothing else to report.
php_errors.log was not enabled, I just did and clicked the email folder but no error was logged.

I tried but once there aren’t any emails there and I think I can’t put them there, there’s no way to click the folder to reproduce the situation.

Rgds,
jss

Is this an old installation, with lots of data?

Can you run this query from phpMyAdmin to see if you have any overgrown table?


SELECT CONCAT(table_schema, '.', table_name),
       CONCAT(ROUND(table_rows / 1000000, 2), 'M')                                    rows,
       CONCAT(ROUND(data_length / ( 1024 * 1024 * 1024 ), 2), 'G')                    DATA,
       CONCAT(ROUND(index_length / ( 1024 * 1024 * 1024 ), 2), 'G')                   idx,
       CONCAT(ROUND(( data_length + index_length ) / ( 1024 * 1024 * 1024 ), 2), 'G') total_size,
       ROUND(index_length / data_length, 2)                                           idxfrac
FROM   information_schema.TABLES
ORDER  BY data_length + index_length DESC
LIMIT  10;

That database error doesn’t look good. Anything can fail in SuiteCRM if the database is timing out inexplicably.

1 Like

No, I just imported a few hundred accounts and I’ve been playing with the system.

Sure, my pleasure, but I used Squirrel instead, I don’t use PHPMyAdmin:

CONCAT(table_schema, '.', table_name)
						rows		DATA	idx		total_size	idxfrac                    
-----------------------------------------------------------------------------------------------
suitecrm.job_queue			0.05M	0.09G	0.13G	0.22G	1.36                       
suitecrm.relationships		0.00M	0.00G	0.00G	0.00G	0.6                        
nextcloud.oc_filecache		0.00M	0.00G	0.00G	0.00G	0.72                       
suitecrm.email_addresses	0.00M	0.00G	0.00G	0.00G	0.35                       
nextcloud.oc_authtoken		0.00M	0.00G	0.00G	0.00G	0.25                       
nextcloud.oc_calendarobjects 0.00M	0.00G	0.00G	0.00G	0.04                       
mysql.innodb_index_stats	0.00M	0.00G	0.00G	0.00G	0                          
mysql.time_zone_transition	0.04M	0.00G	0.00G	0.00G	1.11                       
suitecrm.emails_text		0.00M	0.00G	0.00G	0.00G	0.02                       
nextcloud.oc_activity		0.00M	0.00G	0.00G	0.00G	0.87                       

Is this ok? There are other databases in the server, namely nextcloud.

Although the data that I inserted is not terribly needed, I would like to keep it.

Rgds,
jss

“A few hundred accounts” shouldn’t be any problem for SuiteCRM’s database.

See this issue
https://github.com/salesagility/SuiteCRM/issues/5313

You have some tips there to clear up the job_queue table (which you need to, it’s overgrown), and also a fix to a reminders issue that might be worth applying. See if that helps.

1 Like

Thank you again, I probably should be clicking the “Thank you” item but I’m not sure that’s the correct procedure before the issue is solved. Otherwise I would have done it hundred times.

I’m astonished, I executed:

select count(*) from job_queue where status = 'done';
# and it resulted in 65876
then:
select count(*) from job_queue where status = 'done' and date_entered like '2018-03-03%';
# results in 4383

And I didn’t touch the system today. How can I stop this nonsense?

TIA,
jss

1 Like

I wonder abou that number…If cron runs every minute, that’s 1400 minutes in a day. Multiply that by the number of jobs in Admin / Scheduler (although they don’t ALL run every minute). But I’m not saying there should be a row there for each minute, that doesn’t sound very sane.

Maybe you can have a look and see if they are all the same job, or different jobs, and whether they are all in different minutes?

How did you set your Scheduler jobs in cron?

1 Like

Good deduction, here:

 cat /var/spool/cron/crontabs/apache
* * * * * cd /var/www/example.com/htdocs/crm; php -f cron.php > /dev/null2>&1

and a 5 minute excerpt of messages: [edit] actually 3 minutes

Mar  3 19:05:01 myserver crond[23617]: pam_unix(crond:session): session opened for user apache by (uid=0)
Mar  3 19:05:01 myserver crond[23617]: pam_elogind(crond:session): Failed to connect to system bus: No such file or directory
Mar  3 19:05:01 myserver CROND[23618]: (apache) CMD (cd /var/www/example.com/htdocs/crm; php -f cron.php > /dev/null 2>&1)
Mar  3 19:05:33 myserver CROND[23578]: pam_unix(crond:session): session closed for user apache
Mar  3 19:06:01 myserver crond[23631]: pam_unix(crond:session): session opened for user apache by (uid=0)
Mar  3 19:06:01 myserver crond[23631]: pam_elogind(crond:session): Failed to connect to system bus: No such file or directory
Mar  3 19:06:01 myserver CROND[23633]: (apache) CMD (cd /var/www/example.com/htdocs/crm; php -f cron.php > /dev/null 2>&1)
Mar  3 19:06:40 myserver crontab[23645]: (root) BEGIN EDIT (root)
Mar  3 19:06:43 myserver CROND[23617]: pam_unix(crond:session): session closed for user apache
Mar  3 19:06:47 myserver crontab[23645]: (root) END EDIT (root)
Mar  3 19:07:01 myserver crond[23654]: pam_unix(crond:session): session opened for user apache by (uid=0)
Mar  3 19:07:01 myserver crond[23654]: pam_elogind(crond:session): Failed to connect to system bus: No such file or directory
Mar  3 19:07:01 myserver CROND[23655]: (apache) CMD (cd /var/www/example.com/htdocs/crm; php -f cron.php > /dev/null 2>&1)
Mar  3 19:07:54 myserver CROND[23631]: pam_unix(crond:session): session closed for user apache
Mar  3 19:07:58 myserver CROND[23654]: pam_unix(crond:session): session closed for user apache
Mar  3 19:08:01 myserver crond[23682]: pam_unix(crond:session): session opened for user apache by (uid=0)
Mar  3 19:08:01 myserver crond[23682]: pam_elogind(crond:session): Failed to connect to system bus: No such file or directory
Mar  3 19:08:01 myserver CROND[23683]: (apache) CMD (cd /var/www/example.com/htdocs/crm; php -f cron.php > /dev/null 2>&1)

Rgds
jss

All looks normal.

did you apply the reminders fix from the Issue I linked above? I am not sure if it is related, but I would like to clear that out of our way.

1 Like

Done, but did dot cancel globally with:

$sugar_config['disable_alerts'] = true;

Should I?

Rgds,
jss

After inserting the mods and restarting apache, I’m getting this error on most of areas: accounts, calls, contacts:

An error has occurred:
{"content":"

Although I paid a lot of attention to the line numbers where the mods ought to be inserted, I might have made a mistake and I’m not exactly comfortable with php, I’m a C programmer. The scripts should be in diff format but they don’t have any reference to what is before and after.

Rgds,
jss

Were these the changes you tried to apply?

https://github.com/salesagility/SuiteCRM/pull/5370/files

You can have git do the patching for you, if you know enough git. But an easier path might be to click “View” on those files (on GitHub), and then “Raw”, and copy-paste their entire contents replacing the entire file in your system.

Thank you for the links. Yes, this is diff format and it helped me to confirm my fears: in my source, the patch start for the first file, SugarView.php, is on line 218, not on 177 like the patch states.

Are you sure i should go ahead and patch the files even obviously not being the same version?

I looked for a version file on the root but couldn’t find it. Would you know where it is so that I can provide it to you?

Rgds,
jss

Right, I went ahead and instead of applying the patch, I replaced the whole 3 files as you said.

But issues 2 and 3 in the op remain, I guess this patch doesn’t adress my issues.

Concerning:

select count(*) from job_queue where status = 'done'
77993

can I:

DELETE FROM job_queue
WHERE status = 'done' AND date_entered < '2018-03-03';

That would delete 56777 records and perhaps stop the log messages.

Rgds,
jss

Yes you can do that delete.

It’s really strange you have incorrect versions of files, maybe we’re mixing up something. The 7.10 branch on GitHub is called “develop”.

Have you checked your upgradeWizard.log to see if your upgrade completed without errors? If you go in Admin / About which version does it show?

Admin About:

Version 7.10

Sugar Version 6.5.25 (Build 344)

I guess you are only interested on the last log lines:

Tue, 27 Feb 2018 21:09:12 +0000 [UpgradeWizard] - themes/SuiteP/css/yui.scss
Tue, 27 Feb 2018 21:10:25 +0000 [UpgradeWizard] - Cleaning up the session.  Goodbye.
Tue, 27 Feb 2018 21:10:25 +0000 [UpgradeWizard] - at unlinkUWTempFiles()
Tue, 27 Feb 2018 21:11:29 +0000 [UpgradeWizard] - finished!
Tue, 27 Feb 2018 21:11:29 +0000 [UpgradeWizard] - Cleaning up the session.  Goodbye.
Tue, 27 Feb 2018 21:11:29 +0000 [UpgradeWizard] - resetting $_SESSION

Best Rgds,
jss

I have now officially run out of ideas to help you :frowning:

1 Like