Companion Link SuiteCRM 7.9.7 REST API

I have done an upgrade from Debian Wheezy to Jessie.
Then upgrade PHP5 to PHP7.1 and SuiteCRM to 7.9.7.

I use Companion Link to sync SuiteCRM Calendars to Google Calendars.
Companion Link seem to use SuiteCRM REST API.
I bet something on the upgrades broke the REST API on SuiteCRM.

Any ideas what to look for?

Thanks

You could (should) look in your logs, of course.

Then there was this issue recently:

https://github.com/salesagility/SuiteCRM/issues/4399

but it should be solved in 7.9.7. Unless you’re also using a special encoding?

Followed you suggestion and did go for the logs,
It turned out I had far more issues than I thought.

I use a baremetal converted to VM for testing purposes, change the IP and test everything we normally use before going in production.
Lat time didn’t go as expected and I convinced my self everything was running fine!
Now I see allot of trouble ahead …

I am now on SuiteCRM 7.9.8

Please see my bulky notes maybe there is something standing out for you that I can’t even notice!

  1. Timezone error - configured apache2/php.ini - turns out that it has to be configured in cli/php.ini for the error to go away!
    Need to re-check this!

  2. Re-check both php.ini for upload_max_filesize max_execution_time, max_input_time, post_max_size and memory_limit.

  3. Email notifications and reports didn’t arrive on mailboxes- looks like SuiteCRM stopped working with SSL - quick fix change to port 25 without TLS or SSL.
    It’s an internal mail server so we are good for now!

  4. Scheduled report - I can see the list and edit, I can’t open the scheduled report (There was an error processing your request, please try again at a later time)
    After edit upon saving I see a garbled licence text, button labels and code, changes appear to be saved and working, an email is sent upon saving.
    I didn’t try creating a new scheduled report yet.

  5. Opacus thunderbird extension doesn’t archive emails with attachments - Can’t connect to server is the error message!
    Actually it does archive the emails but not the attachments!
    It creates all entries except the attachment is not there for download!

  6. CompanionLink doesn’t sync - error message can’t connect to server!

When I run Opacus this is what the log files show:
############php_errors.log#############

[03-Jan-2018 20:55:19 Europe/Lisbon] PHP Notice: Undefined index: google_maps_api_key in /var/www/suitecrm/modules/jjwg_Maps/jjwg_Maps.php on line 356
[03-Jan-2018 20:55:19 Europe/Lisbon] PHP Notice: Undefined index: google_maps_api_key in /var/www/suitecrm/modules/jjwg_Maps/jjwg_Maps.php on line 356
[03-Jan-2018 20:55:19 Europe/Lisbon] PHP Notice: Undefined index: google_maps_api_key in /var/www/suitecrm/modules/jjwg_Maps/jjwg_Maps.php on line 356
[03-Jan-2018 20:55:19 Europe/Lisbon] PHP Notice: Undefined index: google_maps_api_key in /var/www/suitecrm/modules/jjwg_Maps/jjwg_Maps.php on line 356
[03-Jan-2018 20:55:23 Europe/Lisbon] PHP Fatal error: Uncaught ArgumentCountError: Too few arguments to function SugarWebServiceImpl::set_note_attachment(), 0 passed in /var/www/suitecrm/service/core/REST/SugarRest.php on line 86 and exactly 2 expected in /var/www/suitecrm/service/core/SugarWebServiceImpl.php:743
Stack trace:
#0 /var/www/suitecrm/service/core/REST/SugarRest.php(86): SugarWebServiceImpl->set_note_attachment()
#1 /var/www/suitecrm/service/core/SugarRestService.php(133): SugarRest->serve()
#2 /var/www/suitecrm/service/core/webservice.php(66): SugarRestService->serve()
#3 /var/www/suitecrm/service/v2/rest.php(52): require_once(’/var/www/suitec…’)
#4 {main}
thrown in /var/www/suitecrm/service/core/SugarWebServiceImpl.php on line 743

############ sugarcrm.log#############
Wed Jan 3 20:55:23 2018 [818][5dc115df-b220-1387-1829-546a466ac64c][ERROR] Unable to find relationship emails_email_templates
Wed Jan 3 20:55:23 2018 [818][5dc115df-b220-1387-1829-546a466ac64c][ERROR] Unable to find relationship emails_email_templates
(this error come up with or without attachments)

