Problem description
An error occurs when I deploy an application. The application cannot be started due to an exception in the Nacos configuration file.
Cause
An exception exists in the Nacos configuration file.
Solution
- Check whether the microservices configurations of the application are queried. Go to the endpoint of the application instance page. In the diamond or nacos directory, run the following command to check whether the microservices configurations are configured:
find / -name "${Data ID}"
Expected results:
- For Elastic Compute Service (ECS) applications, the following information shown in the figure is expected after you run the preceding command.
- For Kubernetes applications, the following information shown in the figure is expected after you run the preceding command.
- For Elastic Compute Service (ECS) applications, the following information shown in the figure is expected after you run the preceding command.
- Perform the following operations based on the query result.
- If no microservices configuration is queried, perform the following operations.
- Check the Nacos client version of the application and make sure that the version meets the requirements of the corresponding EDAS registry.
- Check whether the application and configuration belong to the same microservices namespace, and make sure that no application is configured in the configuration.
- Check whether the data ID and group that are configured for the microservices are valid. For more information about the data ID of a Spring Boot application, see Nacos Spring Cloud.
- Check whether a user-defined Nacos client version is used.
- If unexpected microservices configurations are queried, perform the following operations.
- Check whether the data ID and group that are configured for the microservices are valid. For more information about the data ID of a Spring Boot application, see Nacos Spring Cloud.
- Check whether the microservices configurations are garbled. If the configurations are garbled, downgrade the Nacos client to a version earlier than 1.3. Note If you are using Spring Cloud Alibaba, change the version of Spring Cloud Alibaba to 2.2.6.RELEASE. This will fix the issue of garbled text.
- If no microservices configuration is queried, perform the following operations.