Scenario:
- Have a pull mapping
- Map some records
- Copy database between 2 diff systems
- Pull the records

Expected:
- Content created
- Mapped Objects created

Observed:
- Content created
- Mapped Objects fail to create
- Content created again, ad infinitum, because mapped object failed to be created

I've mostly observed Mapped Objects fail to be created because of a trigger failure on salesforce_mapped_objects table: The user specified as a definer ('foo@bar') does not exist

Proposed solutions:
- Stop using Dynamic Entity References, so we can get away from triggers
- Open a bug report with DER
- Wrap the whole procedure in a transaction and roll back on failure

Comments

AaronBauman created an issue. See original summary.

aaronbauman’s picture

Issue summary: View changes
bob.hinrichs’s picture

There is definitely a problem in the setup that results in this 'user specified as a definer' error. We are struggling to figure it out.

aaronbauman’s picture

bamberjp’s picture

I have installed Salesforce Suite 8.x-4.x-dev and Dynamic Entity Reference 8.x-1.12 and still am receiving the following error:

Drupal\Core\Database\DatabaseExceptionWrapper: SQLSTATE[HY000]: General error: 1449 The user specified as a definer ('...') does not exist: INSERT INTO {salesforce_mapped_object} (revision_id, drupal_entity__target_id, drupal_entity__target_type, salesforce_mapping, salesforce_id, created, changed, entity_updated, last_sync_status, last_sync_action, force_pull) VALUES (:db_insert_placeholder_0, :db_insert_placeholder_1, :db_insert_placeholder_2, :db_insert_placeholder_3, :db_insert_placeholder_4, :db_insert_placeholder_5, :db_insert_placeholder_6, :db_insert_placeholder_7, :db_insert_placeholder_8, :db_insert_placeholder_9, :db_insert_placeholder_10); Array ( [:db_insert_placeholder_0] => [:db_insert_placeholder_1] => 9442 [:db_insert_placeholder_2] => contact_message [:db_insert_placeholder_3] => contact_us [:db_insert_placeholder_4] => 00Q4u00001f7XsAEAU [:db_insert_placeholder_5] => 1623858098 [:db_insert_placeholder_6] => 1623858098 [:db_insert_placeholder_7] => [:db_insert_placeholder_8] => 1 [:db_insert_placeholder_9] => push_create [:db_insert_placeholder_10] => ) in Drupal\Core\Entity\Sql\SqlContentEntityStorage->doSaveFieldItems() (line 973 of /code/core/lib/Drupal/Core/Entity/Sql/SqlContentEntityStorage.php).

Any advice would be much appreciated. Thanks.

johnnydarkko’s picture

Any luck, bamberjp? I'm getting the same error after upgrading the module from 3.x to 4.x and thought maybe I'd have better luck after upgrading core to d9 and salesforce to 5.x, but I'm still getting the same error. I tried dynamic_entity_reference 1.x and 2.x and still getting the same error.

Drupal\Core\Entity\EntityStorageException: SQLSTATE[HY000]: General error: 1449 The user specified as a definer ('dd82cf497cf245a0b3255c35d737eff2'@'%') does not exist: UPDATE "salesforce_mapped_object" SET "revision_id"=:db_update_placeholder_0, "drupal_entity__target_id"=:db_update_placeholder_1, "drupal_entity__target_type"=:db_update_placeholder_2, "salesforce_mapping"=:db_update_placeholder_3, "salesforce_id"=:db_update_placeholder_4, "created"=:db_update_placeholder_5, "changed"=:db_update_placeholder_6, "entity_updated"=:db_update_placeholder_7, "last_sync_status"=:db_update_placeholder_8, "last_sync_action"=:db_update_placeholder_9, "force_pull"=:db_update_placeholder_10 WHERE "id" = :db_condition_placeholder_0; Array ( [:db_update_placeholder_0] => 155 [:db_update_placeholder_1] => 11750 [:db_update_placeholder_2] => node [:db_update_placeholder_3] => events [:db_update_placeholder_4] => a0O8X00000r27RiUAI [:db_update_placeholder_5] => 1640023026 [:db_update_placeholder_6] => 1645130358 [:db_update_placeholder_7] => 1645130358 [:db_update_placeholder_8] => 1 [:db_update_placeholder_9] => pull [:db_update_placeholder_10] => 0 [:db_condition_placeholder_0] => 155 ) in Drupal\Core\Entity\Sql\SqlContentEntityStorage->save() (line 811 of /app/docroot/core/lib/Drupal/Core/Entity/Sql/SqlContentEntityStorage.php).

aaronbauman’s picture

Status: Active » Closed (outdated)

I'm doing some cleanup on unsupported branches.
Please re-open this issue and update the version to 5.0.x-dev if this issue is still applicable to the latest release.