Invalid username, password, security token; or user locked out.

Error : Invalid username, password, security token; or user locked out. while running ANT Migration

Invalid username, password, security token; or user locked out. while running ANT Migration

Background

I am trying to setup a bitbucket pipeline and in the build I am getting this error.

  1. Have tried various combination of password and security tokens.
  2. Reset security tokens multiple times but still getting this error in the logs.
  3. Tried to login using test.salesforce.com with the same password and it works.
  4. Used Data loader with the same password and sec token and it works
  5. Used API to call using the same password and sec token and IT WORKS!!!

What’s wrong ????

My current build.xml is something like the below image, seems fine to me :

without echo Invalid username, password, security token; or user locked out

Then added a line to show the password in the Build process as below:

With echo password Invalid username, password, security token; or user locked out

When I executed this pipeline I could see the issue clearly now.

Root Cause

The issue was with the password I have. The build file removes the “$” (Dollar sign) from the password. My password was xxxx$yyyyyyy and when the build runs my password was showing as xxxxyyyyyyy. I changed my passwrod from xxxx$yyyyyyy to xxxx@yyyyyyy and it worked!!!

$ is a special character and it’s being ignored by the system.

Reference : ANT Migration tool


Comments

Leave a Reply

Your email address will not be published. Required fields are marked *