mirror of
https://github.com/SuiteCRM/SuiteCRM.git
synced 2026-03-02 19:16:58 -05:00
Elasticsearch failing to index cases #4983
Labels
No labels
Area: API
Area: Campaigns
Area: Cases
Area: Clean Up
Area: Clean Up: Performance
Area: Dashlets
Area: Databases
Area: Developer Tools
Area: Elasticsearch
Area: Elasticsearch
Area: Emails
Area: Emails:Campaigns
Area: Emails:Cases
Area: Emails:Compose
Area: Emails:Config
Area: Emails:Templates
Area: Environment
Area: Installation
Area: Language
Area: Mobile
Area: Module
Area: PDFs
Area: PHP8
Area: Reports
Area: Studio
Area: Styling
Area: Upgrading
Area: Workflow
Area:Activity Stream
Area:Calls
Area:Import
Area:Projects
Area:Search
Area:Surveys
Area:Themes
Area:Users
Branch:Hotfix
Good First Issue
Hacktoberfest
Help Wanted
PR:Community Contribution
PR:Type:Enhancement
Priority:Critical
Priority:Important
Priority:Moderate
Severity: Major
Severity: Minor
Severity: Moderate
Status: Requires Code Review
Status: Requires Updates
Status: Stale
Status: Team Investigating
Status:Assessed
Status:Fix Proposed
Status:Needs Assessed
Status:Requires Automated Tests
Type: Bug
Type:Deprecated
Type:Discussion
Type:Duplicate
Type:Invalid
Type:Question
Type:Suggestion
Type:Suggestion
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/SuiteCRM-SuiteCRM#4983
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @cyb456 on GitHub (Mar 17, 2023).
Issue
I have a relate field to a custom module made in studio. This is stored in cases_cstm.mymodule_id_c
I get this error when trying to do a full index. After examing the query in suitecrm.log the join table is missing the cases_cstm join. After manually changing the query in phpmyadmin to join cases_cstm the query does not error.
Expected Behavior
no error
Actual Behavior
error
Possible Fix
detailed above
Steps to Reproduce
Context
Your Environment
@cyb456 commented on GitHub (Mar 17, 2023):
I was able to hacky fix it by adding
if($this->object_name == 'Case'){ return true; }
to SugarBean.php in hasCustomFields()
For some reason hasCustomFields() is blank/false for Cases when running the elasticsearch index
@cyb456 commented on GitHub (Jan 29, 2024):
I am again asking if someone could look into this, still occuring after pulling in the changes from https://github.com/salesagility/SuiteCRM/pull/10275
the root issue is $GLOBALS['dictionary']['Case']['custom_fields'] seems to always be false when run from robo or cron(command line)
So if I have custom field in my cases module, it breaks the indexing.
@chris001 commented on GitHub (Jan 29, 2024):
@JanSiero Any suggestions?
@pgorod commented on GitHub (Jan 30, 2024):
Can anyone get a stack trace at that point (function hasCustomFields), when running from the Scheduler or cron (the cases where it fails)? Knowing where it is being called from would likely provide clues about why it's failing.
Maybe it's as simple as ensuring there is an instantiation of the global variables before accessing them.
@cyb456 commented on GitHub (Jan 30, 2024):
There are multiple places within/called from the SugarBean->get_list() method where it checks that to make the query, what I essentially did to patch it for myself was replace
if (isset($this->custom_fields))with
if (isset($this->custom_fields) || $this->object_name == "Case")(along with inside the hasCustomFields() method from my first reply)
wherever I saw it, obviously this is not a real solution
@cyb456 commented on GitHub (Jan 30, 2024):
one other thing I noticed is LIMIT 1000, 1000, does that mean the first 0-1000 worked?
@chris001 commented on GitHub (Jan 30, 2024):
LIMITis not compatible with Microsoft SQL Server or standard SQL, so it should be changed to be compatible with the standard SQL.For example:
github.com/salesagility/SuiteCRM@b39d9610f7/include/database/MssqlManager.php (L433)@cyb456 commented on GitHub (Jan 31, 2024):
That should probably be in a new issue then
@chris001 commented on GitHub (Jan 31, 2024):
Done! Issue #10350