Skip to content
This repository has been archived by the owner on Nov 19, 2018. It is now read-only.

iTunes Connect - shows login failed #19

Closed
paweldudek opened this issue Nov 13, 2014 · 17 comments
Closed

iTunes Connect - shows login failed #19

paweldudek opened this issue Nov 13, 2014 · 17 comments

Comments

@paweldudek
Copy link
Contributor

It seems that deliver fails to parse website if Apple adds an additional information alert to the top of the window.

Here's the stack trace:

Error logging in user (...) with the given password. Make sure you entered them correctly.
/Users/paweldudek/.rvm/gems/ruby-2.0.0-p576@ios/gems/deliver-0.3.1/lib/deliver/itunes_connect.rb:96:in `rescue in login'
/Users/paweldudek/.rvm/gems/ruby-2.0.0-p576@ios/gems/deliver-0.3.1/lib/deliver/itunes_connect.rb:92:in `login'
/Users/paweldudek/.rvm/gems/ruby-2.0.0-p576@ios/gems/deliver-0.3.1/lib/deliver/itunes_connect.rb:58:in `initialize'
/Users/paweldudek/.rvm/gems/ruby-2.0.0-p576@ios/gems/deliver-0.3.1/lib/deliver/app.rb:69:in `new'
/Users/paweldudek/.rvm/gems/ruby-2.0.0-p576@ios/gems/deliver-0.3.1/lib/deliver/app.rb:69:in `itc'
/Users/paweldudek/.rvm/gems/ruby-2.0.0-p576@ios/gems/deliver-0.3.1/lib/deliver/app.rb:76:in `get_app_status'
/Users/paweldudek/Workspace/showcase-ios/Project/ios-build/deliver.rake:9:in `block (2 levels) in <top (required)>'
/Users/paweldudek/.rvm/gems/ruby-2.0.0-p576@ios/gems/rake-10.0.4/lib/rake/task.rb:246:in `call'
/Users/paweldudek/.rvm/gems/ruby-2.0.0-p576@ios/gems/rake-10.0.4/lib/rake/task.rb:246:in `block in execute'
/Users/paweldudek/.rvm/gems/ruby-2.0.0-p576@ios/gems/rake-10.0.4/lib/rake/task.rb:241:in `each'
/Users/paweldudek/.rvm/gems/ruby-2.0.0-p576@ios/gems/rake-10.0.4/lib/rake/task.rb:241:in `execute'
/Users/paweldudek/.rvm/gems/ruby-2.0.0-p576@ios/gems/rake-10.0.4/lib/rake/task.rb:184:in `block in invoke_with_call_chain'
/Users/paweldudek/.rvm/gems/ruby-2.0.0-p576@ios/gems/rake-10.0.4/lib/rake/task.rb:177:in `invoke_with_call_chain'
/Users/paweldudek/.rvm/gems/ruby-2.0.0-p576@ios/gems/rake-10.0.4/lib/rake/task.rb:170:in `invoke'
/Users/paweldudek/.rvm/gems/ruby-2.0.0-p576@ios/gems/rake-10.0.4/lib/rake/application.rb:143:in `invoke_task'
/Users/paweldudek/.rvm/gems/ruby-2.0.0-p576@ios/gems/rake-10.0.4/lib/rake/application.rb:101:in `block (2 levels) in top_level'
/Users/paweldudek/.rvm/gems/ruby-2.0.0-p576@ios/gems/rake-10.0.4/lib/rake/application.rb:101:in `each'
/Users/paweldudek/.rvm/gems/ruby-2.0.0-p576@ios/gems/rake-10.0.4/lib/rake/application.rb:101:in `block in top_level'
/Users/paweldudek/.rvm/gems/ruby-2.0.0-p576@ios/gems/rake-10.0.4/lib/rake/application.rb:110:in `run_with_threads'
/Users/paweldudek/.rvm/gems/ruby-2.0.0-p576@ios/gems/rake-10.0.4/lib/rake/application.rb:95:in `top_level'
/Users/paweldudek/.rvm/gems/ruby-2.0.0-p576@ios/gems/rake-10.0.4/lib/rake/application.rb:73:in `block in run'
/Users/paweldudek/.rvm/gems/ruby-2.0.0-p576@ios/gems/rake-10.0.4/lib/rake/application.rb:160:in `standard_exception_handling'
/Users/paweldudek/.rvm/gems/ruby-2.0.0-p576@ios/gems/rake-10.0.4/lib/rake/application.rb:70:in `run'
/Users/paweldudek/.rvm/gems/ruby-2.0.0-p576@ios/bin/ruby_executable_hooks:15:in `eval'
/Users/paweldudek/.rvm/gems/ruby-2.0.0-p576@ios/bin/ruby_executable_hooks:15:in `<main>'

See the attached screenshot. Stack and error suggest that signing fail, though the screenshot clearly states that I've been logged in 😉

error1415869705

I'm also attaching part of the web page source code as it might be helpful:

<!-- "Warnings" (non-fatal warning messages) -->
<div id="warnings" class="homepage-msg-container ng-scope" ng-show="hasWarnings">
    <div class="pagemessage warning">
        <!-- ngRepeat: warning in warnings --><p ng-repeat="warning in warnings" class="ng-scope">
            <span ng-bind-html="showHtml(warning.header)" class="alertHeader ng-binding">Agreements, Tax, and Banking</span>
            <span ng-bind-html="showHtml(warning.message)" class="alertMsg ng-binding"><p>An updated contract is now available. Before you can offer your content in new iTunes Store territories, a user with the Legal role must agree to the new contract in the <strong>Agreements, Tax, and Banking</strong> module.<br><br>If your organization does not have a Legal user, see the <a href="/WebObjects/iTunesConnect.woa/wa/jumpTo?page=faqIndex&amp;qa=createlegaluser">Contracts FAQ</a> for details on how to create one.</p></span>
        </p><!-- end ngRepeat: warning in warnings -->
    </div>
</div>


<!-- News Feed -->
<div id="news" class="homepage-msg-container ng-scope" ng-show="hasNews">
    <div class="news-container" ng-class="{'truncated' : newsTruncated, 'show-toggle' : hasLongNews }">
    <!-- <div class="news-container truncated"> -->

        <h1 class="ng-binding">News</h1>
        <div class="ellipsis">
            <div>
                <ul>
                    <!-- ngRepeat: newsitem in news --><li ng-repeat="newsitem in news" class="ng-scope">
                        <div ng-bind-html="showHtml(newsitem.header)" class="newsheader ng-binding"><h2><b>TestFlight Beta Testing for External Testers</b></h2></div>
                        <div ng-bind-html="showHtml(newsitem.message)" class="newstxt ng-binding"><p>You can now invite up to 1000 users to test prerelease builds of your app. To do so, go to External Testers in Prerelease for the app that you want to test and add&nbsp;external testers simply by sending an email invitation. The TestFlight app will allow them to install the prerelease build on their iOS device, receive updates, and provide feedback, all within the TestFlight app. </p><p><a href="https://itunesconnect.apple.com/downloads/Documentation/TestFlight-v09-iTC-Export-sw.mov">For more information, watch the video tutorial.</a></p></div>
                    </li><!-- end ngRepeat: newsitem in news -->
                </ul>
            </div>
        </div>

        <a class="show-more-news" href="javascript:void(0)" ng-click="toggleNewsVisibility()">
            <span ng-show="newsTruncated" class="ng-binding ng-hide">More</span>
            <span ng-show="!newsTruncated" class="ng-binding">Less</span>
        </a>
    </div>
</div>
@KrauseFx
Copy link
Collaborator

Hi @paweldudek,

Deliver waits for .ng-scope.managedWidth to be available: itunes_connect.rb:95

<li .... class="ng-scope managedWidth">
        ... 
</li>

Every 'app icon' on iTC has this class. Can you check if that's the case for you too? Maybe it's because you don't have access to all features of iTC with that developer account.

@KrauseFx KrauseFx changed the title iTunes Connect website parsing fails when an additional alert from Apple is visible iTunes Connect - shows login failed Nov 13, 2014
@paweldudek
Copy link
Contributor Author

Hmmm, interesting, seems that I've rushed my conclusions about the root cause of this issue.

So we did a little bit of digging at our company and it seems that the organizational iTunes Connect account has a different HTML code for most of screens.

Here's an example for the home view:

<div ng-include="getGlobalFilePathMap('/itc/views/shared/main_nav_modules.html')" class="homepageWrapper ng-scope" itc-home-page=""><ul role="menu" id="main-nav" main-nav-size-fix="pageWrapperVars.mainNavigationCount" class="ng-scope ng-isolate-scope" style="width: 502px; max-width: 980px;">
    <!-- ngRepeat: nav in mainNavigation --><li ng-repeat="nav in mainNavigation" role="menuitem" ng-class="{current: currentclass === nav.section}" class="ng-scope" style="width: 25%;">
        <a href="/WebObjects/iTunesConnect.woa/ra/ng/app">
            <!-- ngIf: nav.ticketCount !== undefined && nav.ticketCount > 0 -->
            <img ng-src="/itc/img/ico_homepage/MyApps.png" src="/itc/img/ico_homepage/MyApps.png">
            <span ng-bind-html="nav.name" class="ng-binding">My Apps</span>
        </a>
    </li><!-- end ngRepeat: nav in mainNavigation --><li ng-repeat="nav in mainNavigation" role="menuitem" ng-class="{current: currentclass === nav.section}" class="ng-scope" style="width: 25%;">
        <a href="https://iadworkbench.apple.com/app/?page=routing#routing">
            <!-- ngIf: nav.ticketCount !== undefined && nav.ticketCount > 0 -->
            <img ng-src="/itc/img/ico_homepage/iAd.png" src="/itc/img/ico_homepage/iAd.png">
            <span ng-bind-html="nav.name" class="ng-binding">iAd</span>
        </a>
    </li><!-- end ngRepeat: nav in mainNavigation --><li ng-repeat="nav in mainNavigation" role="menuitem" ng-class="{current: currentclass === nav.section}" class="ng-scope" style="width: 25%;">
        <a href="/WebObjects/iTunesConnect.woa/ra/ng/users_roles">
            <!-- ngIf: nav.ticketCount !== undefined && nav.ticketCount > 0 -->
            <img ng-src="/itc/img/ico_homepage/UsersandRoles.png" src="/itc/img/ico_homepage/UsersandRoles.png">
            <span ng-bind-html="nav.name" class="ng-binding">Users and Roles</span>
        </a>
    </li><!-- end ngRepeat: nav in mainNavigation --><li ng-repeat="nav in mainNavigation" role="menuitem" ng-class="{current: currentclass === nav.section}" class="ng-scope" style="width: 25%;">
        <a href="/WebObjects/iTunesConnect.woa/ra/ng/resources_page">
            <!-- ngIf: nav.ticketCount !== undefined && nav.ticketCount > 0 -->
            <img ng-src="/itc/img/ico_homepage/resourcesAndhelp.png" src="/itc/img/ico_homepage/resourcesAndhelp.png">
            <span ng-bind-html="nav.name" class="ng-binding">Resources and Help</span>
        </a>
    </li><!-- end ngRepeat: nav in mainNavigation -->
</ul></div>

and here's for the apps view:

<li class="app reveal-animation ng-scope" bindonce="" ng-repeat="app in filteredData | startFrom:currentPage*pageSize | limitTo:pageSize">
      <div class="fake-border forgridview"></div>
        <div class="app-icon col1" bo-class="{bundle: isBundle(app.type)}">
        <a bo-href="appBundleLink(app.adamId, app.type)" href="(...)">
          <!-- ngIf: app.iconUrl --><div ng-if="app.iconUrl" class="app-icon-img ng-scope ios7-style-icon-large" ng-class="getIconClass(app)" style="background-image:url(...)"></div><!-- end ngIf: app.iconUrl -->
          <!-- ngIf: !app.iconUrl && appsViewMode == 'list' -->
          <!-- ngIf: !app.iconUrl && appsViewMode != 'list' -->
        </a>
      </div>

      <div class="name col2" bo-class="{bundle: isBundle(app.type)}" bo-title="app.name" title="Marquee by Taptera">
        <!-- boIf: appsViewMode != 'list' && !isBundle(app.type) --><a bo-if="appsViewMode != 'list' &amp;&amp; !isBundle(app.type)" bo-href="appBundleLink(app.adamId, app.type)" class="ng-scope" href="(...)"><div bo-bind="app.name">Marquee by Taptera</div></a>
        <!-- boIf: appsViewMode != 'list' && isBundle(app.type) -->
        <!-- boIf: appsViewMode == 'list' -->
      </div>

      <div class="app-type-badge forgridview" bo-bind="getProperType(app.type)">iOS</div>
      <div class="col3 forlistview"><div class="app-type-badge" bo-bind="getProperType(app.type)">iOS</div></div>

      <div class="versions forgridview">
        <!-- ngRepeat: version in app.versions --><div class="version ng-scope" bindonce="" ng-repeat="version in app.versions">
          <span class="status ready">
            <a bo-href="appBundleLink(app.adamId, app.type, version)" bo-title="l10n.interpolate(referenceData.statusLevels[version.stateKey].locKey)" class="ng-binding" title="Ready for Sale" href="(...)"><!-- ngIf: !isBundle(app.type) --><span ng-if="!isBundle(app.type)" class="ng-scope ng-binding">1.2</span><!-- end ngIf: !isBundle(app.type) --> Ready for Sale</a>
          </span>
        </div><!-- end ngRepeat: version in app.versions --><div class="version ng-scope" bindonce="" ng-repeat="version in app.versions">
          <span class="status waiting">
            <a bo-href="appBundleLink(app.adamId, app.type, version)" bo-title="l10n.interpolate(referenceData.statusLevels[version.stateKey].locKey)" class="ng-binding" title="Pending Developer Release" href="(...)"><!-- ngIf: !isBundle(app.type) --><span ng-if="!isBundle(app.type)" class="ng-scope ng-binding">1.4</span><!-- end ngIf: !isBundle(app.type) --> Pending Developer Release</a>
          </span>
        </div><!-- end ngRepeat: version in app.versions -->
      </div>

      <div class="versions col4 forlistview">
        <!-- ngRepeat: version in app.versions --><div class="version ng-scope" bindonce="" ng-repeat="version in app.versions" bo-hide="version.version == null">
          <a bo-href="appBundleLink(app.adamId, app.type, version)" bo-bind="version.version" href="(...)">1.2</a>
        </div><!-- end ngRepeat: version in app.versions --><div class="version ng-scope" bindonce="" ng-repeat="version in app.versions" bo-hide="version.version == null">
          <a bo-href="appBundleLink(app.adamId, app.type, version)" bo-bind="version.version" href="(...)">1.4</a>
        </div><!-- end ngRepeat: version in app.versions -->
      </div>

      <div class="statuses col5 forlistview">
        <!-- ngRepeat: version in app.versions --><div class="version ng-scope" bindonce="" ng-repeat="version in app.versions" bo-title="version.state" title="readyForSale">
          <span class="status ready" bo-title="l10n.interpolate(referenceData.statusLevels[version.stateKey].locKey)" bo-bind="l10n.interpolate(referenceData.statusLevels[version.stateKey].locKey)" title="Ready for Sale">Ready for Sale</span>
        </div><!-- end ngRepeat: version in app.versions --><div class="version ng-scope" bindonce="" ng-repeat="version in app.versions" bo-title="version.state" title="pendingDeveloperRelease">
          <span class="status waiting" bo-title="l10n.interpolate(referenceData.statusLevels[version.stateKey].locKey)" bo-bind="l10n.interpolate(referenceData.statusLevels[version.stateKey].locKey)" title="Pending Developer Release">Pending Developer Release</span>
        </div><!-- end ngRepeat: version in app.versions -->
      </div>

      <div class="last-modified col5 forlistview" bo-bind="app.lastModifiedDate | date:'longDate'">November 12, 2014</div>
      </li>

Now, with all this having said I do have access for the features necessary for uploading new builds to Apple. I'll see whether I can bake a PR for this one next week.

@KrauseFx
Copy link
Collaborator

Okay, thanks for your help. Can you let me know how to create an "Organizational iTunes Connect" to run into this issue? I can then easier debug the issue.

@KrauseFx KrauseFx added the bug label Nov 14, 2014
@paweldudek
Copy link
Contributor Author

When you're enrolling for Apple Developer program you can either choose an individual account or a company/organization account. Deliver seems to be working with the first one, but the latter one seems to have a lot of issues.

Initially I've attempted to tie this into our build system using provided APIs, however it seems that I can't actually complete deliver init.

I've played a bit with Capybara but it looks like my Ruby foo was too weak today 😉 Let me know whether I can help if any way!

@KrauseFx
Copy link
Collaborator

That's weird. What happens when you run deliver init? This command will only use the iTunes Transportert to download the latest app metadata from iTunes Connect, without using a headless web browser.

@KrauseFx
Copy link
Collaborator

About the apple account: I've tested it with both individual and company account, it's working fine. This has to be related to the missing icons, you only have 4 options on iTC. I'll try to create a new user with the same rights.

@KrauseFx
Copy link
Collaborator

Update: it looks like you have a "technical" iTC account.

@paweldudek
Copy link
Contributor Author

Yup, you're totally right. We've only tested this against technical accounts and it seems that was our mistake. Sorry!

Nevertheless, it's a bit awkward that Apple has a different website just for technical users.

@KrauseFx
Copy link
Collaborator

No, that's not your mistake, don't worry, deliver has to support this too. I'm currently working on fixing this. I could reproduce the error.

Apple is using a complete different HTML code for technical users. It's okay, since it should only affect the "Landing Screen" and not the app management area itself.

@paweldudek
Copy link
Contributor Author

Awesome, let me know whether I can help with anything!

And for the record (and people who might stumble upon this in future) here's the error I get when doing deliver init:

INFO [2014-11-14 17:16:49.12]: Going to download app metadata from iTunesConnect
INFO [2014-11-14 17:16:49.58]: Successfully downloaded the latest package from iTunesConnect.
error: No such file or directory - /tmp/627716885.itmsp//metadata.xml. Use --trace to view backtrace

This might actually be unrelated to issue with technical user. Here's the stack trace:

/Users/eldudi/.rvm/gems/ruby-2.0.0-p576/gems/deliver-0.3.1/lib/deliver/app_metadata.rb:431:in `read': No such file or directory - /tmp/627716885.itmsp//metadata.xml (Errno::ENOENT)
    from /Users/eldudi/.rvm/gems/ruby-2.0.0-p576/gems/deliver-0.3.1/lib/deliver/app_metadata.rb:431:in `parse_package'
    from /Users/eldudi/.rvm/gems/ruby-2.0.0-p576/gems/deliver-0.3.1/lib/deliver/app_metadata.rb:63:in `initialize'
    from /Users/eldudi/.rvm/gems/ruby-2.0.0-p576/gems/deliver-0.3.1/lib/deliver/app.rb:112:in `new'
    from /Users/eldudi/.rvm/gems/ruby-2.0.0-p576/gems/deliver-0.3.1/lib/deliver/app.rb:112:in `metadata'
    from /Users/eldudi/.rvm/gems/ruby-2.0.0-p576/gems/deliver-0.3.1/lib/deliver/deliverfile/deliverfile_creator.rb:56:in `create_based_on_identifier'
    from /Users/eldudi/.rvm/gems/ruby-2.0.0-p576/gems/deliver-0.3.1/lib/deliver/deliverfile/deliverfile_creator.rb:27:in `create'
    from /Users/eldudi/.rvm/gems/ruby-2.0.0-p576/gems/deliver-0.3.1/lib/deliver/commands/init.rb:10:in `block (2 levels) in <top (required)>'
    from /Users/eldudi/.rvm/gems/ruby-2.0.0-p576/gems/commander-4.2.1/lib/commander/command.rb:180:in `call'
    from /Users/eldudi/.rvm/gems/ruby-2.0.0-p576/gems/commander-4.2.1/lib/commander/command.rb:180:in `call'
    from /Users/eldudi/.rvm/gems/ruby-2.0.0-p576/gems/commander-4.2.1/lib/commander/command.rb:155:in `run'
    from /Users/eldudi/.rvm/gems/ruby-2.0.0-p576/gems/commander-4.2.1/lib/commander/runner.rb:421:in `run_active_command'
    from /Users/eldudi/.rvm/gems/ruby-2.0.0-p576/gems/commander-4.2.1/lib/commander/runner.rb:81:in `run!'
    from /Users/eldudi/.rvm/gems/ruby-2.0.0-p576/gems/commander-4.2.1/lib/commander/delegates.rb:8:in `run!'
    from /Users/eldudi/.rvm/gems/ruby-2.0.0-p576/gems/commander-4.2.1/lib/commander/import.rb:10:in `block in <top (required)>'

@KrauseFx
Copy link
Collaborator

That looks weird. Can you post the full stacktrace? Anything special about this app? (like only available in a few countries)

@paweldudek
Copy link
Contributor Author

I move this to a different issue #21 (stack trace & some additional data there).

@KrauseFx
Copy link
Collaborator

Alright, I fixed the issue: 832b804

Could you download the latest zip file and run sudo rake install in unzipped folder?

@paweldudek
Copy link
Contributor Author

Allright, installed :head via ruby gems and it's all working fine! Awesome, thanks! 🎉

@KrauseFx
Copy link
Collaborator

Cool, thanks for helping me debug this issue 👍

@paweldudek
Copy link
Contributor Author

No problem! Let's tackle the other one now 😉

@fastlanebot
Copy link

This issue was migrated to fastlane/fastlane#2468. Please post all further comments there.

fastlane is now a mono repo, you can read more about the change in our blog post. All tools are now available in the fastlane main repo 🚀

@fastlane-old fastlane-old locked and limited conversation to collaborators Mar 11, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants