web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Supply chain | Supply Chain Management, Commerce
Unanswered

Retrieve available token failed. AAD context initialized true, token length {3}.

(0) ShareShare
ReportReport
Posted on by 1,457

This is a follow-up on https://community.dynamics.com/365/commerce/f/dynamics-365-commerce-forum/419018/how-to-run-standard-retail-on-a-development-environment

I had to upgrade the development environment from v10.0.15 to v10.0.18. This is a development environment with standard code, just our data instead of the demo data.


Because I did changes to the retail side like I would have done for my other development environments by copying the retailSDK as if I would have customized the retailSDK when it was on v10.0.15, I decided to delete the development environment and have it re-deployed and check to see if it works like Todd said it should.

So I didn't do any changes other than to apply the standard deployable package for v10.0.18, imported our DB and then deleted the channel DB in SSMS and then applied the latest hotfix v10.0.18 deployable package to create the channel DB again (step that is needed when the backup of the DB is from  an environment with scale units). I ran the reprovisioning tool and then I started with the setup.
Initialize the scheduler, generated the queries for AX7 and then ran the full DB sync for the default channel DB. I made sure the batch job completed and that the download sessions were applied tot he default database.

I am able to log in successfully onto Cloud POS via LCS.

However the product search and customer search returns nothing. 

Looking in SSMS and ran a select on [ax].custtable and [ax].ecoresproduct, I can see the products and customers.  So the channel Db was updated.

When I open a cart and click on Add product and select the product via the hierarchy then it sees the product.

If I open Inventory lookup, enter a product number and click ok to retrieve its inventory, it finds the product and shows the inventory quantities.

If I look in developer tools I see that it calls the search , stated that it has started.

Then  it gives the following: Retrieve available token failed for <URL> . AAD context initialized true, token length {3}.

then it shows that the search was successful and zero records were retrieved.

The URL is "https://commerce.dynamics.com". It is a URL that I can see in the UAT in Retail and Commerce > Headquarters setup > Parameters > Commerce shared parameters  under the identity providers. It is there plus the URL for my site. So I assume it should be there.

So why would I get this token error? what does it mean?

What step is missing that it doesn't want to do the search?

On my development box where I have the retailSDK in the C-drive because I do customizations on that box, there it has no problem showing the products and customers when running Cloud POS from LCS.

.

