0

I'm setting up Weblate on Google Cloud Platform (GCE using Container-Optimized OS) and deploying via docker-compose using the HTTPS configuration.

I've followed these tutorials:

Weblate is running fine, however emails aren't sending due to the following:

ERROR Handled exception: OSError: [Errno 99] Cannot assign requested address
Traceback (most recent call last):
  File "/usr/local/bin/weblate", line 11, in <module>
    load_entry_point('Weblate==3.8', 'console_scripts', 'weblate')()
  File "/usr/local/lib/python3.7/dist-packages/weblate/runner.py", line 34, in main
    execute_from_command_line(argv)
  File "/usr/local/lib/python3.7/dist-packages/django/core/management/__init__.py", line 381, in execute_from_command_line
    utility.execute()
  File "/usr/local/lib/python3.7/dist-packages/django/core/management/__init__.py", line 375, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "/usr/local/lib/python3.7/dist-packages/django/core/management/base.py", line 323, in run_from_argv
    self.execute(*args, **cmd_options)
  File "/usr/local/lib/python3.7/dist-packages/django/core/management/base.py", line 364, in execute
    output = self.handle(*args, **options)
  File "/usr/local/lib/python3.7/dist-packages/django/core/management/commands/sendtestemail.py", line 33, in handle
    recipient_list=kwargs['email'],
  File "/usr/local/lib/python3.7/dist-packages/django/core/mail/__init__.py", line 60, in send_mail
    return mail.send()
  File "/usr/local/lib/python3.7/dist-packages/django/core/mail/message.py", line 291, in send
    return self.get_connection(fail_silently).send_messages([self])
  File "/usr/local/lib/python3.7/dist-packages/django/core/mail/backends/smtp.py", line 103, in send_messages
    new_conn_created = self.open()
  File "/usr/local/lib/python3.7/dist-packages/django/core/mail/backends/smtp.py", line 63, in open
    self.connection = self.connection_class(self.host, self.port, **connection_params)
  File "/usr/lib/python3.7/smtplib.py", line 251, in __init__
    (code, msg) = self.connect(host, port)
  File "/usr/lib/python3.7/smtplib.py", line 336, in connect
    self.sock = self._get_socket(host, port, self.timeout)
  File "/usr/lib/python3.7/smtplib.py", line 307, in _get_socket
    self.source_address)
  File "/usr/lib/python3.7/socket.py", line 727, in create_connection
    raise err
  File "/usr/lib/python3.7/socket.py", line 716, in create_connection
    sock.connect(sa)
OSError: [Errno 99] Cannot assign requested address

I've tried is playing with various settings in the docker-compose-https.override.yml file, namely omitting certain settings to auto configure and changing the email address specified, specifying the port for mail, and changing SSL/TLS settings.

Here are the relevant parts of the configuration:

...
WEBLATE_EMAIL_HOST: "smtp-relay.gmail.com"
WEBLATE_SERVER_EMAIL: "weblate@example.org"
WEBLATE_DEFAULT_FROM_EMAIL: "weblate@example.org"
WEBLATE_USE_SSL: 0
WEBLATE_USE_TLS: 1
WEBLATE_ALLOWED_HOSTS: "i18n.example.org"
...

I'm unsure what the problem is or where to look to address it.

0

I was trying some of my previous attempts again... it appears manually specifying the port was the actual solution.

I must have typed it wrong before, or perhaps if an external configuration in G Suite can cause the above error then the change in settings hadn't propagated yet.

WEBLATE_EMAIL_HOST: "smtp-relay.gmail.com"

# THE SOLUTION #
WEBLATE_EMAIL_PORT: 587

WEBLATE_SERVER_EMAIL: "weblate@example.org"
WEBLATE_DEFAULT_FROM_EMAIL: "weblate@example.org"
WEBLATE_USE_SSL: 0
WEBLATE_USE_TLS: 1

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.