fastlane/fastlane

TestFairy Action Fails with NoMethodError for key? Method on String

ashetty-dev opened this issue · 0 comments

Issue Description

Description
The TestFairy action in Fastlane fails with a NoMethodError when attempting to check for a key? on what is expected to be a Hash object, but is instead a String. This issue impacts the ability to upload builds via the TestFairy action.

Command executed

other_action.publish_to_testfairy(
api_key: ENV["FL_TESTFAIRY_API_KEY"],
upload_url: ENV["FL_TESTFAIRY_UPLOAD_URL"],
app_path: apk_file,
release_notes: release_notes_string,
testers_groups: test_group_name
)

Complete output when running fastlane, including the stack trace and command used
/var/lib/gems/3.0.0/gems/fastlane-2.219.0/fastlane/lib/fastlane/actions/testfairy.rb:125:in `parse_response': \e[31m[!] undefined method `key?' for "":String\e[0m (NoMethodError)

from /var/lib/gems/3.0.0/gems/fastlane-2.219.0/fastlane/lib/fastlane/actions/testfairy.rb:110:in `run'

from /var/lib/gems/3.0.0/gems/fastlane-2.219.0/fastlane/lib/fastlane/runner.rb:263:in `block (2 levels) in execute_action'

from /var/lib/gems/3.0.0/gems/fastlane-2.219.0/fastlane/lib/fastlane/actions/actions_helper.rb:69:in `execute_action'

from /var/lib/gems/3.0.0/gems/fastlane-2.219.0/fastlane/lib/fastlane/runner.rb:255:in `block in execute_action'

from /var/lib/gems/3.0.0/gems/fastlane-2.219.0/fastlane/lib/fastlane/runner.rb:229:in `chdir'

from /var/lib/gems/3.0.0/gems/fastlane-2.219.0/fastlane/lib/fastlane/runner.rb:229:in `execute_action'

from /var/lib/gems/3.0.0/gems/fastlane-2.219.0/fastlane/lib/fastlane/runner.rb:157:in `trigger_action_by_name'

from /var/lib/gems/3.0.0/gems/fastlane-2.219.0/fastlane/lib/fastlane/other_action.rb:23:in `method_missing'

from /tmp/fl_clone20240308-3839-tsfr2v/buildscripts.git/fastlane-common/fastlane/actions/publish_to_testfairy.rb:31:in `run'

from /var/lib/gems/3.0.0/gems/fastlane-2.219.0/fastlane/lib/fastlane/runner.rb:263:in `block (2 levels) in execute_action'

from /var/lib/gems/3.0.0/gems/fastlane-2.219.0/fastlane/lib/fastlane/actions/actions_helper.rb:69:in `execute_action'

from /var/lib/gems/3.0.0/gems/fastlane-2.219.0/fastlane/lib/fastlane/runner.rb:255:in `block in execute_action'

from /var/lib/gems/3.0.0/gems/fastlane-2.219.0/fastlane/lib/fastlane/runner.rb:229:in `chdir'

from /var/lib/gems/3.0.0/gems/fastlane-2.219.0/fastlane/lib/fastlane/runner.rb:229:in `execute_action'

from /var/lib/gems/3.0.0/gems/fastlane-2.219.0/fastlane/lib/fastlane/runner.rb:157:in `trigger_action_by_name'

from /var/lib/gems/3.0.0/gems/fastlane-2.219.0/fastlane/lib/fastlane/other_action.rb:23:in `method_missing'

from /tmp/fl_clone20240308-3839-1gg36s/buildscripts.git/fastlane-android/fastlane/actions/android_publish_testfairy.rb:43:in `block in run'

from <internal:dir>:134:in `glob'

from /tmp/fl_clone20240308-3839-1gg36s/buildscripts.git/fastlane-android/fastlane/actions/android_publish_testfairy.rb:42:in `run'

from /var/lib/gems/3.0.0/gems/fastlane-2.219.0/fastlane/lib/fastlane/runner.rb:263:in `block (2 levels) in execute_action'

from /var/lib/gems/3.0.0/gems/fastlane-2.219.0/fastlane/lib/fastlane/actions/actions_helper.rb:69:in `execute_action'

from /var/lib/gems/3.0.0/gems/fastlane-2.219.0/fastlane/lib/fastlane/runner.rb:255:in `block in execute_action'

from /var/lib/gems/3.0.0/gems/fastlane-2.219.0/fastlane/lib/fastlane/runner.rb:229:in `chdir'

from /var/lib/gems/3.0.0/gems/fastlane-2.219.0/fastlane/lib/fastlane/runner.rb:229:in `execute_action'

from /var/lib/gems/3.0.0/gems/fastlane-2.219.0/fastlane/lib/fastlane/runner.rb:157:in `trigger_action_by_name'

from /var/lib/gems/3.0.0/gems/fastlane-2.219.0/fastlane/lib/fastlane/fast_file.rb:159:in `method_missing'

from ../../tmp/fl_clone20240308-3839-1gg36s/buildscripts.git/fastlane-android/fastlane/Fastfile:429:in `block in parsing_binding'

from /var/lib/gems/3.0.0/gems/fastlane-2.219.0/fastlane/lib/fastlane/lane.rb:41:in `call'

from /var/lib/gems/3.0.0/gems/fastlane-2.219.0/fastlane/lib/fastlane/runner.rb:204:in `try_switch_to_lane'

from /var/lib/gems/3.0.0/gems/fastlane-2.219.0/fastlane/lib/fastlane/runner.rb:146:in `trigger_action_by_name'

from /var/lib/gems/3.0.0/gems/fastlane-2.219.0/fastlane/lib/fastlane/fast_file.rb:159:in `method_missing'

from ../../tmp/fl_clone20240308-3839-tsfr2v/buildscripts.git/fastlane-common/fastlane/Fastfile:236:in `block in parsing_binding'

from /var/lib/gems/3.0.0/gems/fastlane-2.219.0/fastlane/lib/fastlane/lane.rb:41:in `call'

from /var/lib/gems/3.0.0/gems/fastlane-2.219.0/fastlane/lib/fastlane/runner.rb:49:in `block in execute'

from /var/lib/gems/3.0.0/gems/fastlane-2.219.0/fastlane/lib/fastlane/runner.rb:45:in `chdir'

from /var/lib/gems/3.0.0/gems/fastlane-2.219.0/fastlane/lib/fastlane/runner.rb:45:in `execute'

from /var/lib/gems/3.0.0/gems/fastlane-2.219.0/fastlane/lib/fastlane/lane_manager.rb:46:in `cruise_lane'

from /var/lib/gems/3.0.0/gems/fastlane-2.219.0/fastlane/lib/fastlane/command_line_handler.rb:34:in `handle'

from /var/lib/gems/3.0.0/gems/fastlane-2.219.0/fastlane/lib/fastlane/commands_generator.rb:110:in `block (2 levels) in run'

from /var/lib/gems/3.0.0/gems/commander-4.6.0/lib/commander/command.rb:187:in `call'

from /var/lib/gems/3.0.0/gems/commander-4.6.0/lib/commander/command.rb:157:in `run'

from /var/lib/gems/3.0.0/gems/commander-4.6.0/lib/commander/runner.rb:444:in `run_active_command'

from /var/lib/gems/3.0.0/gems/fastlane-2.219.0/fastlane_core/lib/fastlane_core/ui/fastlane_runner.rb:124:in `run!'

from /var/lib/gems/3.0.0/gems/commander-4.6.0/lib/commander/delegates.rb:18:in `run!'

from /var/lib/gems/3.0.0/gems/fastlane-2.219.0/fastlane/lib/fastlane/commands_generator.rb:354:in `run'

from /var/lib/gems/3.0.0/gems/fastlane-2.219.0/fastlane/lib/fastlane/commands_generator.rb:43:in `start'

from /var/lib/gems/3.0.0/gems/fastlane-2.219.0/fastlane/lib/fastlane/cli_tools_distributor.rb:123:in `take_off'

from /var/lib/gems/3.0.0/gems/fastlane-2.219.0/bin/fastlane:23:in `<top (required)>'

from /usr/local/bin/fastlane:25:in `load'

from /usr/local/bin/fastlane:25:in `<main>'
 **Steps to Reproduce**
1. Execute the TestFairy action within a Fastlane script to upload a apk build.
2. The script fails, logging an error related to the `parse_response` method.
**Expected Behavior**
The action should parse the JSON response from the TestFairy API successfully without errors.
**Actual Behavior**
The action throws a `NoMethodError` for `key?` on a String, indicating an issue with handling the response from the TestFairy API.
**Additional Context**
- The issue appears to involve how responses are parsed or handled, possibly related to changes or updates in dependencies or the Fastlane codebase.
- A manual `curl` test to the TestFairy API confirms the API responds with correct JSON content.
This issue may suggest a discrepancy in expected response formats or a bug in handling API responses.

Environment

✅ fastlane environment ✅

Stack

Key Value
OS debian_based bookworm/sid
Ruby 3.0.2
Bundler? false
Git git version 2.37.3
Installation Source /usr/local/bin/fastlane
Host Ubuntu 22.04.1 LTS debian_based bookworm/sid (5.10.51)
Ruby Lib Dir /usr/lib
OpenSSL Version OpenSSL 3.0.2 15 Mar 2022
Is contained false
Is homebrew false
Is installed via Fabric.app false

System Locale

Variable Value
LANG C.UTF-8
LC_ALL
LANGUAGE

fastlane files:

`./fastlane/Fastfile`
default_platform(:android)
fastlane_require 'fileutils'
module CIImportFromGitParameters
Branch = ENV["FL_BUILDSCRIPT_BRANCH"]
end

import_from_git(

	url: "ssh://git@domain/buildscripts.git",

	branch: CIImportFromGitParameters::Branch,

	path: "fastlane-common/fastlane/Fastfile"

)

`./fastlane/Appfile`
package_name "com.victoriassecret.pinknation"

fastlane gems

Gem Version Update-Status
fastlane 2.219.0 ✅ Up-To-Date

Loaded fastlane plugins:

Plugin Version Update-Status
fastlane-plugin-teams 0.2.0 ✅ Up-To-Date
Loaded gems
Gem Version
did_you_mean 1.5.0
babosa 1.0.4
colored 1.2
highline 2.0.3
commander 4.6.0
dotenv 2.8.1
emoji_regex 3.2.3
faraday_middleware 1.2.0
http-cookie 1.0.5
faraday-cookie_jar 0.0.7
gh_inspector 1.1.3
google-cloud-env 1.6.0
naturally 2.2.1
rubyzip 2.3.2
security 0.1.3
terminal-notifier 2.0.0
terminal-table 3.0.2
tty-cursor 0.7.1
tty-spinner 0.9.3
word_wrap 1.0.0
rouge 2.0.7
xcpretty 0.3.0
xcpretty-travis-formatter 1.0.1
set 1.0.1
public_suffix 5.0.4
addressable 2.8.6
artifactory 3.0.17
aws-eventstream 1.3.0
aws-sigv4 1.8.0
aws-partitions 1.895.0
jmespath 1.6.2
aws-sdk-core 3.191.3
aws-sdk-kms 1.77.0
aws-sdk-s3 1.143.0
bundler 2.5.6
base64 0.2.0
nkf 0.2.0
rexml 3.2.6
CFPropertyList 3.0.7
excon 0.109.0
ruby2_keywords 0.0.5
faraday-retry 1.0.3
faraday-rack 1.0.0
faraday-patron 1.0.0
faraday-net_http_persistent 1.2.0
faraday-net_http 1.0.1
multipart-post 2.4.0
faraday-multipart 1.0.4
faraday-httpclient 1.0.1
faraday-excon 1.1.0
faraday-em_synchrony 1.0.0
faraday-em_http 1.0.0
faraday 1.10.3
domain_name 0.6.20240107
fastimage 2.3.0
httpclient 2.8.3
multi_json 1.15.0
jwt 2.8.1
signet 0.19.0
os 1.1.4
googleauth 1.8.1
mini_mime 1.1.5
retriable 3.1.2
trailblazer-option 0.1.2
declarative 0.0.20
uber 0.1.0
representable 3.2.0
google-apis-core 0.11.3
google-apis-androidpublisher_v3 0.54.0
google-apis-playcustomapp_v1 0.13.0
rake 13.1.0
digest-crc 0.6.5
google-apis-storage_v1 0.31.0
google-apis-iamcredentials_v1 0.17.0
google-cloud-errors 1.4.0
google-cloud-core 1.7.0
google-cloud-storage 1.47.0
json 2.7.1
mini_magick 4.12.0
optparse 0.4.0
plist 3.7.1
simctl 1.6.10
unicode-display_width 2.5.0
tty-screen 0.8.2
nanaimo 0.3.0
colored2 3.1.2
claide 1.1.0
atomos 0.1.3
xcodeproj 1.24.0
forwardable 1.3.2
logger 1.4.3
pathname 0.1.0
shellwords 0.1.0
cgi 0.2.0
date 3.1.0
timeout 0.1.1
stringio 3.0.0
securerandom 0.1.0
uri 0.10.1
openssl 3.0.0
digest 3.0.0
io-nonblock 0.1.0
ipaddr 1.2.2
io-wait 0.1.0
zlib 1.1.0
resolv 0.2.0
time 0.1.0
open-uri 0.1.0
mutex_m 0.1.1
net-protocol 0.1.0
ostruct 0.3.1
english 0.7.1
erb 2.2.0
strscan 3.0.0
abbrev 0.1.0
io-console 0.5.7
tempfile 0.1.1
delegate 0.2.0
tmpdir 0.1.2
fileutils 1.7.2
etc 1.2.0
singleton 0.1.1
net-http 0.1.1
open3 0.1.1
nokogiri 1.16.2
racc 1.7.3
prettyprint 0.1.0
pp 0.1.0
find 0.1.0
yaml 0.1.1
psych 3.3.0
fastlane-plugin-teams 0.2.0

generated on: 2024-03-08