All Products
Search
Document Center

Enterprise Distributed Application Service:Error code: HSF-0001

Last Updated:Jun 09, 2023

Error message

HSFServiceAddressNotFoundException: This error is reported if the address of the service to be called is not found.

Description

The service to be called is xxxx, which is in the xxxx group.

Basic troubleshooting

  1. Check whether the service is published and called in a correct way.

    • Check whether the service is published. You can query the required service in the Microservices Governance console in a service environment, such as the daily environment, staging environment, and online environment.

    • Check whether the interface, version, and group parameters configured in the XML files of the service provider and consumer are consistent in the code. The code segments for these configurations are case-sensitive and cannot follow or be followed by spaces.

  2. Check whether the IP address and the High-speed Service Framework (HSF) port of the service provider are properly connected over Telnet. By default, the port number is 12200. If the IP address and the port cannot be properly connected, the firewall is enabled or the network connection fails. In this case, you must contact the relevant developers for troubleshooting.

  3. Check whether multiple network interface controllers (NICs) exist. If multiple NICs exist, use -Dhsf.server.ip to specify the IP address of the service provider.

    • In the on-premises development environment, you can set Java Virtual Machine (JVM) startup parameters.

    • In the production environment, you must contact the relevant developers for troubleshooting.

  4. Check whether the service call is early initiated. If a call is initiated before ConfigServer pushes the address, an error occurs. Add the configuration of maxWaitTimeForCsAddress to the configuration items of the service consumer. For more information, see Develop a service consumer.

Troubleshooting in the on-premises development environment

When a lightweight configuration center is used for development, no authentication is required for service publishing and subscription. Therefore, services can be registered and subscribed to after they are properly started. After basic troubleshooting, perform the following operations:

  1. Troubleshoot errors in the lightweight configuration center.

    1. Log on to the console of the lightweight configuration center, and check whether the service is published and whether the IP address and port of the service provider are correct. If the service fails to be published, troubleshoot the error by following the steps in 2.

    2. Check whether the service has been subscribed to. If the service fails to be subscribed to, troubleshoot the error by following the steps in 3.

    3. Check whether the IP address and port of the service provider can be connected over Telnet on the consumer instance.

  2. Troubleshoot an error on the service provider.

    If the service fails to be published in the lightweight configuration center console, perform the following steps for troubleshooting:

    1. Run the ping jmenv.tbsite.net command to check whether the IP address of the address server is the same as that of the lightweight configuration center.

    2. Clear the files in the /{userhome}/logs/ and /{userhome}/configclient/ directories.

    3. Start the service provider. If Tomcat has been started, restart it.

    4. Check the Tomcat startup log.

      • If the log contains no exceptions, the startup duration is displayed. Unit: ms.

      • If the log contains an exception, resolve the exception.

    5. Check the /{userhome}/configclient/logs/configclient.log file or the /{userhome}/logs/configclient/configclient.log file to determine whether the IP address of the registry connected by using Connecting to remoting://{IP address}is the same as that of the lightweight configuration center. The two files of different versions have slight differences. If the IP addresses are different, check whether the IP address of the lightweight configuration center has been changed by using -Daddress.server.ip={Accessible IP address}.

    6. Check whether the service name, version, and group are the expected ones.

    7. If [Register-ok][Publish-ok] appears, the service provider is registered with the service registry. In the development environment, the service can be registered after it is started.

    Note

    During development, multiple service providers, such as A, B, and C, may be started on the same instance. The HSF port number provided by each service provider increases in sequence from port number 12200. You can also specify the IP address and port number by using the JVM parameter -Dhsf.server.ip=<ip> -Dhsf.server.port=<port>. In the lightweight configuration center, you can check whether the provider port is consistent with the used port. If not, the call to the service provider may fail. You can update the provider port in the lightweight configuration center console, or delete the service and publish the application again.

  3. Troubleshoot an error on the service consumer.

    1. Run the ping jmenv.tbsite.net command to check whether the IP address of the address server is the same as that of the lightweight configuration center.

    2. Start the service consumer. If Tomcat has been started, restart it.

    3. Check the Tomcat startup log.

      • If the log contains no exceptions, the startup duration is displayed. Unit: ms.

      • If the log contains an exception, resolve the exception.

    4. Check the /{userhome}/configclient/logs/configclient.log file or the /{userhome}/logs/configclient/configclient.log file to determine whether the IP address of the registry connected by using Connecting to remoting://{IP address} is the same as that of the lightweight configuration center. The two files of different versions have slight differences. If the IP addresses are different, check whether the IP address of the lightweight configuration center has been changed by using -Daddress.server.ip={Accessible IP address}.

    5. Check the log for service subscription information. Check whether the specific information about the service provider is received based on [Data-received]. If the service provider information is not received, check whether the service provider is registered.

    6. Check whether the IP address and port of the service provider can be connected over Telnet on the consumer instance. If the IP address and the port cannot be properly connected, the firewall is enabled or the network connection fails. In this case, you must contact the relevant developers for troubleshooting.

Troubleshooting in the online environment

Applications managed and deployed in Enterprise Distributed Application Service (EDAS) are in the production environment that enables strict service authentication and data isolation. Due to authentication, services cannot be called among Alibaba Cloud accounts in the production environment, and services in the production environment cannot be called or accessed from the development environment.

  1. Troubleshoot an error on the service provider.

    1. Check the domain name of the address server that corresponds to -Daddress.server.domain=={Address server domain name} in the id="codeph_hor_1ki****">cat /home/admin/{taobao-tomcat directory}/bin/setenv.sh file.

    2. Run the ping {Address server domain name} command to check whether the returned IP address is normal. If the domain name fails to be pinged, the network connection fails. In this case, check the network connection.

    3. Clear the files in the /home/admin/logs/, /home/admin/configclient/, and /home/admin/{taobao-tomcat directory}/logs/ directories.

    4. Start the service provider. If Tomcat has been started, restart it.

    5. Check the /home/admin/{taobao-tomcat directory}/logs/catalina.out file.

      • If the file contains no exceptions, the startup duration is displayed. Unit: ms.

      • If the file contains an exception, resolve the exception.

    6. Check whether the /home/admin/{taobao-tomcat directory}/logs/localhost-{Date}.log file contains exceptions. If the file contains an exception, resolve the exception.

    7. Check the /home/admin/configclient/logs/configclient.log file or the /home/admin/logs/configclient/configclient.log file. The two files of different versions have slight differences. If [Register-ok][Publish-ok] appears, check whether the service name, version, and group are the expected ones. If [Publish or unregister error] appears, troubleshoot the error.

      Check the edas.hsf.xxxx version in the catalina.out log file.

      1. If the version is earlier than edas.hsf.2114.1.0, you must create the required service group. Otherwise, authentication fails. Log on to the EDAS console. In the left-side navigation pane, choose Traffic Management > Microservices Governance > HSF > Service Groups to check whether the service group of the application is created.

      2. If the version is edas.hsf.2114.1.0 or later, multi-tenant data isolation is provided. You do not need to create a service group. The service is registered twice: registered based on tenants and registered based on groups. Tenant-based registration is always successful. Group-based registration may fail but does not affect service calls.

        2018-07-19 10:28:44.716|ERROR|[] [] [%s] [Publish or unregister error] spas-authentication-failed! dataId:com.alibaba.edas.testcase.api.TestCase:1.0.0 group:test error:java.lang.Error: A receivedRevision:2 tenant:DEFAULT_TENANT
        2018-07-19 10:28:44.717|INFO|[] [] [] [Register-ok] Publisher (HSFProvider-com.alibaba.edas.testcase.api.TestCase:1.0.0.2 for com.alibaba.edas.testcase.api.TestCase:1.0.0)Tenant:0846c173-decf-4b47-xxxxxxxx in group test in env default
        2018-07-19 10:28:44.717|INFO|[] [] [] [Publish-ok] dataId=com.alibaba.edas.testcase.api.TestCase:1.0.0, clientId=HSFProvider-com.alibaba.edas.testcase.api.TestCase:1.0.0.2, datumId=ecu:ed5b9d2b-a276-4ad7-b7b9-14e432ff****:192.168.xx.xx,tenant=0846c173-decf-4b47-xxxxxxxx, rev=2, env=default                                       

        The preceding error logs show that authentication by using tenant:DEFAULT_TENANT fails, but service publishing by using tenant=0846c173-decf-4b47-xxxxxxxx succeeds. Ensure that at least one authentication operation is successful.

      3. If [Register-ok][Publish-ok] appears in the returned message, the service provider is registered with the service registry.

  2. Troubleshoot an error on the service consumer.

    1. Run the cat /home/admin/{taobao-tomcat directory}/bin/setenv.sh command to check the domain name of the address server that corresponds to -Daddress.server.domain={Address server domain name}.

    2. Run the ping {Address server domain name} command to check whether the returned IP address is normal. If the domain name fails to be pinged, the network connection fails. In this case, check the network connection.

    3. Clear the files in the /home/admin/logs/, /home/admin/configclient/, and /home/admin/{taobao-tomcat directory}/logs/ directories.

    4. Start the service consumer. If Tomcat has been started, restart it.

    5. Check the /home/admin/{taobao-tomcat directory}/logs/catalina.out file.

      • If the file contains no exceptions, the startup duration is displayed. Unit: ms.

      • If the file contains an exception, resolve the exception.

    6. Check whether the /home/admin/{taobao-tomcat directory}/logs/localhost-{Date}.log file contains exceptions. If the file contains an exception, resolve the exception.

    7. Check the /home/admin/configclient/logs/configclient.log file or the /home/admin/logs/configclient/configclient.log file for service subscription information. The two files of different versions have slight differences. Search for the required service and check whether the specific information about the service provider is received based on [Data-received] in the returned message. If the service provider information is not received, check whether the service provider is registered.

    8. Check whether the IP address and port of the service provider can be connected over Telnet on the consumer instance. If the IP address and the port cannot be properly connected, the firewall is enabled or the network connection fails. In this case, you must contact the relevant developers for troubleshooting.

    9. Troubleshoot an error by using related logs.

      1. Check the subscription services by the consumer in /home/admin/configclient/snapshot/DEFAULT_ENV/.

        [root@iZ2ze26awga24ijh93152dZ com.alibaba.edas.carshop.itemcenter.ItemService:1.0.0]# cat HSF-0846c173-decf-4b47-8aa0-xxxxxx.dat
                                        [
                                        "192.168.xx.xx:12200?_p\u003dhessian2\u0026_ENV\u003dDEFAULT\u0026v\u003d2.0\u0026_TIMEOUT\u003d3000\u0026_ih2\u003dy\u0026_TID\u003d0846c173-decf-4b47-8aa0-04b5a561****\u0026_SERIALIZETYPE\u003dhessian\u0026_auth\u003dy"
                                        ]
                                                
      2. Check the service call errors in the /home/admin/logs/hsf/hsf.log file.

      3. Check the heartbeat check logs of the consumer and the provider in the /home/admin/logs/hsf/hsf-remoting.log file.

        01 2018-06-20 12:35:00.797 ERROR [HSF-Worker-2-thread-1:hsf.remoting] [] [] [HSF-0085] [remoting] fail to connect: /192.168.xx.xx:12200 in timeout: 4000
                                                

        The preceding log shows that a persistent TCP connection cannot be established between the consumer and the provider.

        1. Check whether the service that corresponds to the instance IP address is started and whether the related port such as port 12200 is being listened to.

        2. If the service is started and the port is being listened to, check whether the port of the provider is accessible over Telnet on the consumer.