cancel
Showing results for 
Search instead for 
Did you mean: 

Deploy failed. Detail: get X-CSRF-Token failed: VSCode

ashish_kumar2905
Participant
0 Kudos
783

Hi,

I am getting error while deploying MDK using VSCode:

Deploy failed. Detail: get X-CSRF-Token failed:

Accepted Solutions (0)

Answers (2)

Answers (2)

oliver_kaluscha
Participant

Hi,

as a workaround: you can do the deployment manually. Inside the settings of MDK plugin, you find

Mdk: Create Upload Bundle Zip

Please check the relevant checkbox. While building on a mac, you find a file called uploadBundle.zip a the following location:

/Users/<username>/.vscode/extensions/sapse.vsc-extensions-mdk-<version>/tools

The correct location is shown at the end of your build process in vscode as well.

So open the update section inside your app on mobile service in BTP and upload this file. Deploy it and it will be available for all users.

This gives you more control, as you can store these ZIP files as versions in GIT and you can deploy the same file on all instances.

Hope that helps.

ashish_kumar2905
Participant
0 Kudos

It is still throwing same error.

And while I am trying to debug, getting another error:

While debugging also, I am getting error :

Error processing "launch": Failed to get the bundle result from application: /Users/ashishkumar/Downloads/MDKCLNT23808P_2-80008652/MDKClient_SDK/SaravanaPrinter.mdkproject/metadata/Application.app

Jitendra_Kansal
Product and Topic Expert
Product and Topic Expert
0 Kudos

Looking at this screenshot, your email address is linked to two accounts. This is where you see options to select an account when accessing Mobile services cockpit in browser. This UI window is currently not available in VSC, hence, you can't pick an account while deploying MDK metadata to your mobile services. We'll enhance this in future.

Are those both accounts are S-user and P-user? When you deployed from VSC, did you provide the email address linked to your universal ID OR P/S-user ID? It should work with user ID (i tested with my Universal Id which has two accounts linked to it, deployment works fine when providing my P-user instead of email address).

You can of course continue your development if above works for you. However, i suggest you using MDK tools CLI to deploy your metadata to mobile services. Once you have the BTP org and space set, you don't need to enter credentials anymore.

Please do the following:

  • Install npm install @sap/mdk-tools -g
  • In terminal, navigate to your metadata project root folder
  • Run CF login -a <CF API endpoint> --sso (you can find API endpoint in BTP subaccount page)
  • get the temporary code
  • set org & space
  • run mdk deploy --target mobile if you have .project.json file in your metadata OR
  • run mdk deploy --target mobile --name <your mobile services app ID>