Tag Archives: nacos

How to Solve Seata Nacos connection error: unknown user!

Seata connects to nacos and keeps reporting errors,

<html><body><h1>Whitelabel Error Page</h1><p>This application has no explicit mapping for /error, so you are seeing this as a fallback.</p>
<div id='created'> Fri Jul 23 14:28:47 GMT+08:00 2021</div><div>There was an unexpected error (type=Forbidden, status=403).</div>
<div>unknown user!</div>

The error is very simple, it is unknown user!

Check log, log path

/root/logs/nacos/naming.log
Sure enough, I found the clues, because my password has the @ symbol, and when seata passed it, it was escaped to %40. I tested it, and other examples! It will also be escaped, remove the special characters in the password, modify the nacos password, and the connection is successful.

Unknownhostexception: XXX, an error is reported when using the Nacos remote call service (load balancing)

Remember, this kind of error occurs in the future because @ loadbalanced is not added to the getresttemplate () method in the configuration file of the consumer side to enable the load balancing function, so Nacos reports the error of “no host found”!

The front-end request error page is as follows:

 

Cause analysis:

1. First of all, Nacos has its own load balancing function. Why?Please see the figure below:

 

2. Because Nacos integrates ribbon, you can use resttemplate to remotely call the service for load balancing, and then successfully find the service under the Nacos registration service center. You just don’t know what algorithm to use to select the service provider, so an error is reported – no host exception is found.

 

  Solution:

Add “@ loadbalanced” above the method to get resttemplate in the configuration file to enable the load balancing function.

Done!

Error in uploading configuration file using Nacos

  1. Error in importing configuration file using Nacos: no legal data is read, please check the imported data file

 

 

compared with the files exported in the naocs server, it is found that there is a level 1 directory missing. You need to create a folder with the name of the group
because the namespace can be selected when Nacos uploads files, but the group will not be selected, the Nacos server identifies and reports an error

2. Create a folder named default_Group, then put the configuration file in, package and upload successfully