Informix Error -55251: Could not translate service name 'shost-name', getservbyname( ) failed.
Cause and resolution
Could not translate service name 'shost-name', getservbyname( ) failed.
A service that was intended for use by DB/Cockpit must be defined with the 'tcp' protocol name.
Service-name resolution follows this precedence:
1. NIS services map when NIS (Network Information Service) is running. If you added a new service to the /etc/services file on the NIS server, run the 'ypmake' command to update the services map. Check whether the 'ypcat services' command returns the specified service.
2. File /etc/services on the local computer.
Oninit® Troubleshooting Guidance
Reasons / Common Causes
-55251 fires when getservbyname() can't resolve the service name used by onprobe/oncockpit
— per the official guidance, a service intended for use by DB/Cockpit must be defined with the
tcp protocol name, and resolution follows a documented precedence.
- The service not defined with the
tcpprotocol name, per the official guidance — the named requirement. - The NIS services map not updated, per the official guidance, if NIS is running and a new
service was added only to the local
/etc/services. - The service simply missing from
/etc/serviceson the local computer, per the official guidance's second precedence step.
Solutions / Resolution
- Confirm the service is defined with the
tcpprotocol, per the official guidance. - If NIS is running, run
ypmaketo update the services map after adding a service to/etc/serviceson the NIS server, per the official guidance, and confirm withypcat services. - Check
/etc/serviceson the local computer, per the official guidance's second precedence step, if NIS isn't in play.
Examples
Checking NIS propagation
$ ypcat services | grep <service-name>
Per the official guidance, this confirms whether a newly added service has actually propagated through the NIS services map.
Diagnostic Checks
- Confirm the service uses the
tcpprotocol name. - Check NIS propagation with
ypcat services, if NIS is running. - Check
/etc/serviceson the local computer as the fallback precedence step.
Related Errors / Related Topics
- -55250 — "socket() failed." The step before this one in the same connection chain.
- -55252 — "bind() using service... failed." The next step in the same chain.
- -55274 — "Could not translate host name... gethostbyname() failed." The equivalent resolution failure for host names rather than service names.
- -55276 — "connect() to host... using service... failed." The final step in the same chain.
The service name couldn't be resolved — confirm it's defined with the tcp protocol, then check
NIS propagation (ypcat services) or local /etc/services per the documented precedence.