Skip to content

oro_scope_fill_row_hash fails on Community Edition with ERROR: function md5() does not exist #174

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
romeof1980 opened this issue Jan 23, 2025 · 3 comments

Comments

@romeof1980
Copy link

romeof1980 commented Jan 23, 2025

Summary
Trying to install oro commerce community edition (first installation on clean db) via oro:install throws function md5() does not exist

Steps to reproduce
composer install [successfull]
The following throws an exception instead:
bin/console oro:install --env=dev

Actual Result

Loading "main" data fixtures (language: en, formatting code: en)...
> loading Oro\Bundle\ScopeBundle\Migrations\Data\ORM\LoadDefaultScope

In AbstractPostgreSQLDriver.php line 102:
                                                                               
  An exception occurred while executing 'INSERT INTO oro_scope (serialized_da  
  ta, row_hash, organization_id, user_id, localization_id, website_id, webCat  
  alog_id, customerGroup_id, customer_id) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?)'  
   with params [null, null, null, null, null, null, null, null, null]:         
                                                                               
  SQLSTATE[42883]: Undefined function: 7 ERROR:  function md5() does not exis  
  t                                                                            
  LINE 1: NEW.row_hash = MD5()                                                 
                         ^                                                     
  HINT:  No function matches the given name and argument types. You might nee  
  d to add explicit type casts.                                                
  QUERY:  NEW.row_hash = MD5()                                                 
  CONTEXT:  PL/pgSQL function oro_scope_fill_row_hash() line 3 at assignment   
                                                                               

In Exception.php line 18:
                                                                               
  SQLSTATE[42883]: Undefined function: 7 ERROR:  function md5() does not exis  
  t                                                                            
  LINE 1: NEW.row_hash = MD5()                                                 
                         ^                                                     
  HINT:  No function matches the given name and argument types. You might nee  
  d to add explicit type casts.                                                
  QUERY:  NEW.row_hash = MD5()                                                 
  CONTEXT:  PL/pgSQL function oro_scope_fill_row_hash() line 3 at assignment   
                                                                               

In PDOStatement.php line 117:
                                                                               
  SQLSTATE[42883]: Undefined function: 7 ERROR:  function md5() does not exis  
  t                                                                            
  LINE 1: NEW.row_hash = MD5()                                                 
                         ^                                                     
  HINT:  No function matches the given name and argument types. You might nee  
  d to add explicit type casts.                                                
  QUERY:  NEW.row_hash = MD5()                                                 
  CONTEXT:  PL/pgSQL function oro_scope_fill_row_hash() line 3 at assignment

Expected Result
Oro commerce installed correctly

Details about your environment

  • OroCommerce Community Edition version: 5.1.0 obtained via compose create project
  • PHP version: 8.2
  • Database Postgres 15.1
  • Env: docker via docker-compose.yml
  • node and npm correctly validated (node 18.20.6 and npm 9.3.1)
@romeof1980
Copy link
Author

romeof1980 commented Jan 23, 2025

to add some info:
what I see (attachment) is that the problem is probably not strictly related to postgres md5 (the function is indeed present).

Image

It is related to the fact that bin/console oro:install for some migrations installs NULL data (see query) that obviously can not be handled by the postgres md5 function.

@mbessolov mbessolov changed the title Dockerized OroCommerce 5.1 cmd oro:install fails for SQLSTATE[42883]: Undefined function: 7 ERROR: function md5() does not exist AddTriggerToRowHashQuery fails on Community Edition with ERROR: function md5() does not exist Jan 23, 2025
@mbessolov mbessolov changed the title AddTriggerToRowHashQuery fails on Community Edition with ERROR: function md5() does not exist oro_scope_fill_row_hash fails on Community Edition with ERROR: function md5() does not exist Jan 23, 2025
@mbessolov mbessolov self-assigned this Jan 23, 2025
@mbessolov
Copy link
Member

Internal ticket ID: BB-25085

@romeof1980
Copy link
Author

@mbessolov allow mw to add another log error that I reckon is strictly related (popping up during oro:install->sample_data install):

> loading Oro\Bundle\WebsiteSearchBundle\Migrations\Data\Demo\ORM\LoadSearchTermReportData
In AbstractPostgreSQLDriver.php line 102:
                                                                               
  An exception occurred while executing 'SELECT UUID_GENERATE_V4()':           
                                                                               
  SQLSTATE[42883]: Undefined function: 7 ERROR:  function uuid_generate_v4()   
  does not exist                                                               
  LINE 1: SELECT UUID_GENERATE_V4()                                            
                 ^                                                             
  HINT:  No function matches the given name and argument types. You might nee  
  d to add explicit type casts.                                                
                                                                               

In Exception.php line 18:
                                                                               
  SQLSTATE[42883]: Undefined function: 7 ERROR:  function uuid_generate_v4()   
  does not exist                                                               
  LINE 1: SELECT UUID_GENERATE_V4()                                            
                 ^                                                             
  HINT:  No function matches the given name and argument types. You might nee  
  d to add explicit type casts.                                                
                                                                               

In PDOConnection.php line 143:
                                                                               
  SQLSTATE[42883]: Undefined function: 7 ERROR:  function uuid_generate_v4()   
  does not exist                                                               
  LINE 1: SELECT UUID_GENERATE_V4()                                            
                 ^                                                             
  HINT:  No function matches the given name and argument types. You might nee  
  d to add explicit type casts.                                                
                                                                               

oro:migration:data:load [--fixtures-type [FIXTURES-TYPE]] [--dry-run] [--bundles [BUNDLES]] [--exclude [EXCLUDE]] [--language [LANGUAGE]] [--formatting-code [FORMATTING-CODE]]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

2 participants