tiredofit/docker-traefik-cloudflare-companion

Disabling Log Shipping Functionality

modem7 opened this issue · 6 comments

Summary

today at 06:49:42 /var/run/s6/etc/cont-init.d/05-logging: line 11: /assets/cron//logrotate: No such file or directory
today at 06:49:42 2021-08-09-06:49:42 [NOTICE] ** [logging] Disabling Log Shipping Functionality

Steps to reproduce

Start container, see logs.

What is the expected correct behavior?

For log rotate to work.

Relevant logs and/or screenshots

today at 06:49:41 2021-08-09-06:49:41 [NOTICE] ** [container-init] Detected Container that has been restarted - Cleaning '/tmp/state' files
today at 06:49:41 [cont-init.d] 00-startup: exited 0.
today at 06:49:41 [cont-init.d] 01-timezone: executing... 
today at 06:49:41 [cont-init.d] 01-timezone: exited 0.
today at 06:49:41 [cont-init.d] 02-permissions: executing... 
today at 06:49:41 [cont-init.d] 02-permissions: exited 0.
today at 06:49:41 [cont-init.d] 03-monitoring: executing... 
today at 06:49:41 2021-08-09-06:49:41 [NOTICE] ** [monitoring] Container configured for monitoring with 'zabbix modern'
today at 06:49:41 [cont-init.d] 03-monitoring: exited 0.
today at 06:49:41 [cont-init.d] 04-scheduling: executing... 
today at 06:49:41 2021-08-09-06:49:41 [NOTICE] ** [scheduling] Disabling Scheduling
today at 06:49:41 [cont-init.d] 04-scheduling: exited 0.
today at 06:49:41 [cont-init.d] 05-logging: executing... 
today at 06:49:42 /var/run/s6/etc/cont-init.d/05-logging: line 11: /assets/cron//logrotate: No such file or directory
today at 06:49:42 2021-08-09-06:49:42 [NOTICE] ** [logging] Disabling Log Shipping Functionality
today at 06:49:42 [cont-init.d] 05-logging: exited 0.
today at 06:49:42 [cont-init.d] 06-messaging: executing... 
today at 06:49:42 2021-08-09-06:49:42 [NOTICE] ** [messaging] Container configured to route mail via SMTP to 'postfix-relay'
today at 06:49:42 [cont-init.d] 06-messaging: exited 0.
today at 06:49:42 [cont-init.d] 10-cloudflare-companion: executing... 
today at 06:49:42 [cont-init.d] 10-cloudflare-companion: exited 0.
today at 06:49:42 [cont-init.d] 99-container: executing... 
today at 06:49:42 [cont-init.d] 99-container: exited 0.
today at 06:49:42 [cont-init.d] done.
today at 06:49:42 [services.d] starting services
today at 06:49:42 [services.d] done.

Environment

Docker, latest

  # Cloudflare-Companion - Automatic CNAME DNS Creation
  cfcompanion:
    container_name: CF-Companion
    image: tiredofit/traefik-cloudflare-companion:latest
    restart: always
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock:ro
    environment:
      - TIMEZONE=$TZ
      - TRAEFIK_VERSION=2
      - CF_EMAIL=$CLOUDFLARE_EMAIL # Same as traefik
      # - CF_TOKEN=$CLOUDFLARE_API_TOKEN # Scoped api token not working. Error 10000.
      - CF_TOKEN=$CLOUDFLARE_API_KEY # Same as traefik
      - TARGET_DOMAIN=$DOMAINNAME
      - DOMAIN1=$DOMAINNAME
      - DOMAIN1_ZONE_ID=$CLOUDFLARE_ZONEID # Copy from Cloudflare Overview page
      - DOMAIN1_PROXIED=TRUE
    depends_on:
      - dnscrypt-proxy
    # depends_on: 
    #   dnscrypt-proxy:
    #     condition: service_healthy
    labels:
      # Add hosts specified in rules here to force cf-companion to create the CNAMEs
      # Since cf-companion creates CNAMEs based on host rules, this a workaround for non-docker/external apps
      - "traefik.http.routers.cf-companion-rtr.rule=Host(`netdata.$DOMAINNAME`)" 
      #- "traefik.http.routers.cf-companion-rtr.rule=Host(`impi.$DOMAINNAME`)" #TLS middlewares not yet implemented https://github.com/containous/traefik/issues/6684
      #- "traefik.http.routers.cf-companion-rtr.rule=Host(`webmin.$DOMAINNAME`)" #TLS middlewares not yet implemented https://github.com/containous/traefik/issues/6684
    networks:
      - isonet

Possible fixes

Looks like line 11 has an errant "/" (/assets/cron//logrotate)

Can you try CONTAINER_ENABLE_SHCEDULING=TRUE as an environment variable? That should turn back on Cron but somewhere my logic for log shipping/log rotation has getting broken in the base image. I will investigate.

In the meantime I've also pushed 6.6.2 which should negate having to add that environment variable

The extra "/' is a dirty hack just to catch if someone has changed the "base" prefix of where cron files are pulled from without putting a trailing "/" at the end of their path . Theoretically it shouldn't affect anything, just looks a bit wonky.

Heya,

Both with new image + container_enable_scheduling:

today at 19:41:45 [s6-init] making user provided files available at /var/run/s6/etc...exited 0.
today at 19:41:45 [s6-init] ensuring user provided files have correct perms...exited 0.
today at 19:41:45 [fix-attrs.d] applying ownership & permissions fixes...
today at 19:41:45 [fix-attrs.d] 00-functions: applying... 
today at 19:41:45 [fix-attrs.d] 00-functions: exited 0.
today at 19:41:45 [fix-attrs.d] 01-s6: applying... 
today at 19:41:46 [fix-attrs.d] 01-s6: exited 0.
today at 19:41:46 [fix-attrs.d] 02-zabbix: applying... 
today at 19:41:46 [fix-attrs.d] 02-zabbix: exited 0.
today at 19:41:46 [fix-attrs.d] 03-logrotate: applying... 
today at 19:41:46 [fix-attrs.d] 03-logrotate: exited 0.
today at 19:41:46 [fix-attrs.d] done.
today at 19:41:46 [cont-init.d] executing container initialization scripts...
today at 19:41:46 [cont-init.d] 00-startup: executing... 
today at 19:41:46 [cont-init.d] 00-startup: exited 0.
today at 19:41:46 [cont-init.d] 01-timezone: executing... 
today at 19:41:46 2021-08-09-18:41:46 [NOTICE] ** [timezone] Timezone: Setting to 'Europe/London' from 'Etc/GMT'
today at 19:41:46 [cont-init.d] 01-timezone: exited 0.
today at 19:41:46 [cont-init.d] 02-permissions: executing... 
today at 19:41:46 [cont-init.d] 02-permissions: exited 0.
today at 19:41:46 [cont-init.d] 03-monitoring: executing... 
today at 19:41:46 2021-08-09-19:41:46 [NOTICE] ** [monitoring] Container configured for monitoring with 'zabbix modern'
today at 19:41:46 [cont-init.d] 03-monitoring: exited 0.
today at 19:41:46 [cont-init.d] 04-scheduling: executing... 
today at 19:41:46 2021-08-09-19:41:46 [NOTICE] ** [scheduling] Disabling Scheduling
today at 19:41:46 [cont-init.d] 04-scheduling: exited 0.
today at 19:41:46 [cont-init.d] 05-logging: executing... 
today at 19:41:46 /var/run/s6/etc/cont-init.d/05-logging: line 11: /assets/cron//logrotate: No such file or directory
today at 19:41:46 2021-08-09-19:41:46 [NOTICE] ** [logging] Disabling Log Shipping Functionality
today at 19:41:46 [cont-init.d] 05-logging: exited 0.
today at 19:41:46 [cont-init.d] 06-messaging: executing... 
today at 19:41:46 2021-08-09-19:41:46 [NOTICE] ** [messaging] Container configured to route mail via SMTP to 'postfix-relay'
today at 19:41:46 [cont-init.d] 06-messaging: exited 0.
today at 19:41:46 [cont-init.d] 10-cloudflare-companion: executing... 
today at 19:41:46 [cont-init.d] 10-cloudflare-companion: exited 0.
today at 19:41:46 [cont-init.d] 99-container: executing... 
today at 19:41:46 [cont-init.d] 99-container: exited 0.
today at 19:41:46 [cont-init.d] done.
today at 19:41:46 [services.d] starting services
today at 19:41:46 [services.d] done.

Just something I picked up whilst looking at the logs! Core functionality is still working as expected which is good!

  # Cloudflare-Companion - Automatic CNAME DNS Creation
  cfcompanion:
    container_name: CF-Companion
    image: tiredofit/traefik-cloudflare-companion:latest
    restart: always
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock:ro
    environment:
      - TIMEZONE=$TZ
      - TRAEFIK_VERSION=2
      - CF_EMAIL=$CLOUDFLARE_EMAIL # Same as traefik
      # - CF_TOKEN=$CLOUDFLARE_API_TOKEN # Scoped api token not working. Error 10000.
      - CF_TOKEN=$CLOUDFLARE_API_KEY # Same as traefik
      - TARGET_DOMAIN=$DOMAINNAME
      - DOMAIN1=$DOMAINNAME
      - DOMAIN1_ZONE_ID=$CLOUDFLARE_ZONEID # Copy from Cloudflare Overview page
      - DOMAIN1_PROXIED=TRUE
      - CONTAINER_ENABLE_SHCEDULING=TRUE
    depends_on:
      - dnscrypt-proxy
    labels:
      # Add hosts specified in rules here to force cf-companion to create the CNAMEs
      # Since cf-companion creates CNAMEs based on host rules, this a workaround for non-docker/external apps
      - "traefik.http.routers.cf-companion-rtr.rule=Host(`netdata.$DOMAINNAME`)" 
      #- "traefik.http.routers.cf-companion-rtr.rule=Host(`impi.$DOMAINNAME`)" #TLS middlewares not yet implemented https://github.com/containous/traefik/issues/6684
      #- "traefik.http.routers.cf-companion-rtr.rule=Host(`webmin.$DOMAINNAME`)" #TLS middlewares not yet implemented https://github.com/containous/traefik/issues/6684
    networks:
      - isonet

Happy to help test whatever needed.

OK! I'm taking a day off today but I will look into this. I had a client request big changes to my base images and it seems I have a few kinks to work out. Overall functionality of the image should not be affected are you have noticed, I just need to untangle some of the technical debt I've added.

No worries man! Zero rush on this, as I said, base functionality works as intended, this was just something that was picked up by chance, and realistically shouldn't make any massive impact.

More an FYI rather than anything else! Have a good day off!