You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by GitBox <gi...@apache.org> on 2021/03/26 18:10:01 UTC
[GitHub] [shardingsphere-elasticjob] yangzhoucyl opened a new issue #1858: Elasticjob unable to get local IP address, runtime In JDK version 1.8.0_40
yangzhoucyl opened a new issue #1858:
URL: https://github.com/apache/shardingsphere-elasticjob/issues/1858
## Bug Report
### Which version of ElasticJob did you use?
- 3.0.0-RC1
### Which project did you use? ElasticJob-Lite or ElasticJob-Cloud?
- ElasticJob-Cloud
### Expected behavior
- Project Launch Successfully
### Actual behavior
> org.apache.shardingsphere.elasticjob.infra.env.HostException: ip is null
at org.apache.shardingsphere.elasticjob.infra.env.IpUtils.getIp(IpUtils.java:68)
### Reason analyze (If you can)
Version before jdk1.8.0_74 `InetAddress.isReachable()` returns incorrectly
### Steps to reproduce the behavior.
- JDK 1.8.0_73
- ElasticJob-Cloud 3.0.0-RC1
`@Test
public void assertGetIp() {
assertNotNull(IpUtils.getIp());
}`
> org.apache.shardingsphere.elasticjob.infra.env.HostException: ip is null
at org.apache.shardingsphere.elasticjob.infra.env.IpUtils.getIp(IpUtils.java:68)
at org.apache.shardingsphere.elasticjob.infra.env.IpUtilsTest.assertGetIp(IpUtilsTest.java:33)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
### Example codes for reproduce this issue (such as a github link).
--
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [shardingsphere-elasticjob] doctormacky commented on issue #1858: Elasticjob unable to get local IP address, runtime In JDK version 1.8.0_40
Posted by GitBox <gi...@apache.org>.
doctormacky commented on issue #1858:
URL: https://github.com/apache/shardingsphere-elasticjob/issues/1858#issuecomment-1016154852
Seem issue in Mac
stack trace log:
```
15:16:23.919 [main-SendThread(127.0.0.1:2181)] DEBUG org.apache.zookeeper.ClientCnxn - Reading reply session id: 0x100002f22d70008, packet:: clientPath:/elastic-job-demo/javaHttpJob/config serverPath:/elastic-job-demo/javaHttpJob/config finished:false header:: 13,12 replyHeader:: 13,21,0 request:: '/elastic-job-demo/javaHttpJob/config,F response:: v{},s{6,6,1642575279023,1642575279023,0,0,0,0,392,0,6}
Exception in thread "main" org.apache.shardingsphere.elasticjob.infra.env.HostException: ip is null
at org.apache.shardingsphere.elasticjob.infra.env.IpUtils.getIp(IpUtils.java:70)
at org.apache.shardingsphere.elasticjob.infra.handler.sharding.JobInstance.<init>(JobInstance.java:44)
at org.apache.shardingsphere.elasticjob.lite.internal.schedule.JobScheduler.registerStartUpInfo(JobScheduler.java:176)
at org.apache.shardingsphere.elasticjob.lite.internal.schedule.JobScheduler.createJobScheduleController(JobScheduler.java:140)
at org.apache.shardingsphere.elasticjob.lite.internal.schedule.JobScheduler.<init>(JobScheduler.java:104)
at org.apache.shardingsphere.elasticjob.lite.api.bootstrap.impl.ScheduleJobBootstrap.<init>(ScheduleJobBootstrap.java:40)
at com.ibm.cloud.security.job.Main.main(Main.java:18)
15:16:37.261 [main-SendThread(127.0.0.1:2181)] DEBUG org.apache.zookeeper.ClientCnxn - Got ping response for session id: 0x100002f22d70008 after 5ms.
```
--
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: notifications-unsubscribe@shardingsphere.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [shardingsphere-elasticjob] doctormacky edited a comment on issue #1858: Elasticjob unable to get local IP address, runtime In JDK version 1.8.0_40
Posted by GitBox <gi...@apache.org>.
doctormacky edited a comment on issue #1858:
URL: https://github.com/apache/shardingsphere-elasticjob/issues/1858#issuecomment-1016154852
same issue in Mac
stack trace log:
```
15:16:23.919 [main-SendThread(127.0.0.1:2181)] DEBUG org.apache.zookeeper.ClientCnxn - Reading reply session id: 0x100002f22d70008, packet:: clientPath:/elastic-job-demo/javaHttpJob/config serverPath:/elastic-job-demo/javaHttpJob/config finished:false header:: 13,12 replyHeader:: 13,21,0 request:: '/elastic-job-demo/javaHttpJob/config,F response:: v{},s{6,6,1642575279023,1642575279023,0,0,0,0,392,0,6}
Exception in thread "main" org.apache.shardingsphere.elasticjob.infra.env.HostException: ip is null
at org.apache.shardingsphere.elasticjob.infra.env.IpUtils.getIp(IpUtils.java:70)
at org.apache.shardingsphere.elasticjob.infra.handler.sharding.JobInstance.<init>(JobInstance.java:44)
at org.apache.shardingsphere.elasticjob.lite.internal.schedule.JobScheduler.registerStartUpInfo(JobScheduler.java:176)
at org.apache.shardingsphere.elasticjob.lite.internal.schedule.JobScheduler.createJobScheduleController(JobScheduler.java:140)
at org.apache.shardingsphere.elasticjob.lite.internal.schedule.JobScheduler.<init>(JobScheduler.java:104)
at org.apache.shardingsphere.elasticjob.lite.api.bootstrap.impl.ScheduleJobBootstrap.<init>(ScheduleJobBootstrap.java:40)
at com.ibm.cloud.security.job.Main.main(Main.java:18)
15:16:37.261 [main-SendThread(127.0.0.1:2181)] DEBUG org.apache.zookeeper.ClientCnxn - Got ping response for session id: 0x100002f22d70008 after 5ms.
```
--
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: notifications-unsubscribe@shardingsphere.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [shardingsphere-elasticjob] sunkai-cai commented on issue #1858: Elasticjob unable to get local IP address, runtime In JDK version 1.8.0_40
Posted by GitBox <gi...@apache.org>.
sunkai-cai commented on issue #1858:
URL: https://github.com/apache/shardingsphere-elasticjob/issues/1858#issuecomment-899186643
I think the "isReachable" method has not been worthy of checking local network。Maybe better to check the networdAddress of regCenter.
--
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: notifications-unsubscribe@shardingsphere.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [shardingsphere-elasticjob] Zihao-Liu commented on issue #1858: Elasticjob unable to get local IP address, runtime In JDK version 1.8.0_40
Posted by GitBox <gi...@apache.org>.
Zihao-Liu commented on issue #1858:
URL: https://github.com/apache/shardingsphere-elasticjob/issues/1858#issuecomment-884883517
How about Using `Socket` connect to some open ports like 22, 80, etc. after `InetAddress.isReachable()` return false
--
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: notifications-unsubscribe@shardingsphere.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [shardingsphere-elasticjob] TeslaCN commented on issue #1858: Elasticjob unable to get local IP address, runtime In JDK version 1.8.0_40
Posted by GitBox <gi...@apache.org>.
TeslaCN commented on issue #1858:
URL: https://github.com/apache/shardingsphere-elasticjob/issues/1858#issuecomment-884990940
> How about Using `Socket` connect to some open ports like 22, 80, etc. after `InetAddress.isReachable()` return false
This may not work. The final goal is find a proper IP for current environment. Testing reachable is just a way to do that.
--
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: notifications-unsubscribe@shardingsphere.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org