#29806·fastlane

fastlane failed to receive a connection from the FastlaneRunner binary after 5 seconds, shutting down

Author: seknyCreated Dec 9, 2025Updated Aug 26, 2026

New Issue Checklist

Issue Description

I'm using swift fastlane. The latetest version does not work, an error happened 'fastlane failed to receive a connection from the FastlaneRunner binary after 5 seconds, shutting down'.

Command executed

bundle exec fastlane ios buildAndTest --env development --verbose

func buildAndTestLane() {
        desc("Build and Test project")
        Test.buildAndTest(
            environment: .stage,
            devices: Constant.devices
        )
 }
Complete output when running fastlane, including the stack trace and command used
 DEBUG [2025-12-09 16:53:45.48]: Checking if there are any plugins that should be loaded...
INFO [2025-12-09 16:53:45.58]: loading manifest: /Users/my.name/.gem/gems/fastlane-2.229.1/fastlane/swift/upgrade_manifest.json
DEBUG [2025-12-09 16:53:45.61]: No missing groups found, so we don't need to worry about adding new groups
DEBUG [2025-12-09 16:53:45.61]: Actions.swift FastlaneRunnerAPIVersion (bundled/target): 0.9.56/0.9.56
DEBUG [2025-12-09 16:53:45.61]: Fastlane.swift FastlaneRunnerAPIVersion (bundled/target): 0.9.191/0.9.191
DEBUG [2025-12-09 16:53:45.61]: DeliverfileProtocol.swift FastlaneRunnerAPIVersion (bundled/target): 0.9.138/0.9.138
DEBUG [2025-12-09 16:53:45.61]: GymfileProtocol.swift FastlaneRunnerAPIVersion (bundled/target): 0.9.141/0.9.141
DEBUG [2025-12-09 16:53:45.61]: MatchfileProtocol.swift FastlaneRunnerAPIVersion (bundled/target): 0.9.135/0.9.135
DEBUG [2025-12-09 16:53:45.61]: Plugins.swift FastlaneRunnerAPIVersion (bundled/target): 0.9.56/0.9.56
DEBUG [2025-12-09 16:53:45.61]: PrecheckfileProtocol.swift FastlaneRunnerAPIVersion (bundled/target): 0.9.134/0.9.134
DEBUG [2025-12-09 16:53:45.61]: ScanfileProtocol.swift FastlaneRunnerAPIVersion (bundled/target): 0.9.146/0.9.146
DEBUG [2025-12-09 16:53:45.61]: ScreengrabfileProtocol.swift FastlaneRunnerAPIVersion (bundled/target): 0.9.136/0.9.136
DEBUG [2025-12-09 16:53:45.61]: SnapshotfileProtocol.swift FastlaneRunnerAPIVersion (bundled/target): 0.9.130/0.9.130
DEBUG [2025-12-09 16:53:45.61]: LaneFileProtocol.swift FastlaneRunnerAPIVersion (bundled/target): 0.9.2/0.9.2
DEBUG [2025-12-09 16:53:45.61]: ControlCommand.swift FastlaneRunnerAPIVersion (bundled/target): 0.9.2/0.9.2
DEBUG [2025-12-09 16:53:45.61]: RubyCommand.swift FastlaneRunnerAPIVersion (bundled/target): 0.9.2/0.9.2
DEBUG [2025-12-09 16:53:45.61]: RubyCommandable.swift FastlaneRunnerAPIVersion (bundled/target): 0.9.2/0.9.2
DEBUG [2025-12-09 16:53:45.61]: Runner.swift FastlaneRunnerAPIVersion (bundled/target): 0.9.2/0.9.2
DEBUG [2025-12-09 16:53:45.61]: SocketClient.swift FastlaneRunnerAPIVersion (bundled/target): 0.9.2/0.9.2
DEBUG [2025-12-09 16:53:45.61]: SocketClientDelegateProtocol.swift FastlaneRunnerAPIVersion (bundled/target): 0.9.2/0.9.2
DEBUG [2025-12-09 16:53:45.61]: SocketResponse.swift FastlaneRunnerAPIVersion (bundled/target): 0.9.2/0.9.2
DEBUG [2025-12-09 16:53:45.61]: main.swift FastlaneRunnerAPIVersion (bundled/target): 0.9.2/0.9.2
DEBUG [2025-12-09 16:53:45.61]: ArgumentProcessor.swift FastlaneRunnerAPIVersion (bundled/target): 0.9.2/0.9.2
DEBUG [2025-12-09 16:53:45.61]: RunnerArgument.swift FastlaneRunnerAPIVersion (bundled/target): 0.9.2/0.9.2
DEBUG [2025-12-09 16:53:45.61]: Checking for new user-provided tool configuration files
INFO [2025-12-09 16:53:45.62]: FastlaneSwiftRunner project is up-to-date
DEBUG [2025-12-09 16:53:45.62]: Waiting for 5 seconds for a connection from FastlaneRunner
INFO [2025-12-09 16:53:45.87]: $ ./fastlane/FastlaneRunner lane buildAndTest logMode verbose swiftServerPort 2000
# terminated with exception (report_on_exception is true):
/Users/my.name/.gem/gems/fastlane-2.229.1/fastlane_core/lib/fastlane_core/ui/interface.rb:141:in 'FastlaneCore::Interface#user_error!': fastlane failed to receive a connection from the FastlaneRunner binary after 5 seconds, shutting down (FastlaneCore::Interface::FastlaneError)
        from /Users/my.name/.gem/gems/fastlane-2.229.1/fastlane_core/lib/fastlane_core/ui/ui.rb:17:in 'FastlaneCore::UI.method_missing'
        from /Users/my.name/.gem/gems/fastlane-2.229.1/fastlane/lib/fastlane/server/socket_server.rb:151:in 'Fastlane::SocketServer#listen'
        from /Users/my.name/.gem/gems/fastlane-2.229.1/fastlane/lib/fastlane/server/socket_server.rb:38:in 'Fastlane::SocketServer#start'
        from /Users/my.name/.gem/gems/fastlane-2.229.1/fastlane/lib/fastlane/swift_lane_manager.rb:228:in 'block in Fastlane::SwiftLaneManager.start_socket_thread'
/opt/homebrew/Cellar/ruby/3.4.7/lib/ruby/3.4.0/timeout.rb:40:in 'Timeout::Error.handle_timeout': execution expired (Timeout::Error)
        from /opt/homebrew/Cellar/ruby/3.4.7/lib/ruby/3.4.0/timeout.rb:194:in 'Timeout.timeout'
        from /Users/my.name/.gem/gems/fastlane-2.229.1/fastlane/lib/fastlane/server/socket_server.rb:147:in 'Fastlane::SocketServer#listen'
        from /Users/my.name/.gem/gems/fastlane-2.229.1/fastlane/lib/fastlane/server/socket_server.rb:38:in 'Fastlane::SocketServer#start'
        from /Users/my.name/.gem/gems/fastlane-2.229.1/fastlane/lib/fastlane/swift_lane_manager.rb:228:in 'block in Fastlane::SwiftLaneManager.start_socket_thread'
/Users/my.name/.gem/gems/fastlane-2.229.1/fastlane/lib/fastlane/server/socket_server.rb:148:in 'TCPServer#accept': execution expired (Timeout::ExitException)
        from /Users/my.name/.gem/gems/fastlane-2.229.1/fastlane/lib/fastlane/server/socket_server.rb:148:in 'block in Fastlane::SocketServer#listen'
        from /opt/homebrew/Cellar/ruby/3.4.7/lib/ruby/3.4.0/timeout.rb:185:in 'block in Timeout.timeout'
        from /opt/homebrew/Cellar/ruby/3.4.7/lib/ruby/3.4.0/timeout.rb:38:in 'Timeout::Error.handle_timeout'
        from /opt/homebrew/Cellar/ruby/3.4.7/lib/ruby/3.4.0/timeout.rb:194:in 'Timeout.timeout'
        from /Users/my.name/.gem/gems/fastlane-2.229.1/fastlane/lib/fastlane/server/socket_server.rb:147:in 'Fastlane::SocketServer#listen'
        from /Users/my.name/.gem/gems/fastlane-2.229.1/fastlane/lib/fastlane/server/socket_server.rb:38:in 'Fastlane::SocketServer#start'
        from /Users/my.name/.gem/gems/fastlane-2.229.1/fastlane/lib/fastlane/swift_lane_manager.rb:228:in 'block in Fastlane::SwiftLaneManager.start_socket_thread'
WARN [2025-12-09 16:53:50.63]: Lane Context:
INFO [2025-12-09 16:53:50.63]: {LANE_NAME: "buildAndTest"}
ERROR [2025-12-09 16:53:50.63]: fastlane failed to receive a connection from the FastlaneRunner binary after 5 seconds, shutting down
ERROR [2025-12-09 16:53:50.63]: fastlane finished with errors
bundler: failed to load command: fastlane (/Users/my.name/.gem/bin/fastlane)
/Users/my.name/.gem/gems/fastlane-2.229.1/fastlane_core/lib/fastlane_core/ui/interface.rb:141:in 'FastlaneCore::Interface#user_error!': [!] fastlane failed to receive a connection from the FastlaneRunner binary after 5 seconds, shutting down (FastlaneCore::Interface::FastlaneError)
        from /Users/my.name/.gem/gems/fastlane-2.229.1/fastlane_core/lib/fastlane_core/ui/ui.rb:17:in 'FastlaneCore::UI.method_missing'
        from /Users/my.name/.gem/gems/fastlane-2.229.1/fastlane/lib/fastlane/server/socket_server.rb:151:in 'Fastlane::SocketServer#listen'
        from /Users/my.name/.gem/gems/fastlane-2.229.1/fastlane/lib/fastlane/server/socket_server.rb:38:in 'Fastlane::SocketServer#start'
        from /Users/my.name/.gem/gems/fastlane-2.229.1/fastlane/lib/fastlane/swift_lane_manager.rb:228:in 'block in Fastlane::SwiftLaneManager.start_socket_thread'
/opt/homebrew/Cellar/ruby/3.4.7/lib/ruby/3.4.0/timeout.rb:40:in 'Timeout::Error.handle_timeout': execution expired (Timeout::Error)
        from /opt/homebrew/Cellar/ruby/3.4.7/lib/ruby/3.4.0/timeout.rb:194:in 'Timeout.timeout'
        from /Users/my.name/.gem/gems/fastlane-2.229.1/fastlane/lib/fastlane/server/socket_server.rb:147:in 'Fastlane::SocketServer#listen'
        from /Users/my.name/.gem/gems/fastlane-2.229.1/fastlane/lib/fastlane/server/socket_server.rb:38:in 'Fastlane::SocketServer#start'
        from /Users/my.name/.gem/gems/fastlane-2.229.1/fastlane/lib/fastlane/swift_lane_manager.rb:228:in 'block in Fastlane::SwiftLaneManager.start_socket_thread'
