Routine DSSendMail did not finish OK, return code = '-21'

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
GowthamSen
Participant
Posts: 21
Joined: Tue Nov 02, 2010 2:36 pm
Location: India

Routine DSSendMail did not finish OK, return code = '-21'

Post by GowthamSen »

Hi,

I am using "Notification Activity" in a Job Sequence.

When I provide the mail server address as "my server address", getting an error message as "Routine DSSendMail did not finish OK, return code = '-21''.

Any idea, what could be the issue?

Thanks a lot in advance.
Thank you,
Regards

Gowtham
(Learning DS)
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Learn about the Search capability in DSXchange. Indeed, this very question has already been asked (and answered) this week.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

No solution yet, though.

Probably a silly question, but you don't mean you literally put the words "my server address" in the stage, do you? :?
-craig

"You can never have too many knives" -- Logan Nine Fingers
GowthamSen
Participant
Posts: 21
Joined: Tue Nov 02, 2010 2:36 pm
Location: India

Post by GowthamSen »

ray.wurlod wrote:Learn about the Search capability in DSXchange. Indeed, this very question has already been asked (and answered) this week.
Hi,

I did search. But didn't find any. Even I searched again after your suggestion. But couldn't find any.
Thank you,
Regards

Gowtham
(Learning DS)
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

You may have missed it since we posted simultaneously but I did link you to the post I assume Ray was mentioning.
-craig

"You can never have too many knives" -- Logan Nine Fingers
GowthamSen
Participant
Posts: 21
Joined: Tue Nov 02, 2010 2:36 pm
Location: India

Post by GowthamSen »

Hi chulett ,

Sorry for late reply.

I gave the correct mail server address, which is my company's mail server address.

I verified the file dssendmai_template.txt file. Its having the default options set during installation.
* On Windows NT to run "dssmtpmail.exe", the template looks like this:
<file>
From: %from%
To: %to%
Subject: %subject%
Server: %server%

%body%
</file>
%dsdir%\bin\dssmtpmail.exe -file %file%
In addition to the above text specified lot of description available before and after this text.

Am I missing anything here. I have searched the link provided by you. But it was not helpful.
Thank you,
Regards

Gowtham
(Learning DS)
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

As noted, there was no solution posted in that other link. However, there is a debugging technique mentioned by Arnd, I would advise you to attempt the same.
-craig

"You can never have too many knives" -- Logan Nine Fingers
GowthamSen
Participant
Posts: 21
Joined: Tue Nov 02, 2010 2:36 pm
Location: India

Post by GowthamSen »

Yes Chulett. But my DS is installed on Windows 2003 server.

I am not sure, how can I do the similar task.

Could you please help me in this?
Thank you,
Regards

Gowtham
(Learning DS)
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

OK, try googling for this rather than the UNIX flavor that Arnd posted: "debugging batch files". Also, if you have a full error message, much like was posted in the linked thread about 'error when executing command', can you post the contents of the referenced command file?
-craig

"You can never have too many knives" -- Logan Nine Fingers
GowthamSen
Participant
Posts: 21
Joined: Tue Nov 02, 2010 2:36 pm
Location: India

Post by GowthamSen »

Hi,

Here is the command output:
Demo_Sequence_mail..JobControl (DSSendMail): Error when executing command: C:\IBM\InformationServer\Server\Projects\Tutorial\sendmail_Demo_Sequence_mail_58421446_12232.bat
*** Output from command was: ***
SMTPMail Looking up server...
SMTPMail Opening connection to zz.zzz.com...
SMTPMail Unknown failure!
SMTPMail Error in trying to connect
SMTPMail Network error 10051

Please check any paths in the following command file are correct, and if necessary adjust the 'dssendmail_template.txt' file in the project directory.

Contents of command file:
C:\IBM\InformationServer\Server\DSEngine\bin\dssmtpmail.exe -file sendmail_Demo_Sequence_mail_58421446_12232_file.tmp

Demo_Sequence_mail..JobControl (@Notification_Activity_36): Routine DSSendMail did not finish OK, return code = '-21'
Thank you,
Regards

Gowtham
(Learning DS)
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

You need to take those SMTPMail errors to whomever administers that server and see what they think is going on.
-craig

"You can never have too many knives" -- Logan Nine Fingers
vinnz
Participant
Posts: 92
Joined: Tue Feb 17, 2004 9:23 pm

Post by vinnz »

Did you check the contents of the generated command file ?

Code: Select all

Please check any paths in the following command file are correct, and if necessary adjust the 'dssendmail_template.txt' file in the project directory. 
Contents of command file: 
C:\IBM\InformationServer\Server\DSEngine\bin\dssmtpmail.exe -file sendmail_Demo_Sequence_mail_58421446_12232_file.tmp 
GowthamSen
Participant
Posts: 21
Joined: Tue Nov 02, 2010 2:36 pm
Location: India

Post by GowthamSen »

Thanks Vinz for your reply. It helped me to realize that, the issue might be with teh SMTP server.

I tried direclty using the command. Its showing the actual error message as "Unable to locate server."

When I provided the server as "mail.google.com", its showing some issue with server.
SMTPMail Looking up server...
SMTPMail Opening connection to mail.google.com...
SMTPMail Error in trying to connect
SMTPMail Network error 10051
SMTPMail Unknown failure!

Chulett,

As you suggested, I cannot check with the server admin. As I am using my company server without prior permission, I won't be able to get the help from them. I am working on a test machine.
Thank you,
Regards

Gowtham
(Learning DS)
asorrell
Posts: 1707
Joined: Fri Apr 04, 2003 2:00 pm
Location: Colleyville, Texas

Post by asorrell »

1) You may need an entry in your /etc/hosts file for the smtp server.
2) Google isn't going to like you trying to use their server to send DataStage messages
3) Even if you can "see" the system once /etc/hosts is done, you might not get email to work. Email admins have the ability to reject email requests from non-authorized systems.
Andy Sorrell
Certified DataStage Consultant
IBM Analytics Champion 2009 - 2020
Post Reply