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

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Supply chain | Supply Chain Management, Commerce
Suggested Answer

"Creating device token failed" error on CPOS activation

(0) ShareShare
ReportReport
Posted on by 25

Hi everyone,

We have a cloud-hosted machine with a database which is a copy from a Tier-4 environment. In the Tier-4 environment retail is working as expected and the CPOS activation was successfull.

In the cloud-hosted environment, everytime we attempt to activate a CPOS, we have the following error message:

pastedimage1607179579420v1.png


Step 4 of 15: Creating device token failed.
A database error has occurred.
Application session ID
ed4bc6e2-bdd8-c430-329c-41002f9161fb

We have validated that both the "channel profile" and channel databases were properly configured. In the channel database we re-created the connection string and all async jobs are successfulling executing. The store has been synced with a full-9999 job to make sure all data is there. We have also re-initialized the commerce module (Initialize retail function), and the scheduler. The async metadata was also reseted. Still, the error remains. 

We have also created from scratch a new channel profile and a new channel database and repeated all steps mapping to these, with the same error I'm afraid.

Checking the event viewer for the retail server, we identified that everytime a new CPOS activation is attempted (and results in failure), the following message is logged:

".An error occurred during the Retail Server Request. RequestUri: https://#####.cloudax.dynamics.com/Commerce/ActivateDevice?api-version=7.3. RequestId: a79b411d-b4a2-5923-24fb-55a85a32befe. Exception: Microsoft.Dynamics.Commerce.Runtime.StorageException: Failed to read from the database. See inner exception for details
DatabaseErrorCode: 0 ---> Microsoft.Dynamics.Commerce.Runtime.Data.DatabaseException: Database error 'Unknown' occurred for 'execute stored procedure '[crt].GETSTAFFIDBYEXTERNALIDENTITY''. Could not find stored procedure 'crt.GETSTAFFIDBYEXTERNALIDENTITY'. ---> System.Data.SqlClient.SqlException: Could not find stored procedure 'crt.GETSTAFFIDBYEXTERNALIDENTITY'...."

The referred stored procedure does not exist indeed, but it also does not exist in any other environment we have where all activations happen successfully.

Any help?

I have the same question (0)
  • Suggested answer
    Guanghui Profile Picture
    Microsoft Employee on at

    I believe this issue is caused by version missmatch, that is to say version of retail server dll did not match the version of database, from your symptom,  I think your retail server is newer than the database in you machine, so the possible solution is, please copy the required store procedure from other environment to this environment.

  • Suggested answer
    marxhein94 Profile Picture
    10 on at

    Duplicating the specific stored procedure will not recreate other stored procedures and fields that might be missing from tables in the DB.

    Try to re/apply the latest service package, ensure that the DB is on the same version and RetailSDK is up to date would be my course of action

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Meet the Microsoft Dynamics 365 Contact Center Champions

We are thrilled to have these Champions in our Community!

Congratulations to the March Top 10 Community Leaders

These are the community rock stars!

Leaderboard > Supply chain | Supply Chain Management, Commerce

#1
Mallesh Deshapaga Profile Picture

Mallesh Deshapaga 301

#2
Laurens vd Tang Profile Picture

Laurens vd Tang 236 Super User 2026 Season 1

#3
Syed Haris Shah Profile Picture

Syed Haris Shah 154 Super User 2026 Season 1

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans