Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CocoaPods-version.yml couldn't be downloaded #11159

Open
1 task done
loganrockmore opened this issue Jan 15, 2022 · 19 comments
Open
1 task done

CocoaPods-version.yml couldn't be downloaded #11159

loganrockmore opened this issue Jan 15, 2022 · 19 comments

Comments

@loganrockmore
Copy link

loganrockmore commented Jan 15, 2022

Report

I am trying to run pod install or pod update and it's failing with the error message:

[!] CDN: trunk URL couldn't be downloaded: https://cdn.cocoapods.org/CocoaPods-version.yml Response: URL using bad/illegal format or missing URL

I found #10356 and tried out a lot of the steps that people mentioned worked for them, but nothing worked. From reading through folks' comments, it sounds like lots of people are having intermittent issues connecting to the CDN, where it works sometimes and not others. I've been finding that mine fails 100% of the time. I've tried in a few different days over the course of the last week and it's failed every single time. Also folks in that thread are having issues with the trunk URL unable to be downloaded for various specs, whereas I'm always seeing the failure when trying to download the CocoaPods version yaml file.

What did you do?

Run pod install

What did you expect to happen?

All dependencies correctly install.

What happened instead?

  Preparing

Analyzing dependencies

Inspecting targets to integrate
  Using `ARCHS` setting to build architectures of target `Pods-Brick and Mortar`: (``)
  Using `ARCHS` setting to build architectures of target `Pods-Brick and Mortar-RecommendationsTests`: (``)

Finding Podfile changes
  - Auth0
  - FCModel
  - FMDB
  - Keyboard+LayoutGuide
  - Mapbox-iOS-SDK
  - MarkdownKit
  - MockingbirdFramework
  - Resolver
  - SnapKit
  - SnapshotTesting
  - SwiftCSV
  - SwiftLint
  - XCGLogger
  - Zip

Fetching external sources
-> Fetching podspec for `FCModel` from `Third Party/FCModel`

Resolving dependencies of `Podfile`
  CDN: trunk URL couldn't be downloaded: https://cdn.cocoapods.org/CocoaPods-version.yml Response: URL using bad/illegal format or missing URL,
  retries: 4
  CDN: trunk URL couldn't be downloaded: https://cdn.cocoapods.org/CocoaPods-version.yml Response: URL using bad/illegal format or missing URL,
  retries: 3
  CDN: trunk URL couldn't be downloaded: https://cdn.cocoapods.org/CocoaPods-version.yml Response: URL using bad/illegal format or missing URL,
  retries: 2
  CDN: trunk URL couldn't be downloaded: https://cdn.cocoapods.org/CocoaPods-version.yml Response: URL using bad/illegal format or missing URL,
  retries: 1
[!] CDN: trunk URL couldn't be downloaded: https://cdn.cocoapods.org/CocoaPods-version.yml Response: URL using bad/illegal format or missing URL

/Library/Ruby/Gems/2.6.0/gems/cocoapods-core-1.11.2/lib/cocoapods-core/cdn_source.rb:407:in `block in download_and_save_with_retries_async'
/Library/Ruby/Gems/2.6.0/gems/concurrent-ruby-1.1.6/lib/concurrent-ruby/concurrent/promises.rb:406:in `apply'
/Library/Ruby/Gems/2.6.0/gems/concurrent-ruby-1.1.6/lib/concurrent-ruby/concurrent/promises.rb:1205:in `apply'
/Library/Ruby/Gems/2.6.0/gems/concurrent-ruby-1.1.6/lib/concurrent-ruby/concurrent/promises.rb:1729:in `block (2 levels) in on_resolvable'
/Library/Ruby/Gems/2.6.0/gems/concurrent-ruby-1.1.6/lib/concurrent-ruby/concurrent/promises.rb:1582:in `evaluate_to'
/Library/Ruby/Gems/2.6.0/gems/concurrent-ruby-1.1.6/lib/concurrent-ruby/concurrent/promises.rb:1729:in `block in on_resolvable'
/Library/Ruby/Gems/2.6.0/gems/concurrent-ruby-1.1.6/lib/concurrent-ruby/concurrent/executor/ruby_thread_pool_executor.rb:353:in `run_task'
/Library/Ruby/Gems/2.6.0/gems/concurrent-ruby-1.1.6/lib/concurrent-ruby/concurrent/executor/ruby_thread_pool_executor.rb:342:in `block (3 levels) in create_worker'
/Library/Ruby/Gems/2.6.0/gems/concurrent-ruby-1.1.6/lib/concurrent-ruby/concurrent/executor/ruby_thread_pool_executor.rb:325:in `loop'
/Library/Ruby/Gems/2.6.0/gems/concurrent-ruby-1.1.6/lib/concurrent-ruby/concurrent/executor/ruby_thread_pool_executor.rb:325:in `block (2 levels) in create_worker'
/Library/Ruby/Gems/2.6.0/gems/concurrent-ruby-1.1.6/lib/concurrent-ruby/concurrent/executor/ruby_thread_pool_executor.rb:324:in `catch'
/Library/Ruby/Gems/2.6.0/gems/concurrent-ruby-1.1.6/lib/concurrent-ruby/concurrent/executor/ruby_thread_pool_executor.rb:324:in `block in create_worker'
/Library/Ruby/Gems/2.6.0/gems/concurrent-ruby-1.1.6/lib/concurrent-ruby/concurrent/promises.rb:1257:in `raise'
/Library/Ruby/Gems/2.6.0/gems/concurrent-ruby-1.1.6/lib/concurrent-ruby/concurrent/promises.rb:1257:in `wait_until_resolved!'
/Library/Ruby/Gems/2.6.0/gems/concurrent-ruby-1.1.6/lib/concurrent-ruby/concurrent/promises.rb:977:in `wait!'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-core-1.11.2/lib/cocoapods-core/cdn_source.rb:338:in `download_file'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-core-1.11.2/lib/cocoapods-core/cdn_source.rb:53:in `refresh_metadata'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-core-1.11.2/lib/cocoapods-core/source.rb:31:in `initialize'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-core-1.11.2/lib/cocoapods-core/cdn_source.rb:30:in `initialize'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-core-1.11.2/lib/cocoapods-core/source/manager.rb:315:in `new'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-core-1.11.2/lib/cocoapods-core/source/manager.rb:315:in `block in source_from_path'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-core-1.11.2/lib/cocoapods-core/source/manager.rb:322:in `source_from_path'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-core-1.11.2/lib/cocoapods-core/source/manager.rb:331:in `block in aggregate_with_repos'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-core-1.11.2/lib/cocoapods-core/source/manager.rb:331:in `map'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-core-1.11.2/lib/cocoapods-core/source/manager.rb:331:in `aggregate_with_repos'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-core-1.11.2/lib/cocoapods-core/source/manager.rb:26:in `aggregate'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-core-1.11.2/lib/cocoapods-core/source/manager.rb:60:in `all'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-core-1.11.2/lib/cocoapods-core/source/manager.rb:393:in `source_with_url'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.11.2/lib/cocoapods/sources_manager.rb:22:in `find_or_create_source_with_url'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.11.2/lib/cocoapods/installer/analyzer.rb:178:in `block in sources'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.11.2/lib/cocoapods/installer/analyzer.rb:177:in `map'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.11.2/lib/cocoapods/installer/analyzer.rb:177:in `sources'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.11.2/lib/cocoapods/installer/analyzer.rb:1077:in `block in resolve_dependencies'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.11.2/lib/cocoapods/user_interface.rb:64:in `section'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.11.2/lib/cocoapods/installer/analyzer.rb:1076:in `resolve_dependencies'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.11.2/lib/cocoapods/installer/analyzer.rb:124:in `analyze'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.11.2/lib/cocoapods/installer.rb:416:in `analyze'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.11.2/lib/cocoapods/installer.rb:241:in `block in resolve_dependencies'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.11.2/lib/cocoapods/user_interface.rb:64:in `section'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.11.2/lib/cocoapods/installer.rb:240:in `resolve_dependencies'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.11.2/lib/cocoapods/installer.rb:161:in `install!'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.11.2/lib/cocoapods/command/install.rb:52:in `run'
/Library/Ruby/Gems/2.6.0/gems/claide-1.0.3/lib/claide/command.rb:334:in `run'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.11.2/lib/cocoapods/command.rb:52:in `run'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.11.2/bin/pod:55:in `<top (required)>'
/usr/local/bin/pod:23:in `load'
/usr/local/bin/pod:23:in `<main>'
~/Developer/Recommendations App (tags/2021.1_1542) ᐅ 

This was confusing to me, because it really appears like it's a problem with curl being able to download the file at https://cdn.cocoapods.org/CocoaPods-version.yml. (Looking through the Cocoapods and curl source code, I was able to verify that the error message "URL using bad/illegal format or missing URL" is coming directly from curl.) But then, when I test out using curl directly, it seems to download just fine:

*   Trying 104.26.0.240:443...
* Connected to cdn.cocoapods.org (104.26.0.240) port 443 (#0)
* ALPN, offering h2
* ALPN, offering http/1.1
* successfully set certificate verify locations:
*  CAfile: /etc/ssl/cert.pem
*  CApath: none
* TLSv1.2 (OUT), TLS handshake, Client hello (1):
* TLSv1.2 (IN), TLS handshake, Server hello (2):
* TLSv1.2 (IN), TLS handshake, Certificate (11):
* TLSv1.2 (IN), TLS handshake, Server key exchange (12):
* TLSv1.2 (IN), TLS handshake, Server finished (14):
* TLSv1.2 (OUT), TLS handshake, Client key exchange (16):
* TLSv1.2 (OUT), TLS change cipher, Change cipher spec (1):
* TLSv1.2 (OUT), TLS handshake, Finished (20):
* TLSv1.2 (IN), TLS change cipher, Change cipher spec (1):
* TLSv1.2 (IN), TLS handshake, Finished (20):
* SSL connection using TLSv1.2 / ECDHE-ECDSA-CHACHA20-POLY1305
* ALPN, server accepted to use h2
* Server certificate:
*  subject: C=US; ST=California; L=San Francisco; O=Cloudflare, Inc.; CN=sni.cloudflaressl.com
*  start date: Jul 11 00:00:00 2021 GMT
*  expire date: Jul 10 23:59:59 2022 GMT
*  subjectAltName: host "cdn.cocoapods.org" matched cert's "*.cocoapods.org"
*  issuer: C=US; O=Cloudflare, Inc.; CN=Cloudflare Inc ECC CA-3
*  SSL certificate verify ok.
* Using HTTP2, server supports multi-use
* Connection state changed (HTTP/2 confirmed)
* Copying HTTP/2 data in stream buffer to connection buffer after upgrade: len=0
* Using Stream ID: 1 (easy handle 0x11d811000)
> GET /CocoaPods-version.yml HTTP/2
> Host: cdn.cocoapods.org
> user-agent: curl/7.77.0
> accept: */*
> 
* Connection state changed (MAX_CONCURRENT_STREAMS == 256)!
< HTTP/2 200 
< date: Sat, 15 Jan 2022 19:08:38 GMT
< content-type: text/yaml
< content-length: 56
< x-origin-cache: HIT
< last-modified: Sat, 15 Jan 2022 19:01:05 GMT
< access-control-allow-origin: *
< etag: "61e319f1-38"
< expires: Sat, 15 Jan 2022 19:11:25 GMT
< cache-control: max-age=600
< x-proxy-cache: MISS
< x-github-request-id: 3146:69AA:15FD4B:206226:61E31A05
< via: 1.1 varnish
< age: 79
< x-served-by: cache-ewr18133-EWR
< x-cache: MISS
< x-cache-hits: 0
< x-timer: S1642273640.877454,VS0,VE10
< vary: Accept-Encoding
< x-fastly-request-id: 7a8c42b155c9ad9f44c315417cccf0acae45aed8
< cf-cache-status: HIT
< accept-ranges: bytes
< expect-ct: max-age=604800, report-uri="https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct"
< report-to: {"endpoints":[{"url":"https:\/\/a.nel.cloudflare.com\/report\/v3?s=P4VieYzq%2BQlldjgCYjUERlt1hfQPexhvxcGobiXgf5g2Ey8xGHkNE3aMPPqAkauOeNuDW3c60xFuDOzzHnZxkpEyo6eTFeIfQm9o7yNZ%2BN7lWZGQfVKPHdXpyGpXsP0Oa44t"}],"group":"cf-nel","max_age":604800}
< nel: {"success_fraction":0,"report_to":"cf-nel","max_age":604800}
< server: cloudflare
< cf-ray: 6ce164d6da2818ee-EWR
< 
---
min: 1.0.0
last: 1.11.2
prefix_lengths:
- 1
- 1
- 1
* Connection #0 to host cdn.cocoapods.org left intact

I also tried this on two different wireless networks, and the same issue happened on both.

This issues started for me somewhat recently as I moved from an Intel-based MacBook Pro to an M1 one. I'm sure that whatever is going on here is as a result of my local configuration, since you don't have lots of other folks with M1 machines having the same problem, but I've tried all sorts of different things and I just can't get this to work.

CocoaPods Environment

Uhh, running this command doesn't appear to successfully work, either.

objc[24025]: Class AMSupportURLConnectionDelegate is implemented in both /usr/lib/libauthinstall.dylib (0x1f28e6b90) and /Library/Apple/System/Library/PrivateFrameworks/MobileDevice.framework/Versions/A/MobileDevice (0x1045d02c8). One of the two will be used. Which one is undefined.
objc[24025]: Class AMSupportURLSession is implemented in both /usr/lib/libauthinstall.dylib (0x1f28e6be0) and /Library/Apple/System/Library/PrivateFrameworks/MobileDevice.framework/Versions/A/MobileDevice (0x1045d0318). One of the two will be used. Which one is undefined.
[!] CDN: trunk URL couldn't be downloaded: https://cdn.cocoapods.org/CocoaPods-version.yml Response: URL using bad/illegal format or missing URL

But, here's this:

$ pod --version
1.11.2
$ ruby --version
ruby 2.6.8p205 (2021-07-07 revision 67951) [universal.arm64e-darwin21]
$ git --version
git version 2.32.0 (Apple Git-132)
$ curl --version
curl 7.77.0 (x86_64-apple-darwin21.0) libcurl/7.77.0 (SecureTransport) LibreSSL/2.8.3 zlib/1.2.11 nghttp2/1.42.0
Release-Date: 2021-05-26
Protocols: dict file ftp ftps gopher gophers http https imap imaps ldap ldaps mqtt pop3 pop3s rtsp smb smbs smtp smtps telnet tftp 
Features: alt-svc AsynchDNS GSS-API HSTS HTTP2 HTTPS-proxy IPv6 Kerberos Largefile libz MultiSSL NTLM NTLM_WB SPNEGO SSL UnixSockets

🧡 Thanks so much for the help, and for all of the amazing work that you do! 🧡

@loganrockmore
Copy link
Author

I just tried something else out, which is to use wget to download the file in the Terminal. Unlike using curl, it errors out because of a lack of SSL connection.

$ curl https://cdn.cocoapods.org/CocoaPods-version.yml
---
min: 1.0.0
last: 1.11.2
prefix_lengths:
- 1
- 1
- 1
$ wget https://cdn.cocoapods.org/CocoaPods-version.yml
--2022-01-15 14:40:12--  https://cdn.cocoapods.org/CocoaPods-version.yml
Resolving cdn.cocoapods.org... 104.26.1.240, 172.67.74.167, 104.26.0.240
Connecting to cdn.cocoapods.org|104.26.1.240|:443... connected.
OpenSSL: error:14077410:SSL routines:SSL23_GET_SERVER_HELLO:sslv3 alert handshake failure
Unable to establish SSL connection.

Maybe this is the source of the problem and that this lack of SSL connection is why pod install won't successfully run?

@abdullah2891
Copy link

abdullah2891 commented Jan 18, 2022

Seeing this issue CDN: trunk URL couldn't be downloaded: https://cdn.cocoapods.org/CocoaPods-version.yml Response: Unsupported protocol

with same versions of pod, curl , and ruby . returns the result
curl https://cdn.cocoapods.org/CocoaPods-version.yml


min: 1.0.0
last: 1.11.2
prefix_lengths:

  • 1
  • 1
  • 1

@abdullah2891
Copy link

issue went away , when i dowongraded cocopad , tried running pod install , then uninstalled it , installed the latest then ran pod install . the problem went away ? my feeling is the latest version has some problem with the network and i am basically using the cached version

@zoozobib
Copy link

same problem

@zoozobib
Copy link

same problem on MacBook Air m1

@fangmobile
Copy link

same problem on M1
[!] CDN: trunk URL couldn't be downloaded: https://cdn.cocoapods.org/all_pods_versions_f_7_4.txt Response: URL using bad/illegal format or missing URL

@MicheleCaggiano
Copy link

Same issue for me, 'pod install' get this:
[!] CDN: trunk URL couldn't be downloaded: https://cdn.cocoapods.org/CocoaPods-version.yml Response: SSL peer certificate or SSH remote key was not OK

@zoozobib
Copy link

finnally , I have solved;

1 gem uninstall cocoapods
2 brew install cocoapods

@alxmoroz
Copy link

finnally , I have solved;

1 gem uninstall cocoapods
2 brew install cocoapods

Worked for me! Apple M1

@kaiserabliz
Copy link

If you are on Apple M1
try:
gem uninstall cocoapods
arch -x86_64 brew install cocoapods
arch -x86_64 brew reinstall cocoapods
I was able to fix my issue.

@sschuberth
Copy link

Also happens when running on Windows and following these instructions to install cURL. Apparently cURL does not find the correct certificates then.

@jakehockey10
Copy link

I found the solution! Beg a coworker with a mac to do this for me.

@Jan-Eckerlein
Copy link

gem uninstall cocoapods

I kiss ur a**. that worked for me. this took way to much time xD

@g123k
Copy link

g123k commented Jun 14, 2023

I've the issue on my Mac and despite uninstalling/reinstalling Cocoapods, the issue is still there :/

@iodev
Copy link

iodev commented Jun 23, 2023

@g123k, I figured it out. Just do the brew install cocoapods then do which pod, and it will still say you are going to be using the /usr/local/bin/pod one ... that's what lead me to the solution. When brew installs cocoapods, it puts it into /opt/homebrew/Cellar/cocoapods/1.12.1/bin, so just add that to the front of your PATH var in ~/.zshrc

export PATH="/opt/homebrew/Cellar/cocoapods/1.12.1/bin:/opt/homebrew/opt/ruby/bin:$PATH"
export PATH="/opt/homebrew/sbin:$PATH"

Then I ran pod update in my project, and then flutter build ios ... all success!!
Hope it is successful for you too.

@myerekapan
Copy link

@g123k, I figured it out. Just do the brew install cocoapods then do which pod, and it will still say you are going to be using the /usr/local/bin/pod one ... that's what lead me to the solution. When brew installs cocoapods, it puts it into /opt/homebrew/Cellar/cocoapods/1.12.1/bin, so just add that to the front of your PATH var in ~/.zshrc

export PATH="/opt/homebrew/Cellar/cocoapods/1.12.1/bin:/opt/homebrew/opt/ruby/bin:$PATH"
export PATH="/opt/homebrew/sbin:$PATH"

Then I ran pod update in my project, and then flutter build ios ... all success!! Hope it is successful for you too.

I've been googling everywhere! Thank you for this gem @iodev

@mmrosatab
Copy link

mmrosatab commented Nov 25, 2023

@zoozobib

finnally , I have solved;

1 gem uninstall cocoapods 2 brew install cocoapods

Thanks <3

@turkcankeskin
Copy link

finnally , I have solved;

1 gem uninstall cocoapods 2 brew install cocoapods

thank you for your answer. It solved i problem in my case.
it is not always best to uninstall and reinstall cocoapods and ruby.

is there anyone who can explain why we are experiencing this problem?

@boliveira
Copy link

boliveira commented Feb 21, 2024

To anyone experiencing this problem, this seems to be an issue with ethon version 0.12.0 (that was what I was using).
After updating it to 0.15.0 it worked. The issue seems to be that the url is not being set in libcurl somehow by ethon hence the error URL using bad/illegal format or missing URL. pod install command uses typhoeus to make the request and it uses ethon underneath for it. @turkcankeskin

To use the version of ethon with the fix, just add this to your Gemfile:

gem 'ethon', '~> 0.15.0'

And then run bundle update ethon

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests