Bulk select/delete - 500 error 🤯

So when you tick more than 6-7 leads (leads in my case), and hit bulk → delete → popup → ok
SuiteCRM throws an 500 error.

Execution time for scripts is currently around 600 seconds in php.ini which should be enough at least in theory for the script to delete or import a good amount of data etc.

Anyone that has an idea/former experience with this and maybe know what is going on and how to prevent it?

Thanks in advance
Kind regards
PowerQuest

Run the first SQL command in this post to look for overgrown tables:

no query on 7 records should take over 600 seconds to run…

Any way, check also the php_errors.log to see if it’s really a slow query, or perhaps insufficient memory, or something else.

Hi @pgr :smiley:

Thanks a bunch for your reply. It is very appreciated. :facepunch:

I have allocated 1024 MB to the system which from my understanding should be more than sufficient for most daily tasks, right? (Please do correct me if I am wrong).

I did copy paste your SQL command from your website as instructed, but MariaDB pukes all over it. See the gif screenshot below:
data-base-puked

I added a part of the latest logfile to pastebin:

I can SuiteCRM is complaining over some Google service, (google/apiclient-services/autoload.php). It is a bit weird because as far as I know we haven’t added anything that should be speaking with Google.

some of the errors I found in the error log (The Pastebin):

[13-Apr-2022 00:15:04 UTC] PHP Fatal error: Uncaught ArgumentCountError: Too few arguments to function SugarWebServiceImplv4::login(), 0 passed in /public_html/service/core/REST/SugarRest.php on line 93 and at least 1 expected in /public_html/service/v4/SugarWebServiceImplv4Stack trace:

–AND–

#0 /public_html/service/core/REST/SugarRest.php(93): SugarWebServiceImplv4->login()
#1 /public_html/service/core/SugarRestService.php(136): SugarRest->serve()
#2 /public_html/service/core/webservice.php(70): SugarRestService->serve()
#3 /public_html/service/v4/rest.php(56): require_once('/home/tamacloud...')
#4 {main}
  thrown in /public_html/service/v4/SugarWebServiceImplv4.php on line 73

–AND–

Stack trace:
#0 /public_html/data/Relationships/One2MBeanRelationship.php(161): SugarRelationship->callBeforeDelete(false, Object(Lead))
#1 /public_html/data/Relationships/SugarRelationship.php(164): One2MBeanRelationship->remove(false, Object(Lead))
#2 /public_html/data/Link2.php(636): SugarRelationship->removeAll(Object(Link2))
#3 /public_html/data/SugarBean.php(5475): Link2->delete('38daff49-4bf8-5...')
#4 /public_html/data/SugarBean.php(5455): SugarBean->delete_linked('38daff49-4bf8-5...')
#5 /public_html/data/SugarBean.php(5281): Su in /public_html/data/Relationships/SugarRelationship.php on line 420
[13-Apr-2022 23:16:52 UTC] PHP Warning:  Class 'Google_Service' not found in /public_html/vendor/google/apiclient-services/autoload.php on line 21
[13-Apr-2022 23:16:52 UTC] PHP Warning:  Class 'Google_Service_Resource' not found in /public_html/vendor/google/apiclient-services/autoload.php on line 21
[13-Apr-2022 23:16:52 UTC] PHP Warning:  Class 'Google_Model' not found in /public_html/vendor/google/apiclient-services/autoload.php on line 21
[13-Apr-2022 23:16:52 UTC] PHP Warning:  Class 'Google_Collection' not found in /public_html/vendor/google/apiclient-services/autoload.php on line 21
[13-Apr-2022 23:16:52 UTC] PHP Warning:  get_class() expects parameter 1 to be object, bool given in /public_html/data/Relationships/One2MBeanRelationship.php on line 195
[13-Apr-2022 23:16:52 UTC] PHP Fatal error:  Uncaught Error: Call to a member function call_custom_logic() on bool in /public_html/data/Relationships/SugarRelationship.php:420
Stack trace:
#0 /public_html/data/Relationships/One2MBeanRelationship.php(161): SugarRelationship->callBeforeDelete(false, Object(Lead))
#1 /public_html/data/Relationships/SugarRelationship.php(164): One2MBeanRelationship->remove(false, Object(Lead))
#2 /public_html/data/Link2.php(636): SugarRelationship->removeAll(Object(Link2))
#3 /public_html/data/SugarBean.php(5475): Link2->delete('38daff49-4bf8-5...')
#4 /public_html/data/SugarBean.php(5455): SugarBean->delete_linked('38daff49-4bf8-5...')
#5 /public_html/data/SugarBean.php(5281): Su in /public_html/data/Relationships/SugarRelationship.php on line 420
[13-Apr-2022 23:16:58 UTC] PHP Warning:  Class 'Google_Service' not found in /public_html/vendor/google/apiclient-services/autoload.php on line 21
[13-Apr-2022 23:16:58 UTC] PHP Warning:  Class 'Google_Service_Resource' not found in /public_html/vendor/google/apiclient-services/autoload.php on line 21
[13-Apr-2022 23:16:58 UTC] PHP Warning:  Class 'Google_Model' not found in /public_html/vendor/google/apiclient-services/autoload.php on line 21
[13-Apr-2022 23:16:58 UTC] PHP Warning:  Class 'Google_Collection' not found in /public_html/vendor/google/apiclient-services/autoload.php on line 21
[13-Apr-2022 23:16:58 UTC] PHP Warning:  get_class() expects parameter 1 to be object, bool given in /public_html/data/Relationships/One2MBeanRelationship.php on line 195
[13-Apr-2022 23:16:59 UTC] PHP Fatal error:  Uncaught Error: Call to a member function call_custom_logic() on bool in /public_html/data/Relationships/SugarRelationship.php:420
Stack trace:
#0 /public_html/data/Relationships/One2MBeanRelationship.php(161): SugarRelationship->callBeforeDelete(false, Object(Lead))
#1 /public_html/data/Relationships/SugarRelationship.php(164): One2MBeanRelationship->remove(false, Object(Lead))
#2 /public_html/data/Link2.php(636): SugarRelationship->removeAll(Object(Link2))
#3 /public_html/data/SugarBean.php(5475): Link2->delete('38daff49-4bf8-5...')
#4 /public_html/data/SugarBean.php(5455): SugarBean->delete_linked('38daff49-4bf8-5...')
#5 /public_html/data/SugarBean.php(5281): Su in /public_html/data/Relationships/SugarRelationship.php on line 420

Not really sure which error that belongs to the bulk deleting and the 500 error. On the flip side the google service issue spams the system too so if you know how to get rid of it, it would be very nice too.

Thanks in advance. :+1:
Kind regards
PowerQuest

From the information provided above is there anything that can point towards the issue with bulk updating @pgr ? :thinking:

Kind regards
PowerQuest

Try this adapted query instead:

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

Hi @pgr

Thanks , that command worked:
image
However I cannot see any DB table that is really “overgrown” as you also can see in that DB table screenshot…

Any ideas? :thinking:

Kind regards
PowerQuest

Focus on clearing all FATAL errors from the logs. Whenever there is a FATAL, code execution did not continue - that’s always a serious problem worth solving.

Some of your FATALs seems to be during a call to a logic hook, maybe you should check your hooks’ code…

Well I haven’t changed any code in the system. It is still running the default SuiteCRM code.
Not sure how to fix these fatal errors to be honest. I can code and get servers etc to bend to my will etc. but I would not call myself an coding expert.

Any idea by the way how to solve the google service spam in the error log?

Thanks again.
Kind regards
PowerQuest

I don’t know about the Goolge stuff, sorry.

Try Admin / Repair relationships to see if it clears to FATALs. It’s also possible that you have some corrupted record somewhere, and you’d have to go hunt for it in the database based on those partial ids in the logs ( 38daff49-4bf8-5) - not entirely an easy task, because you don’t know in which table to look…

My Improved Logging PR would get you better contextual information on those FATALs (full ids, status of other variables at that point)

Thanks a bunch! :smiley:
I’ll check it out…

The google entries in the log is bit weird though:

13-Apr-2022 23:16:52 UTC] PHP Warning:  Class 'Google_Service' not found in /public_html/vendor/google/apiclient-services/autoload.php on line 21
[13-Apr-2022 23:16:52 UTC] PHP Warning:  Class 'Google_Service_Resource' not found in /public_html/vendor/google/apiclient-services/autoload.php on line 21
[13-Apr-2022 23:16:52 UTC] PHP Warning:  Class 'Google_Model' not found in /public_html/vendor/google/apiclient-services/autoload.php on line 21
[13-Apr-2022 23:16:52 UTC] PHP Warning:  Class 'Google_Collection' not found in /public_html/vendor/google/apiclient-services/autoload.php on line 21
[13-Apr-2022 23:16:52 UTC] PHP Warning:  get_class() expects parameter 1 to be object, bool given in /public_html/data/Relationships/One2MBeanRelationship.php on line 195
[13-Apr-2022 23:16:52 UTC] PHP Fatal error:  Uncaught Error: Call to a member function call_custom_logic() on bool in /public_html/data/Relationships/SugarRelationship.php:420

Because I haven’t installed anything to the system that connects to Google. I know there is the option to connect to the Google calendar but I did made a post where people said that it doesn’t work well enough so I haven’t attempted to enable it.

Anyway… Thanks again. :+1: I’ll poke around a bit in my system and see if I can solve these issues.

Kind regards
PowqerQuest

I just found something GREAT in phpMyAdmin, while solving a problem of my own, and it’s great for your case too…

image

  1. Make sure you have the database selected, not a table
  2. press Search
  3. type your id fragment
  4. use shift to select all tables in the DB
  5. set column name do id

Relax that last column name restriction if you still don’t find it (there are other possible column names like account_id etc

If you find the record see if you can delete it, and look for relationship tables where it appears. I think it might breaking your system, hopefully it’s something just with that specific record.

1 Like

Awesome, thank you so much for sharing this @pgr ! :facepunch:

I’ll definitively will do this later and check it out. :smiley:

Kind regards
PowerQuest

Did you able to fix this error?

PHP Fatal error:  Uncaught ArgumentCountError: Too few arguments to function SugarWebServiceImpl::set_note_attachment(), 1 passed in /var/www/html/suitecrm/service/core/REST/SugarRestJSON.php on line 97 and exactly 2 expected in /var/www/html/suitecrm/service/core/SugarWebServiceImpl.php:765
Stack trace:
#0 /var/www/html/suitecrm/service/core/REST/SugarRestJSON.php(97): SugarWebServiceImpl->set_note_attachment()
#1 /var/www/html/suitecrm/service/core/SugarRestService.php(136): SugarRestJSON->serve()
#2 /var/www/html/suitecrm/service/core/webservice.php(70): SugarRestService->serve()
#3 /var/www/html/suitecrm/service/v4/rest.php(56): require_once('/var/www/html/s...')
#4 {main}
  thrown in /var/www/html/suitecrm/service/core/SugarWebServiceImpl.php on line 765

If anyone else know solution for it, please let me know.

Thank you!

1 Like

To be honest, I cannot remember as its been a while. :thinking: