Error editing contacts and leads

I have entered in a new contact into my CRM. I noticed that there was an error, so I decided to edit the contact.

UPon trying to save the edited priofile, I get the following error:
Database failure. Please refer to sugarcrm.log for details.

I grabbed a copy of the error in the sugarcrm.log file.


Wed Apr 22 19:19:32 2015 [10692][7d57cb1a-6274-9343-e88b-53d728932ed2][FATAL] Error updating table: contacts: Query Failed: UPDATE contacts
SET date_modified=ā€˜2015-04-22 23:19:31ā€™,modified_user_id=ā€˜7d57cb1a-6274-9343-e88b-53d728932ed2ā€™,created_by=ā€˜7d57cb1a-6274-9343-e88b-53d728932ed2ā€™,description=ā€˜person@gmail.com\r\njperson@email.com ā€˜,assigned_user_id=ā€˜7d57cb1a-6274-9343-e88b-53d728932ed2ā€™,salutation=ā€˜Dr.ā€™,first_name=ā€˜Joanesonā€™,last_name=ā€˜Lacoursā€™,title=NULL,photo=NULL,department=NULL,do_not_call=0,phone_home=NULL,phone_mobile=NULL,phone_work=NULL,phone_other=NULL,phone_fax=NULL,primary_address_street=NULL,primary_address_city=NULL,primary_address_state=NULL,primary_address_postalcode=NULL,primary_address_country=NULL,alt_address_street=NULL,alt_address_city=NULL,alt_address_state=NULL,alt_address_postalcode=NULL,alt_address_country=NULL,assistant=NULL,assistant_phone=NULL,lead_source=NULL,reports_to_id=ā€™ā€™,birthdate=NULL,campaign_id=ā€™ā€™,joomla_account_id=NULL,portal_account_disabled=0,portal_user_type=ā€˜Singleā€™
WHERE contacts.id = ā€˜a599d590-109f-213a-b68c-553795285877ā€™ AND deleted=0: MySQL error 1054: Unknown column ā€˜photoā€™ in ā€˜field listā€™

The only place that I see possibel explination, but I am not sure what to do with it:
error 1054: Unknown column ā€˜photoā€™ in ā€˜field listā€™

I can add leads, contacts, accounts, no problem.

I can edit accounts.

But, contacts and leads cause the database error.

Ideas?

Thanks

Joseph

Can you try doing a quick repair and rebuild (in the admin section) and noting if thereā€™s any database changes required? The contacts and leads modules donā€™t have a photo field out of the box. Is it possible this has been added?

Thanks,
Jim

1 Like

Thanks for the feed back.

I have done no modification of the code anywhere, apart from upgrades.

I did try the repair and it messes up. It starts and stops before compleiting all the repairs:

Clearing Vardefs from cacheā€¦done
Clearing language files from cacheā€¦done
Clearing Template files from cacheā€¦done
Clearing JS files from cacheā€¦done
Clearing Vardefs from cacheā€¦done
Clearing JS Language files from cacheā€¦done
Clearing language files from cacheā€¦done
Clearing Sugar Dashlet files from cacheā€¦done
Clearing Sugar Feed Cacheā€¦done
Clearing Smarty templates from cacheā€¦done
Clearing Theme Cacheā€¦done
Clearing XML files from cacheā€¦done
Clearing Unified Search Cacheā€¦done
Clearing External API Cache Fileā€¦done
Rebuilding Extensionsā€¦
Rebuilding Includeā€¦
Rebuilding Languageā€¦en_us
Rebuilding Languageā€¦es_es
Rebuilding Languageā€¦ru_ru
Rebuilding ActionViewMapā€¦
Rebuilding ActionFileMapā€¦
Rebuilding ActionReMapā€¦
Rebuilding Administrationā€¦
Rebuilding EntryPointRegistryā€¦
Rebuilding Extensionsā€¦
Rebuilding FileAccessControlMapā€¦
Rebuilding Layoutdefsā€¦
Rebuilding GlobalLinksā€¦
Rebuilding LogicHooksā€¦
Rebuilding Menusā€¦
Rebuilding Includeā€¦
Rebuilding ScheduledTasksā€¦
Rebuilding UserPageā€¦
Rebuilding Utilsā€¦
Rebuilding Vardefsā€¦
Rebuilding JSGroupingsā€¦
Rebuilding Actionsā€¦
Rebuilding DC Actionsā€¦
Rebuilding Relationships

It stops there.

I know that I tried to upgrade it recently, and there was a problem with the permissions and when we corrected those permission probelms, all was fine.

Thanks fo ryoru idea.

Joe

Do you see any errors in either the sugarcrm.log or the apache error log?

I know that I tried to upgrade it recently, and there was a problem with the permissions and when we corrected those permission problems the upgrade went forward.

I just looked again and the upgrade process is stuck on the last step: 5: Confirm Layouts

I press next, and it always says done, but when I look at upgrade again, it is stuck on the step 5 again.

I am wondering if it is an easy fix, or might be better off reinstalling. Can I just export of contacts, accounts and notes? I only have a few (maybe 12-15 of each)

Thanks for your ideas.

Joe

ps. No new entries in the sugarcrm.log file.

I will have to look at the apache error log

I found a few entries, which have nothing directly to do with my initial problem, but more the upgrade.

Let me know what you think.

[Thu Apr 23 08:49:46 2015] [warn] [client 192.168.0.1] mod_fcgid: stderr: PHP Warning: session_destroy(): Trying to destroy uninitialized session in /var/www/clients/client2/web11/web/CRM/modules/Users/authentication/SugarAuthenticate/SugarAuthenticate.php on line 320, referer: http://www.eco2haiti.com/CRM/index.php?action=ajaxui
[Thu Apr 23 08:50:59 2015] [warn] [client 192.168.0.1] mod_fcgid: stderr: PHP Fatal error: sugar_file_put_contents_atomic() : fatal rename failure ā€˜/tmp/tempOEtklqā€™ -> ā€˜cache/modules/Schedulers/Schedulervardefs.phpā€™ in /var/www/clients/client2/web11/web/CRM/include/utils/sugar_file_utils.php on line 190, referer: http://www.eco2haiti.com/CRM/index.php?module=Administration&action=Upgrade
[Thu Apr 23 08:55:40 2015] [warn] [client 192.168.0.1] mod_fcgid: stderr: PHP Warning: include(cache/modules/SchedulersJobs/language/en_us.lang.php): failed to open stream: Permission denied in /var/www/clients/client2/web11/web/CRM/include/SugarObjects/LanguageManager.php on line 114, referer: http://www.eco2haiti.com/CRM/index.php?module=UpgradeWizard&action=index
[Thu Apr 23 08:55:40 2015] [warn] [client 192.168.0.1] mod_fcgid: stderr: PHP Warning: include(): Failed opening ā€˜cache/modules/SchedulersJobs/language/en_us.lang.phpā€™ for inclusion (include_path=ā€™/var/www/clients/client2/web11/web/CRM/include/HTMLPurifier/standalone:/var/www/clients/client2/web11/web/CRM/include/ā€¦:.:/usr/share/php:/usr/share/pear:modules/AOD_Index/Libā€™) in /var/www/clients/client2/web11/web/CRM/include/SugarObjects/LanguageManager.php on line 114, referer: http://www.eco2haiti.com/CRM/index.php?module=UpgradeWizard&action=index
[Thu Apr 23 08:55:40 2015] [warn] [client 192.168.0.1] mod_fcgid: stderr: PHP Warning: dir(cache/modules/Import_2): failed to open dir: Permission denied in /var/www/clients/client2/web11/web/CRM/include/dir_inc.php on line 205, referer: http://www.eco2haiti.com/CRM/index.php?module=UpgradeWizard&action=index
[Thu Apr 23 08:55:40 2015] [warn] [client 192.168.0.1] mod_fcgid: stderr: PHP Fatal error: Call to a member function read() on a non-object in /var/www/clients/client2/web11/web/CRM/include/dir_inc.php on line 206, referer: http://www.eco2haiti.com/CRM/index.php?module=UpgradeWizard&action=index
[Thu Apr 23 08:56:25 2015] [warn] [client 192.168.0.1] mod_fcgid: stderr: PHP Warning: include(cache/modules/SchedulersJobs/language/en_us.lang.php): failed to open stream: Permission denied in /var/www/clients/client2/web11/web/CRM/include/SugarObjects/LanguageManager.php on line 114, referer: http://www.eco2haiti.com/CRM/index.php?module=UpgradeWizard&action=index
[Thu Apr 23 08:56:25 2015] [warn] [client 192.168.0.1] mod_fcgid: stderr: PHP Warning: include(): Failed opening ā€˜cache/modules/SchedulersJobs/language/en_us.lang.phpā€™ for inclusion (include_path=ā€™/var/www/clients/client2/web11/web/CRM/include/HTMLPurifier/standalone:/var/www/clients/client2/web11/web/CRM/include/ā€¦:.:/usr/share/php:/usr/share/pear:modules/AOD_Index/Libā€™) in /var/www/clients/client2/web11/web/CRM/include/SugarObjects/LanguageManager.php on line 114, referer: http://www.eco2haiti.com/CRM/index.php?module=UpgradeWizard&action=index
[Thu Apr 23 08:56:25 2015] [warn] [client 192.168.0.1] mod_fcgid: stderr: PHP Warning: dir(cache/modules/Import_2): failed to open dir: Permission denied in /var/www/clients/client2/web11/web/CRM/include/dir_inc.php on line 205, referer: http://www.eco2haiti.com/CRM/index.php?module=UpgradeWizard&action=index
[Thu Apr 23 08:56:25 2015] [warn] [client 192.168.0.1] mod_fcgid: stderr: PHP Fatal error: Call to a member function read() on a non-object in /var/www/clients/client2/web11/web/CRM/include/dir_inc.php on line 206, referer: http://www.eco2haiti.com/CRM/index.php?module=UpgradeWizard&action=index