Decryption Issue

A forum for discussing DataStage<sup>®</sup> basics. If you're not sure where your question goes, start here.

Moderators: chulett, rschirm, roy

Post Reply
Nagac
Premium Member
Premium Member
Posts: 127
Joined: Tue Mar 29, 2011 11:39 am
Location: India

Decryption Issue

Post by Nagac »

Hi

I need to decrypt the source files before processing into database using datastage. For this I have batch script which will decrypt the files and make them ready to process.

I am calling script via Command Execute Activity in Datastage, which giving error "No Secret Key". Same Command is being executed successfully when i run it manually on Server at Command Prompt using the same User ID as Datastage Execution.

For testing purpose i have created separate Sequence with the below command and executed:

Code: Select all

GPG --batch --passphrase-file I:\app\keyphrase\PassPhrase.txt --output J:\dw\out\01_20_200_0000_02012015_003005.csv --decrypt J:\dw\in\01_20_200_0000_02012015_003005.csv.gpg
Output:
Output from command ====>
gpg: encrypted with RSA key, ID 00000000
gpg: decryption failed: No secret key
qt_ky
Premium Member
Premium Member
Posts: 2895
Joined: Wed Aug 03, 2011 6:16 am
Location: USA

Post by qt_ky »

It is possible that your job actually executes under some other user account (you could add some sort of whoami command to verify) and/or likely that the run time execution environment has different settings that your command line session. Start doing some comparisons there.
Choose a job you love, and you will never have to work a day in your life. - Confucius
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Do you get a different result when running the job from dsjob versus running the job from a DataStage client?
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Nagac
Premium Member
Premium Member
Posts: 127
Joined: Tue Mar 29, 2011 11:39 am
Location: India

Post by Nagac »

Hi Ray

I don't see any difference in result of dsjob and client tool execution.

Hi qt_ky
I have checked the user id by using (id) in before routine and found the actual user and Command level the given command works fine.

What kind of comparisons we can do here??
PaulVL
Premium Member
Premium Member
Posts: 1315
Joined: Fri Dec 17, 2010 4:36 pm

Post by PaulVL »

Does the command line version work when your current working directory is the project directory (as would it would be in a command execute activity)?

Echo your env settings before doing that GBG call. Compare that with your shell settings when running manually. Maybe $PATH or some other odd setting is messing with you.


Is HOME environment variable the same for both runs?
Nagac
Premium Member
Premium Member
Posts: 127
Joined: Tue Mar 29, 2011 11:39 am
Location: India

Post by Nagac »

Yes Paul, Command worked from the Project home directory.

I could see some differences in Environment settings
Job Env:
TEMP=C:\Windows\system32\config\systemprofile\AppData\Local\Temp
TERM=nutc
TERMCAP=C:\PROGRA~2\MKSTOO~1\etc\termcap
TERMINFO=C:\PROGRA~2\MKSTOO~1\usr\lib\terminfo
TMP=C:\Windows\system32\config\systemprofile\AppData\Local\Temp
UNIVERSE_CONTROLLING_TERM=1
UNIVERSE_PARENT_PROCESS=11192
USERDOMAIN=GLOBALEXT
USERNAME=<SERVERNAME>$
USERPROFILE=C:\Windows\system32\config\systemprofile
Command Line Env:
TEMP=C:\Users\DWDATA~1.SV\AppData\Local\Temp
TERM=nutc
TERMCAP=C:\PROGRA~2\MKSTOO~1\etc\termcap
TERMINFO=C:\PROGRA~2\MKSTOO~1\usr\lib\terminfo
TMP=C:\Users\DWDATA~1.SV\AppData\Local\Temp
USERDNSDOMAIN=GLOBAL.COMP.NET
USERDOMAIN=GLOBAL
USERNAME=dsuser
USERPROFILE=C:\Users\dsuser
Where do we change the domain in Datastage??
Nagac
Premium Member
Premium Member
Posts: 127
Joined: Tue Mar 29, 2011 11:39 am
Location: India

Post by Nagac »

Thanks Guys,

I've fixed this issue by changing the User ID which runs the dsrpcd Service.

Thanks
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Can you explain what exactly that means? Changed it from what to what?
-craig

"You can never have too many knives" -- Logan Nine Fingers
Nagac
Premium Member
Premium Member
Posts: 127
Joined: Tue Mar 29, 2011 11:39 am
Location: India

Post by Nagac »

dsrpc was running by using local system account, i have changed to specific user id which have full access and i have configured gpg keys for that user.

It worked fine when i manually run a datastage Jobs. But it throws same error when i schedule datastage Job. i have configured same user in administrator schedule tab.

Do i need to configure any other place for schedule?
Post Reply