"This service is not available in your region" [OpenCode Zen] #1794

Open
opened 2026-02-16 17:32:38 -05:00 by yindo · 0 comments
Owner

Originally created by @ahosker on GitHub (Sep 22, 2025).

Originally assigned to: @fwang on GitHub.

Presumed Issue: Zen API routes are deployed on CloudFlare Workers, meaning proxied API requests are handled at the edge. Some of these edge nodes are in Russia (or other blocked regions), and some Model Providers block Russia. So sometimes the Zen API works, but on the odd time CloudFlare routes to an edge node in Russia, it breaks.

I reach the Russian GEO Blocked Edge Node frequently, as my Hetzner server is in Helsinki, Finland.

I can avoid this issue by running requests via a VPN. Still, my recommendation is that Zen checks for "This service is not available in your region." and displays a message to the user instead of "unknown error" so they can take similar steps.

A better solution is to prevent CloudFlare from using Edge Nodes in commonly blocked countries, or utilise CloudFlare's backbone to establish a USA exit node for the API provider (instead of the entry node).

I would author a pull request, but have no idea how to get started on either better error handling or cloudflare deployment.

The TUI shows error 2025-09-21T23:19:27 +1ms service=tui message=AI_APICallError: Forbidden name=UnknownError Server error however the logs give more information:

"statusCode": 403,
    "responseHeaders": {
      "nel": "{\"success_fraction\":0,\"report_to\":\"cf-nel\",\"max_age\":604800}",
      "report-to": "{\"endpoints\":[{\"url\":\"https:\\/\\/a.nel.cloudflare.com\\/report\\/v4?s=QJa9xK90qe2SQbo5I2CbKivb4vMJ4Ad%2F4blAkCPJGzdetkY0O8gas%2BLIgQO8IOtdIeFcmitRnDzYt9VSHG6ygWeMOxWX0bP9EdPqVjaEbPROJMszqj%2FLlJ0pOSq2EQ%3D%3D\"}],\"group\":\"cf-nel\",\"max_age\":604800}",
      "server": "cloudflare",
      "server-timing": "cfL4;desc=\"?proto=TCP&rtt=15697&min_rtt=15677&rtt_var=5893&sent=18&recv=41&lost=0&retrans=0&sent_bytes=3201&recv_bytes=49400&delivery_rate=277093&cwnd=247&unsent_bytes=0&cid=325045ec25d26b62&ts=510&x=0\"",
      "transfer-encoding": "chunked",
      "vary": "Accept-Encoding"
    },
    "responseBody": "<!doctype html>\n<html>\n<body>\n<p>This service is not available in your region.</p>\n<script>(function(){function c(){var b=a.contentDocument||a.contentWindow.document;if(b){var d=b.createElement('script');d.innerHTML=\"window.__CF$cv$params={r:'982d499e0ce4f0ff',t:'MTc1ODQ5Njc2Ny4wMDAwMDA='};var a=document.createElement('script');a.nonce='';a.src='/cdn-cgi/challenge-platform/scripts/jsd/main.js';document.getElementsByTagName('head')[0].appendChild(a);\";b.getElementsByTagName('head')[0].appendChild(d)}}if(document.body){var a=document.createElement('iframe');a.height=1;a.width=1;a.style.position='absolute';a.style.top=0;a.style.left=0;a.style.border='none';a.style.visibility='hidden';document.body.appendChild(a);if('loading'!==document.readyState)c();else if(window.addEventListener)document.addEventListener('DOMContentLoaded',c);else{var e=document.onreadystatechange||function(){};document.onreadystatechange=function(b){e(b);'loading'!==document.readyState&&(document.onreadystatechange=e,c())}}}})();</script></body>\n</html>",
    "isRetryable": false
Originally created by @ahosker on GitHub (Sep 22, 2025). Originally assigned to: @fwang on GitHub. **Presumed Issue**: Zen API routes are deployed on CloudFlare Workers, meaning proxied API requests are handled at the edge. Some of these edge nodes are in Russia (or other blocked regions), and some Model Providers block Russia. So sometimes the Zen API works, but on the odd time CloudFlare routes to an edge node in Russia, it breaks. I reach the Russian GEO Blocked Edge Node frequently, as my Hetzner server is in Helsinki, Finland. I can avoid this issue by running requests via a VPN. Still, my recommendation is that Zen checks for "This service is not available in your region." and displays a message to the user instead of "unknown error" so they can take similar steps. A better solution is to prevent CloudFlare from using Edge Nodes in commonly blocked countries, or utilise CloudFlare's backbone to establish a USA exit node for the API provider (instead of the entry node). I would author a pull request, but have no idea how to get started on either better error handling or cloudflare deployment. The TUI shows error `2025-09-21T23:19:27 +1ms service=tui message=AI_APICallError: Forbidden name=UnknownError Server error` however the logs give more information: ```json "statusCode": 403, "responseHeaders": { "nel": "{\"success_fraction\":0,\"report_to\":\"cf-nel\",\"max_age\":604800}", "report-to": "{\"endpoints\":[{\"url\":\"https:\\/\\/a.nel.cloudflare.com\\/report\\/v4?s=QJa9xK90qe2SQbo5I2CbKivb4vMJ4Ad%2F4blAkCPJGzdetkY0O8gas%2BLIgQO8IOtdIeFcmitRnDzYt9VSHG6ygWeMOxWX0bP9EdPqVjaEbPROJMszqj%2FLlJ0pOSq2EQ%3D%3D\"}],\"group\":\"cf-nel\",\"max_age\":604800}", "server": "cloudflare", "server-timing": "cfL4;desc=\"?proto=TCP&rtt=15697&min_rtt=15677&rtt_var=5893&sent=18&recv=41&lost=0&retrans=0&sent_bytes=3201&recv_bytes=49400&delivery_rate=277093&cwnd=247&unsent_bytes=0&cid=325045ec25d26b62&ts=510&x=0\"", "transfer-encoding": "chunked", "vary": "Accept-Encoding" }, "responseBody": "<!doctype html>\n<html>\n<body>\n<p>This service is not available in your region.</p>\n<script>(function(){function c(){var b=a.contentDocument||a.contentWindow.document;if(b){var d=b.createElement('script');d.innerHTML=\"window.__CF$cv$params={r:'982d499e0ce4f0ff',t:'MTc1ODQ5Njc2Ny4wMDAwMDA='};var a=document.createElement('script');a.nonce='';a.src='/cdn-cgi/challenge-platform/scripts/jsd/main.js';document.getElementsByTagName('head')[0].appendChild(a);\";b.getElementsByTagName('head')[0].appendChild(d)}}if(document.body){var a=document.createElement('iframe');a.height=1;a.width=1;a.style.position='absolute';a.style.top=0;a.style.left=0;a.style.border='none';a.style.visibility='hidden';document.body.appendChild(a);if('loading'!==document.readyState)c();else if(window.addEventListener)document.addEventListener('DOMContentLoaded',c);else{var e=document.onreadystatechange||function(){};document.onreadystatechange=function(b){e(b);'loading'!==document.readyState&&(document.onreadystatechange=e,c())}}}})();</script></body>\n</html>", "isRetryable": false ```
yindo added the zen label 2026-02-16 17:32:38 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#1794