I have the same question (0)
  • Retha Profile Picture
    1,457 on at

    I just ran the product search on the development environment with no custom, thus no RetailSDK setup on the C-drive and the product search on my other development box with the retailSDK in the C-drive with customization extensions.

    The error in the title is actually not the problem because it appears in both development environments under developer tools.

    Console snippet  for environment  with no custom, thus no retailSDK setup under the C-drive and rhe retailCloudPOS points to K:\RetailCloudPos\WebRoot

    ***************

    Navigating from: 'HomeView'. Navigating to 'SearchView'. Correlation Id: 'xxx'.
    Diagnostics.TypeScriptCore.js:558 Page Loaded: SearchView.
    Diagnostics.TypeScriptCore.js:558 Search products started. PageSize: xxx, Skip: 80.
    Diagnostics.TypeScriptCore.js:558 The Retail Server Request with request id 'xxx' and request url 'https://<devretURL>Commerce/Products/SearchByText(channelId=5637145326,catalogId=0,searchText=@p1)?$top=80&@p1='M100057'&api-version=7.3' started.
    Diagnostics.TypeScriptCore.js:558 The page of customer search results is loaded. Number of customer results loaded into page view: 0.
    Diagnostics.TypeScriptCore.js:558 Retrieve available token failed for https://<commerce dynamics URL>. AAD context initialized true, token length {3}.
    Diagnostics.TypeScriptCore.js:558 The Retail Server Request with request id 'xxx' and request url 'https://<devret URL>/Commerce/Products/SearchByText(channelId=5637145326,catalogId=0,searchText=@p1)?$top=80&@p1='M100057'&api-version=7.3' succeeded. Status code 200, Time elapsed Products ms.
    Diagnostics.TypeScriptCore.js:558 Navigated from: 'HomeView'. Navigated to 'SearchView'. Correlation Id: 'xxx'.
    Diagnostics.TypeScriptCore.js:558 The page of product search results is loaded. Number of product results loaded into page view: 0.

    ***************

    Console snippet from my other Dev  environment where I have the retailSDK in the C-drive for customizations and the retailCloudPOS points to C:\Source\RetailSDK\POS\Web

    ***************

    Navigating from: 'HomeView'. Navigating to 'SearchView'. Correlation Id: 'xxx'.
    Diagnostics.TypeScriptCore.js:558 Page Loaded: SearchView.
    Diagnostics.TypeScriptCore.js:558 Search products started. PageSize: xxx, Skip: 80.
    Diagnostics.TypeScriptCore.js:558 The Retail Server Request with request id 'xxx' and request url 'https://<devret URL>/Commerce/Products/SearchByText(channelId=5637145326,catalogId=0,searchText=@p1)?$top=80&@p1='M100057'&api-version=7.3' started.
    Diagnostics.TypeScriptCore.js:558 The page of customer search results is loaded. Number of customer results loaded into page view: 0.
    Diagnostics.TypeScriptCore.js:558 Retrieve available token failed for https://<commerce dynamic URL>. AAD context initialized true, token length {3}.
    Diagnostics.TypeScriptCore.js:558 The Retail Server Request with request id 'xxx' and request url 'https://<devret URL>/Commerce/Products/SearchByText(channelId=5637145326,catalogId=0,searchText=@p1)?$top=80&@p1='M100057'&api-version=7.3' succeeded. Status code 200, Time elapsed Products ms.
    Diagnostics.TypeScriptCore.js:558 Navigated from: 'HomeView'. Navigated to 'SearchView'. Correlation Id: 'xxx'.
    Diagnostics.TypeScriptCore.js:558 The page of product search results is loaded. Number of product results loaded into page view: 1.
    Diagnostics.TypeScriptCore.js:558 The Retail Server Request with request id 'xxx' and request url 'https://<devret URL>/Commerce/Products/GetActivePrices?$top=250&$count=true&api-version=7.3' started.
    Diagnostics.TypeScriptCore.js:558 Retrieve available token failed for https://<commerce dynamics URL>. AAD context initialized true, token length {3}.
    Diagnostics.TypeScriptCore.js:558 The Retail Server Request with request id 'xxx' and request url 'https://<devret URL>/Commerce/Products/GetActivePrices?$top=250&$count=true&api-version=7.3' succeeded. Status code 200, Time elapsed Products ms.

    ***************

    It just doesn't retrieve the product and the product exists in the channel DB [ax]ecoResProduct

  • Juliet Zhu Profile Picture
    on at

    Hi Retha,

    Can you please open a ticket to our support team?

    Thanks,

    Juliet Zhu

  • Retha Profile Picture
    1,457 on at

    This error in the end happened on even the developer box where I do Retail customization.

    I have no idea what the issue was.

    I re-imported our custom DB, ran the environment provisioning tool again.

    Re-did the initialize commerce scheduler, generating the AX7 queries and ran job 9999 again.

    After this I logged into POS from LCS and it still didn't want to retrieve products and customers with the search tiles for it. However it had no problem retrieving it for inventory lookup.

    I was in the process of logging a ticket with Microsoft when I did the product search again to get the entries in the developer tools and suddenly it was showing the product. I tried the customer and it showed the customer too.

    No idea if it took time pull it and that it timed out  even though it never gave a message in the developer tools that there was a time-out.

    The environment has the configuration parameter 'ProductSearch.UseAzureSearch' in the commerce parameter and it is set to true. Maybe Azure needed to catch up or something.

    I have absolutely no idea

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > Supply chain | Supply Chain Management, Commerce

#1
Laurens vd Tang Profile Picture

Laurens vd Tang 301 Super User 2025 Season 2

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 118 Super User 2025 Season 2

#3
Siv Sagar Profile Picture

Siv Sagar 105 Super User 2025 Season 2

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans