# Setting DISCOURSE\_MAXMIND\_LICENSE\_KEY breaks docker image/container build

**URL:** <https://meta.discourse.org/t/setting-discourse-maxmind-license-key-breaks-docker-image-container-build/277564>\
**Category:** Self-hosting\
**Tags:** maxmind\
**Created:** [September 2, 2023, 1:37pm UTC](https://meta.discourse.org/t/setting-discourse-maxmind-license-key-breaks-docker-image-container-build/277564 "2023-09-02T13:37:59Z")\
**Posts on this page:** 1\
**Showing post:** 1

<div class="post-metadata">

**Author:** ![cbreit](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/cbreit/32/373832_2.png) [@cbreit](https://meta.discourse.org/u/cbreit)\
**Post date:** [September 2, 2023, 1:37pm UTC](https://meta.discourse.org/t/setting-discourse-maxmind-license-key-breaks-docker-image-container-build/277564/1 "2023-09-02T13:37:59Z")

</div>

Hey people,

When running a docker based install, and setting `DISCOURSE_MAXMIND_LICENSE_KEY` the image creation process aborts with this error:

```plaintext
/var/www/discourse/lib/discourse_ip_info.rb:48:in `mmdb_download': undefined method `path' for nil:NilClass (NoMethodError)

    filename = File.basename(gz_file.path)
                                    ^^^^^
        from /var/www/discourse/lib/tasks/maxminddb.rake:67:in `block (3 levels) in <main>'
        from /var/www/discourse/lib/tasks/maxminddb.rake:65:in `each'
        from /var/www/discourse/lib/tasks/maxminddb.rake:65:in `block (2 levels) in <main>'

```

When leaving `DISCOURSE_MAXMIND_LICENSE_KEY` empty, everything works fine.  
Tested with versions: `stable` and `tests-passed`

The Maxmind license works – so both URLs provide access to the .mmdb files:

- [https://download.maxmind.com/app/geoip\_download?license\_key=MAXMIND\_KEY&edition\_id=GeoLite2-City&suffix=tar.gz](https://download.maxmind.com/app/geoip_download?license_key=MAXMIND_KEY&edition_id=GeoLite2-City&suffix=tar.gz)

Just a guess (I’m not a ruby guys; so please go easy on me) – maybe the ‘.mmdb’ extension causes problems in `FileHelper.download(...)` a couple of lines below :

> <https://github.com/discourse/discourse/blob/38230970ea2f4426b3fdda2a74a168314f27c81a/lib/discourse_ip_info.rb#L14>

Adding “.mmdb” to the links provided above causes an `Invalid edition ID` error.

Hope this helps narrowing down the issue.

---

_[View the full topic](https://meta.discourse.org/t/setting-discourse-maxmind-license-key-breaks-docker-image-container-build/277564)._
