shlinkio / shlink

The definitive self-hosted URL shortener
https://shlink.io
MIT License
3.2k stars 257 forks source link

Repeated downloads of the GeoIP database #2048

Closed helgew closed 7 months ago

helgew commented 7 months ago

Shlink version

3.7.3

PHP version

8.2.13

How do you serve Shlink

Docker image

Database engine

MariaDB

Database version

10.8

Current behavior

Since yesterday, shlink is downloading the GeoLite2 db file with every orphan requests:

shlink         | 2024-03-05T15:57:53+0000   DEBUG   jobs            job was pushed successfully {"ID": "632fa4d8-38b4-4c9b-9f6d-df87b389840a", "pipeline": "shlink", "driver": "memory", "start": "2024-03-05T15:57:53+0000", "elapsed": "81.816µs"}
shlink         | {"level":"debug","ts":1709654273201260499,"logger":"memory","msg":"message pushed to the priority queue","current":1,"limit":10}
shlink         | 2024-03-05T15:57:53+0000   DEBUG   jobs            job processing was started  {"ID": "632fa4d8-38b4-4c9b-9f6d-df87b389840a", "start": "2024-03-05T14:39:05+0000", "elapsed": "1h18m47.402565202s"}
shlink         | 2024-03-05T15:57:53+0000   INFO    server          [2024-03-05T15:57:53.203684+00:00] [88435a83-c9d5-4aba-a878-01bf220b605c] Access.INFO - GET / 404 979
shlink         | 2024-03-05T15:57:53+0000   INFO    server          [2024-03-05T15:57:53.210397+00:00] [NULL] Shlink.NOTICE - Updating GeoLite2 db file...
shlink         | 
shlink         | 2024-03-05T15:57:53+0000   INFO    server          [2024-03-05T15:57:53.239613+00:00] [NULL] Shlink.NOTICE - Finished updating GeoLite2 db file
shlink         | 
shlink         | 2024-03-05T15:57:54+0000   DEBUG   jobs            job was processed successfully  {"ID": "632fa4d8-38b4-4c9b-9f6d-df87b389840a", "start": "2024-03-05T14:39:05+0000", "elapsed": "1h18m48.830015479s"}

Needless to say, the good folks are MaxMind are not happy and have turned off my API access.

Expected behavior

The GeoLite2 db should be downloaded only when needed.

How to reproduce

unknown

acelaya commented 7 months ago

Duplicates https://github.com/shlinkio/shlink/issues/2021

acelaya commented 7 months ago

Hey @helgew, can you confirm this is reproducible only with orphan visits but not regular visits to existing short URLs?

helgew commented 7 months ago

I just combed through the logs and it looks like the downloads also happen on some kind of schedule and when a short URL is requested. Unfortunately, I can no longer test this directly as I have just updated the image and the container doesn't have a GeoLite DB file to start off with (MaxMind has turned off my API access for the day).