Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Docker 中容器无法联网 #126

Open
Calmact opened this issue Sep 11, 2021 · 25 comments
Open

Docker 中容器无法联网 #126

Calmact opened this issue Sep 11, 2021 · 25 comments

Comments

@Calmact
Copy link

Calmact commented Sep 11, 2021

docker运行在单臂软路由的Lean源码单臂路由器,wan和lan都用eth0接口进行通信,Docker 的网络应该如何设置呢?
下面是logread|grep docker

Sat Sep 11 15:19:27 2021 kern.info kernel: [58309.306863] docker0: port 1(veth70e8c40) entered blocking state
Sat Sep 11 15:19:27 2021 kern.info kernel: [58309.307204] docker0: port 1(veth70e8c40) entered disabled state
Sat Sep 11 15:19:27 2021 kern.info kernel: [58309.308208] docker0: port 1(veth70e8c40) entered blocking state
Sat Sep 11 15:19:27 2021 kern.info kernel: [58309.308548] docker0: port 1(veth70e8c40) entered forwarding state
Sat Sep 11 15:19:27 2021 kern.info kernel: [58309.309515] docker0: port 1(veth70e8c40) entered disabled state
Sat Sep 11 15:19:35 2021 daemon.err dockerd[6040]: time="2021-09-11T15:19:35.033166253+08:00" level=info msg="starting signal loop" namespace=moby path=/tmp/run/docker/containerd/daemon/io.
containerd.runtime.v2.task/moby/59ca536dcde8b29978e94b38dc9cca32b128d92f3cb8a4740b98dea076b5d558 pid=11005
Sat Sep 11 15:19:35 2021 kern.info kernel: [58317.514713] docker0: port 1(veth70e8c40) entered blocking state
Sat Sep 11 15:19:35 2021 kern.info kernel: [58317.515052] docker0: port 1(veth70e8c40) entered forwarding state
Sat Sep 11 15:19:35 2021 daemon.notice netifd: bridge 'docker0' link is up
Sat Sep 11 15:19:35 2021 daemon.notice netifd: Interface 'docker' has link connectivity
Sat Sep 11 15:20:44 2021 daemon.err dockerd[6040]: time="2021-09-11T15:20:44.274783221+08:00" level=error msg="copy shim log" error="read /proc/self/fd/7: file already closed"
Sat Sep 11 15:20:45 2021 kern.info kernel: [58388.121527] docker0: port 1(veth70e8c40) entered disabled state
Sat Sep 11 15:20:46 2021 daemon.notice netifd: bridge 'docker0' link is down
Sat Sep 11 15:20:46 2021 daemon.notice netifd: Interface 'docker' has link connectivity loss
Sat Sep 11 15:20:48 2021 kern.info kernel: [58391.269585] docker0: port 1(veth70e8c40) entered disabled state
Sat Sep 11 15:20:49 2021 kern.info kernel: [58391.273259] docker0: port 1(veth70e8c40) entered disabled state
Sat Sep 11 15:21:01 2021 kern.info kernel: [58403.875883] docker0: port 1(vethd22b7fc) entered blocking state
Sat Sep 11 15:21:01 2021 kern.info kernel: [58403.876221] docker0: port 1(vethd22b7fc) entered disabled state
Sat Sep 11 15:21:11 2021 daemon.err dockerd[6040]: time="2021-09-11T15:21:11.124898099+08:00" level=info msg="starting signal loop" namespace=moby path=/tmp/run/docker/containerd/daemon/io.
containerd.runtime.v2.task/moby/59ca536dcde8b29978e94b38dc9cca32b128d92f3cb8a4740b98dea076b5d558 pid=11703
Sat Sep 11 15:21:11 2021 daemon.notice netifd: bridge 'docker0' link is up
Sat Sep 11 15:21:11 2021 daemon.notice netifd: Interface 'docker' has link connectivity
Sat Sep 11 15:21:11 2021 kern.info kernel: [58413.617968] docker0: port 1(vethd22b7fc) entered blocking state
Sat Sep 11 15:21:11 2021 kern.info kernel: [58413.618304] docker0: port 1(vethd22b7fc) entered forwarding state
Sat Sep 11 15:21:14 2021 daemon.err dockerd[6040]: time="2021-09-11T15:21:14.659074632+08:00" level=error msg="copy shim log" error="read /proc/self/fd/7: file already closed"
Sat Sep 11 15:21:17 2021 kern.info kernel: [58420.084892] docker0: port 1(vethd22b7fc) entered disabled state
Sat Sep 11 15:21:18 2021 daemon.notice netifd: bridge 'docker0' link is down
Sat Sep 11 15:21:18 2021 daemon.notice netifd: Interface 'docker' has link connectivity loss
Sat Sep 11 15:21:19 2021 kern.info kernel: [58421.715312] docker0: port 1(vethd22b7fc) entered disabled state
Sat Sep 11 15:21:19 2021 kern.info kernel: [58421.718745] docker0: port 1(vethd22b7fc) entered disabled state

容器内的webdav-aliyundriver无法联网,日志显示:

tdout: 2021-09-11 15:55:14.775  INFO 1 --- [           main] c.g.z.w.WebdavTeambitionApplication      : Starting WebdavTeambitionApplication v2.4.0 using Java 11.0.12 on webdav-aliyundriver with PID 1 (/webdav.jar started by root in /)
stdout: 2021-09-11 15:55:14.784  INFO 1 --- [           main] c.g.z.w.WebdavTeambitionApplication      : No active profile set, falling back to default profiles: default
stdout: 2021-09-11 15:55:17.235  INFO 1 --- [           main] o.s.b.w.embedded.tomcat.TomcatWebServer  : Tomcat initialized with port(s): 8080 (http)
stdout: 2021-09-11 15:55:17.263  INFO 1 --- [           main] o.apache.catalina.core.StandardService   : Starting service [Tomcat]
stdout: 2021-09-11 15:55:17.264  INFO 1 --- [           main] org.apache.catalina.core.StandardEngine  : Starting Servlet engine: [Apache Tomcat/9.0.41]
stdout: 2021-09-11 15:55:17.365  INFO 1 --- [           main] o.a.c.c.C.[Tomcat].[localhost].[/]       : Initializing Spring embedded WebApplicationContext
stdout: 2021-09-11 15:55:17.366  INFO 1 --- [           main] w.s.c.ServletWebServerApplicationContext : Root WebApplicationContext: initialization completed in 2382 ms
stdout: 2021-09-11 15:56:18.148  WARN 1 --- [           main] ConfigServletWebServerApplicationContext : Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'aliYunDriverClientService' defined in URL [jar:file:/webdav.jar!/BOOT-INF/classes!/com/github/zxbu/webdavteambition/store/AliYunDriverClientService.class]: Unsatisfied dependency expressed through constructor parameter 0; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'teambitionClient' defined in class path resource [com/github/zxbu/webdavteambition/config/AliYunDriverAutoConfig.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [com.github.zxbu.webdavteambition.client.AliYunDriverClient]: Factory method 'teambitionClient' threw exception; nested exception is net.sf.webdav.exceptions.WebdavException: java.net.SocketTimeoutException: connect timed out
stdout: 2021-09-11 15:56:18.155  INFO 1 --- [           main] o.apache.catalina.core.StandardService   : Stopping service [Tomcat]
stdout: 2021-09-11 15:56:18.188  INFO 1 --- [           main] ConditionEvaluationReportLoggingListener : 
stdout: 
stdout: Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled.
stdout: 2021-09-11 15:56:18.261 ERROR 1 --- [           main] o.s.boot.SpringApplication               : Application run failed
stdout: 
stdout: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'aliYunDriverClientService' defined in URL [jar:file:/webdav.jar!/BOOT-INF/classes!/com/github/zxbu/webdavteambition/store/AliYunDriverClientService.class]: Unsatisfied dependency expressed through constructor parameter 0; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'teambitionClient' defined in class path resource [com/github/zxbu/webdavteambition/config/AliYunDriverAutoConfig.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [com.github.zxbu.webdavteambition.client.AliYunDriverClient]: Factory method 'teambitionClient' threw exception; nested exception is net.sf.webdav.exceptions.WebdavException: java.net.SocketTimeoutException: connect timed out
stdout: 	at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:800) ~[spring-beans-5.3.2.jar!/:5.3.2]
stdout: 	at org.springframework.beans.factory.support.ConstructorResolver.autowireConstructor(ConstructorResolver.java:229) ~[spring-beans-5.3.2.jar!/:5.3.2]
stdout: 	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireConstructor(AbstractAutowireCapableBeanFactory.java:1356) ~[spring-beans-5.3.2.jar!/:5.3.2]
stdout: 	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1206) ~[spring-beans-5.3.2.jar!/:5.3.2]
stdout: 	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:571) ~[spring-beans-5.3.2.jar!/:5.3.2]
stdout: 	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:531) ~[spring-beans-5.3.2.jar!/:5.3.2]
stdout: 	at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:335) ~[spring-beans-5.3.2.jar!/:5.3.2]
stdout: 	at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234) ~[spring-beans-5.3.2.jar!/:5.3.2]
stdout: 	at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:333) ~[spring-beans-5.3.2.jar!/:5.3.2]
stdout: 	at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:208) ~[spring-beans-5.3.2.jar!/:5.3.2]
stdout: 	at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:944) ~[spring-beans-5.3.2.jar!/:5.3.2]
stdout: 	at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:923) ~[spring-context-5.3.2.jar!/:5.3.2]
stdout: 	at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:588) ~[spring-context-5.3.2.jar!/:5.3.2]
stdout: 	at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:144) ~[spring-boot-2.4.1.jar!/:2.4.1]
stdout: 	at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:767) ~[spring-boot-2.4.1.jar!/:2.4.1]
stdout: 	at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:759) ~[spring-boot-2.4.1.jar!/:2.4.1]
stdout: 	at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:426) ~[spring-boot-2.4.1.jar!/:2.4.1]
stdout: 	at org.springframework.boot.SpringApplication.run(SpringApplication.java:326) ~[spring-boot-2.4.1.jar!/:2.4.1]
stdout: 	at org.springframework.boot.SpringApplication.run(SpringApplication.java:1309) ~[spring-boot-2.4.1.jar!/:2.4.1]
stdout: 	at org.springframework.boot.SpringApplication.run(SpringApplication.java:1298) ~[spring-boot-2.4.1.jar!/:2.4.1]
stdout: 	at com.github.zxbu.webdavteambition.WebdavTeambitionApplication.main(WebdavTeambitionApplication.java:19) ~[classes!/:2.4.0]
stdout: 	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:na]
stdout: 	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:na]
stdout: 	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:na]
stdout: 	at java.base/java.lang.reflect.Method.invoke(Method.java:566) ~[na:na]
stdout: 	at org.springframework.boot.loader.MainMethodRunner.run(MainMethodRunner.java:49) ~[webdav.jar:2.4.0]
stdout: 	at org.springframework.boot.loader.Launcher.launch(Launcher.java:107) ~[webdav.jar:2.4.0]
stdout: 	at org.springframework.boot.loader.Launcher.launch(Launcher.java:58) ~[webdav.jar:2.4.0]
stdout: 	at org.springframework.boot.loader.JarLauncher.main(JarLauncher.java:88) ~[webdav.jar:2.4.0]
stdout: Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'teambitionClient' defined in class path resource [com/github/zxbu/webdavteambition/config/AliYunDriverAutoConfig.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [com.github.zxbu.webdavteambition.client.AliYunDriverClient]: Factory method 'teambitionClient' threw exception; nested exception is net.sf.webdav.exceptions.WebdavException: java.net.SocketTimeoutException: connect timed out
stdout: 	at org.springframework.beans.factory.support.ConstructorResolver.instantiate(ConstructorResolver.java:658) ~[spring-beans-5.3.2.jar!/:5.3.2]
stdout: 	at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:638) ~[spring-beans-5.3.2.jar!/:5.3.2]
stdout: 	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:1336) ~[spring-beans-5.3.2.jar!/:5.3.2]
stdout: 	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1179) ~[spring-beans-5.3.2.jar!/:5.3.2]
stdout: 	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:571) ~[spring-beans-5.3.2.jar!/:5.3.2]
stdout: 	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:531) ~[spring-beans-5.3.2.jar!/:5.3.2]
stdout: 	at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:335) ~[spring-beans-5.3.2.jar!/:5.3.2]
stdout: 	at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234) ~[spring-beans-5.3.2.jar!/:5.3.2]
stdout: 	at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:333) ~[spring-beans-5.3.2.jar!/:5.3.2]
stdout: 	at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:208) ~[spring-beans-5.3.2.jar!/:5.3.2]
stdout: 	at org.springframework.beans.factory.config.DependencyDescriptor.resolveCandidate(DependencyDescriptor.java:276) ~[spring-beans-5.3.2.jar!/:5.3.2]
stdout: 	at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1367) ~[spring-beans-5.3.2.jar!/:5.3.2]
stdout: 	at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1287) ~[spring-beans-5.3.2.jar!/:5.3.2]
stdout: 	at org.springframework.beans.factory.support.ConstructorResolver.resolveAutowiredArgument(ConstructorResolver.java:887) ~[spring-beans-5.3.2.jar!/:5.3.2]
stdout: 	at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:791) ~[spring-beans-5.3.2.jar!/:5.3.2]
stdout: 	... 28 common frames omitted
stdout: Caused by: org.springframework.beans.BeanInstantiationException: Failed to instantiate [com.github.zxbu.webdavteambition.client.AliYunDriverClient]: Factory method 'teambitionClient' threw exception; nested exception is net.sf.webdav.exceptions.WebdavException: java.net.SocketTimeoutException: connect timed out
stdout: 	at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:185) ~[spring-beans-5.3.2.jar!/:5.3.2]
stdout: 	at org.springframework.beans.factory.support.ConstructorResolver.instantiate(ConstructorResolver.java:653) ~[spring-beans-5.3.2.jar!/:5.3.2]
stdout: 	... 42 common frames omitted
stdout: Caused by: net.sf.webdav.exceptions.WebdavException: java.net.SocketTimeoutException: connect timed out
stdout: 	at com.github.zxbu.webdavteambition.client.AliYunDriverClient.post(AliYunDriverClient.java:156) ~[classes!/:2.4.0]
stdout: 	at com.github.zxbu.webdavteambition.client.AliYunDriverClient.init(AliYunDriverClient.java:85) ~[classes!/:2.4.0]
stdout: 	at com.github.zxbu.webdavteambition.client.AliYunDriverClient.<init>(AliYunDriverClient.java:75) ~[classes!/:2.4.0]
stdout: 	at com.github.zxbu.webdavteambition.config.AliYunDriverAutoConfig.teambitionClient(AliYunDriverAutoConfig.java:22) ~[classes!/:2.4.0]
stdout: 	at com.github.zxbu.webdavteambition.config.AliYunDriverAutoConfig$$EnhancerBySpringCGLIB$$9402a86a.CGLIB$teambitionClient$0(<generated>) ~[classes!/:2.4.0]
stdout: 	at com.github.zxbu.webdavteambition.config.AliYunDriverAutoConfig$$EnhancerBySpringCGLIB$$9402a86a$$FastClassBySpringCGLIB$$ba5e15f1.invoke(<generated>) ~[classes!/:2.4.0]
stdout: 	at org.springframework.cglib.proxy.MethodProxy.invokeSuper(MethodProxy.java:244) ~[spring-core-5.3.2.jar!/:5.3.2]
stdout: 	at org.springframework.context.annotation.ConfigurationClassEnhancer$BeanMethodInterceptor.intercept(ConfigurationClassEnhancer.java:331) ~[spring-context-5.3.2.jar!/:5.3.2]
stdout: 	at com.github.zxbu.webdavteambition.config.AliYunDriverAutoConfig$$EnhancerBySpringCGLIB$$9402a86a.teambitionClient(<generated>) ~[classes!/:2.4.0]
stdout: 	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:na]
stdout: 	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:na]
stdout: 	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:na]
stdout: 	at java.base/java.lang.reflect.Method.invoke(Method.java:566) ~[na:na]
stdout: 	at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:154) ~[spring-beans-5.3.2.jar!/:5.3.2]
stdout: 	... 43 common frames omitted
stdout: Caused by: java.net.SocketTimeoutException: connect timed out
stdout: 	at java.base/java.net.PlainSocketImpl.socketConnect(Native Method) ~[na:na]
stdout: 	at java.base/java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:399) ~[na:na]
stdout: 	at java.base/java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:242) ~[na:na]
stdout: 	at java.base/java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:224) ~[na:na]
stdout: 	at java.base/java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392) ~[na:na]
stdout: 	at java.base/java.net.Socket.connect(Socket.java:609) ~[na:na]
stdout: 	at okhttp3.internal.platform.Platform.connectSocket(Platform.java:130) ~[okhttp-3.14.9.jar!/:na]
stdout: 	at okhttp3.internal.connection.RealConnection.connectSocket(RealConnection.java:263) ~[okhttp-3.14.9.jar!/:na]
stdout: 	at okhttp3.internal.connection.RealConnection.connect(RealConnection.java:183) ~[okhttp-3.14.9.jar!/:na]
stdout: 	at okhttp3.internal.connection.ExchangeFinder.findConnection(ExchangeFinder.java:224) ~[okhttp-3.14.9.jar!/:na]
stdout: 	at okhttp3.internal.connection.ExchangeFinder.findHealthyConnection(ExchangeFinder.java:108) ~[okhttp-3.14.9.jar!/:na]
stdout: 	at okhttp3.internal.connection.ExchangeFinder.find(ExchangeFinder.java:88) ~[okhttp-3.14.9.jar!/:na]
stdout: 	at okhttp3.internal.connection.Transmitter.newExchange(Transmitter.java:169) ~[okhttp-3.14.9.jar!/:na]
stdout: 	at okhttp3.internal.connection.ConnectInterceptor.intercept(ConnectInterceptor.java:41) ~[okhttp-3.14.9.jar!/:na]
stdout: 	at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:142) ~[okhttp-3.14.9.jar!/:na]
stdout: 	at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:117) ~[okhttp-3.14.9.jar!/:na]
stdout: 	at okhttp3.internal.cache.CacheInterceptor.intercept(CacheInterceptor.java:94) ~[okhttp-3.14.9.jar!/:na]
stdout: 	at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:142) ~[okhttp-3.14.9.jar!/:na]
stdout: 	at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:117) ~[okhttp-3.14.9.jar!/:na]
stdout: 	at okhttp3.internal.http.BridgeInterceptor.intercept(BridgeInterceptor.java:93) ~[okhttp-3.14.9.jar!/:na]
stdout: 	at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:142) ~[okhttp-3.14.9.jar!/:na]
stdout: 	at okhttp3.internal.http.RetryAndFollowUpInterceptor.intercept(RetryAndFollowUpInterceptor.java:88) ~[okhttp-3.14.9.jar!/:na]
stdout: 	at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:142) ~[okhttp-3.14.9.jar!/:na]
stdout: 	at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:117) ~[okhttp-3.14.9.jar!/:na]
stdout: 	at com.github.zxbu.webdavteambition.client.AliYunDriverClient$2.intercept(AliYunDriverClient.java:41) ~[classes!/:2.4.0]
stdout: 	at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:142) ~[okhttp-3.14.9.jar!/:na]
stdout: 	at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:117) ~[okhttp-3.14.9.jar!/:na]
stdout: 	at okhttp3.RealCall.getResponseWithInterceptorChain(RealCall.java:229) ~[okhttp-3.14.9.jar!/:na]
stdout: 	at okhttp3.RealCall.execute(RealCall.java:81) ~[okhttp-3.14.9.jar!/:na]
stdout: 	at com.github.zxbu.webdavteambition.client.AliYunDriverClient.post(AliYunDriverClient.java:148) ~[classes!/:2.4.0]
stdout: 	... 56 common frames omitted
stdout: 

接口只保留了LAN和WAN
image
防火墙这样设置的,不知道对不对
image

@lisaac
Copy link
Owner

lisaac commented Sep 12, 2021

http://blog.ick.im/#/posts/7

@acooler15
Copy link
Contributor

之前使用lean的luci-app-docker时好像也遇到过不能联网的问题

@Calmact
Copy link
Author

Calmact commented Sep 13, 2021

@acooler15 是怎么解决的呢?还是重新安装了Dockerman?

@acooler15
Copy link
Contributor

@acooler15 是怎么解决的呢?还是重新安装了Dockerman?

跟dockerman没啥关系,luci-app-dockerdockerd倒是有关系。

编译的时候就把luci-app-docker去掉了,不过/etc/config/dockerd配置文件可能也需要重新配置。

luci-app-docker覆盖了dockerd/etc/init.d/dockerd以及配置文件/etc/config/dockerd,直接opkg remove luci-app-docker可能会导致docker无法启动,还需要重新安装dockerd(opkg install --force-reinstall dockerd),感觉麻烦,索性就重新编译固件,在编译时去掉了luci-app-docker

@acooler15
Copy link
Contributor

acooler15 commented Sep 13, 2021

image
我去,啥情况,反单引号重叠,都看不见了😂github的markdown编辑器的样式出问题了?还是我浏览器的问题?
找到原因了。。。是windows字体Segoe UI Variable的问题,现在好像只有win 11有这个字体

@Calmact
Copy link
Author

Calmact commented Sep 13, 2021

@acooler15 我这里显示正常的,用的eSir 的x86固件,安装在U盘里。关键是上次安装成功过,运行了几天手贱把U盘查到了Win10上,结果overlay分区毁坏,然后重装了openwrt也不行了

@acooler15
Copy link
Contributor

@acooler15 我这里显示正常的,用的eSir 的x86固件,安装在U盘里。关键是上次安装成功过,运行了几天手贱把U盘查到了Win10上,结果overlay分区毁坏,然后重装了openwrt也不行了

额,我现在用的树莓派做的软路由,用的openwrt 21.02分支自己编译的,使用的是ext4格式的,没有overlay(当然也没有恢复出厂设置的功能了。。。)

@Saxon-Sun
Copy link

@acooler15 是怎么解决的呢?还是重新安装了Dockerman?

跟dockerman没啥关系,luci-app-dockerdockerd倒是有关系。

编译的时候就把luci-app-docker去掉了,不过/etc/config/dockerd配置文件可能也需要重新配置。

luci-app-docker覆盖了dockerd/etc/init.d/dockerd以及配置文件/etc/config/dockerd,直接opkg remove luci-app-docker可能会导致docker无法启动,还需要重新安装dockerd(opkg install --force-reinstall dockerd),感觉麻烦,索性就重新编译固件,在编译时去掉了luci-app-docker

大佬 我编译去掉luci-app-docker 容器就在dockerman里面丢失找不到了 选上luci-app-docker才能在dockerman容器里显示出来

@acooler15
Copy link
Contributor

acooler15 commented Sep 20, 2021

@acooler15 是怎么解决的呢?还是重新安装了Dockerman?

跟dockerman没啥关系,luci-app-dockerdockerd倒是有关系。
编译的时候就把luci-app-docker去掉了,不过/etc/config/dockerd配置文件可能也需要重新配置。
luci-app-docker覆盖了dockerd/etc/init.d/dockerd以及配置文件/etc/config/dockerd,直接opkg remove luci-app-docker可能会导致docker无法启动,还需要重新安装dockerd(opkg install --force-reinstall dockerd),感觉麻烦,索性就重新编译固件,在编译时去掉了luci-app-docker

大佬 我编译去掉luci-app-docker 容器就在dockerman里面丢失找不到了 选上luci-app-docker才能在dockerman容器里显示出来

如果是编译时加的luci-app-dockerman,可以试着把luci-app-dockerman也去掉,保存下配置后,再把luci-app-dockerman勾上。这样一般会恢复luci-app-dockerman的默认依赖勾选。

也可以手动勾上luci-app-dockerman的依赖,现在luci-app-dockerman的依赖有

luci-compat : 位置在LuCI -> Modules 里
luci-lib-docker:位置在LuCI -> Collections 里
luci-lib-ip:位置在LUCI -> Libraries 里
docker:位置在 Utilities 里
dockerd:位置在 Utilities 里
ttyd: 位置在 Utilities -> Terminal里

@Saxon-Sun
Copy link

@acooler15 是怎么解决的呢?还是重新安装了Dockerman?

跟dockerman没啥关系,luci-app-dockerdockerd倒是有关系。
编译的时候就把luci-app-docker去掉了,不过/etc/config/dockerd配置文件可能也需要重新配置。
luci-app-docker覆盖了dockerd/etc/init.d/dockerd以及配置文件/etc/config/dockerd,直接opkg remove luci-app-docker可能会导致docker无法启动,还需要重新安装dockerd(opkg install --force-reinstall dockerd),感觉麻烦,索性就重新编译固件,在编译时去掉了luci-app-docker

大佬 我编译去掉luci-app-docker 容器就在dockerman里面丢失找不到了 选上luci-app-docker才能在dockerman容器里显示出来

如果是编译时加的luci-app-dockerman,可以试着把luci-app-dockerman也去掉,保存下配置后,再把luci-app-dockerman勾上。这样一般会恢复luci-app-dockerman的默认依赖勾选。

也可以手动勾上luci-app-dockerman的依赖,现在luci-app-dockerman的依赖有

luci-compat : 位置在LuCI -> Modules 里
luci-lib-docker:位置在LuCI -> Collections 里
luci-lib-ip:位置在LUCI -> Libraries 里
docker:位置在 Utilities 里
dockerd:位置在 Utilities 里
ttyd: 位置在 Utilities -> Terminal里

谢谢 已经解决了 因为之前一直用lean的luci-app-docker,luci-app-docker配置的Docker 根目录是在/opt/目录下面 而luci-app-dockerman配置的Docker 根目录是在/opt/docker目录下面 导致之前的容器找不到 把配置改了一下就可以正常显示之前容器了

@acooler15
Copy link
Contributor

@acooler15 是怎么解决的呢?还是重新安装了Dockerman?

跟dockerman没啥关系,luci-app-dockerdockerd倒是有关系。
编译的时候就把luci-app-docker去掉了,不过/etc/config/dockerd配置文件可能也需要重新配置。
luci-app-docker覆盖了dockerd/etc/init.d/dockerd以及配置文件/etc/config/dockerd,直接opkg remove luci-app-docker可能会导致docker无法启动,还需要重新安装dockerd(opkg install --force-reinstall dockerd),感觉麻烦,索性就重新编译固件,在编译时去掉了luci-app-docker

大佬 我编译去掉luci-app-docker 容器就在dockerman里面丢失找不到了 选上luci-app-docker才能在dockerman容器里显示出来

如果是编译时加的luci-app-dockerman,可以试着把luci-app-dockerman也去掉,保存下配置后,再把luci-app-dockerman勾上。这样一般会恢复luci-app-dockerman的默认依赖勾选。
也可以手动勾上luci-app-dockerman的依赖,现在luci-app-dockerman的依赖有

luci-compat : 位置在LuCI -> Modules 里
luci-lib-docker:位置在LuCI -> Collections 里
luci-lib-ip:位置在LUCI -> Libraries 里
docker:位置在 Utilities 里
dockerd:位置在 Utilities 里
ttyd: 位置在 Utilities -> Terminal里

谢谢 已经解决了 因为之前一直用lean的luci-app-docker,luci-app-docker配置的Docker 根目录是在/opt/目录下面 而luci-app-dockerman配置的Docker 根目录是在/opt/docker目录下面 导致之前的容器找不到 把配置改了一下就可以正常显示之前容器了

额,忘了,如果现在容器内还无法联网,可以查看配置文件/etc/config/dockerd或者使用命令uci show dockerd,里面可能有:

config firewall 'firewall'
	option device 'docker0'
	list blocked_interfaces 'wan'
#	option extra_iptables_args '--match conntrack ! --ctstate RELATED,ESTABLISHED' # allow outbound connections

这段配置,可以把它全删了,或者添加option extra_iptables_args '--match conntrack ! --ctstate RELATED,ESTABLISHED' 这个配置。

如果使用的是lean的固件,而且有在用lean的luci-app-shadowsocksr,docker容器有连接外网的需求。可以在路由器shadowsocksr -> 访问控制 -> 接口控制中勾选上docker接口。如果是使用的其它固件,但也在用luci-app-shadowsocksr,可能还需要先使用命令network.docker.ifname='docker0'; uci commit network;配置下。

@Calmact
Copy link
Author

Calmact commented Sep 22, 2021

@lisaac @Saxon-Sun @acooler15 @feckert
容器不能连外网,应该是dockerd的问题,拆卸后强制重装解决了问题

opkg update
opkg install dockerd --force-reinstall
service dockerd restart

不能连容器端口,目前发现docker容器启动后,每次都要重新重启防火墙service firewall restart

@Calmact
Copy link
Author

Calmact commented Sep 22, 2021

@lisaac @Saxon-Sun @acooler15 @feckert
又出现一个新问题

Containers: restart XXXXX...code:500 Cannot restart container XXXXX: driver failed programming external connectivity on endpoint webdav-aliyundriver (XXXXXXXX):  (iptables failed: iptables --wait -t nat -A DOCKER -p tcp -d 0/0 --dport 9187 -j DNAT --to-destination 172.17.0.2:8080 ! -i docker0: iptables: No chain/target/match by that name

@acooler15
Copy link
Contributor

@lisaac @Saxon-Sun @acooler15 @feckert
又出现一个新问题

Containers: restart XXXXX...code:500 Cannot restart container XXXXX: driver failed programming external connectivity on endpoint webdav-aliyundriver (XXXXXXXX):  (iptables failed: iptables --wait -t nat -A DOCKER -p tcp -d 0/0 --dport 9187 -j DNAT --to-destination 172.17.0.2:8080 ! -i docker0: iptables: No chain/target/match by that name

/etc/init.d/dockerd restart重启一下试试。

@Calmact
Copy link
Author

Calmact commented Sep 22, 2021

@lisaac @Saxon-Sun @acooler15 @feckert
又出现一个新问题

Containers: restart XXXXX...code:500 Cannot restart container XXXXX: driver failed programming external connectivity on endpoint webdav-aliyundriver (XXXXXXXX):  (iptables failed: iptables --wait -t nat -A DOCKER -p tcp -d 0/0 --dport 9187 -j DNAT --to-destination 172.17.0.2:8080 ! -i docker0: iptables: No chain/target/match by that name

/etc/init.d/dockerd restart重启一下试试。
重启是可以恢复正常,但是好麻烦,是啥原因造成这个错误呢?容器运行个几十分钟就会出这个错误,然后重启dockerd之后还要再重启下firewall。
是因为我的软路由是单臂路由,只有eth0端口,没有br-lan虚拟网络么?

@acooler15
Copy link
Contributor

acooler15 commented Sep 22, 2021

@lisaac @Saxon-Sun @acooler15 @feckert
又出现一个新问题

Containers: restart XXXXX...code:500 Cannot restart container XXXXX: driver failed programming external connectivity on endpoint webdav-aliyundriver (XXXXXXXX):  (iptables failed: iptables --wait -t nat -A DOCKER -p tcp -d 0/0 --dport 9187 -j DNAT --to-destination 172.17.0.2:8080 ! -i docker0: iptables: No chain/target/match by that name

/etc/init.d/dockerd restart重启一下试试。
重启是可以恢复正常,但是好麻烦,是啥原因造成这个错误呢?容器运行个几十分钟就会出这个错误,然后重启dockerd之后还要再重启下firewall。
是因为我的软路由是单臂路由,只有eth0端口,没有br-lan虚拟网络么?

应该不是,出现这种情况应该与防火墙有关。
可能是防火墙关闭了,也有可能是防火墙规则清空了。防火墙重启也会导致规则清空

@Saxon-Sun
Copy link

@acooler15 你好 发现一个问题 当每天5点计划任务重新拨号后(/sbin/ifup wan),容器中获取不到ip了 必须要重启容器才行 这是什么问题呀

@lisaac
Copy link
Owner

lisaac commented Sep 24, 2021

@lisaac @Saxon-Sun @acooler15 @feckert
容器不能连外网,应该是dockerd的问题,拆卸后强制重装解决了问题

opkg update
opkg install dockerd --force-reinstall
service dockerd restart

不能连容器端口,目前发现docker容器启动后,每次都要重新重启防火墙service firewall restart

重启防火墙显然时非常不正确的做法,会导致dockerd启动时创建的防火墙规则都清空,势必会影响接下来docker/容器的使用。

其实最简单粗暴的办法就是去掉官方 /etc/init.d/dockerd 中接口及防火墙相关的内容,于此同时,不要使用 lean 的luci-app-docker禁用wan功能

@lisaac
Copy link
Owner

lisaac commented Sep 24, 2021

@acooler15 你好 发现一个问题 当每天5点计划任务重新拨号后(/sbin/ifup wan),容器中获取不到ip了 必须要重启容器才行 这是什么问题呀

容器存于什么类型的网络,获取不到ip具体是指什么?

@Saxon-Sun
Copy link

@acooler15 你好 发现一个问题 当每天5点计划任务重新拨号后(/sbin/ifup wan),容器中获取不到ip了 必须要重启容器才行 这是什么问题呀

容器存于什么类型的网络,获取不到ip具体是指什么?

MACVLAN类型网络
3

@acooler15
Copy link
Contributor

@acooler15 你好 发现一个问题 当每天5点计划任务重新拨号后(/sbin/ifup wan),容器中获取不到ip了 必须要重启容器才行 这是什么问题呀

macvlan没有用过。。。是单网口的路由器吗?

@Saxon-Sun
Copy link

@acooler15 你好 发现一个问题 当每天5点计划任务重新拨号后(/sbin/ifup wan),容器中获取不到ip了 必须要重启容器才行 这是什么问题呀

macvlan没有用过。。。是单网口的路由器吗?
#126 (comment) 看这里介绍...

@sokingshen
Copy link

lan桥接接口要打勾才能联网

@Xunflash
Copy link

Xunflash commented Feb 3, 2022

@acooler15 是怎么解决的呢?还是重新安装了Dockerman?

跟dockerman没啥关系,luci-app-dockerdockerd倒是有关系。
编译的时候就把luci-app-docker去掉了,不过/etc/config/dockerd配置文件可能也需要重新配置。
luci-app-docker覆盖了dockerd/etc/init.d/dockerd以及配置文件/etc/config/dockerd,直接opkg remove luci-app-docker可能会导致docker无法启动,还需要重新安装dockerd(opkg install --force-reinstall dockerd),感觉麻烦,索性就重新编译固件,在编译时去掉了luci-app-docker

大佬 我编译去掉luci-app-docker 容器就在dockerman里面丢失找不到了 选上luci-app-docker才能在dockerman容器里显示出来

如果是编译时加的luci-app-dockerman,可以试着把luci-app-dockerman也去掉,保存下配置后,再把luci-app-dockerman勾上。这样一般会恢复luci-app-dockerman的默认依赖勾选。
也可以手动勾上luci-app-dockerman的依赖,现在luci-app-dockerman的依赖有

luci-compat : 位置在LuCI -> Modules 里
luci-lib-docker:位置在LuCI -> Collections 里
luci-lib-ip:位置在LUCI -> Libraries 里
docker:位置在 Utilities 里
dockerd:位置在 Utilities 里
ttyd: 位置在 Utilities -> Terminal里

谢谢 已经解决了 因为之前一直用lean的luci-app-docker,luci-app-docker配置的Docker 根目录是在/opt/目录下面 而luci-app-dockerman配置的Docker 根目录是在/opt/docker目录下面 导致之前的容器找不到 把配置改了一下就可以正常显示之前容器了

额,忘了,如果现在容器内还无法联网,可以查看配置文件/etc/config/dockerd或者使用命令uci show dockerd,里面可能有:

config firewall 'firewall'
	option device 'docker0'
	list blocked_interfaces 'wan'
#	option extra_iptables_args '--match conntrack ! --ctstate RELATED,ESTABLISHED' # allow outbound connections

这段配置,可以把它全删了,或者添加option extra_iptables_args '--match conntrack ! --ctstate RELATED,ESTABLISHED' 这个配置。

如果使用的是lean的固件,而且有在用lean的luci-app-shadowsocksr,docker容器有连接外网的需求。可以在路由器shadowsocksr -> 访问控制 -> 接口控制中勾选上docker接口。如果是使用的其它固件,但也在用luci-app-shadowsocksr,可能还需要先使用命令network.docker.ifname='docker0'; uci commit network;配置下。

大佬,我有固定ip的需求,于是自建了一个bridge类型网络,但是这个网络好像不和docker0接口绑定,因此ssr也失效了,这种情况怎么办呢,我新发了个issue详细说明

@lozn00
Copy link

lozn00 commented Aug 9, 2023

@lisaac @Saxon-Sun @acooler15 @feckert
又出现一个新问题

Containers: restart XXXXX...code:500 Cannot restart container XXXXX: driver failed programming external connectivity on endpoint webdav-aliyundriver (XXXXXXXX):  (iptables failed: iptables --wait -t nat -A DOCKER -p tcp -d 0/0 --dport 9187 -j DNAT --to-destination 172.17.0.2:8080 ! -i docker0: iptables: No chain/target/match by that name

/etc/init.d/dockerd restart重启一下试试。
重启是可以恢复正常,但是好麻烦,是啥原因造成这个错误呢?容器运行个几十分钟就会出这个错误,然后重启dockerd之后还要再重启下firewall。
是因为我的软路由是单臂路由,只有eth0端口,没有br-lan虚拟网络么?

应该不是,出现这种情况应该与防火墙有关。 可能是防火墙关闭了,也有可能是防火墙规则清空了。防火墙重启也会导致规则清空

去掉就麻烦了

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants