microsoft / app-store-vsts-extension

Visual Studio Team Services (VSTS) extension for performing continuous delivery to the App Store store from your automated CI builds
Other
93 stars 53 forks source link

Unable to deploy using fastlane azure task with Token based authentication #285

Closed Debdan1997 closed 1 year ago

Debdan1997 commented 1 year ago

Question, Bug, or Feature? Type: Question

Enter Task Name: Unable to deploy using fastlane azure task with Token based authentication

Environment Azure Pipelines

Issue Description I'm unable to use AppStoreRelease to publish the app to my external testers. I have been provided with a string api_key in the format -----BEGIN PRIVATE KEY-----\nxxxxyyyyzzzz\n-----END PRIVATE KEY----- as a string key from azure keyvaults and I don't have access to the .p8 file. When I'm uploading to fastlane using local fastlane setup by providing the api_key in json, authentication is working. But azure pipelines is asking the base64 encoded version in service connection.

I tried the following $api_key_content = '-----BEGIN PRIVATE KEY-----\nxxxxyyyyzzzz\n-----END PRIVATE KEY-----'

And provided the api key to the service connection but still getting this error

/usr/local/lib/ruby/gems/2.7.0/gems/fastlane-2.209.1/spaceship/lib/spaceship/connect_api/token.rb:71:in initialize': [!] invalid curve name (OpenSSL::PKey::ECError) from /usr/local/lib/ruby/gems/2.7.0/gems/fastlane-2.209.1/spaceship/lib/spaceship/connect_api/token.rb:71:innew' from /usr/local/lib/ruby/gems/2.7.0/gems/fastlane-2.209.1/spaceship/lib/spaceship/connect_api/token.rb:71:in create' from /usr/local/lib/ruby/gems/2.7.0/gems/fastlane-2.209.1/spaceship/lib/spaceship/connect_api/token.rb:49:infrom_json_file' from /usr/local/lib/ruby/gems/2.7.0/gems/fastlane-2.209.1/spaceship/lib/spaceship/connect_api/token.rb:33:in from' from /usr/local/lib/ruby/gems/2.7.0/gems/fastlane-2.209.1/pilot/lib/pilot/manager.rb:23:inlogin' from /usr/local/lib/ruby/gems/2.7.0/gems/fastlane-2.209.1/pilot/lib/pilot/manager.rb:19:in start' from /usr/local/lib/ruby/gems/2.7.0/gems/fastlane-2.209.1/pilot/lib/pilot/build_manager.rb:17:inupload' from /usr/local/lib/ruby/gems/2.7.0/gems/fastlane-2.209.1/pilot/lib/pilot/commands_generator.rb:67:in block (2 levels) in run' from /usr/local/lib/ruby/gems/2.7.0/gems/commander-4.6.0/lib/commander/command.rb:187:incall' from /usr/local/lib/ruby/gems/2.7.0/gems/commander-4.6.0/lib/commander/command.rb:157:in run' from /usr/local/lib/ruby/gems/2.7.0/gems/commander-4.6.0/lib/commander/runner.rb:444:inrun_active_command' from /usr/local/lib/ruby/gems/2.7.0/gems/fastlane-2.209.1/fastlane_core/lib/fastlane_core/ui/fastlane_runner.rb:124:in run!' from /usr/local/lib/ruby/gems/2.7.0/gems/commander-4.6.0/lib/commander/delegates.rb:18:inrun!' from /usr/local/lib/ruby/gems/2.7.0/gems/fastlane-2.209.1/pilot/lib/pilot/commands_generator.rb:167:in run' from /usr/local/lib/ruby/gems/2.7.0/gems/fastlane-2.209.1/pilot/lib/pilot/commands_generator.rb:19:instart' from /usr/local/lib/ruby/gems/2.7.0/gems/fastlane-2.209.1/fastlane/lib/fastlane/cli_tools_distributor.rb:115:in take_off' from /usr/local/lib/ruby/gems/2.7.0/gems/fastlane-2.209.1/bin/fastlane:23:in<top (required)>' from /usr/local/lib/ruby/gems/2.7.0/bin/fastlane:25:in load' from /usr/local/lib/ruby/gems/2.7.0/bin/fastlane:25:in

' /usr/local/lib/ruby/gems/2.7.0/gems/fastlane-2.209.1/spaceship/lib/spaceship/connect_api/token.rb:71:in initialize': invalid curve name (OpenSSL::PKey::ECError) from /usr/local/lib/ruby/gems/2.7.0/gems/fastlane-2.209.1/spaceship/lib/spaceship/connect_api/token.rb:71:innew' from /usr/local/lib/ruby/gems/2.7.0/gems/fastlane-2.209.1/spaceship/lib/spaceship/connect_api/token.rb:71:in create' from /usr/local/lib/ruby/gems/2.7.0/gems/fastlane-2.209.1/spaceship/lib/spaceship/connect_api/token.rb:49:infrom_json_file' from /usr/local/lib/ruby/gems/2.7.0/gems/fastlane-2.209.1/spaceship/lib/spaceship/connect_api/token.rb:33:in from' from /usr/local/lib/ruby/gems/2.7.0/gems/fastlane-2.209.1/pilot/lib/pilot/manager.rb:23:inlogin' from /usr/local/lib/ruby/gems/2.7.0/gems/fastlane-2.209.1/pilot/lib/pilot/manager.rb:19:in start' from /usr/local/lib/ruby/gems/2.7.0/gems/fastlane-2.209.1/pilot/lib/pilot/build_manager.rb:17:inupload' from /usr/local/lib/ruby/gems/2.7.0/gems/fastlane-2.209.1/pilot/lib/pilot/commands_generator.rb:67:in block (2 levels) in run' from /usr/local/lib/ruby/gems/2.7.0/gems/commander-4.6.0/lib/commander/command.rb:187:incall' from /usr/local/lib/ruby/gems/2.7.0/gems/commander-4.6.0/lib/commander/command.rb:157:in run' from /usr/local/lib/ruby/gems/2.7.0/gems/commander-4.6.0/lib/commander/runner.rb:444:inrun_active_command' from /usr/local/lib/ruby/gems/2.7.0/gems/fastlane-2.209.1/fastlane_core/lib/fastlane_core/ui/fastlane_runner.rb:124:in run!' from /usr/local/lib/ruby/gems/2.7.0/gems/commander-4.6.0/lib/commander/delegates.rb:18:inrun!' from /usr/local/lib/ruby/gems/2.7.0/gems/fastlane-2.209.1/pilot/lib/pilot/commands_generator.rb:167:in run' from /usr/local/lib/ruby/gems/2.7.0/gems/fastlane-2.209.1/pilot/lib/pilot/commands_generator.rb:19:instart' from /usr/local/lib/ruby/gems/2.7.0/gems/fastlane-2.209.1/fastlane/lib/fastlane/cli_tools_distributor.rb:115:in take_off' from /usr/local/lib/ruby/gems/2.7.0/gems/fastlane-2.209.1/bin/fastlane:23:in<top (required)>' from /usr/local/lib/ruby/gems/2.7.0/bin/fastlane:25:in load' from /usr/local/lib/ruby/gems/2.7.0/bin/fastlane:25:in
'

[error]Error: The process '/usr/local/lib/ruby/gems/2.7.0/bin/fastlane' failed with exit code 1

When removing the \n characters and encoding as multiline string, getting error `initialize': [!] string contains null byte (ArgumentError)

vmapetr commented 1 year ago

Hi @Debdan1997 Thank you for your question, We are working on more prioritized issues at the moment but will get back to this one soon.

vmapetr commented 1 year ago

Discussed in DM. Resolved via same solution as here - https://github.com/microsoft/app-store-vsts-extension/issues/218