+ Start a Discussion
Stephanie Boggs 17Stephanie Boggs 17 

Encryption error when attempting to use Data Loader from Command Line

Hello,

I am following the instructions at https://developer.salesforce.com/page/Using_Data_Loader_from_the_command_line and am getting the following error.

c:\Program Files (x86)\salesforce.com\Data Loader\bin>process.bat "C:\Program Files (x86)\salesforce.com\Data Loader\bin\conf" csvAccountExtractProcess
2016-12-27 21:05:15,487 INFO  [main] controller.Controller initLog (Controller.java:396) - Using built-in logging configuration, no log-conf.xml in c:\Program Files (x86)\salesforce.com\Data Loader\bin\log-conf.xml
2016-12-27 21:05:15,495 INFO  [main] controller.Controller initLog (Controller.java:398) - The log has been initialized
2016-12-27 21:05:15,498 INFO  [main] process.ProcessConfig getBeanFactory (ProcessConfig.java:104) - Loading process configuration from config file: C:\Program Files (x86)\salesforce.com\Data Loader\bin\conf\process-conf.xml
2016-12-27 21:05:15,564 INFO  [main] support.AbstractApplicationContext prepareRefresh (AbstractApplicationContext.java:495) - Refreshing org.springframework.context.support.FileSystemXmlApplicationContext@53e25b76: startup date [Tue Dec 27 21:05:15 CST 2016]; root of context hierarchy
2016-12-27 21:05:15,603 INFO  [main] xml.XmlBeanDefinitionReader loadBeanDefinitions (XmlBeanDefinitionReader.java:315) - Loading XML bean definitions from file [C:\Program Files (x86)\salesforce.com\Data Loader\bin\conf\process-conf.xml]
2016-12-27 21:05:15,664 INFO  [main] support.DefaultListableBeanFactory preInstantiateSingletons (DefaultListableBeanFactory.java:557) - Pre-instantiating singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory@1936f0f5: defining beans [csvAccountExtractProcess]; root of factory hierarchy
2016-12-27 21:05:15,700 INFO  [csvAccountExtract] controller.Controller initConfig (Controller.java:334) - config dir created at C:\Program Files (x86)\salesforce.com\Data Loader\bin\conf
2016-12-27 21:05:15,711 INFO  [csvAccountExtract] controller.Controller initConfig (Controller.java:362) - The controller config has been initialized
2016-12-27 21:05:15,712 INFO  [csvAccountExtract] process.ProcessRunner run (ProcessRunner.java:116) - Initializing process engine
2016-12-27 21:05:15,712 INFO  [csvAccountExtract] process.ProcessRunner run (ProcessRunner.java:119) - Loading parameters
2016-12-27 21:05:15,713 ERROR [csvAccountExtract] config.Config initEncryption (Config.java:731) - Error initializing encryption for key file ?c:\Temp\key.txt: Cannot Access Key File: ?c:\Temp\key.txt
2016-12-27 21:05:15,714 FATAL [main] process.ProcessRunner topLevelError (ProcessRunner.java:238) - Unable to run process csvAccountExtract
java.lang.RuntimeException: com.salesforce.dataloader.exception.ConfigInitializationException: Error initializing encryption for key file ?c:\Temp\key.txt: Cannot Access Key File: ?c:\Temp\key.txt
        at com.salesforce.dataloader.process.ProcessRunner.run(ProcessRunner.java:162)
        at com.salesforce.dataloader.process.ProcessRunner.run(ProcessRunner.java:100)
        at com.salesforce.dataloader.process.ProcessRunner.main(ProcessRunner.java:253)
Caused by: com.salesforce.dataloader.exception.ConfigInitializationException: Error initializing encryption for key file ?c:\Temp\key.txt: Cannot Access Key File: ?c:\Temp\key.txt
        at com.salesforce.dataloader.config.Config.initEncryption(Config.java:732)
        at com.salesforce.dataloader.config.Config.postLoad(Config.java:651)
        at com.salesforce.dataloader.config.Config.loadParameterOverrides(Config.java:678)
        at com.salesforce.dataloader.process.ProcessRunner.run(ProcessRunner.java:120)
        ... 2 more

My process-conf is:
<beans>
    <bean id="csvAccountExtractProcess"
          class="com.salesforce.dataloader.process.ProcessRunner"
          singleton="false">
      <description>csvAccountExtract job gets account info from salesforce and saves info into a CSV file."</description>
        <property name="name" value="csvAccountExtract"/>
        <property name="configOverrideMap">
            <map>
                <entry key="sfdc.debugMessages" value="false"/>
                <entry key="sfdc.debugMessagesFile" value="c:\dataloader\samples\status\sfdcSoapTrace.log"/>
                <entry key="sfdc.endpoint" value="https://login.salesforce.com/"/>
                <entry key="sfdc.username" value="myusername@email.com"/>
                <entry key="sfdc.password" value="b028bead3a6fa728a40c9176df0fa742"/>
                <entry key="process.encryptionKeyFile" value="‪c:\Temp\key.txt"/>
                <entry key="sfdc.timeoutSecs" value="600"/>
                <entry key="sfdc.loadBatchSize" value="200"/>
                <entry key="sfdc.entity" value="Implementation__c"/>
                <entry key="sfdc.extractionRequestSize" value="500"/>
                <entry key="sfdc.extractionSOQL" value="SELECT Name,Account_Manager__c,Account_Executive__c,Question_Reset_Allowed__c,Configuration_Notes__c,Special_Use_Cases__c,Using_Integration__c,Integration_System__c,Integration_Notes__c,Utilizes_Roles__c,Utilizes_Group_Access__c,Client_creates_new_users__c,Contact_for_New_User_Setup__c FROM Implementation__c WHERE Implementation_Stage__c != 'Inactive'"/>
                <entry key="process.operation" value="extract"/>
                <entry key="process.mappingFile" value="C:\Program Files (x86)\salesforce.com\Data Loader\bin\conf\mappings.sdl"/>
                <entry key="dataAccess.type" value="csvWrite"/>
                <entry key="dataAccess.name" value="C:\Users\User1\Documents\extract.csv"/>
            </map>
        </property>
    </bean>
</beans>
Alain CabonAlain Cabon
Hello,

Your folder c:\Temp doesn't exist probably or it lacks the file key.txt.

Error initializing encryption for key file c:\Temp\key.txt: Cannot Access Key File: c:\Temp\key.txt

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

Encrypt from the Command Line (Optionally, you can provide a key file for the encryption. In the
configuration file): http://resources.docs.salesforce.com/204/17/en-us/sfdc/pdf/salesforce_data_loader.pdf

Normally the path of Temp folder will be
C:\Users\<username>\AppData\Local\Temp

 
In order to locate temporary folder in windows 7, follow the below steps:
 
Click Start, in the search box, type CMD.
Right click on CMD and choose run as Administrator.
In the command prompt type ECHO %Temp%.
This displays the full path of the actual temp folder and you can follow the path and identify its location by copying the entire path and pasting it in Run command or in search options.

Best regards
Alain