huan / docker-simple-mail-forwarder

Simplest and Smallest Email Forward Service based on Docker.
https://hub.docker.com/r/zixia/simple-mail-forwarder/
Apache License 2.0
544 stars 86 forks source link

Waiting for IP address x.x.x.x to be reachable, then fail #39

Closed Pitasi closed 6 years ago

Pitasi commented 6 years ago

Hi! I used this image before and it was working great. I moved to a Rancher 2 (Kubernetes) installation and I'm trying to figure out why it's not working anymore. I correctly exposed the port 25 to my host as usual, the full log is here (relevant part at the bottom):

Logs

``` >> Chdir to /app... ____ _ _ __ __ _ _ / ___|(_)_ __ ___ _ __ | | ___ | \/ | __ _(_) | \___ \| | '_ ` _ \| '_ \| |/ _ \ | |\/| |/ _` | | | ___) | | | | | | | |_) | | __/ | | | | (_| | | | |____/|_|_| |_| |_| .__/|_|\___| |_| |_|\__,_|_|_| |_| _____ _ | ___|__ _ ____ ____ _ _ __ __| | ___ _ __ | |_ / _ \| '__\ \ /\ / / _` | '__/ _` |/ _ \ '__| | _| (_) | | \ V V / (_| | | | (_| | __/ | |_| \___/|_| \_/\_/ \__,_|_| \__,_|\___|_| Source#2e175b1 Tue Jul 24 14:26:06 2018 +0000 * master Built on Tue Jul 24 14:26:32 UTC 2018 by b700c9167997 >> ENV SMF_DOMAIN not set. >> ENV SMF_CONFIG found. value:[@mydomain.com:mygmail@gmail.com] >> ARGV arguments found. value:[start] Generating a 2048 bit RSA private key ......................................................+++ ..........................................+++ writing new private key to 'smtp.key' ----- >> SMF_CONFIG found in ENV. use this settings for forward maps. >> Setting password[mjfocjp4] for user @mydomain.com ... postmap: warning: /etc/postfix/virtual.db: duplicate entry: "@mydomain.com" Error: could not find any address for the name: `wimi.36c33f49.svc.dockerapp.io' >> Set hostname to mydomain.com postfix/postfix-script: warning: not owned by root: /var/spool/postfix/. postfix/postfix-script: warning: not owned by root: /var/spool/postfix/pid postfix/postfix-script: starting the Postfix mail system >> Start self-testing... 1..17 ok 1 SMF_CONFIG exist ok 2 SMF_DOMAIN exist ok 3 virtual maping source is set ok 4 virtual maping data is set ok 5 virtual maping db is set ok 6 system hostname FQDN resolvable ok 7 postfix myhostname FQDN & resolvable ok 8 check other hostname setting ok 9 confirm postfix is running ok 10 confirm port 25 is open ok 11 # skip (skip this for 0.3.0 -> 0.4.0) crond is running ok 12 ESMTP STATTLS supported ok 13 ESMTP AUTH supported ok 14 ESMTP STARTTLS connect ok ok 15 create user testi@testo.com by password test ok 16 ESMTP AUTH by testi@testo.com/test ok 17 ESMTP TLS AUTH by testi@testo.com/test >> Test PASSED >> CONGRATULATIONS! System is UP and You are SET! >> Powered by SMF - a Simple Mail Forwarder >> View in DockerHub: https://hub.docker.com/r/zixia/simple-mail-forwarder >> Init System for Servicing... [fix-attrs.d] applying owners & permissions fixes... [fix-attrs.d] 00-runscripts: applying... [fix-attrs.d] 00-runscripts: exited 0. [fix-attrs.d] done. [cont-init.d] executing container initialization scripts... [cont-init.d] dns_init.sh: executing... DNS : Initial Setup DNS STEP 1 : Creating the dnsmasq-resolv.conf DNS : Contents of dnsmasq-resolv.conf ------------------- nameserver 213.136.95.10 nameserver 213.136.95.11 nameserver 2a02:c207::1:53 DNS STEP 2 : Adding the linked services Waiting for linked IP address 10.43.0.1 to be reachable Waiting for linked IP address 10.43.0.1 to be reachable Waiting for linked IP address 10.43.0.1 to be reachable Waiting for linked IP address 10.43.0.1 to be reachable DNS : Timed out setting up DNS. [cont-finish.d] executing container finish scripts... [cont-finish.d] done. [s6-finish] syncing disks. [s6-finish] sending all processes the TERM signal. [s6-finish] sending all processes the KILL signal and exiting. ```

Apparently it's trying to resolve 10.43.0.1 which is not even the container IP. Any ideas?

Thank you!

huan commented 6 years ago

Sorry I have never use rancher before so I'm afraid that I cannot help.

Please let me know any updates about your rancher environment, thanks and good luck.

riptidewave93 commented 6 years ago

I am also seeing this issue. Any thoughts on moving to a new base image that has more recent updates, and does not include the "DNS Fixes" used by the current base image? Something like https://hub.docker.com/r/rjlasko/alpine-s6/, which I tested, and builds & passes tests:

$ ./script/build.sh latest
./script/build.sh: line 16: drill: command not found
>> Run docker build -t zixia/simple-mail-forwarder:latest .
Sending build context to Docker daemon  305.2kB
Step 1/24 : FROM rjlasko/alpine-s6:1.3
1.3: Pulling from rjlasko/alpine-s6
4fe2ade4980c: Pull complete 
c1ecc3b8f33c: Pull complete 
6b2c4ba00e64: Pull complete 
Digest: sha256:12d31d756d8c65e6a28adc510afbe82d23bda53f0cf9e3adfab7a91aabe4a36f
Status: Downloaded newer image for rjlasko/alpine-s6:1.3
 ---> 997f83eeeb6d
Step 2/24 : LABEL maintainer="Zhuohuan LI <zixia@zixia.net>"
 ---> Running in 726083a80758
Removing intermediate container 726083a80758
 ---> 12a5bf1c02d2
Step 3/24 : ENV BATS_VERSION 0.4.0
 ---> Running in 9900f5cb0241
Removing intermediate container 9900f5cb0241
 ---> 8cdf9ef8acee
Step 4/24 : RUN apk add --update --no-cache         bash         curl         drill         logrotate         openssl         postfix         cyrus-sasl         && curl -s -o "/tmp/v${BATS_VERSION}.tar.gz" -L         "https://github.com/sstephenson/bats/archive/v${BATS_VERSION}.tar.gz"     && tar -xzf "/tmp/v${BATS_VERSION}.tar.gz" -C /tmp/     && bash "/tmp/bats-${BATS_VERSION}/install.sh" /usr/local         && rm -rf /tmp/*
 ---> Running in 5f98bf2303b6
fetch http://dl-cdn.alpinelinux.org/alpine/v3.8/main/x86_64/APKINDEX.tar.gz
fetch http://dl-cdn.alpinelinux.org/alpine/v3.8/community/x86_64/APKINDEX.tar.gz
(1/25) Installing ncurses-terminfo-base (6.1_p20180818-r1)
(2/25) Installing ncurses-terminfo (6.1_p20180818-r1)
(3/25) Installing ncurses-libs (6.1_p20180818-r1)
(4/25) Installing readline (7.0.003-r0)
(5/25) Installing bash (4.4.19-r1)
Executing bash-4.4.19-r1.post-install
(6/25) Installing ca-certificates (20171114-r3)
(7/25) Installing nghttp2-libs (1.32.0-r0)
(8/25) Installing libssh2 (1.8.0-r3)
(9/25) Installing libcurl (7.61.1-r0)
(10/25) Installing curl (7.61.1-r0)
(11/25) Installing db (5.3.28-r0)
(12/25) Installing krb5-conf (1.0-r1)
(13/25) Installing libcom_err (1.44.2-r0)
(14/25) Installing sqlite-libs (3.24.0-r0)
(15/25) Installing heimdal-libs (7.5.0-r1)
(16/25) Installing libsasl (2.1.26-r13)
(17/25) Installing cyrus-sasl (2.1.26-r13)
(18/25) Installing ldns (1.7.0-r0)
(19/25) Installing drill (1.7.0-r0)
(20/25) Installing popt (1.16-r7)
(21/25) Installing logrotate (3.14.0-r0)
(22/25) Installing libcrypto1.0 (1.0.2p-r0)
(23/25) Installing libssl1.0 (1.0.2p-r0)
(24/25) Installing openssl (1.0.2p-r0)
(25/25) Installing postfix (3.3.0-r4)
Executing postfix-3.3.0-r4.pre-install
Executing busybox-1.28.4-r1.trigger
Executing ca-certificates-20171114-r3.trigger
OK: 29 MiB in 43 packages
Installed Bats to /usr/local/bin/bats
Removing intermediate container 5f98bf2303b6
 ---> d6555366da94
Step 5/24 : COPY install/main.dist.cf /etc/postfix/main.cf
 ---> d78cd302abc7
Step 6/24 : COPY install/master.dist.cf /etc/postfix/master.cf
 ---> 10175ce1b9ee
Step 7/24 : RUN cat /dev/null > /etc/postfix/aliases && newaliases     && echo simple-mail-forwarder.com > /etc/hostname         && echo test | saslpasswd2 -p test@test.com     && chown postfix /etc/sasldb2     && saslpasswd2 -d test@test.com
 ---> Running in 944257779e69
Removing intermediate container 944257779e69
 ---> e089dc62eb03
Step 8/24 : WORKDIR /app
 ---> Running in d1a61a3685fe
Removing intermediate container d1a61a3685fe
 ---> a233c4e0b0f6
Step 9/24 : COPY install/init-openssl.sh /app/init-openssl.sh
 ---> 215333611cd6
Step 10/24 : RUN bash -n /app/init-openssl.sh && chmod +x /app/init-openssl.sh
 ---> Running in 912abbd5427a
Removing intermediate container 912abbd5427a
 ---> 2e522d1c7a29
Step 11/24 : COPY install/postfix.sh /etc/services.d/postfix/run
 ---> 0fd9044e0533
Step 12/24 : RUN bash -n /etc/services.d/postfix/run && chmod +x /etc/services.d/postfix/run
 ---> Running in e0005acaeaaf
Removing intermediate container e0005acaeaaf
 ---> e17b8844c23e
Step 13/24 : COPY entrypoint.sh /entrypoint.sh
 ---> dc6e3a1b3f02
Step 14/24 : RUN bash -n /entrypoint.sh && chmod a+x /entrypoint.sh
 ---> Running in c4eccb2e29e9
Removing intermediate container c4eccb2e29e9
 ---> 0883be110abb
Step 15/24 : COPY BANNER /app/
 ---> eea488b674f5
Step 16/24 : COPY test /app/test
 ---> 8f703d7101b8
Step 17/24 : COPY .git/logs/HEAD /app/GIT_LOG
 ---> 8dd16611396a
Step 18/24 : COPY .git/HEAD /app/GIT_HEAD
 ---> 92d567ff8404
Step 19/24 : COPY install/buildenv.sh /app/
 ---> 16e9fe991d99
Step 20/24 : VOLUME ["/var/spool/postfix"]
 ---> Running in 6255b3aaa9f9
Removing intermediate container 6255b3aaa9f9
 ---> cbdb27214ff8
Step 21/24 : EXPOSE 25
 ---> Running in 7944c4642d1c
Removing intermediate container 7944c4642d1c
 ---> 0af4ea80fadd
Step 22/24 : ENTRYPOINT ["/entrypoint.sh"]
 ---> Running in 0a6742344424
Removing intermediate container 0a6742344424
 ---> 034e5f148b39
Step 23/24 : CMD ["start"]
 ---> Running in 918e0f97844b
Removing intermediate container 918e0f97844b
 ---> 9df03639dbd1
Step 24/24 : RUN bash buildenv.sh
 ---> Running in 9b527f00b928
Error: could not find any address for the name: `wimi.36c33f49.svc.dockerapp.io'
Removing intermediate container 9b527f00b928
 ---> f38dbf81dac7
Successfully built f38dbf81dac7
Successfully tagged zixia/simple-mail-forwarder:latest
>> Run docker run --rm --name simple-mail-forwarder zixia/simple-mail-forwarder:latest test
>> Chdir to /app...
 ____  _                 _         __  __       _ _ 
/ ___|(_)_ __ ___  _ __ | | ___   |  \/  | __ _(_) |
\___ \| | '_ ` _ \| '_ \| |/ _ \  | |\/| |/ _` | | |
 ___) | | | | | | | |_) | |  __/  | |  | | (_| | | |
|____/|_|_| |_| |_| .__/|_|\___|  |_|  |_|\__,_|_|_|
                  |_|                               
  _____                                _           
 |  ___|__  _ ____      ____ _ _ __ __| | ___ _ __ 
 | |_ / _ \| '__\ \ /\ / / _` | '__/ _` |/ _ \ '__|
 |  _| (_) | |   \ V  V / (_| | | | (_| |  __/ |   
 |_|  \___/|_|    \_/\_/ \__,_|_|  \__,_|\___|_|   

Source#23cf65c Tue Oct  2 03:37:26 2018 -0500 * kube-support
Built on Mon Oct 22 23:41:58 UTC 2018 by 9b527f00b928

>> ENV SMF_DOMAIN not set.
>> END SMF_CONFIG not set.
>> ARGV arguments found. value:[test]
>> Start mail server by test data: SMF_CONFIG=test@test.com:tset@tset.com:test-tset-testo-testi;testo@testo.com:testi@testi.com
Generating a 2048 bit RSA private key
.............................................................+++++
...................................................................................................................................................+++++
writing new private key to 'smtp.key'
-----
>> SMF_CONFIG found in ENV. use this settings for forward maps.
>> Setting password[test-tset-testo-testi] for user test@test.com ...
>> Setting password[test-tset-testo-testi] for user testo@testo.com ...
Error: could not find any address for the name: `wimi.36c33f49.svc.dockerapp.io'
>> Set hostname to testo.com
>> exec bats test
1..18
ok 1 postfix service installed
ok 2 SMF_CONFIG exist
ok 3 SMF_DOMAIN exist
ok 4 virtual maping source is set
ok 5 virtual maping data is set
ok 6 virtual maping db is set
ok 7 system hostname FQDN resolvable
ok 8 postfix myhostname FQDN & resolvable
ok 9 check other hostname setting
ok 10 confirm postfix is running
ok 11 confirm port 25 is open
ok 12 # skip (skip this for 0.3.0 -> 0.4.0) crond is running
ok 13 ESMTP STATTLS supported
ok 14 ESMTP AUTH supported
ok 15 ESMTP STARTTLS connect ok
ok 16 create user testi@testo.com by password test
ok 17 ESMTP AUTH by testi@testo.com/test
ok 18 ESMTP TLS AUTH by testi@testo.com/test
riptidewave93 commented 6 years ago

In regards to to this issue, I would be glad to help you move to alpine:base and have your Dockerfile setup s6, or move to a new base image such as the example above. Let me know which you prefer, and I will get a PR going.