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 hangs on unpacking boost 1.59 when executing pod install #69

Open
yoelglus opened this issue Aug 21, 2017 · 30 comments
Open

CocoaPods hangs on unpacking boost 1.59 when executing pod install #69

yoelglus opened this issue Aug 21, 2017 · 30 comments

Comments

@yoelglus
Copy link

See discussion here

@CocoaPods CocoaPods deleted a comment Aug 21, 2017
@yoelglus
Copy link
Author

Tried running the same commands:
curl -f -L -o file.tgz http://sourceforge.net/projects/boost/files/boost/1.59.0/boost_1_59_0.tar.gz
and
tar xfz file.tgz -C out
Seems to work as expected.
I also added a simple test to the http_spec.rb to extract the boost tar file but it took it 7-8s.

@andon
Copy link

andon commented Sep 25, 2017

Hi @yoelglus

I have an issue with this. When I ran pod install I get:

-> Installing boost (1.59.0)
 > Http download
   $ /usr/bin/curl -f -L -o /var/folders/3d/j7xmpxc13pb3ztl40vn3x2_00000gn/T/d20170925-21462-n3dqf4/file.tgz http://sourceforge.net/projects/boost/files/boost/1.59.0/boost_1_59_0.tar.gz
   --create-dirs --netrc-optional
     % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                    Dload  Upload   Total   Spent    Left  Speed
   100   178  100   178    0     0    503      0 --:--:-- --:--:-- --:--:--   502
     0   355    0     0    0     0      0      0 --:--:--  0:00:01 --:--:--     0
   100  126k  100  126k    0     0  56841      0  0:00:02  0:00:02 --:--:--  500k
   $ /usr/bin/tar xfz /var/folders/3d/j7xmpxc13pb3ztl40vn3x2_00000gn/T/d20170925-21462-n3dqf4/file.tgz -C /var/folders/3d/j7xmpxc13pb3ztl40vn3x2_00000gn/T/d20170925-21462-n3dqf4
   tar: Unrecognized archive format
   tar: Error exit delayed from previous errors.

[!] Error installing boost
[!] /usr/bin/tar xfz /var/folders/3d/j7xmpxc13pb3ztl40vn3x2_00000gn/T/d20170925-21462-n3dqf4/file.tgz -C /var/folders/3d/j7xmpxc13pb3ztl40vn3x2_00000gn/T/d20170925-21462-n3dqf4

tar: Unrecognized archive format
tar: Error exit delayed from previous errors.

When I try to manually download the file like so (I've added -v at the end):

/usr/bin/curl -f -L -o file.tgz http://sourceforge.net/projects/boost/files/boost/1.59.0/boost_1_59_0.tar.gz -v

I get the following output (cut some parts for clarity):

  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0*   Trying 216.34.181.60...
* TCP_NODELAY set
* Connected to sourceforge.net (216.34.181.60) port 80 (#0)
> GET /projects/boost/files/boost/1.59.0/boost_1_59_0.tar.gz HTTP/1.1
> Host: sourceforge.net
> User-Agent: Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; Trident/5.0)
> Accept: */*
> Referer:
>
< HTTP/1.1 301 Moved Permanently
< Server: nginx
< Date: Mon, 25 Sep 2017 20:11:53 GMT
< Content-Type: text/html
< Content-Length: 178
< Connection: keep-alive
< Location: https://sourceforge.net/projects/boost/files/boost/1.59.0/boost_1_59_0.tar.gz
<
* Ignoring the response-body
{ [178 bytes data]
100   178  100   178    0     0    521      0 --:--:-- --:--:-- --:--:--   520
* Connection #0 to host sourceforge.net left intact
* Issue another request to this URL: 'https://sourceforge.net/projects/boost/files/boost/1.59.0/boost_1_59_0.tar.gz'
...
> GET /projects/boost/files/boost/1.59.0/boost_1_59_0.tar.gz HTTP/1.1
> Host: sourceforge.net
> User-Agent: Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; Trident/5.0)
> Accept: */*
> Referer: http://sourceforge.net/projects/boost/files/boost/1.59.0/boost_1_59_0.tar.gz
>
  0     0    0     0    0     0      0      0 --:--:--  0:00:01 --:--:--     0< HTTP/1.1 302 Found
< Server: nginx
< Date: Mon, 25 Sep 2017 20:11:54 GMT
< Content-Type: text/html; charset=UTF-8
< Content-Length: 15610
< Connection: close
< Pragma: no-cache
< Cache-Control: no-cache
< X-UA-Compatible: IE=edge,chrome=1
< X-Frame-Options: SAMEORIGIN
< Content-Security-Policy: upgrade-insecure-requests
...
* Closing connection 1
* Issue another request to this URL: 'https://sourceforge.net/projects/boost/files/boost/1.59.0/boost_1_59_0.tar.gz/download'
* Connection 0 seems to be dead!
* Closing connection 0
* Hostname sourceforge.net was found in DNS cache
*   Trying 216.34.181.60...
* TCP_NODELAY set
* Connected to sourceforge.net (216.34.181.60) port 443 (#2)
* SSL re-using session ID
...
> GET /projects/boost/files/boost/1.59.0/boost_1_59_0.tar.gz/download HTTP/1.1
> Host: sourceforge.net
> User-Agent: Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; Trident/5.0)
> Accept: */*
> Referer: https://sourceforge.net/projects/boost/files/boost/1.59.0/boost_1_59_0.tar.gz
>
< HTTP/1.1 200 OK
< Server: nginx
< Date: Mon, 25 Sep 2017 20:11:55 GMT
< Content-Type: text/html; charset=utf-8
< Content-Length: 114760
< Connection: close
< Pragma: no-cache
< Cache-Control: no-cache
...
{ [99 bytes data]
100  112k  100  112k    0     0  40706      0  0:00:02  0:00:02 --:--:--  202k
* Closing connection 2

Seems that the returned response is the html page from sourceforge and not the requested binary.

@yoelglus
Copy link
Author

hi @andon - I see the same when running curl but my pod install runs as expected...

@andon
Copy link

andon commented Sep 29, 2017

@yoelglus Can you run pod install in verbose mode? It should do the same as the curl cmd.

@yoelglus
Copy link
Author

@andon - see bellow:

-> Installing boost (1.59.0)
 > Http download
   $ /usr/bin/curl -f -L -o /var/folders/jt/xszc8h512l1fvvghn02kd41rf00bxx/T/d20170930-94356-hcyz5b/file.tgz http://sourceforge.net/projects/boost/files/boost/1.59.0/boost_1_59_0.tar.gz --create-dirs --netrc-optional
     % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                    Dload  Upload   Total   Spent    Left  Speed
   100   178  100   178    0     0    539      0 --:--:-- --:--:-- --:--:--   539
     0   355    0     0    0     0      0      0 --:--:--  0:00:01 --:--:--     0
     0   431    0     0    0     0      0      0 --:--:--  0:00:01 --:--:--     0
     0   345    0     0    0     0      0      0 --:--:--  0:00:02 --:--:--     0
   100 79.8M  100 79.8M    0     0   674k      0  0:02:01  0:02:01 --:--:--  602k
   $ /usr/bin/tar xfz /var/folders/jt/xszc8h512l1fvvghn02kd41rf00bxx/T/d20170930-94356-hcyz5b/file.tgz -C /var/folders/jt/xszc8h512l1fvvghn02kd41rf00bxx/T/d20170930-94356-hcyz5b

@yoelglus
Copy link
Author

Some network latency but the thing that really takes a long time is the tar command...

@andon
Copy link

andon commented Sep 30, 2017

Strange. Latency and size were not the issue on my side, but the redirects from sourceforge.net.
Anyway, as a workaround I use a podspec that points to a different URL for downloading it.

@yoelglus
Copy link
Author

yoelglus commented Oct 1, 2017

yep, we will do the same probably...

@MPiccinato
Copy link

Just came across this same issue when installing React Native dependencies. I can run the curl command no problem but CocoaPods just hangs on /usr/bin/tar xfz /var/folders/6m/l15crj8s3g938fh1hky8n9q80000gn/T/d20171001-8272-uapq6q/file.tgz -C /var/folders/6m/l15crj8s3g938fh1hky8n9q80000gn/T/d20171001-8272-uapq6q.

When I check the folder it looks like everything unpacked fine but CocoaPods is unsure what to do next?

@irace
Copy link

irace commented Oct 13, 2017

@andon @yoelglus What URL did you end up using?

@yoelglus
Copy link
Author

@irace - I kept it as it is (same one as in the first comments)

@bartdorsey
Copy link

I'm new to cocoa pods and I'm having this issue while using a react native app. @andon how do you go about using this custom url in a pod spec? I've been trying to digest documentation and figure it out, but I'm not having much luck.

@stefanengel
Copy link

stefanengel commented Oct 19, 2017

We have experienced the same problem every now and then on different machines. Downloading boost does not seem to be a problem, but after that Ruby uses up all CPU for about 10 minutes, then the installation succeeds.

@lakhman
Copy link

lakhman commented Dec 12, 2017

I had this same error, the spec download url points to a sourceforge page with a redirect, and that redirect is where it fails.

[!] Error installing boost

126k 0 0 45312 0 0:00:02 0:00:02 --:--:-- 101k
$ /usr/bin/tar xfz /var/folders/path/file.tgz -C /var/folders/path
tar: Unrecognized archive format
tar: Error exit delayed from previous errors.

[!] Error installing boost
[!] /usr/bin/tar xfz /var/folders/path/file.tgz -C /var/folders/path

Quick Fix

Find this file on your system and edit it's source url.

https://github.com/CocoaPods/Specs/blob/d0ec5a65e80656c8d78e12ff19f251df879e0bc2/Specs/9/9/d/boost/1.59.0/boost.podspec.json

Find the boost spec file locally

open ~/.cocoapods/repos/master/Specs/9/9/d/boost/1.59.0/boost.podspec.json

Change the source download url to a direct link

  "source": {
    "http": "https://downloads.sourceforge.net/project/boost/boost/1.59.0/boost_1_59_0.tar.gz?r=&ts=1513105136&use_mirror=kent"
  },

Pod install with patience

# everything should work - boost can be downloaded and unpacks
# Note this takes a while to compile, be patient.
pod install

@Pranit-Harekar
Copy link

How to achieve this on travis ??

@Epsiloni
Copy link

To build upon @lakhman's answer, what solved this for me was to go to the SourceForge page here and get the link it provides for you when you click the boost_1_59_0.tar.gz file (or simply click here). You can get it by right clicking the "direct link" link they have and press "copy link".
Then paste it into the source like @lakhman showed above. and run pod install.

Be prepared, it takes forever.

@vovkasm
Copy link

vovkasm commented Jan 1, 2018

If it can help someone to detect the bottleneck, I run sampler (from Monitor.app) while wait that process to complete.
On screen:

> pod install --verbose
...
-> Installing boost (1.59.0)
 > Http download
   $ /usr/bin/curl -f -L -o /var/folders/mm/c6dmpcvs5qz89rdd_v0hfm8w0000gn/T/d20180102-25086-1otwbdt/file.tgz http://sourceforge.net/projects/boost/files/boost/1.59.0/boost_1_59_0.tar.gz --create-dirs --netrc-optional
     % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                    Dload  Upload   Total   Spent    Left  Speed
   100   178  100   178    0     0    576      0 --:--:-- --:--:-- --:--:--   577
     0   355    0     0    0     0      0      0 --:--:--  0:00:01 --:--:--     0
     0   431    0     0    0     0      0      0 --:--:--  0:00:01 --:--:--     0
     0   345    0     0    0     0      0      0 --:--:--  0:00:02 --:--:--     0
   100 79.8M  100 79.8M    0     0  1192k      0  0:01:08  0:01:08 --:--:-- 3639k
   $ /usr/bin/tar xfz /var/folders/mm/c6dmpcvs5qz89rdd_v0hfm8w0000gn/T/d20180102-25086-1otwbdt/file.tgz -C /var/folders/mm/c6dmpcvs5qz89rdd_v0hfm8w0000gn/T/d20180102-25086-1otwbdt

Sampler results: https://gist.github.com/vovkasm/613107727d86ae12384865113ab97d93

@itinance
Copy link

itinance commented Jan 4, 2018

Any news on this? I've found out that the root cause is indeed an invalid tar.gz file for boost that only contains plain html code.

Pls find more info here:
CocoaPods/CocoaPods#4830 (comment)

@rghorbani
Copy link

rghorbani commented Jan 6, 2018

I did a test and disabling cocoapods cache solves that issue.
digging around I've saw that it extracts boost to the cache directory ~500MB of data and then it has another copy to do into the target directory, all that copies takes a loot of time and makes it look like it hangs.

You can disable it by creating a ~/.cocoapods/config.yaml file with the following contents.

skip_download_cache: true

@Young-Je
Copy link

change the source at https://downloads.sourceforge.net/project/boost/boost/1.59.0/boost_1_59_0.tar.gz
and save the spec file. issue gone.
contact me via youngjexu@icloud.com, if you want further explanation.

@enijar
Copy link

enijar commented Mar 28, 2018

I had the following error.

[!] Error installing boost
[!] /usr/local/php5/bin/curl -f -L -o /var/folders/bk/qnj768gj3lzd3l10fpv646_80000gp/T/d20180328-76160-oa20vt/file.tgz https://downloads.sourceforge.net/project/boost/boost/1.59.0/boost_1_59_0.tar.gz?r=&ts=1513105136&use_mirror=kent --create-dirs --netrc-optional

  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0curl: (35) Unknown SSL protocol error in connection to downloads.sourceforge.net:443

Open ~/.cocoapods/repos/master/Specs/9/9/d/boost/1.59.0/boost.podspec.json

Change the URL from this

"source": {
    "http": "https://downloads.sourceforge.net/project/boost/boost/1.59.0/boost_1_59_0.tar.gz?r=&ts=1513105136&use_mirror=kent"
  }

to this

"source": {
    "http": "http://downloads.sourceforge.net/project/boost/boost/1.59.0/boost_1_59_0.tar.gz?r=&ts=1513105136&use_mirror=kent"
  }

@khiami
Copy link

khiami commented May 15, 2018

Updating the download link:
https://jaist.dl.sourceforge.net/project/boost/boost/1.59.0/boost_1_59_0.tar.gz

It took 29 seconds for download but around 3 minutes to unpack the file :(

@sospedra
Copy link

It's really funny that this is happening with a pod called boost

@GuoZhiQiang
Copy link

GuoZhiQiang commented Feb 11, 2020

Thanks @lakhman . Or open ~/.cocoapods/repos/cocoapods/Specs/9/9/d/boost/1.59.0/boost.podspec.json

@bogdanbolchis
Copy link

After constantly having this problem, i put skip_download_cache: true in ~/.cocoapods/config.yml (didn't work), then in ~/.cocoapods/config.yaml which appears to work (no cached stuff at ~/Library/Caches/CocoaPods). No hanged install anymore.

@vanjaoljaca
Copy link

vanjaoljaca commented Jan 24, 2023

I'm having this issue today:

-> Installing boost (1.76.0)
 > Http download
   $ /usr/bin/curl -f -L -o /var/folders/y4/pjc9r3q93x54jhkyv5cs720h0000gn/T/d20230124-35212-kph6qw/file.tbz https://boostorg.jfrog.io/artifactory/main/release/1.76.0/source/boost_1_76_0.tar.bz2 --create-dirs
   --netrc-optional --retry 2 -A 'CocoaPods/1.11.3 cocoapods-downloader/1.6.3'
     % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                    Dload  Upload   Total   Spent    Left  Speed
     0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
   100  104M  100  104M    0     0  14.1M      0  0:00:07  0:00:07 --:--:-- 16.0M
   $ /usr/bin/tar xf /var/folders/y4/pjc9r3q93x54jhkyv5cs720h0000gn/T/d20230124-35212-kph6qw/file.tbz -C /var/folders/y4/pjc9r3q93x54jhkyv5cs720h0000gn/T/d20230124-35212-kph6qw
  > Copying boost from `/Users/voljaca/Library/Caches/CocoaPods/Pods/External/boost/909665deed38b6f25051fac8c534aa3c-a7c83` to `Pods/boost`

Seems stuck.

~/.cocoapods/repos/master//boost//boost.podspec.json does not exist, and neither does it exist in ~/.cocoapods/repos/trunk/...

Any advice?

edit: it eventually finished on its own

@dccabao
Copy link

dccabao commented Nov 24, 2023

What is the fix sorry?

@andres-dos-santos
Copy link

I used @rghorbani's tip and then ran pod install --verbose and I was able to see that it weighs 104mb and takes a while to download.

My internet is good but the download is slow anyway. I do not know the reason.

@Kelier
Copy link

Kelier commented Feb 20, 2024

still

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