fastlane: [Regression] register_devices fails in Fastlane 2.163.0

New Issue Checklist

Issue Description

We are using the register_devices action in our Fastfile, something that worked properly until 1 day ago with Fastlane 2.162.0 and suddenly errors out with 2.163.0.

From looking at apple docs: https://developer.apple.com/documentation/appstoreconnectapi/interpreting_and_handling_errors/parsing_the_error_response_code

409 ENTITY_ERROR: The request entity is valid and in the right format, but the data in it is unacceptable; for example, it contains an invalid email address, or a duplicate locale.

The action is set like

register_devices(
      devices_file: "./devices.txt"
)

Error in fastlane 2.163.0 is:

"errors" : [ {
    "id" : "33ba304f-945e-47aa-aa76-873b9b6c9729",
    "status" : "409",
    "code" : "ENTITY_ERROR",
    "title" : "There is a problem with the request entity",
    "detail" : "A device with number 'xxxxxxxx-xxxxxxxxxxxxxxxx' already exists on this team."
}
Command executed

Our fastlane config runs in a CI, and we execute fastlane commands with bundle exec, e.g.:

bundle exec fastlane ios_lane

The ios_lane then has all the actions including the register_devices one.

Complete output when running fastlane, including the stack trace and command used
 [07:12:43]: fastlane finished with errors

Looking for related GitHub issues on fastlane/fastlane…

Found no similar issues. To create a new issue, please visit: https://github.com/fastlane/fastlane/issues/new Run fastlane env to append the fastlane environment to your issue bundler: failed to load command: fastlane (/Users/distiller/xxxxxxx/ios/vendor/bundle/ruby/2.6.0/bin/fastlane) FastlaneCore::Interface::FastlaneCrash: [!] Failed to register new device (name: NAME001, UDID: xxxxxxxx-xxxxxxxxxxxxxxxx) /Users/distiller/pillarwallet/ios/vendor/bundle/ruby/2.6.0/gems/fastlane-2.163.0/fastlane_core/lib/fastlane_core/ui/interface.rb:129:in crash!' /Users/distiller/pillarwallet/ios/vendor/bundle/ruby/2.6.0/gems/fastlane-2.163.0/fastlane_core/lib/fastlane_core/ui/ui.rb:17:in method_missing’ /Users/distiller/pillarwallet/ios/vendor/bundle/ruby/2.6.0/gems/fastlane-2.163.0/fastlane/lib/fastlane/actions/register_devices.rb:80:in rescue in try_create_device' /Users/distiller/pillarwallet/ios/vendor/bundle/ruby/2.6.0/gems/fastlane-2.163.0/fastlane/lib/fastlane/actions/register_devices.rb:76:in try_create_device’ /Users/distiller/pillarwallet/ios/vendor/bundle/ruby/2.6.0/gems/fastlane-2.163.0/fastlane/lib/fastlane/actions/register_devices.rb:69:in block in run' /Users/distiller/pillarwallet/ios/vendor/bundle/ruby/2.6.0/gems/fastlane-2.163.0/fastlane/lib/fastlane/actions/register_devices.rb:55:in map’ /Users/distiller/pillarwallet/ios/vendor/bundle/ruby/2.6.0/gems/fastlane-2.163.0/fastlane/lib/fastlane/actions/register_devices.rb:55:in run' /Users/distiller/pillarwallet/ios/vendor/bundle/ruby/2.6.0/gems/fastlane-2.163.0/fastlane/lib/fastlane/runner.rb:263:in block (2 levels) in execute_action’ /Users/distiller/pillarwallet/ios/vendor/bundle/ruby/2.6.0/gems/fastlane-2.163.0/fastlane/lib/fastlane/actions/actions_helper.rb:69:in execute_action' /Users/distiller/pillarwallet/ios/vendor/bundle/ruby/2.6.0/gems/fastlane-2.163.0/fastlane/lib/fastlane/runner.rb:255:in block in execute_action’ /Users/distiller/pillarwallet/ios/vendor/bundle/ruby/2.6.0/gems/fastlane-2.163.0/fastlane/lib/fastlane/runner.rb:229:in chdir' /Users/distiller/pillarwallet/ios/vendor/bundle/ruby/2.6.0/gems/fastlane-2.163.0/fastlane/lib/fastlane/runner.rb:229:in execute_action’ /Users/distiller/pillarwallet/ios/vendor/bundle/ruby/2.6.0/gems/fastlane-2.163.0/fastlane/lib/fastlane/runner.rb:157:in trigger_action_by_name' /Users/distiller/pillarwallet/ios/vendor/bundle/ruby/2.6.0/gems/fastlane-2.163.0/fastlane/lib/fastlane/fast_file.rb:159:in method_missing’ Fastfile:159:in block (2 levels) in parsing_binding' /Users/distiller/pillarwallet/ios/vendor/bundle/ruby/2.6.0/gems/fastlane-2.163.0/fastlane/lib/fastlane/lane.rb:33:in call’ /Users/distiller/pillarwallet/ios/vendor/bundle/ruby/2.6.0/gems/fastlane-2.163.0/fastlane/lib/fastlane/runner.rb:49:in block in execute' /Users/distiller/pillarwallet/ios/vendor/bundle/ruby/2.6.0/gems/fastlane-2.163.0/fastlane/lib/fastlane/runner.rb:45:in chdir’ /Users/distiller/pillarwallet/ios/vendor/bundle/ruby/2.6.0/gems/fastlane-2.163.0/fastlane/lib/fastlane/runner.rb:45:in execute' /Users/distiller/pillarwallet/ios/vendor/bundle/ruby/2.6.0/gems/fastlane-2.163.0/fastlane/lib/fastlane/lane_manager.rb:47:in cruise_lane’ /Users/distiller/pillarwallet/ios/vendor/bundle/ruby/2.6.0/gems/fastlane-2.163.0/fastlane/lib/fastlane/command_line_handler.rb:36:in handle' /Users/distiller/pillarwallet/ios/vendor/bundle/ruby/2.6.0/gems/fastlane-2.163.0/fastlane/lib/fastlane/commands_generator.rb:108:in block (2 levels) in run’ /Users/distiller/pillarwallet/ios/vendor/bundle/ruby/2.6.0/gems/commander-fastlane-4.4.6/lib/commander/command.rb:178:in call' /Users/distiller/pillarwallet/ios/vendor/bundle/ruby/2.6.0/gems/commander-fastlane-4.4.6/lib/commander/command.rb:153:in run’ /Users/distiller/pillarwallet/ios/vendor/bundle/ruby/2.6.0/gems/commander-fastlane-4.4.6/lib/commander/runner.rb:476:in run_active_command' /Users/distiller/pillarwallet/ios/vendor/bundle/ruby/2.6.0/gems/fastlane-2.163.0/fastlane_core/lib/fastlane_core/ui/fastlane_runner.rb:76:in run!’ /Users/distiller/pillarwallet/ios/vendor/bundle/ruby/2.6.0/gems/commander-fastlane-4.4.6/lib/commander/delegates.rb:15:in run!' /Users/distiller/pillarwallet/ios/vendor/bundle/ruby/2.6.0/gems/fastlane-2.163.0/fastlane/lib/fastlane/commands_generator.rb:352:in run’ /Users/distiller/pillarwallet/ios/vendor/bundle/ruby/2.6.0/gems/fastlane-2.163.0/fastlane/lib/fastlane/commands_generator.rb:41:in start' /Users/distiller/pillarwallet/ios/vendor/bundle/ruby/2.6.0/gems/fastlane-2.163.0/fastlane/lib/fastlane/cli_tools_distributor.rb:119:in take_off’ /Users/distiller/pillarwallet/ios/vendor/bundle/ruby/2.6.0/gems/fastlane-2.163.0/bin/fastlane:23:in <top (required)>' /Users/distiller/pillarwallet/ios/vendor/bundle/ruby/2.6.0/bin/fastlane:23:in load’ /Users/distiller/pillarwallet/ios/vendor/bundle/ruby/2.6.0/bin/fastlane:23:in `<top (required)>'

Environment

fastlane gems

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

Loaded fastlane plugins:

Plugin Version Update-Status
fastlane-plugin-get_version_name 0.2.2 ✅ Up-To-Date
fastlane-plugin-property_file_read 1.0.1 ✅ Up-To-Date
fastlane-plugin-appcenter 1.10.0 ✅ Up-To-Date

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Comments: 15 (7 by maintainers)

Most upvoted comments

It works like a charm @joshdholtz. Thanks again!

@joshdholtz I checked the various UDID’s in the file against the ones in the portal, and the offending UDID did indeed have different case, while the others had the same case.

I also tried out your fix branch, and now it works! Thank you very much!

@antonioned PR and instructions on how to use are here! https://github.com/fastlane/fastlane/pull/17433

Hoping this solves it for you 🙏

@antonioned Yeah yeah, I was getting the error on an existing device too. My guess is the UDID that the new API returns to use (that we switched to in 2.162.0) might have different case then what you are trying to register with.

Example: 00008006-001573C02EE2002E vs 00008006-001573c02ee2002e

We were not doing a case insensitive compare previously but we might need to now with the new API. I’ll have a PR up for this soon that I think will solve the issues you are seeing!

@antonioned @boeingjr Do either of you know if your UDID’s happen to have different case (upper and lower) A through F between what you are uploading and what’s up there? 🤔 It looks like mine setup is detecting duplicates fine so I’m curious if that is what is happening? Maybe there is a uppercase/lowercase issue.

EDIT: I was able to replicate by changing a case in one of my devices that was already registered and I got the same error you both received. It seems like this might be the issue. I’ll be creating a PR for this. If either of you could test this PR for me when its up that would be ❤️