<p dir="auto">Seen with Celery 3.1.20, Django 1.9</p>
<p dir="auto">Steps to reproduce:</p>
<ul dir="auto">
<li>Set CELERY_RESULT_BACKEND to multiple memcache servers e.g. <code class="notranslate">CELERY_RESULT_BACKEND = 'cache+memcached://127.0.0.1:11211;127.0.0.10:11211/'</code></li>
<li>Start a celery worker using ./manage.py celery worker</li>
</ul>
<p dir="auto">Result is a crash with stacktrace:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="[2016-02-20 14:58:41,566: ERROR/MainProcess] Unrecoverable error: ValueError(&quot;invalid literal for int() with base 10: '11211;127.0.0.10'&quot;,)
Traceback (most recent call last):
  File &quot;/Users/malcolmbox/dev/tellybug/webserver/lib/python2.7/site-packages/celery/worker/__init__.py&quot;, line 206, in start
    self.blueprint.start(self)
  File &quot;/Users/malcolmbox/dev/tellybug/webserver/lib/python2.7/site-packages/celery/bootsteps.py&quot;, line 119, in start
    self.on_start()
  File &quot;/Users/malcolmbox/dev/tellybug/webserver/lib/python2.7/site-packages/celery/apps/worker.py&quot;, line 170, in on_start
    string(self.colored.cyan(' \n', self.startup_info())),
  File &quot;/Users/malcolmbox/dev/tellybug/webserver/lib/python2.7/site-packages/celery/apps/worker.py&quot;, line 232, in startup_info
    self.app.conf.CELERY_RESULT_BACKEND or 'disabled',
  File &quot;/Users/malcolmbox/dev/tellybug/webserver/lib/python2.7/site-packages/kombu/utils/url.py&quot;, line 63, in maybe_sanitize_url
    return sanitize_url(url, mask)
  File &quot;/Users/malcolmbox/dev/tellybug/webserver/lib/python2.7/site-packages/kombu/utils/url.py&quot;, line 58, in sanitize_url
    return as_url(*_parse_url(url), sanitize=True, mask=mask)
  File &quot;/Users/malcolmbox/dev/tellybug/webserver/lib/python2.7/site-packages/kombu/utils/url.py&quot;, line 24, in _parse_url
    return (scheme, unquote(parts.hostname or '') or None, parts.port,
  File &quot;/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urlparse.py&quot;, line 113, in port
    port = int(port, 10)
ValueError: invalid literal for int() with base 10: '11211;127.0.0.10'"><pre class="notranslate"><code class="notranslate">[2016-02-20 14:58:41,566: ERROR/MainProcess] Unrecoverable error: ValueError("invalid literal for int() with base 10: '11211;127.0.0.10'",)
Traceback (most recent call last):
  File "/Users/malcolmbox/dev/tellybug/webserver/lib/python2.7/site-packages/celery/worker/__init__.py", line 206, in start
    self.blueprint.start(self)
  File "/Users/malcolmbox/dev/tellybug/webserver/lib/python2.7/site-packages/celery/bootsteps.py", line 119, in start
    self.on_start()
  File "/Users/malcolmbox/dev/tellybug/webserver/lib/python2.7/site-packages/celery/apps/worker.py", line 170, in on_start
    string(self.colored.cyan(' \n', self.startup_info())),
  File "/Users/malcolmbox/dev/tellybug/webserver/lib/python2.7/site-packages/celery/apps/worker.py", line 232, in startup_info
    self.app.conf.CELERY_RESULT_BACKEND or 'disabled',
  File "/Users/malcolmbox/dev/tellybug/webserver/lib/python2.7/site-packages/kombu/utils/url.py", line 63, in maybe_sanitize_url
    return sanitize_url(url, mask)
  File "/Users/malcolmbox/dev/tellybug/webserver/lib/python2.7/site-packages/kombu/utils/url.py", line 58, in sanitize_url
    return as_url(*_parse_url(url), sanitize=True, mask=mask)
  File "/Users/malcolmbox/dev/tellybug/webserver/lib/python2.7/site-packages/kombu/utils/url.py", line 24, in _parse_url
    return (scheme, unquote(parts.hostname or '') or None, parts.port,
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urlparse.py", line 113, in port
    port = int(port, 10)
ValueError: invalid literal for int() with base 10: '11211;127.0.0.10'
</code></pre></div>
<p dir="auto">According to the documentation, this is a valid format for CELERY_RESULT_BACKEND, and this was working on previous versions of celery</p>
<p dir="auto">This is happening during printing of the startup banner, so completely prevents the worker from starting.</p>
<p dir="auto">This breaks mongo backend, because of <a class="commit-link" data-hovercard-type="commit" data-hovercard-url="https://github.com/celery/celery/commit/33f1dc829223da5499e05e271a6d49edde7ffc68/hovercard" href="https://github.com/celery/celery/commit/33f1dc829223da5499e05e271a6d49edde7ffc68"><tt>33f1dc8</tt></a>. I believe <code class="notranslate">maybe_sanitize_url</code> doesn't play well with replica sets...</p>
<p dir="auto">Full backtrace:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="ValueError: invalid literal for int() with base 10: '53473,{snip}.mongolab.com'
  File &quot;celery/worker/__init__.py&quot;, line 206, in start
    self.blueprint.start(self)
  File &quot;celery/bootsteps.py&quot;, line 119, in start
    self.on_start()
  File &quot;celery/apps/worker.py&quot;, line 170, in on_start
    string(self.colored.cyan(' \n', self.startup_info())),
  File &quot;celery/apps/worker.py&quot;, line 232, in startup_info
    self.app.conf.CELERY_RESULT_BACKEND or 'disabled',
  File &quot;kombu/utils/url.py&quot;, line 63, in maybe_sanitize_url
    return sanitize_url(url, mask)
  File &quot;kombu/utils/url.py&quot;, line 58, in sanitize_url
    return as_url(*_parse_url(url), sanitize=True, mask=mask)
  File &quot;kombu/utils/url.py&quot;, line 24, in _parse_url
    return (scheme, unquote(parts.hostname or '') or None, parts.port,
  File &quot;python2.7/urlparse.py&quot;, line 113, in port
    port = int(port, 10)"><pre class="notranslate"><code class="notranslate">ValueError: invalid literal for int() with base 10: '53473,{snip}.mongolab.com'
  File "celery/worker/__init__.py", line 206, in start
    self.blueprint.start(self)
  File "celery/bootsteps.py", line 119, in start
    self.on_start()
  File "celery/apps/worker.py", line 170, in on_start
    string(self.colored.cyan(' \n', self.startup_info())),
  File "celery/apps/worker.py", line 232, in startup_info
    self.app.conf.CELERY_RESULT_BACKEND or 'disabled',
  File "kombu/utils/url.py", line 63, in maybe_sanitize_url
    return sanitize_url(url, mask)
  File "kombu/utils/url.py", line 58, in sanitize_url
    return as_url(*_parse_url(url), sanitize=True, mask=mask)
  File "kombu/utils/url.py", line 24, in _parse_url
    return (scheme, unquote(parts.hostname or '') or None, parts.port,
  File "python2.7/urlparse.py", line 113, in port
    port = int(port, 10)
</code></pre></div>