Assets deleted from DAM cause errors on asset sync

Created on 26 January 2018, over 6 years ago
Updated 11 April 2019, about 5 years ago

We are attempting to automate the sync of DAM assets in our Drupal environment using the following command in a cron task:

queue-run media_acquiadam_asset_refresh

As suggested in the following document:
https://www.drupal.org/docs/8/modules/media-acquia-dam/asset-sync-config ...

None of the assets update and we receive hundreds of the following error messages:

Client error: GET https://apiv2.webdamdb.com/assets/64447515 resulted in a 404 Not Found response:
{"message":"Not Authorized"}

Checking in the DAM for the id numbers in the errors we verified that the assets had been removed by user action.

It appears that when the sync operation cannot find an asset in the DAM to sync with, it leaves the queue entry intact and adds new entries on later cron runs, bloating the queue and throwing more errors.

Quick steps to reproduce:

  • Set up the Media AcquaDAM module ecosystem, entity browsers, content types, etc.
  • Add assets to DAM and complete the required metadata
  • Insert a DAM asset into a Drupal content entity
  • Delete the DAM asset
  • Run cron and the sync task; observe errors as shown above

Expected outcome: Asset sync queue is cleared and available assets are synced - missing assets are either ignored or deleted from Drupal

Actual outcome: Errors thrown & logged, asset sync queue items retained, missing assets remain in place and new queue items created

I would propose the following when a DAM asset is determined to be missing: The local item is flagged for removal, either deletion (which seems bad, leading to broken images) or is no longer added to the queue (and is allowed to exist as an orphaned asset); A user config could determine the action to take.

🐛 Bug report
Status

Fixed

Version

1.2

Component

Code

Created by

🇺🇸United States tkiehne

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • 🇮🇳India nikky171091

    Is there any Update about this issue? We are facing the same issue

    "Received a missing asset response when trying to load asset 386cd79 Was the asset deleted in Acquia DAM? DAM API client returned a 404 exception code with the following message: Client error: `GET h

Production build 0.69.0 2024