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

[BUG] Error downloading database #933

Closed
1 task done
Cheezzhead opened this issue Aug 9, 2024 · 3 comments
Closed
1 task done

[BUG] Error downloading database #933

Cheezzhead opened this issue Aug 9, 2024 · 3 comments

Comments

@Cheezzhead
Copy link

Cheezzhead commented Aug 9, 2024

Is there an existing issue for this?

  • I have searched the existing issues

Name of mod

The MaxMind database is not being downloaded, instead giving a tar: short read log message (see below).

This has already been reported (along with a solution) in the last reply of #833, but since that ticket is already closed (and its problem description was somewhat confusing), I figured I'd make a new one here.

The curl command in /etc/periodic/weekly/libmaxminddb is the culprit as it is not following redirects. Adding the -L flag will solve the issue.

// Leads to an empty file
curl https://download.maxmind.com/app/geoip_download?edition_id=GeoLite2-City&license_key=${KEY}&suffix=tar.gz" -o "./GeoLite2-City.mmdb.tar.gz" 

// Outputs the correct file
curl -L https://download.maxmind.com/app/geoip_download?edition_id=GeoLite2-City&license_key=${KEY}&suffix=tar.gz" -o "./GeoLite2-City.mmdb.tar.gz" 

Name of base container

swag

Current Behavior

No database file is being downloaded automatically.

Expected Behavior

No response

Steps To Reproduce

Simply run the compose script (with a valid license key)

Environment

- OS:Ubuntu 20.04
- How docker service was installed: Compose

CPU architecture

x86-64

Docker creation

services:
  swag:
    image: ghcr.io/linuxserver/swag:2.11.0
    container_name: swag
    extends:
      file: ${STACKS_DIR}/common.yml
      service: default
    cap_add:
      - NET_ADMIN
    networks:
      - default
      - backend
    ports:
      - 443:443/tcp
      - 80:80/tcp
    secrets:
      - maxmind-license
      - maxmind-user
    env_file: letsencrypt.env
    environment:
      URL: ${DOMAIN}
      EMAIL: ${WEB_ADMIN_EMAIL}
      STAGING: false
      DOCKER_MODS: >-
        linuxserver/mods:swag-dashboard|
        linuxserver/mods:swag-cloudflare-real-ip|
        linuxserver/mods:swag-maxmind
      FILE__MAXMINDDB_LICENSE_KEY: /run/secrets/maxmind-license
      FILE__MAXMINDDB_USER_ID: /run/secrets/maxmind-user
    volumes:
      - ${DOCKER_CONF_DIR}/swag:/config

Container logs

[mod-init] Running Docker Modification Logic
[mod-init] Adding linuxserver/mods:swag-dashboard to container
[mod-init] linuxserver/mods:swag-dashboard at sha256:7923509263d7e4a92b693ed23c60d8d35e8e24a97bf06ea549be910c99256d7d has been previously applied skipping
[mod-init] Adding linuxserver/mods:swag-cloudflare-real-ip to container
[mod-init] linuxserver/mods:swag-cloudflare-real-ip at sha256:21aa292df04e2eddad2acfe90c81ec0e3254d4cf87535c72ef7b517be5428cef has been previously applied skipping
[mod-init] Adding linuxserver/mods:swag-maxmind to container
[mod-init] linuxserver/mods:swag-maxmind at sha256:4f920f4949af13674bd0fdcb6010af441b51577e4096a28887e3fce10915415c has been previously applied skipping
[migrations] started
[migrations] 01-nginx-site-confs-default: skipped
[migrations] done
[env-init] MAXMINDDB_LICENSE_KEY set from FILE__MAXMINDDB_LICENSE_KEY
[env-init] MAXMINDDB_USER_ID set from FILE__MAXMINDDB_USER_ID
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:    ####
User GID:    ####
───────────────────────────────────────

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

Using Let's Encrypt as the cert provider
SUBDOMAINS entered, processing
Sub-domains processed are: ####
E-mail address entered: ####
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 SWAG dashboard mod... ****
libmaxminddb
**** goaccess already installed, skipping ****
**** libmaxminddb already installed, skipping ****
**** libmaxminddb already installed, skipping ****
**** Applied the SWAG dashboard mod ****
Applying the maxmind mod...
Downloading GeoIP2 City database.
tar: short read
Applied the maxmind mod
[custom-init] No custom files found, skipping...
[ls.io-init] done.
Server ready
@LinuxServer-CI
Copy link

This issue has been automatically marked as stale because it has not had recent activity. This might be due to missing feedback from OP. It will be closed if no further activity occurs. Thank you for your contributions.

@drizuid
Copy link
Member

drizuid commented Oct 15, 2024

We do not handle the crontab entry ourselves, this mod simply installs libmaxminddb from the alpine repo. That said, when you opened this, the mod was likely 3.19 and lacking the ability to follow links
https://gitlab.alpinelinux.org/alpine/aports/-/blob/3.19-stable/main/libmaxminddb/libmaxminddb.cron?ref_type=heads#L20
however, the mod should be 3.20 now, and you can see they have updated the file.
https://gitlab.alpinelinux.org/alpine/aports/-/blob/3.20-stable/main/libmaxminddb/libmaxminddb.cron?ref_type=heads#L21

with that said, i think this issue (caused by upstream) is resolved?

@Cheezzhead
Copy link
Author

Just tested by deleting the existing database, yes it works!

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

No branches or pull requests

3 participants