Skip to content

Personal tools
You are here: Home » DB2 » DB2 Distributed (UDB) Articles Archive » “Error get TCP proto by name” Error When Calling a Web Service from DB2 Universal Database: A Simple Fix to a Big Problem
Seeking new owner for this high-traffic site.
Tap into the potential of this DBA community to expand your business! Interested? Contact us today.
Who Are You?
I am a:
Mainframe True Believer
Distributed Fast-tracker

[ Results | Polls ]
Votes : 3561

“Error get TCP proto by name” Error When Calling a Web Service from DB2 Universal Database: A Simple Fix to a Big Problem

by Paul C. Zikopoulos

I’m pretty diligent about securing my computer. I run anti-virus protection software, I am always up-to-date with protection profiles, and I always have a firewall running. I’ve purchased two different scanning programs to keep everything on my machine alive and well. Heck, I can’t even book a rental car online with my company’s preferred vendor because of the cookie control I’ve defined for my system.

And yet, out of nowhere, I started to experience problems when calling Web services from IBM® DB2® Universal Database™ (DB2 UDB), and even when calling DB2 UDB stored procedures from Microsoft® Access (yes, you can do that). This problem stumped me for quite some time. When I finally took the time to solve it, I was shocked to learn that my computer had been infected with a virus. A virus! How could it be, with all that protection?

In this article, I detail the problem that occurred on my machine, and show you how I was able to get things working again. I hope to spare you the weeks of research that I had to do.

Before We Start

Before I get into detailing the problem, I’ll first give you the framework in which the problem occurred. DB2 UDB has very powerful Web services support, encapsulating the ability to host, consume, and create these services with mere ‘clicks’ of a button.

I created a DB2 UDB function that calls a public Web service that converts one currency into another. The Web service is hosted on the X Methods Web site. The function I created to call this Web service is shown below:

As you can see, I used Visual Studio.NET® (VS.NET) to build my DB2 UDB function, but you could use the DB2 Development Center, IBM® WebSphere® Studio Application Developer, the command line, or whatever other development framework you’re used to.

After creating the DB2 UDB function that calls this currency conversion Web service, I used VS.NET to test it. VS.NET lets me do this from the IBM Explorer window plug-in (showcasing one of the rich DB2 UDB integration features with VS.NET).

Testing this function in VS.NET is simple: you just put in the currencies as input into the function (as shown below):

DB2 UDB connects to the Internet, invokes the Web service with the two input parameters. (In this case, I am requesting the conversion rate between the EURO and the US dollar.) The results are returned to the integrated application development environment (IDE), as shown below:

Of course, I could have done this from the command line processor.

If you have followed along on your own computer and got these results, you have nothing to worry about. (But read on; you might be able to help someone else.)

The Problem

The DB2 UDB function that calls the Web service outlined in the previous section worked well for a long time. Then one day, it suddenly stopped working. Invoking the same Web service gave me the following error:

The Research (with a whole lot of thanks to Dirk Wollscheid)

The “Error get TCP proto by name” error occurs when the getprotobyname network function returns an error. This is very rare. The first step was to take a DB2 UDB trace to try to figure out with development what was going on. (I masked the trace with the *.*.147.*.* mask.)

A DB2 UDB trace can reveal what the DB2 UDB code is doing, but it won’t necessarily explain why the function is failing. From the trace, my developer and I were able to find out that the DB2 UDB SOAP code was calling a Windows® operating system function (getprotobyname) and was getting an 11004 return code. This return code means that there’s no data for this TCP/IP protocol.

At this point, I knew what the problem was, but had no idea how to fix it or how it got there. I recruited some folks I knew in service, but we still had our problems.

A lucky Web hit on Google implied that it could have been a virus among other possible causes; either way, I knew I was onto something.

The Google hit has a number of potential causes, but it did lead me to investigate my services file since I knew the error had something to do with TCP/IP. It’s not every day that I go looking into the windows/system32/drivers/etc directory, but what I found was shocking:

Not only were a number of files missing, but there was also a new file called quotes, and a new directory called export in its parent directory (which I never created).

The quotes file looked like this:

Well, I wouldn’t have minded having a personal collection of literary quotes; somehow, this wasn’t what I had in mind when I installed DB2 UDB.

The services file created even more concern:

The Solution

I am neither a virus nor a TCP/IP expert, but even I knew I had to clean up my services file and deal with this quotes file.

This is where things can get a little confusing. I continually flash my 80 GB drive to two backup drives so I’ll never experience that feeling of ‘losing it all’. I was able to solve this problem on my production machine. Since I had two copies of my drive, I decided to try the solution on my other two drives. On the first backup drive, I had the DB2 UDB function working after step three; however, my system seemed to become unstable and crash often. On the second drive, I tried the first four steps, which seemed to work fine.

Below are the steps that I used to solve the problem and I’ve not had any problems since. Perhaps some are not needed, but they worked for me without issue — and for the most part, the extra steps are actually good things to do to your system anyway.

To resolve the issue outlined in this article, perform the following steps:

1) Get rid of that quotes file! This is easier said than done. Whatever virus put that file there puts some sort of protection on the file so that you can’t easily delete it. I deleted this file by rebooting to a command line shell and removing the file manually.

2) Edit out the entries in the services file that are highlighted in the previous figure.

3) Replace your missing files in your etc\ directory — they were moved (seemingly untouched, from what I can see) to the windows\system32\export\ directory.

4) Run some sort of scanning and cleaning software to remove trackers, spy ware, and so on from your machine. I tried a number of different tools on my machine, but the latest version of SpyBot was the one that seemed to do the trick. Download, install, and run this tool to clean up your system.

5) Scan your system for the qhosts virus (it’s a kind of Trojan virus). I used Symantec’s removal tool, which you can download free of charge from the Web.

If you’re following along, I hope this worked for you and that you’re back up and running. If this doesn’t solve things — call service! If you only read this article out of interest, and not necessity, then maybe the steps outlined in this article will help you fix someone else’s problem.

Remember, this article details how I solved this problem; perhaps I could have avoided some steps all together, or should have performed others. What I do know is that my system is back up and running without problems or incident, and that’s what’s making me smile these days!


Paul C. Zikopoulos, BA, MBA, is an award-winning writer and speaker with the IBM Database Competitive Technology team. He has more than nine years of experience with DB2 UDB and has written numerous magazine articles and books about it. Paul has co-authored the books: DB2 Version 8: The Official Guide, DB2: The Complete Reference, DB2 Fundamentals Certification for Dummies, DB2 for Dummies, and A DBA's Guide to Databases on Linux. Paul is a DB2 Certified Advanced Technical Expert (DRDA and Cluster/EEE) and a DB2 Certified Solutions Expert (Business Intelligence and Database Administration). You can reach him at:

Trademarks and Disclaimers
DB2, DB2 Universal Database, and IBM are trademarks or registered trademarks of International Business Machines Corporation in the United States, other countries, or both.
Microsoft and Windows are registered trademarks of Microsoft Corporation in the United States, other countries, or both.
Other company, product, and service names may be trademarks or service marks of others.
The opinions, solutions, and advice in this article are from the author’s experience and not intended to represent official communication from IBM. Neither the author nor IBM is liable for any of the contents in, or the actions that result from reading, this article. Problems with DB2 UDB should be directed through service. The author used the products detailed in this article as a result of his own personal experiences and satisfaction with them. The freeware products used to solve this problem are in no way endorsed by the author nor IBM – there are other products that can be used to clean you system.

Contributors : Paul C. Zikopoulos
Last modified 2005-04-12 06:21 AM
Transaction Management
Reduce downtime and increase repeat sales by improving end-user experience.
Free White Paper
Database Recovery
Feeling the increased demands on data protection and storage requirements?
Download Free Report!

Powered by Plone