When I run CompanionLink there is nothing on log files.

Here is almost everything I did after upgrading Debian and installing PHP7.1

a2dismod php5
a2enmod php7.1
service apache2 restart
apt-get install php7.1-curl
php7.1-gd
php7.1-mbstring
php7.1-mysql
php7.1-xml
php7.1-imap
php7.1-zip
service apache2 restart

I need to check if any other module is necessary

need to confirm if uninstalling php5 is ok

nano /etc/php/7.1/apache2/php.ini
upload_max_filesize = 60M
max_execution_time = 6000
max_input_time = 240
post_max_size = 60M
memory_limit = 256M
####### SuiteCRM OK #############
CompanionLink doesn’t sync, OPACUS error “Can’t connect to server” only happens on emails with attachments.
Notifications for calls, Metting, reports, etc do not arrive on mailboxes.

Editar os settings PHP do Apache:
nano /etc/php/7.1/apache2/php.ini
date.timezone = “Europe/Lisbom”

Editar os setthings PHP do CLI:
Nano /etc/php/7.1/cli/php.ini
date.timezone = “Europe/Lisbom”

Timezone error only went away when cli/php.ini was configured with timezone.
#################################
Tue Jan 2 15:18:33 2018 [1244][1][ERROR] Unable to load custom logic file: custom/include/social/hooks.php

find / -name hooks.php
/var/www/suitecrm/custom/backup/custom/include/social/hooks.php
/var/www/suitecrm/include/social/hooks.php

hooks.php exit on other directories …

cp /var/www/suitecrm/include/social/hooks.php /var/www/suitecrm/custom/include/social/hooks.php

Change permissions to match other files.
rwxrwxr-x www-data (0775)

################################
Tue Jan 2 15:19:01 2018 [1291][1][ERROR] Unable to load custom logic file: include/SugarSearchEngine/SugarSearchEngineQueueManager.php
This file doesn’t exist …
Deleted file has suggest in the forum because file is from SugarPRO
Deleted file SugarFTSHooks.php in
/var/www/suitecrm/custom/Extension/application/Ext/LogicHooks

Admin/QuickRepair and Rebuild
#################################

In order to run SuiteCRM schedulers, run ‘crontab -e’ and add the following line to the crontab file:

          • cd /var/www/html/suitecrm; php -f cron.php > /dev/null 2>&1
            

service cron restart
####################################
Set the following permissions on the SuiteCRM directory(Linux):
cd /var/www/suitecrm
chown -R www-data:www-data .
chmod -R 755 .
chmod -R 775 cache custom modules themes data upload config_override.php
Didn’t notice any behavior change, apparently everything was with correct permissions.
#######################################
SuiteCRM emails seem to do not work correctly with SSL.
Changed Outgoing Mail accounts to use port 25 without TLS or SSL
Everything seems to run normally.
#####################################
Calendar MonthView show upto 6 events/calls
edit /var/www/suitecrm/modules/calendar/Cal.js
Changed
eventLimit:true
to
eventLimit:6
#######################################
You might need to turn on this log in your relevant php.ini file, by uncommenting or typing the following line:
nano /etc/php/7.1/apache2/php.ini
error_log = php_errors.log
remove comment marker ;
View log files in /var/www/suitecrm/
php_errors.log
sugarcrm.log
upgradeWizard.log
######################################
Changed permissions on all files /var/www/suitecrm to 777 www-data:www-data

I don’t have time for all that now, but what stands out the most is you need to make sure your cron jobs are running as root. You’re editing crontab with

crontab -e

and you should probably be doing it with

crontab -e -u www-data

Background reading:

https://pgorod.github.io/Scheduler-Jobs/

I’ll have more time to help next week…

1 Like

Congratulation on the blog.
I was reading it … thanks for quick tip!
I am only an advanced user I believe I need professional help to fix all that stuff.
I am probably one of those users you professionals usually dislike! LOL.
Keep in touch
Thanks

INSTALL PHP7.0

All I had to do is install PHP7.0

apt-get update
apt-get upgrade
apt-get install php7.0
a2dismod php7.1
a2enmod php7.0

Install all other relevant modules php7.0-gd, mbstring, xml, zip, mysql, etc just to name some.