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

pod install fails (not M1) — 401 when installing Boost #33462

Closed
Tycholiz opened this issue Mar 22, 2022 · 47 comments
Closed

pod install fails (not M1) — 401 when installing Boost #33462

Tycholiz opened this issue Mar 22, 2022 · 47 comments
Labels
Platform: iOS iOS applications. Platform: macOS Building on macOS. Priority: Low

Comments

@Tycholiz
Copy link

Tycholiz commented Mar 22, 2022

Description

Following the docs, I'm initializing a new react-native with Typescript repo with the command

npx react-native init myproject --template react-native-template-typescript

Upon running that command, I get the following:

✔ Downloading template
✔ Copying template
✔ Processing template
✖ Installing CocoaPods dependencies (this may take a few minutes)
✖ Installing CocoaPods dependencies (this may take a few minutes)
error Error: Failed to install CocoaPods dependencies for iOS project, which is required by this template.
Please try again manually: "cd ./myproject/ios && pod install".

So I cd into the ios/ directory and run pod install. Everything installs propery, but when I get to boost...

Installing boost (1.76.0)

[!] Error installing boost
[!] /usr/bin/curl -f -L -o /var/folders/55/_ncpv5xd2hj2q2_k5m2bmn6r0000gn/T/d20220321-2395-th53eu/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.5.1'

  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0    80    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
curl: (22) The requested URL returned error: 401

I understand that it's the request to jfrog.io that's giving me the 401, but how do I get around this? I'm not even clear on why access to this package would be forbidden in the first place. Strangely, I can install the tar.bz2 file directly just by putting that URL into my address bar. Why would it return a 401 to cURL?

I'm a web developer so I'm used to the npm ecosystem and have never faced a 401 before.

What can I do to move past this?

Version

0.67.4

Output of npx react-native info

info Fetching system and libraries information...
System:
OS: macOS 12.1
CPU: (12) x64 Intel(R) Core(TM) i7-9750H CPU @ 2.60GHz
Memory: 294.95 MB / 16.00 GB
Shell: 5.8 - /bin/zsh
Binaries:
Node: 14.19.1 - /usr/local/opt/node@14/bin/node
Yarn: 1.22.18 - /usr/local/bin/yarn
npm: 6.14.16 - /usr/local/opt/node@14/bin/npm
Watchman: 2021.10.18.00 - /usr/local/bin/watchman
Managers:
CocoaPods: 1.11.3 - /usr/local/bin/pod
SDKs:
iOS SDK:
Platforms: iOS 14.0, DriverKit 19.0, macOS 10.15, tvOS 14.0, watchOS 7.0
Android SDK:
API Levels: 28, 29
Build Tools: 28.0.3, 29.0.3
System Images: android-26 | Google Play Intel x86 Atom
Android NDK: Not Found
IDEs:
Android Studio: 3.6 AI-192.7142.36.36.6392135
Xcode: 12.0/12A7209 - /usr/bin/xcodebuild
Languages:
Java: 1.8.0_252 - /usr/bin/javac
npmPackages:
@react-native-community/cli: Not Found
react: 17.0.2 => 17.0.2
react-native: 0.67.4 => 0.67.4
react-native-macos: Not Found
npmGlobalPackages:
react-native: Not Found

Steps to reproduce

  1. run npx react-native init myproject --template react-native-template-typescript
  2. cd into ios
  3. run pod install

Snack, code example, screenshot, or link to a repository

No response

@Tycholiz
Copy link
Author

Tycholiz commented Mar 23, 2022

I found a workaround, though admittedly it's pretty lame and is no better than a bandaid solution. The approach is to download the file and then source it from the local filesystem, rather than making a network call:

  1. Download the tar.bz2 file from https://boostorg.jfrog.io/artifactory/main/release/1.76.0/source/boost_1_76_0.tar.bz2
  2. move the (compressed) file to node_modules/react-native/third-party-podspecs
  3. open node_modules/react-native/third-party-podspecs/boost.podspec
  4. change the :http part of the spec.source key to:
:http => 'file:' + __dir__ + '/boost_1_76_0.tar.bz2'
  1. run pod install

note: you may need to adjust the version of the boost package your project specifies.

@khokanuzzman
Copy link

try
git config --global core.autocrlf false
brew install cocoapods

@rushi-b-vachhani
Copy link

@Tycholiz Have you got the solution? Actually, I got the same error but I am using Mac with M1 chip.

@Tycholiz
Copy link
Author

Tycholiz commented Apr 9, 2022

No solution yet unfortunately. With my workaround above I haven't ran into the issue since. I expect it will poke its head soon though.

@Tycholiz
Copy link
Author

bump on this issue

Tried to initialize a new project today and got the 401 again, this time on OpenSSL package.

