function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
crikketlangcrikketlang 

Struggling with Apex Data Loader Command Line Password

I seem to be having an issue with the Encrypt or decrypt portion of the password process. From what i read on the return from command prompt, it knows the first two characters in my password and decrypts it properly ("Sh") but it seems to have a problem with something after this point??? Or i could be completely crazy...

 

Might anyone be able to shed some light? Did i encrypt wrong? Is it recquired to have a key file? If so, where am i supposed to place it?

 

Any help would be appreciated.

834 [main] FATAL com.salesforce.dataloader.process.ProcessRunner  - Unable to ru
n process UofUAccountExtractToCSV
java.lang.RuntimeException: com.salesforce.dataloader.exception.ParameterLoadExc
eption: Error loading parameter: sfdc.password of type: java.lang.String
        at com.salesforce.dataloader.process.ProcessRunner.run(ProcessRunner.jav
a:136)
        at com.salesforce.dataloader.process.ProcessRunner.run(ProcessRunner.jav
a:74)
        at com.salesforce.dataloader.process.ProcessRunner.main(ProcessRunner.ja
va:226)
Caused by: com.salesforce.dataloader.exception.ParameterLoadException: Error loa
ding parameter: sfdc.password of type: java.lang.String
        at com.salesforce.dataloader.config.Config.decryptProperty(Config.java:6
83)
        at com.salesforce.dataloader.config.Config.postLoad(Config.java:620)
        at com.salesforce.dataloader.config.Config.loadParameterOverrides(Config
.java:646)
        at com.salesforce.dataloader.process.ProcessRunner.run(ProcessRunner.jav
a:94)
        ... 2 more
Caused by: java.lang.NumberFormatException: For input string: "Sh"
        at java.lang.NumberFormatException.forInputString(NumberFormatException.
java:48)
        at java.lang.Integer.parseInt(Integer.java:447)
        at java.lang.Integer.valueOf(Integer.java:526)
        at java.lang.Integer.decode(Integer.java:919)
        at com.salesforce.dataloader.security.EncryptionUtil.textToBytes(Encrypt
ionUtil.java:58)
        at com.salesforce.dataloader.security.EncryptionUtil.decryptString(Encry
ptionUtil.java:194)
        at com.salesforce.dataloader.config.Config.decryptProperty(Config.java:6
68)

 process-conf.xml looks like this:

 

<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd">
<beans>

    <bean id="UofUAccountExtractToCSV"
          class="com.salesforce.dataloader.process.ProcessRunner"
          singleton="false">
      <description>Gets the UofU accounts with clients and exports to CSV"</description>
        <property name="name" value="UofUAccountExtractToCSV"/>
        <property name="configOverrideMap">
            <map>
                <entry key="sfdc.debugMessages" value="false"/>
                <entry key="sfdc.debugMessagesFile" value="c:\Salesforce\DataLoader\Resources\Logs\SFDCdebug.log"/>
                <entry key="sfdc.endpoint" value="https://login.salesforce.com"/>
                <entry key="sfdc.username" value="sfdcusername"/>
		<entry key="sfdc.password" value="value returned by encrypt.bat -e"/>
                <entry key="sfdc.timeoutSecs" value="600"/>
                <entry key="sfdc.loadBatchSize" value="200"/>
                <entry key="sfdc.entity" value="Client__c"/>
                <entry key="sfdc.extractionSOQL" value="SELECT c.LIS_Account_Name__c, c.Entity_Code__c,c.ClientID_Ext_Id__c, c.Phone_and_Extension__c, c.Secured_Fax__c, c.Comments__c,c.Street_Address__c, c.City__c, c.State__c, c.account__r.name from client__c c where c.account__r.recordtypeid ='012C0000000Q7lIIAS'"/>
                <entry key="process.operation" value="extract"/>
                <entry key="process.mappingFile" value="c:\Salesforce\DataLoader\Resources\Mapping\UofUAccountExtractMap.sdl"/>
                <entry key="process.outputError" value="c:\Salesforce\DataLoader\Resources\Logs\LastOperationError.csv"/>
    		<entry key="dataAccess.writeUTF8" value="true"/>            
		<entry key="dataAccess.type" value="csvWrite"/>
                <entry key="dataAccess.name" value="c:\Salesforce\DataLoader\Resources\Data\UofUSFDCExtract.csv"/>
            </map>
        </property>
    </bean>
</beans>

 

 

 

Best Answer chosen by Admin (Salesforce Developers) 
AnnyAnny

Hi,

 

Please follow below steps.

 

1. Open command prompt in ur system.

2. Change the directory to bin directory of ur datalaoder(Example:C:\ProgramFiles\Dataloader\bin).

3. In the command prompt  type encrypt.bat -g test(Example:C:\ProgramFiles\Dataloader\bin>encrypt.bat -g test)

4. Hit enter then key will be generated copy the key and paste it in key.txt file(create .txt file and rename it to key.txt and paste the key).

5.type encrypt.bat -e kevin123456 and location of ur key.txt file(Example:C:\ProgramFiles\Dataloader\bin>encrypt.bat -e kevin123456 "C:\ProgramFiles\Dataloader\test\key.txt" ) .

6. Hit enter then one alpha numeric number will be genarated copy that and paste it in Process-conf.xml file

 

Regards,

Anny

All Answers

AnnyAnny

Hi,

 

Please find below steps.

 

Encrypting Passwords:

Encrypting passwords for use in the Data Loader command line involves a 2 step process. The following

section details these steps:

Step 1:

Create the Key File:

Create the Key.txt file. (File name can be different)

Save the Key.txt file into the directory where the process-conf.xml file is located.

 

To Generate the key type below command in command prompt

Go to bin directory of dataloader and type encrypt.bat -g test then hit enter(C:\ProgramFiles\Dataloader\bin>encrypt.bat -g test)

Key will be generated copy the key and paste it in Key.txt file.

 

Step2;

 

Encrypt the Password:

Go to bin directory of dataloader and type encrypt.bat -e password give the location of key.txt then hit the enter then ur password will be encrypted,copy it and paste it in process-conf.xml

(C:\ProgramFiles\Dataloader\bin>encrypt.bat -e password "C:\ProgramFiles\Dataloader\test\key.txt" then hit enter)

 

Regards,

Anil

kevin_zhangkevin_zhang

Hi,Anny.

Can u speak a little clearly and let me know what the test is,i really wanna know...thnx!

AnnyAnny

Hey Kevin,

 

To generate a key you can give any text like abcd ,kevin anything. Please see below example.

 

 Example---C:\ProgramFiles\Dataloader\bin>encrypt.bat -g kevin

 

Let me know still if you have any issues.

 

Regards,

Anny

kevin_zhangkevin_zhang

ok!thanks Anny

I still have a question that how to generate a key file(for exemple:password is kevin123456) and then encrypt and decrypt it by commend line.

the following is:
\bin>encrypt.bat -g <seedtext>
i dont know what the parameter <seedtext> is?

\bin>encrypt.bat -e <plain text> [Path to Key]

the parameter <plain text> is mean my password or any other things? 

MunmunMunmun

put  in dos \bin>encrypt   -g kevin123456

 

 

\bin> encrypt   -e kevin123456 this is for key

AnnyAnny

Hi,

 

Please follow below steps.

 

1. Open command prompt in ur system.

2. Change the directory to bin directory of ur datalaoder(Example:C:\ProgramFiles\Dataloader\bin).

3. In the command prompt  type encrypt.bat -g test(Example:C:\ProgramFiles\Dataloader\bin>encrypt.bat -g test)

4. Hit enter then key will be generated copy the key and paste it in key.txt file(create .txt file and rename it to key.txt and paste the key).

5.type encrypt.bat -e kevin123456 and location of ur key.txt file(Example:C:\ProgramFiles\Dataloader\bin>encrypt.bat -e kevin123456 "C:\ProgramFiles\Dataloader\test\key.txt" ) .

6. Hit enter then one alpha numeric number will be genarated copy that and paste it in Process-conf.xml file

 

Regards,

Anny

This was selected as the best answer
MunmunMunmun

Hi Anne,

Thanks for reply,I ndid same exactly like that,but getting same error.
One more thing when we logon to dataloader we use pwd=pwd+securitytoken.

so <entry key="sfdc.password" value> in this place what shall i put.,please correct me if i am wrong.is this encrypted value of pwd+security token.

Please let me know

thanks:mansad:

MunmunMunmun

I m getting this error- Error loading parameter: sfdc.password of type : java.lang
.String
javax.crypto.BadPaddingException: Given final block not properly padded
        at com.sun.crypto.provider.SunJCE_h.b(DashoA12275)
        at com.sun.crypto.provider.SunJCE_h.b(DashoA12275)
        at com.sun.crypto.provider.DESCipher.engineDoFinal(DashoA12275)
        at javax.crypto.Cipher.doFinal(DashoA12275)
        at com.salesforce.dataloader.security.EncryptionUtil.decryptString(Encry
ptionUtil.java:197)

MunmunMunmun

Hi,

I am gettting following error when try to run the file

 

<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd">
<beans>
    <bean id="accountMasterProcess"
          class="com.salesforce.dataloader.process.ProcessRunner"
          singleton="false">
        <description>LOGIN</description>
        <property name="name" value="accountMasterProcess"/>
        <property name="configOverrideMap">
            <map>
                <entry key="sfdc.debugMessages" value="true"/>
                <entry key="sfdc.debugMessagesFile" value="D:\Apex Dataloader\samples\status\accountMasterSoapTrace.log"/>
                <entry key="sfdc.endpoint" value="https://login.salesforce.com"/>
                <entry key="sfdc.username" value="sm_miky@gmail.com"/>
                <!-- password below has been encrypted using key file, therefore it will not work without the key setting: process.encryptionKeyFile
                the password is not a valid encrypted value, please generate the real value using encrypt.bat utility -->
                <entry key="sfdc.password" value="0a2aeb7885e668e6f80a8187cf4eec85"/>
              <!--  <entry key="process.encryptionKeyFile" value="D:\Apex Dataloader\samples\conf\sample.key"/>-->
                <entry key="sfdc.timeoutSecs" value="600"/>
                <entry key="sfdc.loadBatchSize" value="200"/>                          
               
                <entry key="dataAccess.type" value="databaseRead"/>
                <entry key="process.initialLastRunDate" value="2005-12-01T00:00:00.000-0800"/>
            </map>
        </property>
    </bean>
 </beans>
   

 

 

 

 

