Skip to content

Deployment fails when ifconfig.co answers with captcha #5050

@simon-mueller

Description

@simon-mueller

Describe the bug

if the external website ifconfig.co answers with html instead of json, the entire deployment fails at step:
galaxy/coturn : Fetch IP address information from echoip service

When I manually curl the endpoint from my matrix server, it's clear that there's a cloudflare captcha in the way.

# curl https://ifconfig.co/json
<!DOCTYPE html><html lang="en-US"><head><title>Just a moment...</title><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><meta http-equiv="X-UA-Compatible" content="IE=Edge"><meta name="robots" content="noindex,nofollow"><meta name="viewport" content="width=device-width,initial-scale=1"><style>*{box-sizing:border-box;margin:0;padding:0}html{line-height:1.15;-webkit-text-size-adjust:100%;color:#313131;font-family:system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,"Noto Sans",sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji"}body{display:flex;flex-direction:column;height:100vh;min-height:100vh}.main-content{margin:8rem auto;padding-left:1.5rem;max-width:60rem}@media (width <= 720px){.main-content{margin-top:4rem}}#challenge-error-text{background-image:url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIzMiIgaGVpZ2h0PSIzMiIgZmlsbD0ibm9uZSI+PHBhdGggZmlsbD0iI0IyMEYwMyIgZD0iTTE2IDNhMTMgMTMgMCAxIDAgMTMgMTNBMTMuMDE1IDEzLjAxNSAwIDAgMCAxNiAzbTAgMjRhMTEgMTEgMCAxIDEgMTEtMTEgMTEuMDEgMTEuMDEgMCAwIDEtMTEgMTEiLz48cGF0aCBmaWxsPSIjQjIwRjAzIiBkPSJNMTcuMDM4IDE4LjYxNUgxNC44N0wxNC41NjMgOS41aDIuNzgzem0tMS4wODQgMS40MjdxLjY2IDAgMS4wNTcuMzg4LjQwNy4zODkuNDA3Ljk5NCAwIC41OTYtLjQwNy45ODQtLjM5Ny4zOS0xLjA1Ny4zODktLjY1IDAtMS4wNTYtLjM4OS0uMzk4LS4zODktLjM5OC0uOTg0IDAtLjU5Ny4zOTgtLjk4NS40MDYtLjM5NyAxLjA1Ni0uMzk3Ii8+PC9zdmc+");background-repeat:no-repeat;background-size:contain;padding-left:34px}</style><meta http-equiv="refresh" content="360"></head><body><div class="main-wrapper" role="main"><div class="main-content"><noscript><div class="h2"><span id="challenge-error-text">Enable JavaScript and cookies to continue</span></div></noscript></div></div><script>(function(){window._cf_chl_opt = {cvId: '3',cZone: 'ifconfig.co',cType: 'managed',cRay: '9de69127a8a403c4',cH: 'KlG.ZGWRHAjoe52OOUV8BoStLnRvRtafe8OJNTYt60w-1773861336-1.2.1.1-XhB7XlsNaKbIb2WHsKS9mq0dedx.CCh4jtSXcPYbX.D8AP4pgwUklmkM5bK5M7LB',cUPMDTk:"/json?__cf_chl_tk=SQrbmCTWc2zAg2TtB.K3wg0QBYiyGCJlDIejAbwoBeY-1773861336-1.0.1.1-ti1YARA9nW0ygPQHHep.xqgm2b.R0TtyZtyMUZ9epto",cFPWv: 'b',cITimeS: '1773861336',cTplC:0,cTplO:0,cTplV:5,cTplB: '0',fa:"/json?__cf_chl_f_tk=SQrbmCTWc2zAg2TtB.K3wg0QBYiyGCJlDIejAbwoBeY-1773861336-1.0.1.1-ti1YARA9nW0ygPQHHep.xqgm2b.R0TtyZtyMUZ9epto",md: 'tPOdRhC6Oa1z6Vo_eaEAeS4HplXvSbkmnq0CV6keQ60-1773861336-1.2.1.1-Tn9610dGs8WNS9UjHg0xRTZUWG_k9eY6RjvJncmsSI61QkuqGP93YaSGHjR7XCQ0yzRukYiM4muaQJbgHfg4H4iCDhCSDgL.CWYX8SLhbzNy8xMVI.mrocWl3UUIby3IagPqrEoFnZAJ.28Fw2PuDEvTvBrdSJPrOed4cjOJoShjixeNvHcPjVMcSETKCCqJCbMBiSVU7NwMuWEX79.pKhF7GQPpU2Q7096gRzG8VD6_Lnz4BQG84.7sWIHbIHETAOxiB9jg4A7Hi13tr_0vEZSb.NroEzvB.yc2wpDbMI0LaKmiLs0MJfxBIbMnYp.0nO1NLOLNuTI4wsW1IIEBBjmoSdJYfAPTXp_.VnF_p0EbtM_a4xwwx5vGVXDLLWGzdoJlJTuDaCAKbJzaAUnjPxpYRrTNYlT6v_BL4cyE6G2RR7k06hRmQkkRTgOwrRzWSCW8adC14k5ANaHOs0r2s_jjUP.mMeZ74Lqy9EOYq79KdgaxcM8ug5Dqv7dEkZinW6Metsed45o9EthmIXtm.HRd4yopXNSgopJTqAF382yvMoahz7cWewI9tl7kafAwuwpvvsXL4k.SbffAAmlz8zxH23h2ruTToYQR4.lWcIG7wFDnpvrCb8iCKAxwT5EQojnXWx171eqPuKuRxN1bvtfZvPh8rIqdtiJnuAYZIsYUOUbMozPiSBJOTLeTDBnDKembdbnUHTbZsSKQZiVfNYr2DyslYd76seOhCjkzPVBceL4Hh6FeBIEbd318zKNdKnn5hfvZ_XP2VCYwYL.VN65zDaIhVrwnp_jdfBcqHxXmFGWL1EcOzaz5HCPe5kue',mdrd: 'aB5kqnB8uafYFZCN.a1y37oy0.wvVnaq656YOhAhJ1M-1773861336-1.2.1.1-gr2_FJMNpZMG8khIesuRrEdJ9YKneTR1w.aTaz7gkhXqE0sIQkZVurORYfeIis7bXDAgeo0T8fc1U4pBQh8Wep9iFC48HIdyq32ezCpN2L3McW4kOKZV_STqqHJz4k8NE8Qp5T.CC0HnUeAgpllQQJa6IoDFrFNrRBJonTayt2.PYm1mqCfNVlJ76_ov2ErMMmobUtGIkBfoIhjeQjXlH11Q560EkBJ8ZCXacRQBp1AXj7.JY3tkrsw6KeHdpwkX',};var a = document.createElement('script');a.src = '/cdn-cgi/challenge-platform/h/b/orchestrate/chl_page/v1?ray=9de69127a8a403c4';window._cf_chl_opt.cOgUHash = location.hash === '' && location.href.indexOf('#') !== -1 ? '#' : location.hash;window._cf_chl_opt.cOgUQuery = location.search === '' && location.href.slice(0, location.href.length - window._cf_chl_opt.cOgUHash.length).indexOf('?') !== -1 ? '?' : location.search;if (window.history && window.history.replaceState) {var ogU = location.pathname + window._cf_chl_opt.cOgUQuery + window._cf_chl_opt.cOgUHash;history.replaceState(null, null,"/json?__cf_chl_rt_tk=SQrbmCTWc2zAg2TtB.K3wg0QBYiyGCJlDIejAbwoBeY-1773861336-1.0.1.1-ti1YARA9nW0ygPQHHep.xqgm2b.R0TtyZtyMUZ9epto"+ window._cf_chl_opt.cOgUHash);a.onload = function() {history.replaceState(null, null, ogU);}}document.getElementsByTagName('head')[0].appendChild(a);}());</script></body></html>
TASK [galaxy/coturn : Fetch IP address information from echoip service] ********************************************************************************************************************************************************************
FAILED - RETRYING: [matrix.fqdn.tld]: Fetch IP address information from echoip service (10 retries left).
FAILED - RETRYING: [matrix.fqdn.tld]: Fetch IP address information from echoip service (9 retries left).
FAILED - RETRYING: [matrix.fqdn.tld]: Fetch IP address information from echoip service (8 retries left).
FAILED - RETRYING: [matrix.fqdn.tld]: Fetch IP address information from echoip service (7 retries left).
FAILED - RETRYING: [matrix.fqdn.tld]: Fetch IP address information from echoip service (6 retries left).
FAILED - RETRYING: [matrix.fqdn.tld]: Fetch IP address information from echoip service (5 retries left).
FAILED - RETRYING: [matrix.fqdn.tld]: Fetch IP address information from echoip service (4 retries left).
FAILED - RETRYING: [matrix.fqdn.tld]: Fetch IP address information from echoip service (3 retries left).
FAILED - RETRYING: [matrix.fqdn.tld]: Fetch IP address information from echoip service (2 retries left).
FAILED - RETRYING: [matrix.fqdn.tld]: Fetch IP address information from echoip service (1 retries left).
[ERROR]: Task failed: Module failed: Status code was 403 and not [200]: HTTP Error 403: Forbidden
Origin: /home/simon/git/matrix-docker-ansible-deploy/roles/galaxy/coturn/tasks/install.yml:27:7

25     # `ansible.builtin.uri` does not provide a way to configure whether IPv4 or IPv6 is used.
26     # Luckily, the default instance we use does not define AAAA records for now, so it's always IPv4.
27     - name: Fetch IP address information from echoip service
         ^ column 7

fatal: [matrix.fqdn.tld]: FAILED! => {"accept_ch": "Sec-CH-UA-Bitness, Sec-CH-UA-Arch, Sec-CH-UA-Full-Version, Sec-CH-UA-Mobile, Sec-CH-UA-Model, Sec-CH-UA-Platform-Version, Sec-CH-UA-Full-Version-List, Sec-CH-UA-Platform, Sec-CH-UA, UA-Bitness, UA-Arch, UA-Full-Version, UA-Mobile, UA-Model, UA-Platform-Version, UA-Platform, UA", "alt_svc": "h3=\":443\"; ma=86400", "attempts": 10, "cf_mitigated": "challenge", "cf_ray": "9de68afaee9d882b-FRA", "changed": false, "connection": "close", "content_type": "text/html; charset=UTF-8", "critical_ch": "Sec-CH-UA-Bitness, Sec-CH-UA-Arch, Sec-CH-UA-Full-Version, Sec-CH-UA-Mobile, Sec-CH-UA-Model, Sec-CH-UA-Platform-Version, Sec-CH-UA-Full-Version-List, Sec-CH-UA-Platform, Sec-CH-UA, UA-Bitness, UA-Arch, UA-Full-Version, UA-Mobile, UA-Model, UA-Platform-Version, UA-Platform, UA", "cross_origin_embedder_policy": "require-corp", "cross_origin_opener_policy": "same-origin", "cross_origin_resource_policy": "same-origin", "date": "Wed, 18 Mar 2026 19:11:23 GMT", "elapsed": 0, "msg": "Status code was 403 and not [200]: HTTP Error 403: Forbidden", "nel": "{\"report_to\":\"cf-nel\",\"success_fraction\":0.0,\"max_age\":604800}", "origin_agent_cluster": "?1", "permissions_policy": "accelerometer=(),browsing-topics=(),camera=(),clipboard-read=(),clipboard-write=(),geolocation=(),gyroscope=(),hid=(),interest-cohort=(),magnetometer=(),microphone=(),payment=(),publickey-credentials-get=(),screen-wake-lock=(),serial=(),sync-xhr=(),usb=()", "redirected": false, "referrer_policy": "same-origin", "report_to": "{\"group\":\"cf-nel\",\"max_age\":604800,\"endpoints\":[{\"url\":\"https://a.nel.cloudflare.com/report/v4?s=PhmFjg5B8uU4Q8aHw6k2jH%2BETWZ6RTeUiQM4GQAgm2IT%2FsLiO8HlleBHUBH3P47bDUXLqQSOJicnlPcN5052obHENhvHR%2FaHye3wl6zjDm6uew%2BEXiGE\"}]}", "server": "cloudflare", "server_timing": "chlray;desc=\"9de68afaee9d882b\"", "status": 403, "transfer_encoding": "chunked", "url": "https://ifconfig.co/json", "x_content_type_options": "nosniff", "x_frame_options": "SAMEORIGIN"}
...ignoring

TASK [galaxy/coturn : Fail if echoip service failed] ***************************************************************************************************************************************************************************************
[ERROR]: Task failed: Action failed: Failed contacting echoip service API at `https://ifconfig.co/json` (controlled by `coturn_turn_external_ip_address_auto_detection_echoip_service_url`). Full error: {'redirected': False, 'url': 'https://ifconfig.co/json', 'status': 403, 'date': 'Wed, 18 Mar 2026 19:11:23 GMT', 'content_type': 'text/html; charset=UTF-8', 'transfer_encoding': 'chunked', 'connection': 'close', 'accept_ch': 'Sec-CH-UA-Bitness, Sec-CH-UA-Arch, Sec-CH-UA-Full-Version, Sec-CH-UA-Mobile, Sec-CH-UA-Model, Sec-CH-UA-Platform-Version, Sec-CH-UA-Full-Version-List, Sec-CH-UA-Platform, Sec-CH-UA, UA-Bitness, UA-Arch, UA-Full-Version, UA-Mobile, UA-Model, UA-Platform-Version, UA-Platform, UA', 'cf_mitigated': 'challenge', 'critical_ch': 'Sec-CH-UA-Bitness, Sec-CH-UA-Arch, Sec-CH-UA-Full-Version, Sec-CH-UA-Mobile, Sec-CH-UA-Model, Sec-CH-UA-Platform-Version, Sec-CH-UA-Full-Version-List, Sec-CH-UA-Platform, Sec-CH-UA, UA-Bitness, UA-Arch, UA-Full-Version, UA-Mobile, UA-Model, UA-Platform-Version, UA-Platform, UA', 'cross_origin_embedder_policy': 'require-corp', 'cross_origin_opener_policy': 'same-origin', 'cross_origin_resource_policy': 'same-origin', 'origin_agent_cluster': '?1', 'permissions_policy': 'accelerometer=(),browsing-topics=(),camera=(),clipboard-read=(),clipboard-write=(),geolocation=(),gyroscope=(),hid=(),interest-cohort=(),magnetometer=(),microphone=(),payment=(),publickey-credentials-get=(),screen-wake-lock=(),serial=(),sync-xhr=(),usb=()', 'referrer_policy': 'same-origin', 'server_timing': 'chlray;desc="9de68afaee9d882b"', 'x_content_type_options': 'nosniff', 'x_frame_options': 'SAMEORIGIN', 'report_to': '{"group":"cf-nel","max_age":604800,"endpoints":[{"url":"https://a.nel.cloudflare.com/report/v4?s=PhmFjg5B8uU4Q8aHw6k2jH%2BETWZ6RTeUiQM4GQAgm2IT%2FsLiO8HlleBHUBH3P47bDUXLqQSOJicnlPcN5052obHENhvHR%2FaHye3wl6zjDm6uew%2BEXiGE"}]}', 'nel': '{"report_to":"cf-nel","success_fraction":0.0,"max_age":604800}', 'server': 'cloudflare', 'cf_ray': '9de68afaee9d882b-FRA', 'alt_svc': 'h3=":443"; ma=86400', 'elapsed': 0, 'changed': False, 'failed': True, 'msg': 'Status code was 403 and not [200]: HTTP Error 403: Forbidden', 'attempts': 10, 'exception': '(traceback unavailable)'}
Origin: /home/simon/git/matrix-docker-ansible-deploy/roles/galaxy/coturn/tasks/install.yml:41:7

39       until: not result_coturn_turn_external_ip_address_auto_detection_echoip_response.failed
40
41     - name: Fail if echoip service failed
         ^ column 7

fatal: [matrix.fqdn.tld]: FAILED! => {"changed": false, "msg": "Failed contacting echoip service API at `https://ifconfig.co/json` (controlled by `coturn_turn_external_ip_address_auto_detection_echoip_service_url`). Full error: {'redirected': False, 'url': 'https://ifconfig.co/json', 'status': 403, 'date': 'Wed, 18 Mar 2026 19:11:23 GMT', 'content_type': 'text/html; charset=UTF-8', 'transfer_encoding': 'chunked', 'connection': 'close', 'accept_ch': 'Sec-CH-UA-Bitness, Sec-CH-UA-Arch, Sec-CH-UA-Full-Version, Sec-CH-UA-Mobile, Sec-CH-UA-Model, Sec-CH-UA-Platform-Version, Sec-CH-UA-Full-Version-List, Sec-CH-UA-Platform, Sec-CH-UA, UA-Bitness, UA-Arch, UA-Full-Version, UA-Mobile, UA-Model, UA-Platform-Version, UA-Platform, UA', 'cf_mitigated': 'challenge', 'critical_ch': 'Sec-CH-UA-Bitness, Sec-CH-UA-Arch, Sec-CH-UA-Full-Version, Sec-CH-UA-Mobile, Sec-CH-UA-Model, Sec-CH-UA-Platform-Version, Sec-CH-UA-Full-Version-List, Sec-CH-UA-Platform, Sec-CH-UA, UA-Bitness, UA-Arch, UA-Full-Version, UA-Mobile, UA-Model, UA-Platform-Version, UA-Platform, UA', 'cross_origin_embedder_policy': 'require-corp', 'cross_origin_opener_policy': 'same-origin', 'cross_origin_resource_policy': 'same-origin', 'origin_agent_cluster': '?1', 'permissions_policy': 'accelerometer=(),browsing-topics=(),camera=(),clipboard-read=(),clipboard-write=(),geolocation=(),gyroscope=(),hid=(),interest-cohort=(),magnetometer=(),microphone=(),payment=(),publickey-credentials-get=(),screen-wake-lock=(),serial=(),sync-xhr=(),usb=()', 'referrer_policy': 'same-origin', 'server_timing': 'chlray;desc=\"9de68afaee9d882b\"', 'x_content_type_options': 'nosniff', 'x_frame_options': 'SAMEORIGIN', 'report_to': '{\"group\":\"cf-nel\",\"max_age\":604800,\"endpoints\":[{\"url\":\"https://a.nel.cloudflare.com/report/v4?s=PhmFjg5B8uU4Q8aHw6k2jH%2BETWZ6RTeUiQM4GQAgm2IT%2FsLiO8HlleBHUBH3P47bDUXLqQSOJicnlPcN5052obHENhvHR%2FaHye3wl6zjDm6uew%2BEXiGE\"}]}', 'nel': '{\"report_to\":\"cf-nel\",\"success_fraction\":0.0,\"max_age\":604800}', 'server': 'cloudflare', 'cf_ray': '9de68afaee9d882b-FRA', 'alt_svc': 'h3=\":443\"; ma=86400', 'elapsed': 0, 'changed': False, 'failed': True, 'msg': 'Status code was 403 and not [200]: HTTP Error 403: Forbidden', 'attempts': 10, 'exception': '(traceback unavailable)'}"}

If the ifconfig.co website doesn't reply with the expected json, the deployment shouldn't fail.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions