Skip to content

Magento 245 - Elasticsearch error caused by prefix-table #35970

Closed
@nhatlich994

Description

@nhatlich994

Preconditions and environment

  • Magento version CE-2.4.5
  • Database with prefix table

Steps to reproduce

  1. Install Magento version CE-2.4.5
  2. View category page
Error report
Exception #1 (Zend_Db_Statement_Exception): SQLSTATE[42S02]: Base table or view not found: 1146 Table 'eav_attribute' doesn't exist

Expected result

View category page, list page, search page without error

Actual result

Error report
Exception #1 (Zend_Db_Statement_Exception): SQLSTATE[42S02]: Base table or view not found: 1146 Table 'eav_attribute' doesn't exist

Additional information

The class that is causing the issue: https://github.com/magento/magento2/blob/2.4.5/app/code/Magento/Elasticsearch/Model/ResourceModel/Fulltext/Collection/SearchResultApplier.php
Line 242
(SELECT attribute_id FROM eav_attribute WHERE entity_type_id={$entityTypeId}

The query did not declare the prefix for eav_attribute table

Release note

No response

Triage and priority

  • Severity: S0 - Affects critical data or functionality and leaves users without workaround.
  • Severity: S1 - Affects critical data or functionality and forces users to employ a workaround.
  • Severity: S2 - Affects non-critical data or functionality and forces users to employ a workaround.
  • Severity: S3 - Affects non-critical data or functionality and does not force users to employ a workaround.
  • Severity: S4 - Affects aesthetics, professional look and feel, “quality” or “usability”.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Area: CatalogComponent: DBIssue: ConfirmedGate 3 Passed. Manual verification of the issue completed. Issue is confirmedPriority: P2A defect with this priority could have functionality issues which are not to expectations.Progress: ready for devReported on 2.4.5Indicates original Magento version for the Issue report.Reproduced on 2.4.xThe issue has been reproduced on latest 2.4-develop branch

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions