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

Pilot fails using environment variables on GitHub #18655

Closed
3 of 4 tasks
roncsak opened this issue May 7, 2021 · 13 comments
Closed
3 of 4 tasks

Pilot fails using environment variables on GitHub #18655

roncsak opened this issue May 7, 2021 · 13 comments

Comments

@roncsak
Copy link

roncsak commented May 7, 2021

New Issue Checklist

Issue Description

When I run my fastlane command on my local computer it works but it won't in GitHub.
Both have the same version number: 2.181.0

I tried to put the content of APP_STORE_CONNECT_API_KEY_KEY in various ways:

  • the original content of .p8 file
  • the original content of .p8 file base64 encoded
  • the original content of .p8 file base64 encoded into a single line
  • removing linefeeds from the original content of .p8 file
  • removing linefeeds from the original content of .p8 file base64 encoded
  • removing linefeeds from the original content of .p8 file base64 encoded into a single line
  • changing linefeeds to \n in the original content of .p8 file
  • changing linefeeds to \n in the original content of .p8 file base64 encoded
  • changing linefeeds to \n in the original content of .p8 file base64 encoded into a single line

Where I encoded the content I also set APP_STORE_CONNECT_API_KEY_IS_KEY_CONTENT_BASE64 to true.
To create a single line base64 encoded string I used the following command:
cat AuthKey_XXXXXXXXX.p8 | openssl base64 -A

Command executed

I run the following command: fastlane ios testflight_release

I have a Fastfile with a lane containing the following actions:

  • app_store_connect_api_key()
  • match
  • gym
  • pilot

The secret parameters are set via environment variables such as:

  • MATCH_PASSWORD
  • MATCH_KEYCHAIN_NAME
  • MATCH_KEYCHAIN_PASSWORD
  • APP_STORE_CONNECT_API_KEY_ISSUER_ID
  • APP_STORE_CONNECT_API_KEY_KEY_ID
  • APP_STORE_CONNECT_API_KEY_KEY
  • MATCH_GIT_BASIC_AUTHORIZATION

The following parameters are also set via env variables:

  • LANG="en_US.UTF-8"
  • LC_ALL="en_US.UTF-8"
  • MATCH_READONLY="true"
  • APP_STORE_CONNECT_API_KEY_IS_KEY_CONTENT_BASE64="true"
  • APP_STORE_CONNECT_API_KEY_DURATION="1200"
  • APP_STORE_CONNECT_API_KEY_IN_HOUSE="false"
  • SSH_AUTH_SOCK="/tmp/ssh_agent.sock"
  • PILOT_SKIP_WAITING_FOR_BUILD_PROCESSING="true"

The GiHub Action looks like this:

name: Release to Testflight

on:
push:
tags:
- 'TEST-v*'
workflow_dispatch:

jobs:
build:
name: Build
runs-on: macos-latest

steps:
  - name: Checkout
    uses: actions/checkout@v2

  - name: Add SSH key
    env:
      SSH_AUTH_SOCK: /tmp/ssh_agent.sock
    run: |
      mkdir -p ~/.ssh/
      ssh-keyscan github.com >> ~/.ssh/known_hosts
      echo "${{ secrets.SSH_KEY }}" > ~/.ssh/github_actions
      chmod 600 ~/.ssh/github_actions
      ssh-agent -a $SSH_AUTH_SOCK > /dev/null
      ssh-add ~/.ssh/github_actions

  - name: Setup keychain
    run: fastlane run create_keychain name:${{ secrets.MATCH_KEYCHAIN_NAME }} password:${{ secrets.MATCH_KEYCHAIN_PASSWORD }}

  - name: Fastlane Action
    env:
      LANG: 'en_US.UTF-8'
      LC_ALL: 'en_US.UTF-8'
      MATCH_READONLY: true
      MATCH_PASSWORD:                      ${{ secrets.MATCH_PASSWORD }}
      MATCH_KEYCHAIN_NAME:                 ${{ secrets.MATCH_KEYCHAIN_NAME }}
      MATCH_KEYCHAIN_PASSWORD:             ${{ secrets.MATCH_KEYCHAIN_PASSWORD }}
      APP_STORE_CONNECT_API_KEY_ISSUER_ID: ${{ secrets.ASC_API_KEY_ISSUER_ID }}
      APP_STORE_CONNECT_API_KEY_KEY_ID:    ${{ secrets.ASC_API_KEY_KEY_ID }}
      APP_STORE_CONNECT_API_KEY_KEY:       ${{ secrets.ASC_API_KEY }}
      APP_STORE_CONNECT_API_KEY_IS_KEY_CONTENT_BASE64: "true"
      APP_STORE_CONNECT_API_KEY_DURATION:  "1200"
      APP_STORE_CONNECT_API_KEY_IN_HOUSE:  "false"
      MATCH_GIT_BASIC_AUTHORIZATION:       ${{ secrets.MATCH_GIT_BASIC_AUTHORIZATION }}
      SSH_AUTH_SOCK: /tmp/ssh_agent.sock
      PILOT_SKIP_WAITING_FOR_BUILD_PROCESSING: ${CI}
    run: fastlane ios testflight_release
Complete output when running fastlane, including the stack trace and command used
 [15:20:43]: -------------------
[15:20:43]: --- Step: pilot ---
[15:20:43]: -------------------
+------------------------------------+------------------------------------------------------------------------------------------------------------+
|                                                                  Lane Context                                                                   |
+------------------------------------+------------------------------------------------------------------------------------------------------------+
| DEFAULT_PLATFORM                   | ios                                                                                                        |
| PLATFORM_NAME                      | ios                                                                                                        |
| LANE_NAME                          | ios testflight_release                                                                                     |
| SIGH_PROFILE_TYPE                  | app-store                                                                                                  |
| MATCH_PROVISIONING_PROFILE_MAPPING | {"hu.noyb.testapp"=>"match AppStore hu.noyb.testapp"}                                                      |
| IPA_OUTPUT_PATH                    | /Users/runner/work/testapp-iOS/testapp-iOS/archives/testapp_testflight.ipa                                 |
| XCODEBUILD_ARCHIVE                 | /Users/runner/Library/Developer/Xcode/Archives/2021-05-07/testapp_testflight 2021-05-07 15.19.21.xcarchive |
| DSYM_OUTPUT_PATH                   | /Users/runner/work/testapp-iOS/testapp-iOS/archives/testapp_testflight.app.dSYM.zip                        |
+------------------------------------+------------------------------------------------------------------------------------------------------------+
[15:20:43]: invalid curve name

+------+---------------------------+-------------+
| fastlane summary |
+------+---------------------------+-------------+
| Step | Action | Time (in s) |
+------+---------------------------+-------------+
| 1 | opt_out_usage | 0 |
| 2 | default_platform | 0 |
| 3 | app_store_connect_api_key | 0 |
| 4 | match | 2 |
| 5 | gym | 88 |
| 💥 | pilot | 0 |
+------+---------------------------+-------------+

[15:20:43]: fastlane finished with errors

Looking for related GitHub issues on fastlane/fastlane...

➡️ Pilot and deliver fails with "string contains null byte"
#18312 [closed] 6 💬
2 weeks ago

➡️ app_store_connect_api_key doesn't work with key_content
#17340 [closed] 16 💬
02 Feb 2021

➡️ app_store_connect_api_key doesn't work with key_filepath as Environment Variable - Azure Bamboo
#17468 [closed] 10 💬
29 Dec 2020

and 2 more at: https://github.com/fastlane/fastlane/search?q=invalid%20curve%20name&type=Issues&utf8=✓

🔗 You can ⌘ + double-click on links to open them directly in your browser.

#######################################################################

fastlane 2.182.0 is available. You are on 2.181.0.

You should use the latest version.

Please update using gem install fastlane.

#######################################################################
/usr/local/lib/ruby/gems/2.7.0/gems/fastlane-2.181.0/spaceship/lib/spaceship/connect_api/token.rb:62:in initialize': \e[31m[!] invalid curve name\e[0m (OpenSSL::PKey::ECError) from /usr/local/lib/ruby/gems/2.7.0/gems/fastlane-2.181.0/spaceship/lib/spaceship/connect_api/token.rb:62:in new'
from /usr/local/lib/ruby/gems/2.7.0/gems/fastlane-2.181.0/spaceship/lib/spaceship/connect_api/token.rb:62:in create' from /usr/local/lib/ruby/gems/2.7.0/gems/fastlane-2.181.0/pilot/lib/pilot/manager.rb:37:in api_token'
from /usr/local/lib/ruby/gems/2.7.0/gems/fastlane-2.181.0/pilot/lib/pilot/manager.rb:20:in login' from /usr/local/lib/ruby/gems/2.7.0/gems/fastlane-2.181.0/pilot/lib/pilot/manager.rb:16:in start'
from /usr/local/lib/ruby/gems/2.7.0/gems/fastlane-2.181.0/pilot/lib/pilot/build_manager.rb:17:in upload' from /usr/local/lib/ruby/gems/2.7.0/gems/fastlane-2.181.0/fastlane/lib/fastlane/actions/upload_to_testflight.rb:31:in run'
from /usr/local/lib/ruby/gems/2.7.0/gems/fastlane-2.181.0/fastlane/lib/fastlane/runner.rb:263:in block (2 levels) in execute_action' from /usr/local/lib/ruby/gems/2.7.0/gems/fastlane-2.181.0/fastlane/lib/fastlane/actions/actions_helper.rb:69:in execute_action'
from /usr/local/lib/ruby/gems/2.7.0/gems/fastlane-2.181.0/fastlane/lib/fastlane/runner.rb:255:in block in execute_action' from /usr/local/lib/ruby/gems/2.7.0/gems/fastlane-2.181.0/fastlane/lib/fastlane/runner.rb:229:in chdir'
from /usr/local/lib/ruby/gems/2.7.0/gems/fastlane-2.181.0/fastlane/lib/fastlane/runner.rb:229:in execute_action' from /usr/local/lib/ruby/gems/2.7.0/gems/fastlane-2.181.0/fastlane/lib/fastlane/runner.rb:157:in trigger_action_by_name'
from /usr/local/lib/ruby/gems/2.7.0/gems/fastlane-2.181.0/fastlane/lib/fastlane/fast_file.rb:159:in method_missing' from Fastfile:39:in block (2 levels) in parsing_binding'
from /usr/local/lib/ruby/gems/2.7.0/gems/fastlane-2.181.0/fastlane/lib/fastlane/lane.rb:33:in call' from /usr/local/lib/ruby/gems/2.7.0/gems/fastlane-2.181.0/fastlane/lib/fastlane/runner.rb:49:in block in execute'
from /usr/local/lib/ruby/gems/2.7.0/gems/fastlane-2.181.0/fastlane/lib/fastlane/runner.rb:45:in chdir' from /usr/local/lib/ruby/gems/2.7.0/gems/fastlane-2.181.0/fastlane/lib/fastlane/runner.rb:45:in execute'
from /usr/local/lib/ruby/gems/2.7.0/gems/fastlane-2.181.0/fastlane/lib/fastlane/lane_manager.rb:47:in cruise_lane' from /usr/local/lib/ruby/gems/2.7.0/gems/fastlane-2.181.0/fastlane/lib/fastlane/command_line_handler.rb:36:in handle'
from /usr/local/lib/ruby/gems/2.7.0/gems/fastlane-2.181.0/fastlane/lib/fastlane/commands_generator.rb:108:in block (2 levels) in run' from /usr/local/lib/ruby/gems/2.7.0/gems/commander-fastlane-4.4.6/lib/commander/command.rb:178:in call'
from /usr/local/lib/ruby/gems/2.7.0/gems/commander-fastlane-4.4.6/lib/commander/command.rb:153:in run' from /usr/local/lib/ruby/gems/2.7.0/gems/commander-fastlane-4.4.6/lib/commander/runner.rb:476:in run_active_command'
from /usr/local/lib/ruby/gems/2.7.0/gems/fastlane-2.181.0/fastlane_core/lib/fastlane_core/ui/fastlane_runner.rb:76:in run!' from /usr/local/lib/ruby/gems/2.7.0/gems/commander-fastlane-4.4.6/lib/commander/delegates.rb:15:in run!'
from /usr/local/lib/ruby/gems/2.7.0/gems/fastlane-2.181.0/fastlane/lib/fastlane/commands_generator.rb:352:in run' from /usr/local/lib/ruby/gems/2.7.0/gems/fastlane-2.181.0/fastlane/lib/fastlane/commands_generator.rb:41:in start'
from /usr/local/lib/ruby/gems/2.7.0/gems/fastlane-2.181.0/fastlane/lib/fastlane/cli_tools_distributor.rb:122:in take_off' from /usr/local/lib/ruby/gems/2.7.0/gems/fastlane-2.181.0/bin/fastlane:23:in <top (required)>'
from /usr/local/lib/ruby/gems/2.7.0/bin/fastlane:23:in load' from /usr/local/lib/ruby/gems/2.7.0/bin/fastlane:23:in

'
/usr/local/lib/ruby/gems/2.7.0/gems/fastlane-2.181.0/spaceship/lib/spaceship/connect_api/token.rb:62:in initialize': invalid curve name (OpenSSL::PKey::ECError) from /usr/local/lib/ruby/gems/2.7.0/gems/fastlane-2.181.0/spaceship/lib/spaceship/connect_api/token.rb:62:in new'
from /usr/local/lib/ruby/gems/2.7.0/gems/fastlane-2.181.0/spaceship/lib/spaceship/connect_api/token.rb:62:in create' from /usr/local/lib/ruby/gems/2.7.0/gems/fastlane-2.181.0/pilot/lib/pilot/manager.rb:37:in api_token'
from /usr/local/lib/ruby/gems/2.7.0/gems/fastlane-2.181.0/pilot/lib/pilot/manager.rb:20:in login' from /usr/local/lib/ruby/gems/2.7.0/gems/fastlane-2.181.0/pilot/lib/pilot/manager.rb:16:in start'
from /usr/local/lib/ruby/gems/2.7.0/gems/fastlane-2.181.0/pilot/lib/pilot/build_manager.rb:17:in upload' from /usr/local/lib/ruby/gems/2.7.0/gems/fastlane-2.181.0/fastlane/lib/fastlane/actions/upload_to_testflight.rb:31:in run'
from /usr/local/lib/ruby/gems/2.7.0/gems/fastlane-2.181.0/fastlane/lib/fastlane/runner.rb:263:in block (2 levels) in execute_action' from /usr/local/lib/ruby/gems/2.7.0/gems/fastlane-2.181.0/fastlane/lib/fastlane/actions/actions_helper.rb:69:in execute_action'
from /usr/local/lib/ruby/gems/2.7.0/gems/fastlane-2.181.0/fastlane/lib/fastlane/runner.rb:255:in block in execute_action' from /usr/local/lib/ruby/gems/2.7.0/gems/fastlane-2.181.0/fastlane/lib/fastlane/runner.rb:229:in chdir'
from /usr/local/lib/ruby/gems/2.7.0/gems/fastlane-2.181.0/fastlane/lib/fastlane/runner.rb:229:in execute_action' from /usr/local/lib/ruby/gems/2.7.0/gems/fastlane-2.181.0/fastlane/lib/fastlane/runner.rb:157:in trigger_action_by_name'
from /usr/local/lib/ruby/gems/2.7.0/gems/fastlane-2.181.0/fastlane/lib/fastlane/fast_file.rb:159:in method_missing' from Fastfile:39:in block (2 levels) in parsing_binding'
from /usr/local/lib/ruby/gems/2.7.0/gems/fastlane-2.181.0/fastlane/lib/fastlane/lane.rb:33:in call' from /usr/local/lib/ruby/gems/2.7.0/gems/fastlane-2.181.0/fastlane/lib/fastlane/runner.rb:49:in block in execute'
from /usr/local/lib/ruby/gems/2.7.0/gems/fastlane-2.181.0/fastlane/lib/fastlane/runner.rb:45:in chdir' from /usr/local/lib/ruby/gems/2.7.0/gems/fastlane-2.181.0/fastlane/lib/fastlane/runner.rb:45:in execute'
from /usr/local/lib/ruby/gems/2.7.0/gems/fastlane-2.181.0/fastlane/lib/fastlane/lane_manager.rb:47:in cruise_lane' from /usr/local/lib/ruby/gems/2.7.0/gems/fastlane-2.181.0/fastlane/lib/fastlane/command_line_handler.rb:36:in handle'
from /usr/local/lib/ruby/gems/2.7.0/gems/fastlane-2.181.0/fastlane/lib/fastlane/commands_generator.rb:108:in block (2 levels) in run' from /usr/local/lib/ruby/gems/2.7.0/gems/commander-fastlane-4.4.6/lib/commander/command.rb:178:in call'
from /usr/local/lib/ruby/gems/2.7.0/gems/commander-fastlane-4.4.6/lib/commander/command.rb:153:in run' from /usr/local/lib/ruby/gems/2.7.0/gems/commander-fastlane-4.4.6/lib/commander/runner.rb:476:in run_active_command'
from /usr/local/lib/ruby/gems/2.7.0/gems/fastlane-2.181.0/fastlane_core/lib/fastlane_core/ui/fastlane_runner.rb:76:in run!' from /usr/local/lib/ruby/gems/2.7.0/gems/commander-fastlane-4.4.6/lib/commander/delegates.rb:15:in run!'
from /usr/local/lib/ruby/gems/2.7.0/gems/fastlane-2.181.0/fastlane/lib/fastlane/commands_generator.rb:352:in run' from /usr/local/lib/ruby/gems/2.7.0/gems/fastlane-2.181.0/fastlane/lib/fastlane/commands_generator.rb:41:in start'
from /usr/local/lib/ruby/gems/2.7.0/gems/fastlane-2.181.0/fastlane/lib/fastlane/cli_tools_distributor.rb:122:in take_off' from /usr/local/lib/ruby/gems/2.7.0/gems/fastlane-2.181.0/bin/fastlane:23:in <top (required)>'
from /usr/local/lib/ruby/gems/2.7.0/bin/fastlane:23:in load' from /usr/local/lib/ruby/gems/2.7.0/bin/fastlane:23:in '
Error: Process completed with exit code 1.

Environment

 
🚫 fastlane environment 🚫

Stack

Key Value
OS 10.15.7
Ruby 2.7.3
Bundler? false
Git git version 2.31.1
Installation Source /usr/local/lib/ruby/gems/2.7.0/bin/fastlane
Host Mac OS X 10.15.7 (19H1030)
Ruby Lib Dir /usr/local/Cellar/ruby@2.7/2.7.3/lib
OpenSSL Version OpenSSL 1.1.1k 25 Mar 2021
Is contained false
Is homebrew false
Is installed via Fabric.app false
Xcode Path /Applications/Xcode_12.4.app/Contents/Developer/
Xcode Version 12.4

System Locale

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

fastlane files:

`./fastlane/Fastfile`
opt_out_usage

# Uncomment the line if you want fastlane to automatically update itself
# update_fastlane

default_platform(:ios)

platform :ios do

  before_all do
    @app_identifier = 'hu.noyb.testapp'
    @team_id = "XXXXXXXX"
    @app_codename = "testapp"
    @ouput_dir = "archives"
    @pilot_filename = "testapp_testflight.ipa"
  end

  desc "Build and release to Testflight"
  lane :testflight_release do

    app_store_connect_api_key()

    match(
      type: "appstore",
      app_identifier: @app_identifier
    )

    gym(
      project: "#{@app_codename}.xcodeproj",
      # workspace: "#{@app_codename}.xcworkspace", 
      scheme: @app_codename,
      configuration: "Release",
      clean: true,
      output_directory: @ouput_dir,
      output_name: @pilot_filename,
      export_method: "app-store"
    )

    pilot(
      team_id: @team_id,
      app_identifier: @app_identifier,
      app_platform: "ios",
      ipa: "#{@ouput_dir}/#{@pilot_filename}",
    )
  end

end
`./fastlane/Appfile`
app_identifier("hu.noyb.testapp") # The bundle identifier of your app
# apple_id("") # Your Apple email address


# For more information about the Appfile, see:
#     https://docs.fastlane.tools/advanced/#appfile

fastlane gems

Gem Version Update-Status
fastlane 2.181.0 🚫 Update available

Loaded fastlane plugins:

No plugins Loaded

Loaded gems
Gem Version
did_you_mean 1.4.0
slack-notifier 2.3.2
atomos 0.1.3
CFPropertyList 3.0.3
claide 1.0.3
colored2 3.1.2
nanaimo 0.3.0
xcodeproj 1.19.0
rouge 2.0.7
xcpretty 0.3.0
terminal-notifier 2.0.0
public_suffix 4.0.6
addressable 2.7.0
multipart-post 2.0.0
word_wrap 1.0.0
tty-screen 0.8.1
tty-cursor 0.7.1
tty-spinner 0.9.3
artifactory 3.0.15
babosa 1.0.4
colored 1.2
highline 1.7.10
commander-fastlane 4.4.6
excon 0.81.0
unf_ext 0.0.7.7
unf 0.1.4
domain_name 0.5.20190701
http-cookie 1.0.3
faraday-cookie_jar 0.0.7
faraday-excon 1.1.0
faraday-net_http 1.0.1
faraday-net_http_persistent 1.1.0
ruby2_keywords 0.0.4
faraday 1.4.1
faraday_middleware 1.0.0
fastimage 2.2.3
gh_inspector 1.1.3
mini_magick 4.11.0
naturally 2.2.1
rubyzip 2.3.0
security 0.1.3
xcpretty-travis-formatter 1.0.1
dotenv 2.7.6
bundler 2.2.16
simctl 1.6.8
jwt 2.2.3
uber 0.1.0
declarative 0.0.20
trailblazer-option 0.1.1
representable 3.1.1
retriable 3.1.2
mini_mime 1.1.0
multi_json 1.15.0
signet 0.15.0
memoist 0.16.2
os 1.1.1
googleauth 0.16.2
httpclient 2.8.3
google-api-client 0.38.0
google-cloud-env 1.5.0
google-cloud-errors 1.1.0
google-cloud-core 1.6.0
rexml 3.2.3.1
webrick 1.6.1
google-apis-core 0.3.0
google-apis-iamcredentials_v1 0.3.0
google-apis-storage_v1 0.3.0
rake 13.0.1
digest-crc 0.6.3
google-cloud-storage 1.31.0
emoji_regex 3.2.2
jmespath 1.4.0
aws-partitions 1.451.0
aws-eventstream 1.1.1
aws-sigv4 1.2.3
aws-sdk-core 3.114.0
aws-sdk-kms 1.43.0
aws-sdk-s3 1.94.0
uri 0.10.0
unicode-display_width 1.7.0
terminal-table 1.8.0
plist 3.6.0
json 2.3.0
forwardable 1.3.1
logger 1.4.2
cgi 0.1.0
date 3.0.0
timeout 0.1.0
stringio 0.1.0
zlib 1.1.0
ipaddr 1.2.2
openssl 2.1.2
net-http-persistent 2.9.4
ostruct 0.2.0
strscan 1.0.3
delegate 0.1.0
fileutils 1.4.1
singleton 0.1.0
open3 0.1.0
mini_portile2 2.1.0
nokogiri 1.6.8.1
racc 1.4.16
yaml 0.1.0
psych 3.1.0
mutex_m 0.1.0

generated on: 2021-05-07

@dockusan
Copy link

same with me. It also happen when using p8 file directly.

@roncsak
Copy link
Author

roncsak commented May 10, 2021

same with me. It also happen when using p8 file directly.

Hey m8,
try to use the json file described in Fastlane Docs - App Store Connect Api > Using Fastlane API key json file.
I've just tried it and it works!

Still drives me nuts I cannot do this by simply setting the environment variables!

@markemer
Copy link

markemer commented May 20, 2021

I refuse to check my private key into a git repo in any form, is there another workaround anyone has found? Or can the ENV variable be the JSON file?

@markemer
Copy link

markemer commented May 21, 2021

app_store_connect_api_key(key_id: "ACTUALID",            
                          issuer_id: "ISSUERID",            
                          key_content: "#{ENV['KEY_CONTENT']}".gsub('\n', '\\n'),            
                          duration: 1200,            
                          in_house: false)

Seemed to work with KEY_CONTENT as a Github Secret.

P.S. - This using the latest Firebase.

@fastlane-bot
Copy link

There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates.

Please make sure to update to the latest fastlane version and check if that solves the issue. Let us know if that works for you by adding a comment 👍

Friendly reminder: contributions are always welcome! Check out CONTRIBUTING.md for more information on how to help with fastlane and feel free to tackle this issue yourself 💪

This issue will be auto-closed if there is no reply within 1 month.

@lazerwalker
Copy link

As a data point, I was getting this exact same error, but it simply ended up being a typo in how I was threading through my secrets through from the repo secrets -> action workflow -> env vars. This is now working perfectly for me, loading the raw contents of my .p8 file via a GitHub Secret.

Here's the relevant bits of my setup:

Fastfile

app_store_connect_api_key(
  key_id: ENV["APP_STORE_CONNECT_KEY_ID"],
  issuer_id: ENV["APP_STORE_CONNECT_ISSUER_ID"],
  key_content: ENV["APP_STORE_CONNECT_KEY"]
)

Workflow YAML file:

      - name: Build
        shell: bash
        run: bundle exec fastlane beta
        env:
          APP_STORE_CONNECT_KEY_ID: ${{ secrets.APP_STORE_CONNECT_KEY_ID }}
          APP_STORE_CONNECT_ISSUER_ID: ${{ secrets.APP_STORE_CONNECT_ISSUER_ID }}
          APP_STORE_CONNECT_KEY: ${{ secrets.APP_STORE_CONNECT_KEY }}
          ...

APP_STORE_CONNECT_KEY is just the plaintext raw form of the .p8 file:

-----BEGIN PRIVATE KEY-----
[long string of characters]
-----END PRIVATE KEY-----

This works great for me, despite not escaping newlines like @markemer is.

@fwalker007
Copy link

fwalker007 commented Aug 3, 2021

I am also having the exact same problem. At one point I managed to fix it on one computer by encoding the p8 key and using the encoded key. But now I am trying to run using TestFlight and a remote cmdline call to the same computer and the problem is back :( Just as rocSank) describes I have tried all the above avenues. So frustrating. I wish the error was more informative. What is a curve anyways?

@mrtnrst
Copy link

mrtnrst commented Aug 5, 2021

Another option could be to base64 encode your key, set it as a secret on Github, and then decode it into a file.
From there, you can use it in your Fastlane. You can also add a teardown action that removes all the keys you have generated in the CI machine for added safety.

Example:

- name: Setup Secret  
  env:
    APP_STORE_KEY: ${{ secrets.APP_STORE_KEY }}
  run: |
    echo "$APP_STORE_KEY" | base64 -d > appstorekey.p12

@kvacquier
Copy link

I've got the same issue :
/Users/ci/.gem/gems/fastlane-2.194.0/spaceship/lib/spaceship/connect_api/token.rb:71:in `initialize': invalid curve name (OpenSSL::PKey::ECError)

Tried with bundle, without, using je json file, the app_store_connect_api_key, both with escaping, double escaping and without, base64... Could not find a way to get it working (was ok and probably broke since an apple auto-update_

@fastlane-bot
Copy link

There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates.

Please make sure to update to the latest fastlane version and check if that solves the issue. Let us know if that works for you by adding a comment 👍

Friendly reminder: contributions are always welcome! Check out CONTRIBUTING.md for more information on how to help with fastlane and feel free to tackle this issue yourself 💪

This issue will be auto-closed if there is no reply within 1 month.

@VipulDungranee
Copy link

app_store_connect_api_key(key_id: "ACTUALID",            
                          issuer_id: "ISSUERID",            
                          key_content: "#{ENV['KEY_CONTENT']}".gsub('\n', '\\n'),            
                          duration: 1200,            
                          in_house: false)

Seemed to work with KEY_CONTENT as a Github Secret.

P.S. - This using the latest Firebase.

this only works for me

@fastlane-bot
Copy link

There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates.

Please make sure to update to the latest fastlane version and check if that solves the issue. Let us know if that works for you by adding a comment 👍

Friendly reminder: contributions are always welcome! Check out CONTRIBUTING.md for more information on how to help with fastlane and feel free to tackle this issue yourself 💪

This issue will be auto-closed if there is no reply within 1 month.

@fastlane-bot
Copy link

This issue will be auto-closed because there hasn't been any activity for a few months. Feel free to open a new one if you still experience this problem 👍

@fastlane fastlane locked and limited conversation to collaborators May 9, 2022
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

9 participants