[data-reveal]{opacity:1!important;transform:none!important}
AntelopeJS DMS
DocumentationFAQ

FAQ

Answers to the common questions and problems with the SaaS module, and the database fixes an upgrade needs.

A visitor who just registered stays signed out

The POST /auth/establish route of the frontend server answers 403 when it does not allow /api/saas/register/finalize. The module declares that endpoint in its frontend registration (authEstablishEndpoints), so check that the frontend server serves the frontend module of @antelopejs/dms-saas. To add the endpoint by hand, set DMS_AUTH_ESTABLISH_ENDPOINTS=/api/saas/register/finalize in the environment of the frontend server. See Public screens.

Registration answers 409 saas.errors.plan.no_free_plan

The catalogue has no active free plan open to individuals. Publish one. See Default plan for how defaultPlanSlug picks among such plans.

Choosing a plan answers 400 saas.errors.plan.not_synced_with_stripe

The plan is not linked to a Stripe price yet. Either the sync failed or the Stripe keys are placeholders. Check the logs, then save the plan again or wait for the next sync pass. See Plans and their Stripe products.

Checkout answers 409 saas.errors.plan.checkout_in_progress

A Stripe Checkout session for the workspace is still open. Finish or abandon it. The next attempt releases a session that expired or was never recorded. See Starting a paid plan.

The billing portal or checkout refuses to redirect

The Manage in Stripe button or Stripe Checkout refuses to redirect when the host of its return URL is neither the host of the DMS clientBaseUrl nor, when you set it, in allowedRedirectHosts. List the host in allowedRedirectHosts, together with the host of clientBaseUrl, because a set value replaces the default. Loopback hosts are accepted without an entry only in a development runtime. See Options.

The next invoice preview says "unavailable"

Stripe could not price the invoice. The causes are placeholder keys, Stripe Tax not active, a missing or invalid tax location, a usage provider that failed, or a Stripe answer slower than stripe.readTimeoutMs (4 seconds by default, see Options). The reason of the upcoming invoice preview says which.

A member lost a permission their role grants

Plans cap permissions. A member keeps only the permissions that both their roles and the plan of the workspace grant, and the owner gets every permission of the plan. Add the permission to the plan. See Tenant owner permissions.

A trial ended, but the workspace still shows it as trialing

Stripe reports how a trial ends (customer.subscription.updated), and no cron advances a trial, so the webhook does not reach the module. The same holds for renewals, failed payments and cancellations. Check the endpoint and its signing secret, or run stripe listen in development. See What moves a workspace's billing state.

Seeded or demo workspaces were suspended or deleted on their own

The crons of the module act on every subscription, whether the module wrote it or not. At 01:00, a workspace past due for longer than the suspension delay is suspended. At 04:30, a workspace cancelled for longer than the data retention period is deleted with its data. Write seeded dates relative to the time of writing, and use a Stripe test account for demos. See Demos, tests and seeded data.

A plan migration or webhook is stuck in "reconciliation required"

The module stops on purpose, because the attempt may have partial effects. Before you resolve it, establish what happened and that the previous executor stopped. See Operations.

Upgrading

Upgrade the DMS with the module

Upgrade the DMS backend, @antelopejs/interface-dms and the @antelopejs/dms-frontend renderer together, to the ranges of the compatibility table, before the module. Troubleshooting covers dependency resolution and frontend integration errors. stripe.readTimeoutMs and stripe.readMaxNetworkRetries are optional.

Tenant billing page anchors

The plan, next invoice, payment method and money-back cards of the tenant billing page share a two-column grid (overview), so planCard, paymentMethod and refundButton are no longer top-level fields of the page. The names in tenantBillingPage.components are unchanged. RegisterTenantBillingPageExtension maps each name to its position through tenantBillingPageAnchorPaths, so a block registered after planCard still lands right under the plan card, in its column. Upgrade @antelopejs/interface-dms-saas together with @antelopejs/dms-saas. An earlier build of the interface anchors on the old top-level fields. The DMS no longer finds them, and appends the block at the end of the page. Code that anchors with the DMS's own @RegisterPageExtension passes the path, as in .after(tenantBillingPageAnchorPaths.planCard).

The permission ids of those four cards follow their position (settings.workspace.billing.overview.plan.current.planCard, and so on), so a plan or role granting them needs the new ids.

Rows written by earlier builds

Billing no longer infers state from rows that predate the current fields. Rows imported from the pre-DMS codebase or written by earlier builds must be fixed in the database, with writers stopped, before upgrading:

  • features.displayName and features.tooltip are localized. Rows written by earlier builds hold a plain string (often a $ i18n key) that the localized readers cannot use. Drop the features table and let the declaring modules write it again on startup, then re-enter any feature created by hand.
  • plans.name, plans.description and plans.borderLabel are localized. Rows written by earlier builds hold a plain string (or a $ i18n key). Rewrite each as one text per locale ({ "en": "Pro" }), or let the seeding module write its plans again.
  • tenant_subscriptions.isComplimentary is required. Only isComplimentary: true makes a subscription complimentary. A missing value is read as not complimentary. Set isComplimentary: true on admin gifts that lack it (typically rows with no stripeCustomerId, no stripeSubscriptionId and a status other than pending_payment), otherwise they are billed and shown as paid plans. Backfill isComplimentary: false on every other row that lacks the field, including workspaces created through paid provisioning before this change, so the stored rows match the table type.
  • invoices.documentType is required. Invoice lists and reads only match documentType: "invoice". A row without it is neither listed nor readable. Set documentType: "invoice" on every invoice row that lacks it.
  • stripe_webhook_events.result no longer accepts failed. Such attempts may carry partial effects. Establish their outcome as described for reconciliation_required above, then set their result to reconciliation_required or delete the record once resolved.
  • revision is required on tenant_subscriptions, segments, user_segments, plan_migrations, stripe_webhook_events, saas_lifecycle_deliveries and saas_operator_actions. Revision-fenced writes no longer adopt a row without one. They refuse it, and the workflow that holds that row stalls. Give every row lacking the field (absent or null) an initial revision, any unique string such as a fresh UUID. Segments created through the platform data API by earlier builds are the usual case.
  • tenant_subscriptions.paidUsagePeriods is required. It is the only source of usage coverage. A renewal invoice bills usage only inside a period recorded for its own Stripe subscription, and a missing ledger is no longer read as "bill the whole window". Rows lacking it (or holding null) are typically default-plan, free-plan and pending-checkout subscriptions, and workspaces created through paid provisioning. Set it by kind:
    • A row with a stripeSubscriptionId that is not complimentary gets [{ stripeSubscriptionId, start, end: null }]. Set start to the start_date of the Stripe subscription, or any earlier date, so renewals keep billing their whole window.
    • Every other row, with no Stripe subscription or with isComplimentary: true, gets [].