@rushi-b-vachhani
Copy link

@Tycholiz I resolved my issue with command:
pod repo update

@Tycholiz
Copy link
Author

No luck, still getting error:

[!] Error installing OpenSSL-Universal
[!] /usr/bin/curl -f -L -o /var/folders/55/_ncpv5xd2hj2q2_k5m2bmn6r0000gn/T/d20220415-48164-teg9l8/file.zip https://github.com/krzyzanowskim/OpenSSL/archive/1.1.1100.zip --create-dirs --netrc-optional --retry 2 -A 'CocoaPods/1.11.3 cocoapods-downloader/1.5.1'

  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
curl: (22) The requested URL returned error: 401

I also get the following error when running the initial yarn install

error An unexpected error occurred: "https://registry.yarnpkg.com/react-native-template-react-native-template-typescript: Not found".
info If you think this is a bug, please open a bug report with the information provided in "/Users/kyletycholiz/programming/projects/never-forget-rn/MyApp/yarn-error.log".
info Visit https://yarnpkg.com/en/docs/cli/add for documentation about this command.
yarn remove v1.22.18
[1/2] 🗑  Removing module react-native-template-react-native-template-typescript...
error This module isn't specified in a package.json file.
info Visit https://yarnpkg.com/en/docs/cli/remove for documentation about this command.
warn Failed to clean up template temp files in node_modules/react-native-template-react-native-template-typescript. This is not a critical error, you can work on your app.

Although as noted, it's not a critical error.

Nonetheless I don't understand why any of these issues would be happening for only some people but not all.

@kei4eva4
Copy link

kei4eva4 commented May 7, 2022

@Tycholiz I resolved this issue by removing the following line from ~/.netrc.

machine github.com
  login xxxxx
  password xxxxxx

@ghasemikasra39
Copy link

Updating cocoapods via sudo gem install cocoapods fixed this issue.

@cortinico
Copy link
Contributor

Closing as I believe this was a transient issue, related to local network configuration (.netrc file, VPNs or flakyness on cocoapod side). Feel free to re-open if the issue persists consistently.

I've also tested this locally on the RC for 0.69, and everything works 👍

@cortinico cortinico closed this as not planned Won't fix, can't repro, duplicate, stale Jun 1, 2022
@cortinico cortinico added Platform: iOS iOS applications. Platform: macOS Building on macOS. Priority: Low and removed Needs: Triage 🔍 labels Jun 1, 2022
@mutablestudio
Copy link

mutablestudio commented Jun 13, 2022

I experienced this yesterday - no idea why. The boost install step has been hanging for several years for me. Only happens occasionally. I thought maybe it was a DNS issue or something like that, tried using a VPN (I'm in the EU). Anyway, this clean step worked for me:

cd ios && rm -rf Pods && rm -rf Podfile.lock && rm -rf build && pod deintegrate && cd ..

...then run pod install

The key fix for me was adding deintegrate.

@mariogruizdiaz
Copy link

I am having the same error. @Tycholiz did you fix it?

@Tycholiz
Copy link
Author

Tycholiz commented Jul 7, 2022

I did not. The workaround I posted above was sufficient to move past

@mariogruizdiaz
Copy link

@Tycholiz the only workaround that I see you posted is about the 401 aover boost_1_76_0.tar.bz2, but in this case the problem is about "Error installing OpenSSL-Universal", are them related?

@URvesh109
Copy link

  1. open node_modules/react-native/third-party-podspecs/boost.podspec

Replaced

spec.source = { :http => 'https://boostorg.jfrog.io/artifactory/main/release/1.76.0/source/boost_1_76_0.tar.bz2',
:sha256 => 'f0397ba6e982c4450f27bf32a2a83292aba035b827a5623a14636ea583318c41' }

              with

spec.source = { :http => 'https://sourceforge.net/projects/boost/files/boost/1.76.0/boost_1_76_0.tar.bz2'}

@mariogruizdiaz
Copy link

@URvesh109 Thanks but it didn't work
image

@Tycholiz
Copy link
Author

I'm pretty sure this issue is related to something at the network level. I'm not sure what my exact setup was at the time, but see if you are on a VPN. Maybe even try a different wifi network to see if the result changes.

It's quite a strange issue and I'm not exactly sure what to think about it

@URvesh109
Copy link

@Tycholiz true it is strange issue
Now below link is also working
https://boostorg.jfrog.io/artifactory/main/release/1.76.0/source/boost_1_76_0.tar.bz2

Morning I was facing could not resolve host
boost

@saadgulofficial
Copy link

I found a workaround, though admittedly it's pretty lame and is no better than a bandaid solution. The approach is to download the file and then source it from the local filesystem, rather than making a network call:

  1. Download the tar.bz2 file from https://boostorg.jfrog.io/artifactory/main/release/1.76.0/source/boost_1_76_0.tar.bz2
  2. move the (compressed) file to node_modules/react-native/third-party-podspecs
  3. open node_modules/react-native/third-party-podspecs/boost.podspec
  4. change the :http part of the spec.source key to:
:http => 'file:' + __dir__ + '/boost_1_76_0.tar.bz2'
  1. run pod install

note: you may need to adjust the version of the boost package your project specifies.

Thanks

@toby-lei
Copy link

toby-lei commented Aug 2, 2022

I found a workaround, though admittedly it's pretty lame and is no better than a bandaid solution. The approach is to download the file and then source it from the local filesystem, rather than making a network call:

  1. Download the tar.bz2 file from https://boostorg.jfrog.io/artifactory/main/release/1.76.0/source/boost_1_76_0.tar.bz2
  2. move the (compressed) file to node_modules/react-native/third-party-podspecs
  3. open node_modules/react-native/third-party-podspecs/boost.podspec
  4. change the :http part of the spec.source key to:
:http => 'file:' + __dir__ + '/boost_1_76_0.tar.bz2'
  1. run pod install

note: you may need to adjust the version of the boost package your project specifies.

It works for me

@crackerack
Copy link

I am still seing this issue. Is there anything besides the workaround? A lot of people seem to have reported this.

@glhrmoura
Copy link

Worked for me:

rm -rf ~/Library/Caches/CocoaPods
rm -rf Pods
rm -rf ~/Library/Developer/Xcode/DerivedData/*
pod deintegrate
pod setup
pod install

@williamgurzoni
Copy link

What worked for me was just waiting the download... The link was downloading on an average of 25KB/s.
After waiting for a loooong time it worked.

@runtimeterror1997
Copy link

Worked for me:

rm -rf ~/Library/Caches/CocoaPods
rm -rf Pods
rm -rf ~/Library/Developer/Xcode/DerivedData/*
pod deintegrate
pod setup
pod install

This worked for me. Thank you

@msahin35
Copy link

msahin35 commented Dec 7, 2022

For workaround solution. You don't need to download the tar.bz2. And move to node_modules/react-native/third-party-podspecs.
Only change line
spec.source = { :http => 'https://boostorg.jfrog.io/artifactory/main/release/1.76.0/source/boost_1_76_0.tar.bz2',
:sha256 => 'f0397ba6e982c4450f27bf32a2a83292aba035b827a5623a14636ea583318c41' }
to
spec.source = { :http => 'https://sourceforge.net/projects/boost/files/boost/1.76.0/boost_1_76_0.tar.bz2',
:sha256 => 'f0397ba6e982c4450f27bf32a2a83292aba035b827a5623a14636ea583318c41' }
in file node_modules/react-native/third-party-podspecs/boost.podspec

i think jfrog close their server. You may need to change 76 if you use another version

@built-by-as
Copy link

@Tycholiz I resolved this issue by removing the following line from ~/.netrc.

machine github.com
  login xxxxx
  password xxxxxx

this worked for me

@vladanyes
Copy link

Connecting to another wifi(iPhone hotspot) solved the issue for me.

@react06
Copy link

react06 commented Jan 12, 2023

hit the same command pod install after failing works for me, might be network issue.

@ricardodolnl
Copy link

ricardodolnl commented Jan 30, 2023

I tried to run the curl command itself (/usr/bin/curl -f -L -o ... and i noticed that that command only works if the -f option is removed. Only than it'll use the .netrc file the way it should. But i don't know how to fix this of pod install.

Btw I have this problem while installing mapbox.

@arunsa-hrbl
Copy link

For workaround solution. You don't need to download the tar.bz2. And move to node_modules/react-native/third-party-podspecs. Only change line spec.source = { :http => 'https://boostorg.jfrog.io/artifactory/main/release/1.76.0/source/boost_1_76_0.tar.bz2', :sha256 => 'f0397ba6e982c4450f27bf32a2a83292aba035b827a5623a14636ea583318c41' } to spec.source = { :http => 'https://sourceforge.net/projects/boost/files/boost/1.76.0/boost_1_76_0.tar.bz2', :sha256 => 'f0397ba6e982c4450f27bf32a2a83292aba035b827a5623a14636ea583318c41' } in file node_modules/react-native/third-party-podspecs/boost.podspec

i think jfrog close their server. You may need to change 76 if you use another version

This is really worked for me. Thanks a lot :)

@mvn-sonnguyen3-hn
Copy link

  1. open node_modules/react-native/third-party-podspecs/boost.podspec

Replaced

spec.source = { :http => 'https://boostorg.jfrog.io/artifactory/main/release/1.76.0/source/boost_1_76_0.tar.bz2', :sha256 => 'f0397ba6e982c4450f27bf32a2a83292aba035b827a5623a14636ea583318c41' }

              with

spec.source = { :http => 'https://sourceforge.net/projects/boost/files/boost/1.76.0/boost_1_76_0.tar.bz2'}

oh thank you, It's work for me.

@Adnan-Bacic
Copy link
Contributor

Adnan-Bacic commented Apr 12, 2023

running pod deintegrate as some people have suggested, deletes quite a few lines of code in ios/projectName.xcodeproj/project.pbxproj file.

is this okay?

either way, this solution sadly didnt work for me.

manually editing node_modules/ would only work locally, and would still fail on CI builds.(even changing it locally didnt work for me)

is this a widespread problem people have? i just got the problem yesterday, while this issue is a year old.

@aleena-adnan1
Copy link

did you find out any work around @Adnan-Bacic ?

@Adnan-Bacic
Copy link
Contributor

@aleena-adnan1 as someone else suggested, i just waited. it takes a very long time. i honestly didnt look at the time but i guess it was at least 30 min, if not 60+

@Kawaljeet-AUI
Copy link

@Adnan-Bacic Despite waiting, did it work or no?

@Adnan-Bacic
Copy link
Contributor

@Adnan-Bacic Despite waiting, did it work or no?

Yes it worked

@dohooo
Copy link

dohooo commented Jul 12, 2023

@Tycholiz I resolved this issue by removing the following line from ~/.netrc.

machine github.com
  login xxxxx
  password xxxxxx

It works for me!!!!

@cairocampos
Copy link

Updating cocoapods via sudo gem install cocoapods fixed this issue.

@sathiyaraj45
Copy link

/usr/bin/tar xf /var/folders/_y/1jlgk27j6xz72bwmny4f2_cw0000gq/T/d20230915-6496-r9jxag/file.tbz -C /var/folders/_y/1jlgk27j6xz72bwmny4f2_cw0000gq/T/d20230915-6496-r9jxag

tar: Error opening archive: Unrecognized archive format

@sathiyaraj45
Copy link

sathiyaraj45 commented Sep 20, 2023

@cairocampos we updated sudo command and manual steps also we are getting the below error

/usr/bin/tar xf /var/folders/_y/1jlgk27j6xz72bwmny4f2_cw0000gq/T/d20230915-6496-r9jxag/file.tbz -C /var/folders/_y/1jlgk27j6xz72bwmny4f2_cw0000gq/T/d20230915-6496-r9jxag

tar: Error opening archive: Unrecognized archive format

when we navigate the below path we unable to identify the file file.tbz
/var/folders/_y/1jlgk27j6xz72bwmny4f2_cw0000gq/T/d20230915-6496-r9jxag/

But we got unrecognized archive format. I'm wonder how to identify the root cause.

@tamdvyounetgroup
Copy link

oh thank you, It's work for me.

@Roka20012
Copy link

Maybe it would be ridiculous but switching from WiFi to LTE makes it load in 2 minutes, WiFi it showed me like >2 hours btw my wifi is faster than LTE)

@TarifEzaz
Copy link

The build process stopped with errors the first time when I ran the command --platform ios --lcal once. But after running the command for the second time, boost installing took about 20 minutes and finally the build was successfully made.

@lalitshahi
Copy link

Worked for me:

rm -rf ~/Library/Caches/CocoaPods
rm -rf Pods
rm -rf ~/Library/Developer/Xcode/DerivedData/*
pod deintegrate
pod setup
pod install

This Worked for me as well.

@mehdiChibani
Copy link

mehdiChibani commented Jan 1, 2024

  1. open node_modules/react-native/third-party-podspecs/boost.podspec

Replaced

spec.source = { :http => 'https://boostorg.jfrog.io/artifactory/main/release/1.76.0/source/boost_1_76_0.tar.bz2', :sha256 => 'f0397ba6e982c4450f27bf32a2a83292aba035b827a5623a14636ea583318c41' }

              with

spec.source = { :http => 'https://sourceforge.net/projects/boost/files/boost/1.76.0/boost_1_76_0.tar.bz2'}

this solution saved my project 🥹
to install the newest version of boost use this link : https://sourceforge.net/projects/boost/files/boost/1.83.0/boost_1_83_0.tar.bz2

@hotrungnhan
Copy link

hotrungnhan commented Jan 1, 2024

After One year, react teams are not offically fix this issue .

@arnoldc
Copy link

arnoldc commented Jan 8, 2024

not really

see pin issue from maintainer
#42180

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Platform: iOS iOS applications. Platform: macOS Building on macOS. Priority: Low
Projects
None yet
Development

No branches or pull requests