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] exception while running mmdb-country.py #1021

Closed
2 tasks done
celevra opened this issue Apr 5, 2024 · 3 comments
Closed
2 tasks done

[BUG] exception while running mmdb-country.py #1021

celevra opened this issue Apr 5, 2024 · 3 comments
Labels
bug Something isn't working

Comments

@celevra
Copy link

celevra commented Apr 5, 2024

What happened?

bunker-bw-scheduler-1  | [2024-04-05 12:54:40] - JOBS.MMDB-COUNTRY - ℹ️  - Downloading mmdb file from url https://download.db-ip.com/free/dbip-country-lite-2024-04.mmdb.gz ...
bunker-bw-scheduler-1  | [2024-04-05 12:54:40] - JOBS.MMDB-COUNTRY - ℹ️  - Decompressing mmdb file ...
bunker-bw-scheduler-1  | [2024-04-05 12:54:40] - JOBS.MMDB-COUNTRY - ℹ️  - Checking if mmdb file is valid ...
bunker-bw-scheduler-1  | [2024-04-05 12:54:40] - JOBS.MMDB-COUNTRY - ❌ - Exception while running mmdb-country.py :
bunker-bw-scheduler-1  | Traceback (most recent call last):
bunker-bw-scheduler-1  |   File "/usr/share/bunkerweb/core/jobs/jobs/mmdb-country.py", line 115, in <module>
bunker-bw-scheduler-1  |     with open_database(content, mode=MODE_FD) as reader:
bunker-bw-scheduler-1  |          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
bunker-bw-scheduler-1  |   File "/usr/share/bunkerweb/deps/python/maxminddb/__init__.py", line 69, in open_database
bunker-bw-scheduler-1  |     return Reader(database, mode)
bunker-bw-scheduler-1  |            ^^^^^^^^^^^^^^^^^^^^^^
bunker-bw-scheduler-1  |   File "/usr/share/bunkerweb/deps/python/maxminddb/reader.py", line 81, in __init__
bunker-bw-scheduler-1  |     filename = database.name  # type: ignore
bunker-bw-scheduler-1  |                ^^^^^^^^^^^^^
bunker-bw-scheduler-1  | AttributeError: '_io.BytesIO' object has no attribute 'name'
bunker-bw-scheduler-1  |
bunker-bw-scheduler-1  | [2024-04-05 12:54:41] - SCHEDULER - ❌ - Error while executing job mmdb-country from plugin jobs

How to reproduce?

not sure

Configuration file(s) (yaml or .env)

No response

Relevant log output

No response

BunkerWeb version

1.5.6

What integration are you using?

Docker

Linux distribution (if applicable)

No response

Removed private data

  • I have removed all private data from the configuration file and the logs

Code of Conduct

  • I agree to follow this project's Code of Conduct
@celevra celevra added the bug Something isn't working label Apr 5, 2024
@fl0ppy-d1sk
Copy link
Member

Hello @celevra,

Thanks, it will be fixed in the next version.

@TheophileDiot
Copy link
Member

Hi @celevra we are aware of this bug and as referenced on discord and by @fl0ppy-d1sk it will be fixed in the next version.

Here's a temporary step-by-step guide to temporary fix it:

  1. Create a dir named bw-tmp for example (if you're on linux you won't need to create a dir)
  2. Download the mmdb files present in src/bw/misc of the project in the bw-tmp dir (for linux it will be at /var/tmp/bunkerweb/)
wget https://github.com/bunkerity/bunkerweb/raw/master/src/bw/misc/asn.mmdb
wget https://github.com/bunkerity/bunkerweb/raw/master/src/bw/misc/country.mmdb
  1. (Docker only) create a volume on the scheduler container from your dir (bw-tmp) pointing to /var/tmp/bunkerweb - remember to respect the same permissions as with the bw-data folder: https://docs.bunkerweb.io/1.5.6/integrations/#scheduler
  2. Once the files downloaded and placed correctly you just have to restart BunkerWeb and it's fixed (on docker just the scheduler suffice)

@fl0ppy-d1sk
Copy link
Member

Hey @celevra,

It's fixed in 1.5.7 ! Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants