fastlane: App-specific password does not seem to work

New Issue Checklist

Issue Description

I generated a fresh app-specific password and tried running deliver to upload my ipa when it said the credentials are invalid

Complete output when running fastlane, including the stack trace and command used
export DELIVER_PASSWORD="<fresh app-specific password>" && deliver --username sonnycnn24117@gmail.com --app 1037854626 --team_id 9DE4B762BF --ipa build/Esplorio.ipa --skip_screenshots --skip_metadata --force
[10:48:02]: Login to iTunes Connect (sonnycnn24117@gmail.com)
The login credentials for 'sonnycnn24117@gmail.com' seem to be wrong
The password was taken from the environment variable
Please make sure it is correct
Please run this tool again to apply the new password

Environment

<details><summary>✅ fastlane environment ✅</summary>

### Stack

| Key                 | Value                                         |
| ------------------- | --------------------------------------------- |
| OS                  | 10.12.1                                       |
| Ruby                | 2.2.4                                         |
| Bundler?            | false                                         |
| Git                 | git version 2.7.4                             |
| Installation Source | /Users/son/.rbenv/versions/2.2.4/bin/fastlane |
| Host                | Mac OS X 10.12.1 (16B2555)                    |
| Ruby Lib Dir        | /Users/son/.rbenv/versions/2.2.4/lib          |
| OpenSSL Version     | OpenSSL 1.0.2g  1 Mar 2016                    |
| Is contained        | false                                         |
| Xcode Path          | /Applications/Xcode.app/Contents/Developer/   |
| Xcode Version       | 8.1                                           |


### System Locale

| Variable | Value       |   |
| -------- | ----------- | - |
| LANG     | en_US.UTF-8 | ✅ |
| LC_ALL   | en_US.UTF-8 | ✅ |
| LANGUAGE |             |   |


### fastlane files:

<details><summary>`./fastlane/Fastfile`</summary>

```ruby
# This file defines all the lanes

default_platform :ios


platform :ios do
  lane :build do
    desc "Perform a beta build"
    gym
    pilot
    hockey(
       api_token: ENV['HOCKEY_API_TOKEN'],
       ipa: './build/esplorio.ipa',
       dsym: './build/esplorio.app.dSYM.zip'
    )
  end

  lane :beta_build do
    desc "Increment a beta build"
    increment_build_number(xcodeproj: 'esplorio.xcodeproj')
  end

  desc "Increment a beta version"
  lane :beta_version do
    increment_build_number
    increment_version_number
  end
end
`./fastlane/Appfile`
app_identifier "io.esplor.ios" # The bundle identifier of your app

fastlane gems

Gem Version Update-Status
credentials_manager 0.16.2 ✅ Up-To-Date
spaceship 0.38.1 ✅ Up-To-Date
fastlane_core 0.57.1 ✅ Up-To-Date
deliver 1.15.1 ✅ Up-To-Date
snapshot 1.16.4 ✅ Up-To-Date
frameit 3.0.0 ✅ Up-To-Date
pem 1.4.0 ✅ Up-To-Date
cert 1.4.4 ✅ Up-To-Date
sigh 1.11.2 ✅ Up-To-Date
produce 1.3.1 ✅ Up-To-Date
gym 1.12.1 ✅ Up-To-Date
pilot 1.12.1 ✅ Up-To-Date
scan 0.14.2 ✅ Up-To-Date
supply 0.7.1 ✅ Up-To-Date
match 0.11.0 ✅ Up-To-Date
screengrab 0.5.6 ✅ Up-To-Date
fastlane 1.110.0 ✅ Up-To-Date

Loaded fastlane plugins:

No plugins Loaded

Loaded gems
Gem Version
highline 1.7.8
commander 4.4.0
terminal-table 1.4.5
multipart-post 2.0.0
faraday 0.9.2
faraday_middleware 0.10.0
dotenv 2.1.0
net-ssh 3.1.1
net-sftp 2.1.2
plist 3.1.0
rubyzip 1.1.7
security 0.1.3
krausefx-shenzhen 0.14.11
slack-notifier 1.5.1
rouge 1.10.1
xcpretty 0.2.4
terminal-notifier 1.6.3
addressable 2.3.8
colored 1.2
credentials_manager 0.16.2
multi_xml 0.5.5
unf_ext 0.0.7.2
unf 0.1.4
domain_name 0.5.20160310
http-cookie 1.0.2
faraday-cookie_jar 0.0.6
fastimage 1.6.8
xcode-install 2.0.2
word_wrap 1.0.0
multi_json 1.11.2
babosa 1.0.2
excon 0.45.4
gh_inspector 1.0.2
fastlane_core 0.57.1
bundler 1.12.5
mini_magick 4.5.1
xcpretty-travis-formatter 0.0.4
uber 0.0.15
representable 2.3.0
retriable 2.1.0
mime-types-data 3.2016.0221
mime-types 3.0
hurley 0.2
little-plugger 1.1.4
logging 2.1.0
jwt 1.5.3
memoist 0.14.0
os 0.9.6
signet 0.7.2
googleauth 0.5.1
thor 0.19.1
httpclient 2.7.1
google-api-client 0.9.4
i18n 0.7.0
thread_safe 0.3.5
tzinfo 1.2.2
minitest 5.9.1
activesupport 4.2.7.1
json 1.8.3
CFPropertyList 2.3.4
claide 1.0.1
nanaimo 0.2.2
xcodeproj 1.4.1

generated on: 2016-11-28

```

About this issue

  • Original URL
  • State: closed
  • Created 8 years ago
  • Comments: 18 (4 by maintainers)

Most upvoted comments

I solved it, this is how I did:

I run

fastlane-credentials remove --username myusername

then I run my lane again (fastlane release), wich is conformed like this

lane :release do
    produce
    pem
    cert
    sigh
    gym(scheme: "MyScheme")
    # snapshot
    deliver(force: true)
    # frameit
  end

when the terminal prompted me for my password FIRST TIME I entered my AppleID password the SECOND TIME I entered the specific generated password from https://appleid.apple.com/account/manage WITH OUT the dash char “-” (this is important, i was trying leaving the dash char and it doesn’t work)

and all worked like a charm

I hope it helps!

So it sounds like there needs to be 2 env vars, FASTLANE_SESSION as well as FASTLANE_APPLE_APPLICATION_SPECIFIC_PASSWORD set in order to for 2FA to work from a CI build

That is correct. The FASTLANE_SESSION is used for everything around the Developer Portal and iTunes Connect, and the FASTLANE_APPLE_APPLICATION_SPECIFIC_PASSWORD is only use for the iTunes Transporter to upload the binary to iTunes Connect. Without 2 factor enabled, none of those values need to be provided 👍