Getting a Faraday::TimeoutError in development when creating a Terminal Checkout

Im running into this problem just in Development for now. I get a Faraday::TimeoutError execution expired error when creating a new terminal checkout. It is happening about half the time in Development. Using ngrok for my https forwarder.
I had not had this issue before but here is the code which has not changed

    @terminal_result = square_api_client.terminal.create_terminal_checkout(
        body: {
          idempotency_key: SecureRandom.uuid,
          checkout: {
            amount_money: {
              amount: @square_amount,
              currency: "USD"
            },
            reference_id: @sale_id,
            note: @skiswap.swap_name,
            device_options: {
              device_id: @terminal_id,
              skip_receipt_screen: false,
              tip_settings: {
                allow_tipping: false
              }
            },
            payment_type: "CARD_PRESENT",
            customer_id: "",
            app_fee_money: {
              amount: @app_fee,
              currency: "USD"
            }
          }
        }
      )

Not really sure how to troubleshoot that error since it’s not a Square error. Searching around it looks like it’s an unified client error for timeouts. So something must be happening before any of the requests are making it to Square. :slightly_smiling_face:

Im not sure either. The error is happening on this line
@terminal_result = square_api_client.terminal.create_terminal_checkout(
I thought maybe it was api it happens on every 5th or so call when creating a terminal checkout. It is specific to Development so thats good. Seems production works fine.

What SDK are you using? :slightly_smiling_face:

Im using the ruby sdk square.rb 22.1.0.20220823

I haven’t been able to replicate this. I’m not using ngrok but all my tests are succeeding. If you try it without using ngrok does it work as expected? :slightly_smiling_face:

@jcrone Can you try increasing the timeout value in Square::Client.new?