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

cUrl 401 Authorization Required after upgrading to 1.0.0 #5318

Closed
1 task done
nmccann opened this issue May 13, 2016 · 2 comments
Closed
1 task done

cUrl 401 Authorization Required after upgrading to 1.0.0 #5318

nmccann opened this issue May 13, 2016 · 2 comments
Labels
d1:easy An easy ticket that is a good start for first-time contributors s2:confirmed Issues that have been confirmed by a CocoaPods contributor

Comments

@nmccann
Copy link
Contributor

nmccann commented May 13, 2016

Report

What did you do?

Updated from 0.39 to 1.0.0
Ran pod install

What did you expected to happen?

Pods should have installed correctly

What happened instead?

The following error was reported when trying to install a pod that has a username/password embedded in it's URL:
(Error edited for privacy)

[!] Error installing POD_NAME
[!] /usr/bin/curl -f -L -o /var/folders/temp/file.zip https://username:password@domain.com/file.zip --create-dirs --netrc

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

CocoaPods Environment

Stack

   CocoaPods : 1.0.0
        Ruby : ruby 2.2.2p95 (2015-04-13 revision 50295) [x86_64-darwin14]
    RubyGems : 2.4.7
        Host : Mac OS X 10.11.4 (15E65)
       Xcode : 7.3.1 (7D1014)
         Git : git version 2.7.4 (Apple Git-66)
Ruby lib dir : /Users/user/.rvm/rubies/ruby-2.2.2/lib
Repositories : custom-specs - ssh://domain.com:7999/ilb/specs.git @ 5823f9448a22ba75f6d3178b55a274d8c646f245
               master - https://github.com/CocoaPods/Specs.git @ 718aac8045b2e79ebc9fbc0bca34e475c2c31fa5

Installation Source

Executable Path: /Users/user/.rvm/gems/ruby-2.2.2/bin/pod

Plugins

cocoapods-deintegrate : 1.0.0
cocoapods-plugins     : 1.0.0
cocoapods-search      : 1.0.0
cocoapods-stats       : 1.0.0
cocoapods-trunk       : 1.0.0
cocoapods-try         : 1.0.0

Podfile

source 'https://github.com/CocoaPods/Specs.git'
source 'ssh://git@domain.com:7999/ilb/specs.git'

project 'Project.xcodeproj'

platform :ios, '9.0'

target 'Project' do
pod 'AffectedPod', '1.0.0'
end

Workaround

Add credentials to ~/.netrc file in the format:

machine DOMAIN
  login USERNAME
  password PASSWORD

Changing the command from:

/usr/bin/curl -f -L -o /var/folders/temp/file.zip https://username:password@domain.com/file.zip --create-dirs --netrc

To:

/usr/bin/curl -f -L -o /var/folders/temp/file.zip https://username:password@domain.com/file.zip --create-dirs --netrc-optional

Also resolves the problem, but from what I can tell this would require a change to Cocoapods.

Summary

The new version of Cocoapods introduced authentication issues for a pod accessed with username/password. There is a reasonable workaround (which is probably the more correct approach). I'm more interested in knowing if this change was intentional or if it was an unexpected side effect of some other change.

Thank you for your time,
Noah

@nmccann nmccann changed the title cUrl Authorization Required after upgrading to 1.0.0 cUrl 401 Authorization Required after upgrading to 1.0.0 May 13, 2016
@segiddins
Copy link
Member

@nmccann I believe changing https://github.com/CocoaPods/cocoapods-downloader to pass --netrc-optional would be 🚀

@sguillope
Copy link
Contributor

Thanks @segiddins for the suggestion. Submitted CocoaPods/cocoapods-downloader#56

@segiddins segiddins added d1:easy An easy ticket that is a good start for first-time contributors s4:awaiting validation A Pull Request that is waiting for validation by a CocoaPods Core Team member labels May 14, 2016
@mrackwitz mrackwitz added s2:confirmed Issues that have been confirmed by a CocoaPods contributor and removed s4:awaiting validation A Pull Request that is waiting for validation by a CocoaPods Core Team member labels Jun 1, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
d1:easy An easy ticket that is a good start for first-time contributors s2:confirmed Issues that have been confirmed by a CocoaPods contributor
Projects
None yet
Development

No branches or pull requests

4 participants