gateway timeout on Lead Import, what to check for?

I am in the process of catching up with upgrades and have my DEV environment on v14.0 and TST (and PRD) on v12 (as seen below)

On both Sugar v12 and Sugar v14, when I try to upload 100 leads via the Import process I get a "Gateway Timeout" and after trying to troubleshoot for quite some time with both my sysadmin and dba I'm at a loss.... any ideas on what to look for?

Thanks!

FrancescaS

 

Parents
  • Raising the apache timeout got rid of the problem.

    Now to figure out why Lead imports take so long....

  • Hello  , 



    For scenarios like these, my typical approach is to follow these troubleshooting steps:

    1. Analyze the target module's save() function
      Check for logic hooks (e.g., before_save and after_save), BPMs, and workflows.
      Actions triggered by these hooks will be performed at each records save and will sum up on the total import time. 
      If there are external calls at this level, they can easily lead to a considerable increase in processing time.

      Start by disabling them on a test instance to check if you see a considerable improvement on the import time to check if this is indeed the cause. 

    2. Investigate related modules
      If there are related fields that pull data from the Leads module, you might find yourself in a situation where an import into Leads triggers a save() on a related Module. If that happens, keep in mind that logic on the related Module save() will also be triggered.

      To identify potential fields, perform a quick scan in the custom/ folder for references to "$leads". This can help determine if fields in other modules reference the Leads module. As a test, you might try temporarily disabling related calculated fields to see if performance improves.


      https://support.sugarcrm.com/documentation/sugar_developer/sugar_developer_guide_13.0/integration/best_practices/#Disabling_Related_Calculation_Fields

    3. Check for database bottlenecks
      If the above steps don’t resolve the issue, consider Log slow queries in system settings. 
      This can help identify if there is a DB slow query behind the slow import. 

      Let me know if this helps narrow down the root cause!

    Cheers,


    André

  • Thank you  ,

    I had taken all the steps above and also tried commenting out all logic hooks.

    Turns out it was an apache timeout. Raising it from 300 to 600 solved the problem.

    The import was still running in the background, the Gateway Timeout was the browser waiting for a response, the progress bar wasn't moving at all.

    Now the records are imported fine, though in v12 it's showing an empty list (pencil icon for each record but no values). I'm ignoring it since I hope to be at v14 before the end of January and the results of the Leads Import show just fine there.

    Happy Holidays!

    Francesca

Reply
  • Thank you  ,

    I had taken all the steps above and also tried commenting out all logic hooks.

    Turns out it was an apache timeout. Raising it from 300 to 600 solved the problem.

    The import was still running in the background, the Gateway Timeout was the browser waiting for a response, the progress bar wasn't moving at all.

    Now the records are imported fine, though in v12 it's showing an empty list (pencil icon for each record but no values). I'm ignoring it since I hope to be at v14 before the end of January and the results of the Leads Import show just fine there.

    Happy Holidays!

    Francesca

Children
No Data