CDN: trunk URL couldn't be downloaded: https://cdn.cocoapods.org/CocoaPods-version.yml Response: 403

1,959

Solution 1

There seems to be a problem with CloudFlare at the moment, status: https://github.com/CocoaPods/CocoaPods/issues/11355

Solution 2

also getting this error! until fixed, you can try to bypass the CDN:

run:

pod repo remove trunk

and add to Podfile:

source 'https://cocoapods-cdn.netlify.app/'

or without CDN at all:

source 'https://github.com/CocoaPods/Specs.git'

Solution 3

This should be fixed now. It seems that CloudFlare started to falsely detect CocoaPods traffic as a DDoS attack, and Orta Therox, a CocoaPods maintainer, had to change some configuration in order to get it working properly. Quoting from one of their comments on the GitHub issue:

The DDoS detection was triggered which can happen occasionally because CDN activity is still going up overall. It looks like traffic bounces over a threshold for stricter rules now. The way DDoS detection works in Cloudflare is through a series of rules/heuristics which can be individually tuned ( which is what I looked at in #11355 .)

After tuning the one people were hitting to "off", we paused a bit to determine if it was making changes. After seeing no changes, we flipped every rule/heuristic to off #11355

What we were seeing was still similar CDN traffic patterns but some traffic occasionally getting through correctly. This was when we reached out to Cloudflare support. With their help we determined that it was likely that the migration of our rules from the central settings repo to the different CDN edges (e.g. for simplicity think the servers closest to users each time) were using the cached (older) settings.

This meant some regions didn't have the new rules saying ignore the rule about 'allow the custom user-agent' - the Cloudflare support folks clears up the cache and now its looking like everything is working fine.

Solution 4

I found a temporary workaround that worked for me very well:

source 'https://cdn.cocoapods.org/'

target '...' do
  ...
end

require 'typhoeus'
Typhoeus::Config.user_agent = 'CocoaPods'

After that start pod deintegrate and pod install

Share:
1,959
SVG
Author by

SVG

Updated on January 04, 2023

Comments

  • SVG
    SVG over 1 year

    I was testing my application which is written in flutter and suddenly I keep getting CDN: trunk URL couldn't be downloaded: https://cdn.cocoapods.org/CocoaPods-version.yml Response: 403 error. I am not sure why this is happening. This is the error I am getting in the log. Note: This project was working fine but however suddenly I keep getting these errors.

    [!] CDN: trunk URL couldn't be downloaded: https://cdn.cocoapods.org/CocoaPods-version.yml Response: 403 <!DOCTYPE html>
    <!--[if lt IE 7]> <html class="no-js ie6 oldie" lang="en-US"> <![endif]-->
    <!--[if IE 7]>    <html class="no-js ie7 oldie" lang="en-US"> <![endif]-->
    <!--[if IE 8]>    <html class="no-js ie8 oldie" lang="en-US"> <![endif]-->
    <!--[if gt IE 8]><!--> <html class="no-js" lang="en-US"> <!--<![endif]-->
    <head>
    <title>Attention Required! | Cloudflare</title>
    <meta charset="UTF-8" />
    <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" />
    <link rel="stylesheet" id="cf_styles-css" href="/cdn-cgi/styles/cf.errors.css" />
    <!--[if lt IE 9]><link rel="stylesheet" id='cf_styles-ie-css' href="/cdn-cgi/styles/cf.errors.ie.css" /><![endif]-->
    <style>body{margin:0;padding:0}</style>
    
    
    <!--[if gte IE 10]><!-->
    <script>
      if (!navigator.cookieEnabled) {
        window.addEventListener('DOMContentLoaded', function () {
          var cookieEl = document.getElementById('cookie-alert');
          cookieEl.style.display = 'block';
        })
      }
    </script>
    <!--<![endif]-->
    
    
    </head>
    <body>
      <div id="cf-wrapper">
        <div class="cf-alert cf-alert-error cf-cookie-error" id="cookie-alert" data-translate="enable_cookies">Please enable cookies.</div>
        <div id="cf-error-details" class="cf-error-details-wrapper">
          <div class="cf-wrapper cf-header cf-error-overview">
            <h1 data-translate="block_headline">Sorry, you have been blocked</h1>
            <h2 class="cf-subheadline"><span data-translate="unable_to_access">You are unable to access</span> cocoapods.org</h2>
          </div><!-- /.header -->
    
          <div class="cf-section cf-highlight">
            <div class="cf-wrapper">
              <div class="cf-screenshot-container cf-screenshot-full">
                
                  <span class="cf-no-screenshot error"></span>
                
              </div>
            </div>
          </div><!-- /.captcha-container -->
    
          <div class="cf-section cf-wrapper">
            <div class="cf-columns two">
              <div class="cf-column">
                <h2 data-translate="blocked_why_headline">Why have I been blocked?</h2>
    
                <p data-translate="blocked_why_detail">This website is using a security service to protect itself from online attacks. The action you just performed triggered the security solution. There are several actions that could trigger this block including submitting a certain word or phrase, a SQL command or malformed data.</p>
              </div>
    
              <div class="cf-column">
                <h2 data-translate="blocked_resolve_headline">What can I do to resolve this?</h2>
    
                <p data-translate="blocked_resolve_detail">You can email the site owner to let them know you were blocked. Please include what you were doing when this page came up and the Cloudflare Ray ID found at the bottom of this page.</p>
              </div>
            </div>
          </div><!-- /.section -->
    
          <div class="cf-error-footer cf-wrapper w-240 lg:w-full py-10 sm:py-4 sm:px-8 mx-auto text-center sm:text-left border-solid border-0 border-t border-gray-300">
      <p class="text-13">
        <span class="cf-footer-item sm:block sm:mb-1">Cloudflare Ray ID: <strong class="font-semibold">709ac7f028be46eb</strong></span>
        <span class="cf-footer-separator sm:hidden">&bull;</span>
        <span class="cf-footer-item sm:block sm:mb-1"><span>Your IP</span>:..</span>
        <span class="cf-footer-separator sm:hidden">&bull;</span>
        <span class="cf-footer-item sm:block sm:mb-1"><span>Performance &amp; security by</span> <a rel="noopener noreferrer" href="https://www.cloudflare.com/5xx-error-landing" id="brand_link" target="_blank">Cloudflare</a></span>
        
      </p>
    </div><!-- /.error-footer -->
    
    
        </div><!-- /#cf-error-details -->
      </div><!-- /#cf-wrapper -->
    
      <script>
      window._cf_translation = {};
      
      
    </script>
    
    </body>
    </html>
    

    Any instructions how i could solve this?

    • Sounho Chung
      Sounho Chung almost 2 years
      I am struggling with the exact same error now. I'm also getting this error suddenly when trying to build my flutter project on iOS. Maybe it's a cocoapods server error? From about 12: 15, the problem seems to be resolved. My project build succeeds on iOS without any changes!!
    • Kirsten
      Kirsten almost 2 years
      Also getting this error, I'm new to react-native and saw this as a solution github.com/CocoaPods/CocoaPods/issues/… It does take a while to run but will work and install your pods successfully