You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@servicecomb.apache.org by "luanwenfei-venus (via GitHub)" <gi...@apache.org> on 2023/08/15 01:53:37 UTC

[GitHub] [servicecomb-service-center] luanwenfei-venus opened a new issue, #1424: 在服务注册时,注册失败,应该是HostName超过最大的64个字符

luanwenfei-venus opened a new issue, #1424:
URL: https://github.com/apache/servicecomb-service-center/issues/1424

   **Describe the bug**
   我在测试中使用的Local-cse,我的服务向local-cse注册时,出现了如下错误:
   `
   org.apache.servicecomb.service.center.client.exception.OperationException: register service instance fails, statusCode = 400; message = Bad Request; content = {"errorCode":"400001","errorMessage":"Invalid parameter(s)","detail":"field 'MicroServiceInstance.HostName' invalid value 'fv-az1030-247.0z3bz3dbib5etlgfrg5jtymgxc.cx.internal.cloudapp.net' does not match rule: {Min: 1, Max: 64, Regexp: \\S+}"}
   	at org.apache.servicecomb.service.center.client.ServiceCenterClient.registerMicroserviceInstance(ServiceCenterClient.java:214)
   	at org.apache.servicecomb.service.center.client.ServiceCenterRegistration$RegisterMicroserviceInstanceTask.execute(ServiceCenterRegistration.java:223)
   	at org.apache.servicecomb.http.client.task.AbstractTask.lambda$startTask$1(AbstractTask.java:84)
   	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
   	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
   	at java.lang.Thread.run(Thread.java:750)
   `
   目前来看,是我的微服务HostName超过了最大的64个字符长度,因为测试使用的是github分配的机器,我无法指定我自己的HostName和网络的主DNS,所以这个名称我无法控制,想了解这个字符长度的限制是出于什么原因?我该如何解决这个问题?
   
   **To Reproduce**
   Steps to reproduce the behavior:
   1. 利用github的Action运行local-cse并且有应用发起注册,github将会分配机器,让应用运行
   
   **Expected behavior**
   应用注册成功
   
   **Platform And Runtime (please complete the following information):**
   
   Platform
    - OS: [Ubuntu]
    - Browser [e.g. chrome, safari]
    - Version [Local-CSE-2.1.3-linux-amd64]
   
   **Additional context**
   目前来看spring-cloud-common中的InetUtils中有个convertAddress方法,把HostName和主DNS拼接形成了一个新的HostName,单HostName没有那么长


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@servicecomb.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [servicecomb-service-center] liubao68 commented on issue #1424: 在服务注册时,注册失败,应该是HostName超过最大的64个字符

Posted by "liubao68 (via GitHub)" <gi...@apache.org>.
liubao68 commented on issue #1424:
URL: https://github.com/apache/servicecomb-service-center/issues/1424#issuecomment-1734722812

   @luanwenfei-venus   你使用的 spring cloud huawei吗?最新版本对 hostname 做了substring 处理。 这个属性只用于展示, 目前没使用。 https://github.com/huaweicloud/spring-cloud-huawei/pull/1072


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@servicecomb.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] 在服务注册时,注册失败,应该是HostName超过最大的64个字符 [servicecomb-service-center]

Posted by "luanwenfei-venus (via GitHub)" <gi...@apache.org>.
luanwenfei-venus commented on issue #1424:
URL: https://github.com/apache/servicecomb-service-center/issues/1424#issuecomment-1751546427

   > @luanwenfei-venus 你使用的 spring cloud huawei吗?最新版本对 hostname 做了substring 处理。 这个属性只用于展示, 目前没使用。 [huaweicloud/spring-cloud-huawei#1072](https://github.com/huaweicloud/spring-cloud-huawei/pull/1072)
   用的不是springcloudhuawei,您说的我理解了,如果仅用于展示,substring的话没问题,感谢
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@servicecomb.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] 在服务注册时,注册失败,应该是HostName超过最大的64个字符 [servicecomb-service-center]

Posted by "luanwenfei-venus (via GitHub)" <gi...@apache.org>.
luanwenfei-venus closed issue #1424: 在服务注册时,注册失败,应该是HostName超过最大的64个字符
URL: https://github.com/apache/servicecomb-service-center/issues/1424


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@servicecomb.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [servicecomb-service-center] liubao68 commented on issue #1424: 在服务注册时,注册失败,应该是HostName超过最大的64个字符

Posted by "liubao68 (via GitHub)" <gi...@apache.org>.
liubao68 commented on issue #1424:
URL: https://github.com/apache/servicecomb-service-center/issues/1424#issuecomment-1728658286

   @luanwenfei-venus 我看spring cloud huawei是通过    `InetAddress.getLocalHost()` 读取的hostname
   
   '''
    InetAddress localHost = InetAddress.getLocalHost();
         hostName = localHost.getHostName();  
   '''
   
   这个是JDK的接口。 没发现你说的 convertAddress方法。 
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@servicecomb.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org