/Users/my.name/.gem/gems/fastlane-2.229.1/fastlane/lib/fastlane/server/socket_server.rb:148:in 'TCPServer#accept': execution expired (Timeout::ExitException)
        from /Users/my.name/.gem/gems/fastlane-2.229.1/fastlane/lib/fastlane/server/socket_server.rb:148:in 'block in Fastlane::SocketServer#listen'
        from /opt/homebrew/Cellar/ruby/3.4.7/lib/ruby/3.4.0/timeout.rb:185:in 'block in Timeout.timeout'
        from /opt/homebrew/Cellar/ruby/3.4.7/lib/ruby/3.4.0/timeout.rb:38:in 'Timeout::Error.handle_timeout'
        from /opt/homebrew/Cellar/ruby/3.4.7/lib/ruby/3.4.0/timeout.rb:194:in 'Timeout.timeout'
        from /Users/my.name/.gem/gems/fastlane-2.229.1/fastlane/lib/fastlane/server/socket_server.rb:147:in 'Fastlane::SocketServer#listen'
        from /Users/my.name/.gem/gems/fastlane-2.229.1/fastlane/lib/fastlane/server/socket_server.rb:38:in 'Fastlane::SocketServer#start'
        from /Users/my.name/.gem/gems/fastlane-2.229.1/fastlane/lib/fastlane/swift_lane_manager.rb:228:in 'block in Fastlane::SwiftLaneManager.start_socket_thread' 

Environment

ruby
// This file contains the fastlane.tools configuration
// You can find the documentation at https://docs.fastlane.tools
//
// For a list of all available actions, check out
//
//     https://docs.fastlane.tools/actions
//

import Foundation

class Fastfile: LaneFile {

	override func beforeAll(with _: String) {
		
	}
	
	func buildLane() {
		desc("Description of what the lane does")
	}

	func appVersionLane() {
		desc("Description of what the lane does")
	}

	
    // MARK: - Code signing

    func syncDevelopmentStagingCodeSigningLane() {
        desc("Sync the Development match signing for the Staging build")
        Match.syncCodeSigning(
            type: .development,
            environment: .stage
        )
    }

    func syncDevelopmentProductionCodeSigningLane() {
        desc("Sync the Development match signing for the Production build")
        Match.syncCodeSigning(
            type: .development,
            environment: .production
        )
    }

    func syncAdHocStagingCodeSigningLane() {
        desc("Sync the Ad Hoc match signing for the Staging build")
        Match.syncCodeSigning(
            type: .adHoc,
            environment: .stage
        )
    }

    func syncAdHocProductionCodeSigningLane() {
        desc("Sync the Ad Hoc match signing for the Production build")
        Match.syncCodeSigning(
            type: .adHoc,
            environment: .production
        )
    }

    func syncAppStoreCodeSigningLane() {
        desc("Sync the App Store match signing for the Production build")
        Match.syncCodeSigning(
            type: .appStore,
            environment: .production
        )
    }

    func removeKeychainLane() {
        desc("Delete keychain")
        Keychain.remove()
    }

    // MARK: - Build

    func buildAdHocStagingLane() {
        desc("Build ad-hoc staging")
        Build.adHoc(environment: .stage)
    }

    func buildAdHocProductionLane() {
        desc("Build ad-hoc production")
        Build.adHoc(environment: .production)
    }

    func buildAppStoreLane() {
        desc("Build app store")
        Build.appStore()
    }

    // MARK: - Upload builds to Firebase and AppStore

    func buildStagingAndUploadToFirebaseLane() {
        desc("Build Staging app and upload to Firebase")

        setAppVersion()
        bumpBuild()

        buildAdHocStagingLane()

        // TODO: - Make release notes
        Distribution.uploadToFirebase(environment: .stage, releaseNotes: "")

        Symbol.uploadToCrashlytics(environment: .stage)

        Build.saveBuildContextToCI()
    }

    func buildProductionAndUploadToFirebaseLane() {
        desc("Build Production app and upload to Firebase")

        setAppVersion()
        bumpBuild()

        buildAdHocProductionLane()

        // TODO: - Make release notes
        Distribution.uploadToFirebase(environment: .production, releaseNotes: "")

        Symbol.uploadToCrashlytics(environment: .production)

        Build.saveBuildContextToCI()
    }

    func buildAndUploadToAppStoreLane() {
        desc("Build Production app and upload to App Store")

        setAppVersion()
        AppStoreAuthentication.connectAPIKey()
        if Secret.bumpAppStoreBuildNumber {
            bumpAppstoreBuild()
        } else {
            bumpBuild()
        }

        buildAppStoreLane()

        Distribution.uploadToAppStore()

        Symbol.uploadToCrashlytics(environment: .production)

        Build.saveBuildContextToCI()
    }

    func buildAndUploadToTestFlightLane() {
        desc("Build Production app and upload to TestFlight")

        setAppVersion()
        bumpBuild()

        buildAppStoreLane()

        AppStoreAuthentication.connectAPIKey()
        Distribution.uploadToTestFlight()

        Symbol.uploadToCrashlytics(environment: .production)

        Build.saveBuildContextToCI()
    }

    // MARK: - Test

    func buildAndTestLane() {
        desc("Build and Test project")
        Test.buildAndTest(
            environment: .stage,
            devices: Constant.devices
        )
    }

    func setUpTestProjectLane() {
        desc("Disable Exempt Encryption")
        Test.disableExemptEncryption()
    }

    // MARK: - Register device

    func registerNewDeviceLane() {
        let deviceName = prompt(text: "Enter the device name:")
        let deviceUDID = prompt(text: "Enter the device UDID:")

        registerDevice(
            name: deviceName,
            udid: deviceUDID,
            apiKey: .userDefined(Constant.apiKey),
            teamId: .userDefined(Constant.appleStagingTeamId)
        )

        Match.syncCodeSigning(type: .development, environment: .stage, isForce: true)
        Match.syncCodeSigning(type: .adHoc, environment: .stage, isForce: true)
    }

    func addDevicesGenerateProfilesLane() {
        desc("Add device and regenerate profiles with match")

        guard let data = Secret.devices.data(using: .utf8),
              let devices = try? JSONSerialization.jsonObject(with: data, options: []) as? [String: Any] else {
            return
        }
        registerDevices(
            devices: .userDefined(devices),
            apiKey: .userDefined(Constant.apiKey),
            teamId: .userDefined(Constant.appleStagingTeamId),
            platform: Secret.platform
        )

        Match.syncCodeSigning(type: .development, environment: .stage, isForce: true)
        Match.syncCodeSigning(type: .adHoc, environment: .stage, isForce: true)
    }

    // MARK: - Utilities

    func cleanUpOutputLane() {
        desc("Clean up Output")
        clearDerivedData(derivedDataPath: Constant.outputPath)
    }

    // MARK: - Private Helper

    private func setAppVersion() {
        desc("Check if any specific version number in build environment")
        guard !Constant.manualVersion.isEmpty else { return }
        incrementVersionNumber(
            versionNumber: .userDefined(Constant.manualVersion)
        )
    }

    private func bumpBuild(buildNumber: Int = numberOfCommits()) {
        desc("Set build number with number of commits")
        incrementBuildNumber(
            buildNumber: .userDefined(String(buildNumber)),
            xcodeproj: .userDefined(Constant.projectPath)
        )
    }

    private func bumpAppstoreBuild() {
        desc("Set build number with App Store latest build")
        let theLatestBuildNumber = latestTestflightBuildNumber(
            appIdentifier: Constant.productionBundleId
        ) + 1
        incrementBuildNumber(
            buildNumber: .userDefined("\(theLatestBuildNumber)")
        )
    }
}

No Appfile found

fastlane gems

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

Loaded fastlane plugins:

No plugins Loaded

Loaded gems
Gem Version
error_highlight 0.7.0
did_you_mean 2.0.0
syntax_suggest 2.0.2
artifactory 3.0.17
aws-eventstream 1.4.0
aws-sigv4 1.12.1
base64 0.2.0
jmespath 1.6.2
aws-sdk-core 3.239.2
aws-sdk-kms 1.118.0
aws-sdk-s3 1.205.0
babosa 1.0.4
bundler 2.7.2
CFPropertyList 3.0.8
colored 1.2
highline 2.0.3
commander 4.6.0
dotenv 2.8.1
emoji_regex

Source: fastlane/fastlane