fastlane: register_devices action is broken due to Spaceship::Client::UnexpectedResponse

New Issue Checklist

Issue Description

I have a cmd that scans for devices plugged into the computer and then gets their UDID and adds it to the Apple Dev Portal using the register_devices action but it seems to be broken right now. I am guessing this is due to changes made on Apple’s Dev Portal API

Complete output when running fastlane, including the stack trace and command used
[11:06:49]: -------------------------------------------------
[11:06:49]: --- Step: Verifying required fastlane version ---
[11:06:49]: -------------------------------------------------
[11:06:49]: Your fastlane version 1.105.3 matches the minimum requirement of 1.99  ✅
[11:06:49]: ------------------------------
[11:06:49]: --- Step: default_platform ---
[11:06:49]: ------------------------------
[11:06:49]: Driving the lane 'add_devices' 🚀
[11:06:49]: Searching connected devices...
[11:06:51]: Devices to be added:

[11:06:51]: Device Name: My iPhone
[11:06:51]: Device UDID: 8000XXXXXXXXXXXXXXXXXXXXXXXXab76cc09
[11:06:51]: ------------------------------
[11:06:51]: --- Step: register_devices ---
[11:06:51]: ------------------------------
[11:06:55]: Variable Dump:
[11:06:55]: {:DEFAULT_PLATFORM=>:ios, :PLATFORM_NAME=>nil, :LANE_NAME=>"add_devices"}
[11:06:55]: <html>
<head><title>403 Forbidden</title></head>
<body bgcolor="white">
<center><h1>403 Forbidden</h1></center>
<hr><center>Shield</center>
</body>
</html>


+------+-------------------------------------+-------------+
|                     fastlane summary                     |
+------+-------------------------------------+-------------+
| Step | Action                              | Time (in s) |
+------+-------------------------------------+-------------+
| 1    | Verifying required fastlane version | 0           |
| 2    | default_platform                    | 0           |
| 💥    | register_devices                    | 3           |
+------+-------------------------------------+-------------+

[11:06:55]: fastlane finished with errors

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

➡️  silent option is not available in ipa block
   https://github.com/fastlane/fastlane/issues/403 [closed] 4 💬
   4 weeks ago

 (Spaceship::Client::UnexpectedResponse)ems/spaceship-0.36.0/lib/spaceship/client.rb:400:in `parse_response': [!] <html>
<head><title>403 Forbidden</title></head>
<body bgcolor="white">
<center><h1>403 Forbidden</h1></center>
<hr><center>Shield</center>
</body>
</html>

    from /Users/username/.rvm/gems/ruby-2.2.1/gems/spaceship-0.36.0/lib/spaceship/portal/portal_client.rb:256:in `create_device!'
    from /Users/username/.rvm/gems/ruby-2.2.1/gems/spaceship-0.36.0/lib/spaceship/portal/device.rb:155:in `create!'
    from /Users/username/.rvm/gems/ruby-2.2.1/gems/fastlane-1.105.3/lib/fastlane/actions/register_devices.rb:25:in `block in run'
    from /Users/username/.rvm/gems/ruby-2.2.1/gems/fastlane-1.105.3/lib/fastlane/actions/register_devices.rb:23:in `each'
    from /Users/username/.rvm/gems/ruby-2.2.1/gems/fastlane-1.105.3/lib/fastlane/actions/register_devices.rb:23:in `map'
    from /Users/username/.rvm/gems/ruby-2.2.1/gems/fastlane-1.105.3/lib/fastlane/actions/register_devices.rb:23:in `run'
    from /Users/username/.rvm/gems/ruby-2.2.1/gems/fastlane-1.105.3/lib/fastlane/runner.rb:202:in `block (2 levels) in execute_action'
    from /Users/username/.rvm/gems/ruby-2.2.1/gems/fastlane-1.105.3/lib/fastlane/actions/actions_helper.rb:35:in `execute_action'
    from /Users/username/.rvm/gems/ruby-2.2.1/gems/fastlane-1.105.3/lib/fastlane/runner.rb:187:in `block in execute_action'
    from /Users/username/.rvm/gems/ruby-2.2.1/gems/fastlane-1.105.3/lib/fastlane/runner.rb:186:in `chdir'
    from /Users/username/.rvm/gems/ruby-2.2.1/gems/fastlane-1.105.3/lib/fastlane/runner.rb:186:in `execute_action'
    from /Users/username/.rvm/gems/ruby-2.2.1/gems/fastlane-1.105.3/lib/fastlane/runner.rb:112:in `trigger_action_by_name'
    from /Users/username/.rvm/gems/ruby-2.2.1/gems/fastlane-1.105.3/lib/fastlane/fast_file.rb:140:in `method_missing'
    from Fastfile:154:in `block in parsing_binding'
    from /Users/username/.rvm/gems/ruby-2.2.1/gems/fastlane-1.105.3/lib/fastlane/lane.rb:33:in `call'
    from /Users/username/.rvm/gems/ruby-2.2.1/gems/fastlane-1.105.3/lib/fastlane/lane.rb:33:in `call'
    from /Users/username/.rvm/gems/ruby-2.2.1/gems/fastlane-1.105.3/lib/fastlane/runner.rb:49:in `block in execute'
    from /Users/username/.rvm/gems/ruby-2.2.1/gems/fastlane-1.105.3/lib/fastlane/runner.rb:45:in `chdir'
    from /Users/username/.rvm/gems/ruby-2.2.1/gems/fastlane-1.105.3/lib/fastlane/runner.rb:45:in `execute'
    from /Users/username/.rvm/gems/ruby-2.2.1/gems/fastlane-1.105.3/lib/fastlane/lane_manager.rb:52:in `cruise_lane'
    from /Users/username/.rvm/gems/ruby-2.2.1/gems/fastlane-1.105.3/lib/fastlane/command_line_handler.rb:30:in `handle'
    from /Users/username/.rvm/gems/ruby-2.2.1/gems/fastlane-1.105.3/lib/fastlane/commands_generator.rb:49:in `block (2 levels) in run'
    from /Users/username/.rvm/gems/ruby-2.2.1/gems/commander-4.4.0/lib/commander/command.rb:178:in `call'
    from /Users/username/.rvm/gems/ruby-2.2.1/gems/commander-4.4.0/lib/commander/command.rb:178:in `call'
    from /Users/username/.rvm/gems/ruby-2.2.1/gems/commander-4.4.0/lib/commander/command.rb:153:in `run'
    from /Users/username/.rvm/gems/ruby-2.2.1/gems/commander-4.4.0/lib/commander/runner.rb:444:in `run_active_command'
    from /Users/username/.rvm/gems/ruby-2.2.1/gems/fastlane_core-0.52.3/lib/fastlane_core/ui/fastlane_runner.rb:38:in `run!'
    from /Users/username/.rvm/gems/ruby-2.2.1/gems/commander-4.4.0/lib/commander/delegates.rb:15:in `run!'
    from /Users/username/.rvm/gems/ruby-2.2.1/gems/fastlane-1.105.3/lib/fastlane/commands_generator.rb:244:in `run'
    from /Users/username/.rvm/gems/ruby-2.2.1/gems/fastlane-1.105.3/lib/fastlane/commands_generator.rb:20:in `start'
    from /Users/username/.rvm/gems/ruby-2.2.1/gems/fastlane-1.105.3/lib/fastlane/cli_tools_distributor.rb:58:in `take_off'
    from /Users/username/.rvm/gems/ruby-2.2.1/gems/fastlane-1.105.3/bin/fastlane:5:in `<top (required)>'
    from /Users/username/.rvm/gems/ruby-2.2.1/bin/fastlane:23:in `load'
    from /Users/username/.rvm/gems/ruby-2.2.1/bin/fastlane:23:in `<main>'
    from /Users/username/.rvm/gems/ruby-2.2.1/bin/ruby_executable_hooks:15:in `eval'
    from /Users/username/.rvm/gems/ruby-2.2.1/bin/ruby_executable_hooks:15:in `<main>'

Configuration Files

Please copy the complete content of your Fastfile and any other configuration files you use below:

Fastfile:

#####################################################
####### Adds plugged in device to Profiles ##########
#####################################################
desc "Add connected device UDID to Apple Dev Portal"
desc "Refresh provisioning profiles"
lane :add_devices do
    puts "Searching connected devices..."
    stdout, stderr, status = Open3.capture3("instruments -s devices")

    matches = stdout.scan(/(.*)\s\(.*\[(.*)\]\n/)
    devices = {}
    if matches.length < 1
        puts "No connected devices found!"
        puts "Try unplugging and plugging back in"
    else
        puts "Devices to be added:\n"
        for match in matches do
            name, udid = match[0], match[1]

            devices[name] = udid
            puts "Device Name: #{name}"
            puts "Device UDID: #{udid}\n"
        end

        register_devices(devices: devices)
        fix_provisioning
    end
end

Environment

fastlane version (run fastlane -v): 1.105.3

Do you use bundler to execute fastlane (i.e. bundle exec fastlane)? Yes

Do you use a Ruby environment manager (e.g. chruby, rbenv, rvm)? rvm

What Xcode version do you use (e.g. 7.3, 8.0) 8.0

About this issue

  • Original URL
  • State: closed
  • Created 8 years ago
  • Comments: 21 (2 by maintainers)

Most upvoted comments

In my case the issue was ´ symbol in devices.txt:

The Future´s iPhone7 -> The Future's iPhone7

How to avoid this in future?

@KrauseFx indeed it was! Everything is all good now 👍

Huh it’s working again now - the response is a bit weird listing an array of nils though:

bundle exec fastlane run register_devices devices_file:./fastlane/BetaTesters
[14:36:36]: ------------------------------
[14:36:36]: --- Step: register_devices ---
[14:36:36]: ------------------------------
[14:36:41]: Fetching list of currently registered devices...
[14:36:42]: Successfully registered new devices.
[14:36:42]: Result: [nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil]```

Yup, today it’s working! 👍