Expand my Community achievements bar.

AT: getOffers failed - Error Error: Unable to fulfill request; decisioning engine not ready.

Avatar

Level 2

I am getting an error "decisioning engine not ready" in production. Only preview/QA link in non-prod and production seems to be working fine. What I am doing wrong here? please help. 

My code:

 adobe.target.getOffers({
      request: {
        execute: {
          mboxes: [{
            index: 0,
            name: viewName
          }]
        }
      }
      }).then(function(response) {
        setadobeData(response.execute?.mboxes[0]?.options[0].content);
      }).catch(function(error) {
          console.log('AT: getOffers failed - Error', error);
      }).finally(() => {
          adobe.target.triggerView('vulcan_search', {
              page: true
          });
      });

I have the react state which stores the response from the Adobe.  

1 Reply

Avatar

Employee Advisor

Hi @Pravinrams1 ,

 

The "decisioning engine not ready" error in Adobe Target typically occurs when the on-device decisioning artifact (rules.json) hasn't been fully downloaded before making a getOffers request. This issue is more prevalent in production environments due to differences in network latency and caching compared to non-production environments.

Potential Solution:

To ensure that the getOffers call is made only after the decisioning artifact is ready, you can listen for the ARTIFACT_DOWNLOAD_SUCCEEDED event. This event indicates that the artifact has been successfully downloaded and the decisioning engine is ready to process requests.

Here's how you can modify your code:

document.addEventListener(adobe.target.event.ARTIFACT_DOWNLOAD_SUCCEEDED, function() {
adobe.target.getOffers({
request: {
execute: {
mboxes: [{
index: 0,
name: viewName
}]
}
}
}).then(function(response) {
setadobeData(response.execute?.mboxes[0]?.options[0].content);
}).catch(function(error) {
console.log('AT: getOffers failed - Error', error);
}).finally(() => {
adobe.target.triggerView('vulcan_search', {
page: true
});
});
});