这是indexloc提供的服务,不要输入任何密码
Skip to content

[invoice.upcoming] failed: Value for argument "documentPath" is not a valid resource path. Path must be a non-empty string. #701

@nickycdk

Description

@nickycdk

Bug report

  • Extension name: [e.g. firestore-stripe-payments]

Describe the bug

After upgrading the extension to latest version, I suddenly get the error:
Webhook handler for Stripe event [evt_1Rgkh5Iy2zuSu12r1YV6PmeP] of type [invoice.upcoming] failed: Value for argument "documentPath" is not a valid resource path. Path must be a non-empty string.

A Stripe invoice.invoice.upcoming webhook triggers a failure in the Firebase extension ext-firestore-stripe-payments-handleWebhookEvents. The error indicates that the documentPath argument passed to Firestore is invalid (Path must be a non-empty string), leading to an unhandled exception in the webhook processing function.

I can see in the "customers" collection that the user exist!

To Reproduce

I would guess that you would have a customer who has a subscription, and stripe should notify about an upcoming payment automatically

Expected behavior

That it does not fail when the customer actually exist in the collection

Additional context

Response:

{
  "error": "Webhook handler failed. View function logs in Firebase."
}

Request:


{
  "id": "evt_1Rgkh5Iy2zuSu12r1YV6PmeP",
  "object": "event",
  "api_version": "2022-11-15",
  "created": 1751539723,
  "data": {
    "object": {
      "object": "invoice",
      "account_country": "DK",
      "account_name": "Coachplan",
      "account_tax_ids": null,
      "amount_due": 24900,
      "amount_overpaid": 0,
      "amount_paid": 0,
      "amount_remaining": 24900,
      "amount_shipping": 0,
      "application": null,
      "application_fee_amount": null,
      "attempt_count": 0,
      "attempted": false,
      "automatic_tax": {
        "disabled_reason": null,
        "enabled": false,
        "liability": null,
        "provider": null,
        "status": null
      },
      "automatically_finalizes_at": null,
      "billing_reason": "upcoming",
      "charge": null,
      "collection_method": "charge_automatically",
      "created": 1752144466,
      "currency": "dkk",
      "custom_fields": null,
      "customer": "cus_S0Sums3ypqICxB",
      "customer_address": {
        "city": "hidden",
        "country": "DK",
        "line1": "hidden",
        "line2": "",
        "postal_code": "hidden",
        "state": ""
      },
      "customer_email": "hidden@hidden.dk",
      "customer_name": "HIDDEN",
      "customer_phone": null,
      "customer_shipping": null,
      "customer_tax_exempt": "none",
      "customer_tax_ids": [],
      "default_payment_method": null,
      "default_source": null,
      "default_tax_rates": [],
      "description": null,
      "discount": null,
      "discounts": [],
      "due_date": null,
      "effective_at": null,
      "ending_balance": 0,
      "footer": null,
      "from_invoice": null,
      "issuer": {
        "type": "self"
      },
      "last_finalization_error": null,
      "latest_revision": null,
      "lines": {
        "object": "list",
        "data": [
          {
            "id": "il_tmp_1a425aIy2zuSu12r274f4fc9",
            "object": "line_item",
            "amount": 24900,
            "amount_excluding_tax": 24900,
            "currency": "dkk",
            "description": "1 × Starter (at 249.00 kr / month)",
            "discount_amounts": [],
            "discountable": true,
            "discounts": [],
            "invoice": null,
            "livemode": true,
            "metadata": {
              "companyId": "Nz8o8lGoab41Qs0FJ4UD"
            },
            "parent": {
              "invoice_item_details": null,
              "subscription_item_details": {
                "invoice_item": null,
                "proration": false,
                "proration_details": {
                  "credited_items": null
                },
                "subscription": "sub_1RYPiYIy2zuSu12rbja5UatN",
                "subscription_item": "si_STMRmQns1RePiw"
              },
              "type": "subscription_item_details"
            },
            "period": {
              "end": 1754822866,
              "start": 1752144466
            },
            "plan": {
              "id": "price_1PNZIcIy2zuSu12rvw5b3D4B",
              "object": "plan",
              "active": true,
              "aggregate_usage": null,
              "amount": 24900,
              "amount_decimal": "24900",
              "billing_scheme": "per_unit",
              "created": 1717415018,
              "currency": "dkk",
              "interval": "month",
              "interval_count": 1,
              "livemode": true,
              "metadata": {},
              "meter": null,
              "nickname": "This is the starter package",
              "product": "prod_QE1LyVrxiFGuV3",
              "tiers_mode": null,
              "transform_usage": null,
              "trial_period_days": null,
              "usage_type": "licensed"
            },
            "pretax_credit_amounts": [],
            "price": {
              "id": "price_1PNZIcIy2zuSu12rvw5b3D4B",
              "object": "price",
              "active": true,
              "billing_scheme": "per_unit",
              "created": 1717415018,
              "currency": "dkk",
              "custom_unit_amount": null,
              "livemode": true,
              "lookup_key": null,
              "metadata": {},
              "nickname": "This is the starter package",
              "product": "prod_QE1LyVrxiFGuV3",
              "recurring": {
                "aggregate_usage": null,
                "interval": "month",
                "interval_count": 1,
                "meter": null,
                "trial_period_days": null,
                "usage_type": "licensed"
              },
              "tax_behavior": "inclusive",
              "tiers_mode": null,
              "transform_quantity": null,
              "type": "recurring",
              "unit_amount": 24900,
              "unit_amount_decimal": "24900"
            },
            "pricing": {
              "price_details": {
                "price": "price_1PNZIcIy2zuSu12rvw5b3D4B",
                "product": "prod_QE1LyVrxiFGuV3"
              },
              "type": "price_details",
              "unit_amount_decimal": "24900"
            },
            "proration": false,
            "proration_details": {
              "credited_items": null
            },
            "quantity": 1,
            "subscription": "sub_1RYPiYIy2zuSu12rbja5UatN",
            "subscription_item": "si_STMRmQns1RePiw",
            "tax_amounts": [],
            "tax_rates": [],
            "taxes": [],
            "type": "subscription",
            "unit_amount_excluding_tax": "24900"
          }
        ],
        "has_more": false,
        "total_count": 1,
        "url": "/v1/invoices/upcoming/lines?customer=cus_S0Sums3ypqICxB&subscription=sub_1RYPiYIy2zuSu12rbja5UatN"
      },
      "livemode": true,
      "metadata": {},
      "next_payment_attempt": 1752148066,
      "number": null,
      "on_behalf_of": null,
      "paid": false,
      "paid_out_of_band": false,
      "parent": {
        "quote_details": null,
        "subscription_details": {
          "metadata": {
            "companyId": "Nz8o8lGoab41Qs0FJ4UD"
          },
          "subscription": "sub_1RYPiYIy2zuSu12rbja5UatN"
        },
        "type": "subscription_details"
      },
      "payment_intent": null,
      "payment_settings": {
        "default_mandate": null,
        "payment_method_options": {
          "acss_debit": null,
          "bancontact": null,
          "card": {
            "request_three_d_secure": "automatic"
          },
          "customer_balance": null,
          "konbini": null,
          "sepa_debit": null,
          "us_bank_account": null
        },
        "payment_method_types": null
      },
      "period_end": 1752144466,
      "period_start": 1749552466,
      "post_payment_credit_notes_amount": 0,
      "pre_payment_credit_notes_amount": 0,
      "quote": null,
      "receipt_number": null,
      "rendering": null,
      "rendering_options": null,
      "shipping_cost": null,
      "shipping_details": null,
      "starting_balance": 0,
      "statement_descriptor": null,
      "status": "draft",
      "status_transitions": {
        "finalized_at": null,
        "marked_uncollectible_at": null,
        "paid_at": null,
        "voided_at": null
      },
      "subscription": "sub_1RYPiYIy2zuSu12rbja5UatN",
      "subscription_details": {
        "metadata": {
          "companyId": "Nz8o8lGoab41Qs0FJ4UD"
        }
      },
      "subtotal": 24900,
      "subtotal_excluding_tax": 24900,
      "tax": null,
      "test_clock": null,
      "total": 24900,
      "total_discount_amounts": [],
      "total_excluding_tax": 24900,
      "total_pretax_credit_amounts": [],
      "total_tax_amounts": [],
      "total_taxes": [],
      "transfer_data": null,
      "webhooks_delivered_at": null
    }
  },
  "livemode": true,
  "pending_webhooks": 1,
  "request": {
    "id": null,
    "idempotency_key": null
  },
  "type": "invoice.upcoming"
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions