A DNS label is empty

I’m having an issue when trying to connect to the mflix site (localhost:5000) with python run.py or when trying to run the notebook cursor_methods_agg_equivalents (or any that tries to make a connection string).

it fails both in name.py
c:\python\lib\site-packages\dns\name.py in from_unicode(text, origin, idna_codec)
787 if len(label) == 0:
–> 788 raise EmptyLabel
789 labels.append(idna_codec.encode(label))

EmptyLabel: A DNS label is empty.
and in uri_parser.py
During handling of the above exception, another exception occurred:

c:\python\lib\site-packages\pymongo\uri_parser.py in _get_dns_srv_hosts(hostname)
287 results = resolver.query(’_mongodb._tcp.’ + hostname, ‘SRV’)
288 except Exception as exc:
–> 289 raise ConfigurationError(str(exc))
290 return [(maybe_decode(res.target.to_text(omit_final_dot=True)), res.port)
291 for res in results]

ConfigurationError: A DNS label is empty.

Does anyone has an idea what could it be? I was able to make the first chapters without issue last week.


Hi @Gustavo_07903,

Can you send us your .ini file contents?

This error may be caused by an incorrect (perhaps a small typo) MFLIX_DB_URI value.


Hello Norberto,

Exactly like this one:

Ticket: Connection#

[PROD]SECRET_KEY = super_secret_key_you_should_change
MFLIX_DB_URI = mongodb+srv://m220student:m220password@mflix-35raq.mongodb.net/test
[TEST]SECRET_KEY = super_secret_testing_key
MFLIX_DB_URI = mongodb+srv://m220student:m220password@mflix-35raq.mongodb.net/test