I am getting this error

 

D:\Apex Dataloader\bin>process conf accountMasterProcess
2011-08-29 09:20:34,653 INFO  [main] controller.Controller initLog (Controller.j
ava:367) - The log has been initialized
2011-08-29 09:20:34,663 INFO  [main] process.ProcessConfig getBeanFactory (Proce
ssConfig.java:78) - Loading process configuration from config file: D:\Apex Data
loader\bin\conf\process-conf.xml
2011-08-29 09:20:34,718 INFO  [main] xml.XmlBeanDefinitionReader loadBeanDefinit
ions (XmlBeanDefinitionReader.java:163) - Loading XML bean definitions from file
 [D:\Apex Dataloader\bin\conf\process-conf.xml]
2011-08-29 09:20:34,740 INFO  [main] core.CollectionFactory <clinit> (Collection
Factory.java:66) - JDK 1.4+ collections available
2011-08-29 09:20:34,746 INFO  [main] core.CollectionFactory <clinit> (Collection
Factory.java:71) - Commons Collections 3.x available

 

2011-08-29 09:20:34,785 INFO  [accountMasterProcess] controller.Controller initC
onfig (Controller.java:328) - The controller config has been initialized
2011-08-29 09:20:34,790 INFO  [accountMasterProcess] process.ProcessRunner run (
ProcessRunner.java:90) - Initializing process engine
2011-08-29 09:20:34,790 INFO  [accountMasterProcess] process.ProcessRunner run (
ProcessRunner.java:93) - Loading parameters


2011-08-29 09:20:35,572 INFO  [accountMasterProcess] config.LastRun load (LastRu
n.java:101) - Last run info will be saved in file: D:\Apex Dataloader\bin\conf\a
ccountMasterProcess_lastRun.properties

2011-08-29 09:20:35,597 FATAL [main] process.ProcessRunner topLevelError (Proces
sRunner.java:211) - Unable to run process accountMasterProcess
java.lang.RuntimeException: java.lang.IllegalArgumentException: No enum const cl
ass com.salesforce.dataloader.action.OperationInfo.
        at com.salesforce.dataloader.process.ProcessRunner.run(ProcessRunner.jav
a:136)
        at com.salesforce.dataloader.process.ProcessRunner.run(ProcessRunner.jav
a:74)
        at com.salesforce.dataloader.process.ProcessRunner.main(ProcessRunner.ja
va:226)
Caused by: java.lang.IllegalArgumentException: No enum const class com.salesforc
e.dataloader.action.OperationInfo.
        at java.lang.Enum.valueOf(Enum.java:192)
        at com.salesforce.dataloader.config.Config.getEnum(Config.java:441)
        at com.salesforce.dataloader.config.Config.getOperationInfo(Config.java:
981)
        at com.salesforce.dataloader.process.ProcessRunner.run(ProcessRunner.jav
a:97)
        ... 2 more

 

 

 

 

please let me know the  if face this

 

 

kevinvw2000kevinvw2000

I think this is the same issue I was having.

 

I grabbed the xml from the help file and it was missing a key line -

 

<entry key="process.encryptionKeyFile" value="c:\DataImportTest\key.txt"/>

 

The video tutorial really helped me figure out how to get things working -

 

http://www.salesforce.com/_app/video/data_loader/help/data_loader_cli.jsp

 

Hope this helps.

 

Kevin Williams - Lexnet Consulting Group

CaleAtSpecificMediaCaleAtSpecificMedia

Great comment Kevin.  Thank you very much for this find.  I've been struggling with the issue for 3 hours now.  You're awesome.

Linda 98Linda 98
Kevin,

I have everything fine.
I still get the same error.
Any other suggestion.
JitendraJitendra

For all the users coming back, You will receive this error if path to key file is missing in "process-conf.xml". 
<entry key="process.encryptionKeyFile" value="path/key.txt"/>

For more, refer this blog article - http://www.jitendrazaa.com/blog/salesforce/tutorial-of-command-line-dataloader-salesforce/
Arpit AgarwalArpit Agarwal
Hi,

Can anyone please let me know the root cause of this error- "Given last block not properly padded".
I have added <entry key="process.encryptionKeyFile" value="path/key.txt"/> this time around while encryption and since then it is running fine but I want to know previously we never added that line in the process-conf.xml or config.properties, but batch was working.
Please let me know the reason for this error as I am using same version of Data loader for both the bacthes, V 27.0. It is really important for me and any help on this would be really appreciated.

Thanks.
James YorkJames York
I have the same issue.  I had added the process.encryptionKeyFile.  Did anyone ever figure this out?