Significant-Gravitas/AutoGPT · error · PreconditionFailed

User must create a Marketplace Profile before submitting an

Error message

User must create a Marketplace Profile before submitting an agent

What it means

PreconditionFailed raised when the submitting user's User record has no Profile row (or the User relation did not load). The store requires a marketplace profile (username, display name) because the listing's CreatorProfile is derived from it. This is a 'do something else first' error: create the profile, then resubmit. Same shape as error 406: state must be fixed before retrying.

Source

Thrown at autogpt_platform/backend/backend/api/features/store/db.py:909

        if not graph:
            logger.warning(
                f"Agent graph {graph_id} v{graph_version} not found for user {user_id}"
            )
            # Provide more user-friendly error message when graph_id is empty
            if not graph_id or graph_id.strip() == "":
                raise ValueError(
                    "No agent selected. "
                    "Please select an agent before submitting to the store."
                )
            else:
                raise NotFoundError(
                    f"Agent #{graph_id} v{graph_version} not found "
                    f"for this user (#{user_id})"
                )

        if not graph.User or not graph.User.Profile:
            logger.warning(f"User #{user_id} does not have a Profile")
            raise PreconditionFailed(
                "User must create a Marketplace Profile before submitting an agent"
            )

        async with transaction() as tx:
            # Determine next version number for this listing
            existing_listing = await prisma.models.StoreListing.prisma(tx).find_unique(
                where={"agentGraphId": graph_id},
                include={
                    "Versions": {
                        # We just need the latest version and one of each status:
                        "order_by": {"version": "desc"},
                        "distinct": ["submissionStatus"],
                        "where": {"isDeleted": False},
                    }
                },
            )
            next_version = 1
            graph_has_pending_submissions = False

View on GitHub (pinned to 9c8bb5550f)

Solutions

  1. Call the profile endpoints (PUT /store/profile) to create the marketplace profile, then retry the submission.
  2. In the UI, route users through a profile-creation step before showing the publish dialog.
  3. For tests/seeds, ensure the user fixture includes a Profile row.

Example fix

// before
await api.createSubmission(payload); // fails: no Profile
// after
let profile = await api.getMyProfile();
if (!profile) profile = await api.updateProfile({ name: user.name, username: user.handle });
await api.createSubmission(payload);
Defensive patterns

Strategy: validation

Validate before calling

let profile = await api.getMyStoreProfile();
if (!profile) {
  profile = await api.updateStoreProfile({ name: defaultName, username: suggestUsername() });
}
await api.createSubmission(payload);

Try / catch

from backend.util.exceptions import PreconditionFailed

try:
    await store_db.create_store_submission(...)
except PreconditionFailed as e:
    if 'Marketplace Profile' in str(e):
        ui.openProfileCreationWizard();
        return;
    raise

Prevention

When it happens

Trigger: POST /store/submissions by a brand-new account that never opened the marketplace profile settings; a user whose Profile row was deleted; submitting immediately after signup before profile creation.

Common situations: First-time publishers skipping the 'Create your creator profile' step; E2E tests using fresh seeded users without profiles; profile creation call failed silently earlier in the session.

Related errors


AI-assisted analysis of Significant-Gravitas/AutoGPT@9c8bb5550f (2026-08-14). Data as JSON: /api/errors/8dead8aa773c9503. Report an issue: GitHub.