linuxserver / docker-swag

Nginx webserver and reverse proxy with php support and a built-in Certbot (Let's Encrypt) client. It also contains fail2ban for intrusion prevention.
https://docs.linuxserver.io/general/swag
GNU General Public License v3.0
2.88k stars 246 forks source link

[BUG] STDOUT Logs spamming "Server Ready" #374

Closed kernelkaribou closed 1 year ago

kernelkaribou commented 1 year ago

Is there an existing issue for this?

Current Behavior

On latest version of SWAG, 2.6.0-ls213, STDOUT logs for container are being spammed with Server Ready. Not showing any indication of NGINX server issues and reverse proxying seems to be working as per usual.

Expected Behavior

Not spam container STDOUT logs with Server Ready

Steps To Reproduce

So far tested on two bare metal hosts with same OS version. Reverting my container from latest to tag 2.6.0-ls212 addressed the issue

Have no other environments OS environments to test on, but two separate baremetal with identical versions and package version on Debian have produced this issue

Environment

- OS: Debian 11.7
- How docker service was installed: Docker apt repository

CPU architecture

x86-64

Docker creation

swag:
    container_name: swag
    image: lscr.io/linuxserver/swag:latest
    hostname: swag
    cap_add:
      - NET_ADMIN
    networks:
      - infra-net
      - proxy-net
    ports:
      - 80:80
      - 443:443
    environment:
      - PUID=${puid}
      - PGID=${pgid}
      - TZ=${tz}
      - EMAIL=${letsencrypt_email}
      - URL=${letsencrypt_domain}
      - SUBDOMAINS=${letsencrypt_subdomains}
      - VALIDATION=dns
      - DNSPLUGIN=cloudflare
      - DOCKER_MODS=linuxserver/mods:swag-auto-reload|linuxserver/mods:universal-stdout-logs
      - LOGS_TO_STDOUT=/config/log/nginx/error.log
    volumes:
      - ./swag:/config
    restart: always

Container logs

[mod-init] Attempting to run Docker Modification Logic
[mod-init] Adding linuxserver/mods:swag-auto-reload to container
[mod-init] linuxserver/mods:swag-auto-reload at sha256:9dbae5d11b0dab3c5825a700ea1933a606a81df6312186da0f167e6ed8b6039e has been previously applied skipping
[mod-init] Adding linuxserver/mods:universal-stdout-logs to container
[mod-init] linuxserver/mods:universal-stdout-logs at sha256:9cf1b3862da4f62e9795ec448616ab44564b4c40f665bb63b1793c60767b8945 has been previously applied skipping
[migrations] started
[migrations] 01-nginx-site-confs-default: skipped
[migrations] done
usermod: no changes
───────────────────────────────────────

      ██╗     ███████╗██╗ ██████╗
      ██║     ██╔════╝██║██╔═══██╗
      ██║     ███████╗██║██║   ██║
      ██║     ╚════██║██║██║   ██║
      ███████╗███████║██║╚██████╔╝
      ╚══════╝╚══════╝╚═╝ ╚═════╝

   Brought to you by linuxserver.io
───────────────────────────────────────

To support the app dev(s) visit:
Certbot: https://supporters.eff.org/donate/support-work-on-certbot

To support LSIO projects visit:
https://www.linuxserver.io/donate/

───────────────────────────────────────
GID/UID
───────────────────────────────────────

User UID:    1032
User GID:    1032
───────────────────────────────────────

using keys found in /config/keys
Variables set:
PUID=1032
PGID=1032
TZ=America/Chicago
URL=REDACTED
SUBDOMAINS=wildcard
EXTRA_DOMAINS=
ONLY_SUBDOMAINS=false
VALIDATION=dns
CERTPROVIDER=
DNSPLUGIN=cloudflare
EMAIL=REDACTED
STAGING=

cp: not replacing '/config/dns-conf/acmedns-registration.json'
...truncated...
cp: not replacing '/config/etc/letsencrypt/renewal-hooks/pre/10-nginx'
Using Let's Encrypt as the cert provider
SUBDOMAINS entered, processing
Wildcard cert for REDACTED will be requested
E-mail address entered: REDACTED
dns validation via cloudflare plugin is selected
Certificate exists; parameters unchanged; starting nginx
The cert does not expire within the next day. Letting the cron script handle the renewal attempts overnight (2:08am).
**** The following active confs have different version dates than the samples that are shipped. ****
**** This may be due to user customization or an update to the samples. ****
**** You should compare the following files to the samples in the same folder and update them. ****
**** Use the link at the top of the file to view the changelog. ****
┌────────────┬────────────┬────────────────────────────────────────────────────────────────────────┐
│  old date  │  new date  │ path                                                                   │
├────────────┼────────────┼────────────────────────────────────────────────────────────────────────┤
REDACTED
└────────────┴────────────┴────────────────────────────────────────────────────────────────────────┘
**** swag-auto-reload deps already installed, skipping ****
[custom-init] No custom files found, skipping...
MOD Auto-reload: Watching the following files/folders for changes (excluding .sample and .md files):
/config/nginx
Executing: tail -F /config/log/nginx/error.log
[ls.io-init] done.
Server ready
Server ready
Server ready
Server ready
Server ready
Server ready
Server ready
Server ready
Server ready
Server ready
Server ready
Server ready
Server ready
Server ready
Server ready
Server ready
Server ready
github-actions[bot] commented 1 year ago

Thanks for opening your first issue here! Be sure to follow the relevant issue templates, or risk having this issue marked as invalid.

nemchik commented 1 year ago

Start with updating your outdated (redacted) configs noted in your logs and restart the container and post updated logs here.

Zedifuu commented 1 year ago

I'm receiving the same, on fresh container / volumes, no modified confs aside from dns.

kernelkaribou commented 1 year ago

On my second host with near identical compose, (different domain and using a few extra mods, linuxserver/mods:swag-dbip & linuxserver/mods:swag-maxmind) is reporting the same issue without those conf notices of needing to be updated, nearly fresh like @Zedifuu above

[mod-init] Adding linuxserver/mods:swag-dbip to container
[mod-init] linuxserver/mods:swag-dbip at sha256:c0f811f787b4f88f745437b68691eee6a3a1a7239e5952e1e1fcd66fb0574515 has been previously applied skipping
[mod-init] Adding linuxserver/mods:swag-maxmind to container
[mod-init] linuxserver/mods:swag-maxmind at sha256:bb158926d3ef7bc99993ba17f735a21b4826e1b72a89069f33a94358a2730b71 has been previously applied skipping
[mod-init] Adding linuxserver/mods:swag-auto-reload to container
[mod-init] linuxserver/mods:swag-auto-reload at sha256:9dbae5d11b0dab3c5825a700ea1933a606a81df6312186da0f167e6ed8b6039e has been previously applied skipping
[mod-init] Adding linuxserver/mods:universal-stdout-logs to container
[mod-init] linuxserver/mods:universal-stdout-logs at sha256:9cf1b3862da4f62e9795ec448616ab44564b4c40f665bb63b1793c60767b8945 has been previously applied skipping
[migrations] started
[migrations] 01-nginx-site-confs-default: skipped
[migrations] done
usermod: no changes
───────────────────────────────────────

      ██╗     ███████╗██╗ ██████╗
      ██║     ██╔════╝██║██╔═══██╗
      ██║     ███████╗██║██║   ██║
      ██║     ╚════██║██║██║   ██║
      ███████╗███████║██║╚██████╔╝
      ╚══════╝╚══════╝╚═╝ ╚═════╝

   Brought to you by linuxserver.io
───────────────────────────────────────

To support the app dev(s) visit:
Certbot: https://supporters.eff.org/donate/support-work-on-certbot

To support LSIO projects visit:
https://www.linuxserver.io/donate/

───────────────────────────────────────
GID/UID
───────────────────────────────────────

User UID:    1032
User GID:    1032
───────────────────────────────────────

using keys found in /config/keys
Variables set:
PUID=1032
PGID=1032
TZ=America/Chicago
URL=REDACTED
SUBDOMAINS=wildcard
EXTRA_DOMAINS=
ONLY_SUBDOMAINS=false
VALIDATION=dns
CERTPROVIDER=
DNSPLUGIN=cloudflare
EMAIL=REDACTED
STAGING=

cp: not replacing '/config/dns-conf/acmedns-registration.json'
cp: not replacing '/config/dns-conf/acmedns.ini'
cp: not replacing '/config/dns-conf/aliyun.ini'
cp: not replacing '/config/dns-conf/azure.ini'
cp: not replacing '/config/dns-conf/cloudflare.ini'
cp: not replacing '/config/dns-conf/cpanel.ini'
cp: not replacing '/config/dns-conf/desec.ini'
cp: not replacing '/config/dns-conf/digitalocean.ini'
cp: not replacing '/config/dns-conf/directadmin.ini'
cp: not replacing '/config/dns-conf/dnsimple.ini'
cp: not replacing '/config/dns-conf/dnsmadeeasy.ini'
cp: not replacing '/config/dns-conf/dnspod.ini'
cp: not replacing '/config/dns-conf/do.ini'
cp: not replacing '/config/dns-conf/domeneshop.ini'
cp: not replacing '/config/dns-conf/duckdns.ini'
cp: not replacing '/config/dns-conf/dynu.ini'
cp: not replacing '/config/dns-conf/gandi.ini'
cp: not replacing '/config/dns-conf/gehirn.ini'
cp: not replacing '/config/dns-conf/godaddy.ini'
cp: not replacing '/config/dns-conf/google-domains.ini'
cp: not replacing '/config/dns-conf/google.json'
cp: not replacing '/config/dns-conf/he.ini'
cp: not replacing '/config/dns-conf/hetzner.ini'
cp: not replacing '/config/dns-conf/infomaniak.ini'
cp: not replacing '/config/dns-conf/inwx.ini'
cp: not replacing '/config/dns-conf/ionos.ini'
cp: not replacing '/config/dns-conf/linode.ini'
cp: not replacing '/config/dns-conf/loopia.ini'
cp: not replacing '/config/dns-conf/luadns.ini'
cp: not replacing '/config/dns-conf/netcup.ini'
cp: not replacing '/config/dns-conf/njalla.ini'
cp: not replacing '/config/dns-conf/nsone.ini'
cp: not replacing '/config/dns-conf/ovh.ini'
cp: not replacing '/config/dns-conf/porkbun.ini'
cp: not replacing '/config/dns-conf/rfc2136.ini'
cp: not replacing '/config/dns-conf/route53.ini'
cp: not replacing '/config/dns-conf/sakuracloud.ini'
cp: not replacing '/config/dns-conf/standalone.ini'
cp: not replacing '/config/dns-conf/transip.ini'
cp: not replacing '/config/dns-conf/vultr.ini'
cp: not replacing '/config/etc/letsencrypt/renewal-hooks/deploy/10-default'
cp: not replacing '/config/etc/letsencrypt/renewal-hooks/post/10-nginx'
cp: not replacing '/config/etc/letsencrypt/renewal-hooks/pre/10-nginx'
Using Let's Encrypt as the cert provider
SUBDOMAINS entered, processing
Wildcard cert for REDACTED will be requested
E-mail address entered: REDACTED
dns validation via cloudflare plugin is selected
Certificate exists; parameters unchanged; starting nginx
The cert does not expire within the next day. Letting the cron script handle the renewal attempts overnight (2:08am).
Applying the dbip mod...
**** Applying the SWAG dashboard mod... ****
Applied the dbip mod
**** goaccess already installed, skipping ****
libmaxminddb
**** swag-auto-reload deps already installed, skipping ****
**** libmaxminddb already installed, skipping ****
**** libmaxminddb already installed, skipping ****
**** Applied the SWAG dashboard mod ****
Applying the maxmind mod...
Starting 2019/12/30, GeoIP2 databases require personal license key to download. Please retrieve a free license key from MaxMind,
and add a new env variable "MAXMINDDB_LICENSE_KEY", set to your license key.
Applied the maxmind mod
[custom-init] No custom files found, skipping...
Executing: tail -F /config/log/nginx/error.log
MOD Auto-reload: Watching the following files/folders for changes (excluding .sample and .md files):
/config/nginx
[ls.io-init] done.
Server ready
Server ready
Server ready
Server ready
Server ready
Server ready
Server ready
Server ready
Server ready
Server ready
Server ready
Server ready

Changing this container to use the 2.6.0-ls212 release tag immediately addressed the issue.

aptalca commented 1 year ago

Try removing the mods one by one (I'm suspecting auto-reload)

I don't have those mods (only maxmind and dashboard) and no issues

kernelkaribou commented 1 year ago

In attempt to expedite review, I removed all the mods (with the intention to work forward through them until it broke again) and still seeing the same issue. Only fix so far has been moved back to 2.6.0-ls212 with all other configurations remaining the same.

Zedifuu commented 1 year ago

Also additional information referring to my previous comment:

Fresh install running latest, default deployment with cloudflare dns, no conf changes aside from uptime-kuma (Happens with/without this conf) & cloudflare dns challenge credentials. No mods. I originally backed up my proxy-confs & burned my swag install thinking it would resolve.

Environment : arm64

Docker run:

   - docker run -d
     --name=swag
     --cap-add=NET_ADMIN
     --network=nginx
     -e PUID=1000
     -e PGID=1000
     -e TZ=America/Chicago
     -e URL=REDACTED
     -e VALIDATION=dns
     -e SUBDOMAINS=REDACTED,REDACTED,REDACTED
     -e DNSPLUGIN=cloudflare `#optional`
     -e PROPAGATION=30
     -e EMAIL="REDACTED" `#optional`
     -e ONLY_SUBDOMAINS=true
     -e STAGING=false `#optional`
     -p 443:443
     -p 80:80 `#optional`
     -v /REDACTED:/config
     --restart unless-stopped
     lscr.io/linuxserver/swag

Log output:

[migrations] started
[migrations] 01-nginx-site-confs-default: skipped
[migrations] done
───────────────────────────────────────

      ██╗     ███████╗██╗ ██████╗
      ██║     ██╔════╝██║██╔═══██╗
      ██║     ███████╗██║██║   ██║
      ██║     ╚════██║██║██║   ██║
      ███████╗███████║██║╚██████╔╝
      ╚══════╝╚══════╝╚═╝ ╚═════╝

   Brought to you by linuxserver.io
───────────────────────────────────────

To support the app dev(s) visit:
Certbot: https://supporters.eff.org/donate/support-work-on-certbot

To support LSIO projects visit:
https://www.linuxserver.io/donate/

───────────────────────────────────────
GID/UID
───────────────────────────────────────

User UID:    1000
User GID:    1000
───────────────────────────────────────

using keys found in /config/keys
Variables set:
PUID=1000
PGID=1000
TZ=America/Chicago
URL=REDACTED
SUBDOMAINS=REDACTED,REDACTED,REDACTED
EXTRA_DOMAINS=
ONLY_SUBDOMAINS=true
VALIDATION=dns
CERTPROVIDER=
DNSPLUGIN=cloudflare
EMAIL=REDACTED
STAGING=false

cp: not replacing '/config/dns-conf/acmedns-registration.json'
cp: not replacing '/config/dns-conf/acmedns.ini'
cp: not replacing '/config/dns-conf/aliyun.ini'
cp: not replacing '/config/dns-conf/azure.ini'
cp: not replacing '/config/dns-conf/cloudflare.ini'
cp: not replacing '/config/dns-conf/cpanel.ini'
cp: not replacing '/config/dns-conf/desec.ini'
cp: not replacing '/config/dns-conf/digitalocean.ini'
cp: not replacing '/config/dns-conf/directadmin.ini'
cp: not replacing '/config/dns-conf/dnsimple.ini'
cp: not replacing '/config/dns-conf/dnsmadeeasy.ini'
cp: not replacing '/config/dns-conf/dnspod.ini'
cp: not replacing '/config/dns-conf/do.ini'
cp: not replacing '/config/dns-conf/domeneshop.ini'
cp: not replacing '/config/dns-conf/duckdns.ini'
cp: not replacing '/config/dns-conf/dynu.ini'
cp: not replacing '/config/dns-conf/gandi.ini'
cp: not replacing '/config/dns-conf/gehirn.ini'
cp: not replacing '/config/dns-conf/godaddy.ini'
cp: not replacing '/config/dns-conf/google-domains.ini'
cp: not replacing '/config/dns-conf/google.json'
cp: not replacing '/config/dns-conf/he.ini'
cp: not replacing '/config/dns-conf/hetzner.ini'
cp: not replacing '/config/dns-conf/infomaniak.ini'
cp: not replacing '/config/dns-conf/inwx.ini'
cp: not replacing '/config/dns-conf/ionos.ini'
cp: not replacing '/config/dns-conf/linode.ini'
cp: not replacing '/config/dns-conf/loopia.ini'
cp: not replacing '/config/dns-conf/luadns.ini'
cp: not replacing '/config/dns-conf/netcup.ini'
cp: not replacing '/config/dns-conf/njalla.ini'
cp: not replacing '/config/dns-conf/nsone.ini'
cp: not replacing '/config/dns-conf/ovh.ini'
cp: not replacing '/config/dns-conf/porkbun.ini'
cp: not replacing '/config/dns-conf/rfc2136.ini'
cp: not replacing '/config/dns-conf/route53.ini'
cp: not replacing '/config/dns-conf/sakuracloud.ini'
cp: not replacing '/config/dns-conf/standalone.ini'
cp: not replacing '/config/dns-conf/transip.ini'
cp: not replacing '/config/dns-conf/vultr.ini'
cp: not replacing '/config/etc/letsencrypt/renewal-hooks/deploy/10-default'
cp: not replacing '/config/etc/letsencrypt/renewal-hooks/post/10-nginx'
cp: not replacing '/config/etc/letsencrypt/renewal-hooks/pre/10-nginx'
Using Let's Encrypt as the cert provider
SUBDOMAINS entered, processing
SUBDOMAINS entered, processing
Only subdomains, no URL in cert
Sub-domains processed are:  -d REDACTED -d REDACTED -d REDACTED
E-mail address entered: REDACTED
dns validation via cloudflare plugin is selected
Certificate exists; parameters unchanged; starting nginx
The cert does not expire within the next day. Letting the cron script handle the renewal attempts overnight (2:08am).
**** The following active confs have different version dates than the samples that are shipped. ****
**** This may be due to user customization or an update to the samples. ****
**** You should compare the following files to the samples in the same folder and update them. ****
**** Use the link at the top of the file to view the changelog. ****
┌────────────┬────────────┬────────────────────────────────────────────────────────────────────────┐
│  old date  │  new date  │ path                                                                   │
├────────────┼────────────┼────────────────────────────────────────────────────────────────────────┤
│            │ 2023-02-05 │ /config/nginx/proxy-confs/uptime-kuma.subdomain.conf                   │
└────────────┴────────────┴────────────────────────────────────────────────────────────────────────┘
[custom-init] No custom files found, skipping...
[ls.io-init] done.
Server ready
Server ready
Server ready
Server ready
Server ready
..................Repeating

Swag appears to serve connections normally, but the log is flooded with 'Server Ready'

Zedifuu commented 1 year ago

To confirm, @kernelkaribou suggested workaround of reverting to image tag 2.6.0-ls212, Resolves for me.

nemchik commented 1 year ago

Fixed in https://github.com/linuxserver/docker-swag/pull/375 Should be available on the latest tag once that merges and releases a new image, likely numbered 2.6.0-ls214 (or above).

HarvsG commented 7 months ago

I'm still getting it at scr.io/linuxserver/swag:latest@sha256:0b1a30ef43d7dccfefe2299db3f781516d6fa0500147cacd0b492bc6a57b1074 Linuxserver.io version:- 2.10.0-ls294 Build-date:- 2024-04-06T03:21:38+00:00

~/docker-files/swag/config/fail2ban/filter.d $ cat nginx-unauthorized.conf
# A fail2ban filter for unauthorized log messages

[Definition]

failregex = ^<HOST>.*"(GET|POST|HEAD).*" (401) .*$
mod-init] Running Docker Modification Logic
[mod-init] Adding linuxserver/mods:swag-dashboard to container
[mod-init] linuxserver/mods:swag-dashboard at sha256:71c6dd5d43e9202721c5d880ad7ffde14c610f45266ca74044464c2b6e4cc07d has been previously applied skipping
[migrations] started
[migrations] 01-nginx-site-confs-default: skipped
[migrations] done
usermod: no changes
───────────────────────────────────────
      ██╗     ███████╗██╗ ██████╗
      ██║     ██╔════╝██║██╔═══██╗
      ██║     ███████╗██║██║   ██║
      ██║     ╚════██║██║██║   ██║
      ███████╗███████║██║╚██████╔╝
      ╚══════╝╚══════╝╚═╝ ╚═════╝
   Brought to you by linuxserver.io
───────────────────────────────────────
To support the app dev(s) visit:
Certbot: https://supporters.eff.org/donate/support-work-on-certbot
To support LSIO projects visit:
https://www.linuxserver.io/donate/
───────────────────────────────────────
GID/UID
───────────────────────────────────────
User UID:    1000
User GID:    1000
───────────────────────────────────────
using keys found in /config/keys
Variables set:

0

0
TZ=Europe/London
URL=REDACTED
SUBDOMAINS=wildcard
EXTRA_DOMAINS=
ONLY_SUBDOMAINS=false
VALIDATION=dns
CERTPROVIDER=
DNSPLUGIN=cloudflare
EMAIL=
STAGING=
Using Let's Encrypt as the cert provider
SUBDOMAINS entered, processing
Wildcard cert for REDACTED will be requested
No e-mail address entered or address invalid
dns validation via cloudflare plugin is selected
Certificate exists; parameters unchanged; starting nginx
The cert does not expire within the next day. Letting the cron script handle the renewal attempts overnight (2:08am).
/config/nginx/geoip2.conf exists.
        Please migrate to https://github.com/linuxserver/docker-mods/tree/swag-maxmind
/config/nginx/ldap.conf exists.
        Please apply any customizations to /config/nginx/ldap-server.conf
        Ensure your configs are updated and remove /config/nginx/ldap.conf
        If you do not use this config, simply remove it.
**** Applying the SWAG dashboard mod... ****
**** goaccess already installed, skipping ****
**** libmaxminddb already installed, skipping ****
**** Applied the SWAG dashboard mod ****
[custom-init] No custom files found, skipping...
[ls.io-init] done.

Server ready

Server ready
j0nnymoe commented 7 months ago

Please open a new issue, this has been closed for nearly 10 months.