Giter Site home page Giter Site logo

Comments (6)

MikeWang000000 avatar MikeWang000000 commented on July 23, 2024

这个和 Natter 关系不大,看起来是 Docker 或者是操作系统的问题。

首先先测试下您的 Docker 是否能正常创建网络:

docker network create test_net
docker network rm test_net

如果上面命令失败了,先排查 Docker 出现的故障吧。


另外为了方便定位问题,麻烦提供下相关版本号:

uname -a
cat /etc/os-release
iptables --version
docker version

from natter.

despire1119 avatar despire1119 commented on July 23, 2024

确实是我的系统问题,以下是我可以查到的信息:

  1. 系统版本:
    Linux AS6704T-5FDB 5.13.x #1 SMP Wed Mar 13 00:11:10 CST 2024 x86_64 GNU/Linux

  2. iptables version:

iptables v1.8.4 (legacy)
  1. 运行docker network create test_net
Error response from daemon: Failed to program FILTER chain: iptables failed: iptables --wait -I FORWARD -o br-3e42f43f0721 -j DOCKER: iptables v1.8.4 (legacy): Couldn't load target `DOCKER':No such file or directory

Try `iptables -h' or 'iptables --help' for more information.
 (exit status 2)
root@AS6704T-5FDB:/volume1/natterISO # docker network create test_net
Error response from daemon: Failed to program FILTER chain: iptables failed: iptables --wait -I FORWARD -o br-0a438d66b352 -j DOCKER: iptables v1.8.4 (legacy): Couldn't load target `DOCKER':No such file or directory

Try `iptables -h' or 'iptables --help' for more information.
 (exit status 2)
  1. docker版本:
Client:
 Version:           25.0.3
 API version:       1.44
 Go version:        go1.21.6
 Git commit:        4debf41
 Built:             Tue Feb  6 21:13:00 2024
 OS/Arch:           linux/amd64
 Context:           default

Server: Docker Engine - Community
 Engine:
  Version:          25.0.3
  API version:      1.44 (minimum version 1.24)
  Go version:       go1.21.6
  Git commit:       f417435
  Built:            Tue Feb  6 21:13:08 2024
  OS/Arch:          linux/amd64
  Experimental:     false
 containerd:
  Version:          v1.7.13
  GitCommit:        7c3aca7a610df76212171d200ca3811ff6096eb8
 runc:
  Version:          1.1.12
  GitCommit:        v1.1.12-0-g51d5e94
 docker-init:
  Version:          0.19.0
  GitCommit:        de40ad0

from natter.

MikeWang000000 avatar MikeWang000000 commented on July 23, 2024

不知道什么原因,你的系统缺少了 Docker 相关的 chain。
如果是 NAS 专用操作系统,可以向有关厂商提单。

不过,可以尝试通过下面的方式手动补回来。

iptables -t filter -N DOCKER
iptables -t filter -N DOCKER-ISOLATION-STAGE-1
iptables -t filter -N DOCKER-ISOLATION-STAGE-2
iptables -t filter -N DOCKER-USER
iptables -t nat -N DOCKER

另外,也可以规避创建网络,就是在 docker-compose.yml 里加上 network_mode: bridge

from natter.

despire1119 avatar despire1119 commented on July 23, 2024

感谢回复,按照大佬的方法尝试手补,提示nat已存在,于是又运行了一次docker compose up,成功了(虽然不知道咋回事)。

但在成功运行的log中有一行/usr/bin/env: ‘python3\r’: No such file or directory,服务端口可以正常访问,不知这个抛出有何影响?

[+] Running 2/0
 ✔ Container natteriso-nginx-1            Created                                                                               0.0s 
 ✔ Container natteriso-natter-nginx-cf-1  Created                                                                               0.0s 
Attaching to natter-nginx-cf-1, nginx-1
nginx-1            | /docker-entrypoint.sh: /docker-entrypoint.d/ is not empty, will attempt to perform configuration
nginx-1            | /docker-entrypoint.sh: Looking for shell scripts in /docker-entrypoint.d/
nginx-1            | /docker-entrypoint.sh: Launching /docker-entrypoint.d/10-listen-on-ipv6-by-default.sh
nginx-1            | 10-listen-on-ipv6-by-default.sh: info: IPv6 listen already enabled
nginx-1            | /docker-entrypoint.sh: Sourcing /docker-entrypoint.d/15-local-resolvers.envsh
nginx-1            | /docker-entrypoint.sh: Launching /docker-entrypoint.d/20-envsubst-on-templates.sh
nginx-1            | /docker-entrypoint.sh: Launching /docker-entrypoint.d/30-tune-worker-processes.sh
nginx-1            | /docker-entrypoint.sh: Configuration complete; ready for start up
nginx-1            | 2024/03/21 13:18:43 [notice] 1#1: using the "epoll" event method
nginx-1            | 2024/03/21 13:18:43 [notice] 1#1: nginx/1.25.4
nginx-1            | 2024/03/21 13:18:43 [notice] 1#1: built by gcc 12.2.0 (Debian 12.2.0-14) 
nginx-1            | 2024/03/21 13:18:43 [notice] 1#1: OS: Linux 5.13.x
nginx-1            | 2024/03/21 13:18:43 [notice] 1#1: getrlimit(RLIMIT_NOFILE): 1024:4096
nginx-1            | 2024/03/21 13:18:43 [notice] 1#1: start worker processes
nginx-1            | 2024/03/21 13:18:43 [notice] 1#1: start worker process 21
nginx-1            | 2024/03/21 13:18:43 [notice] 1#1: start worker process 22
nginx-1            | 2024/03/21 13:18:43 [notice] 1#1: start worker process 23
nginx-1            | 2024/03/21 13:18:43 [notice] 1#1: start worker process 24
natter-nginx-cf-1  | 2024-03-21 13:18:44 [I] Natter v2.0.0-rc3
natter-nginx-cf-1  | 2024-03-21 13:18:49 [I] 
natter-nginx-cf-1  | 2024-03-21 13:18:49 [I] tcp://192.168.1.107:2335 <--socket--> tcp://192.168.1.107:44463 <--Natter--> tcp://-:-
natter-nginx-cf-1  | 2024-03-21 13:18:49 [I] 
natter-nginx-cf-1  | 2024-03-21 13:18:49 [I] Calling script: /opt/cf-redir.py
natter-nginx-cf-1  | /usr/bin/env: ‘python3\r’: No such file or directory
natter-nginx-cf-1  | /usr/bin/env: use -[v]S to pass options in shebang lines
natter-nginx-cf-1  | 2024-03-21 13:18:49 [I] LAN > -    [ OPEN ]
natter-nginx-cf-1  | 2024-03-21 13:18:49 [I] LAN > -   [ OPEN ]
natter-nginx-cf-1  | 2024-03-21 13:18:49 [I] LAN > -   [ OPEN ]
natter-nginx-cf-1  | 2024-03-21 13:18:51 [I] WAN > -   [ OPEN ]
natter-nginx-cf-1  | 2024-03-21 13:18:51 [I] 

感谢

from natter.

MikeWang000000 avatar MikeWang000000 commented on July 23, 2024

原因是:你使用的是Windows的记事本编辑的脚本文件。
换行符格式与Linux不兼容。

请删除这个脚本,使用专用代码编辑器例如:VSCode, Notepad3 等,根据原文件重新修改。

from natter.

despire1119 avatar despire1119 commented on July 23, 2024

Sorry, 我自罚一杯,感谢回复。

from natter.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.