Unexpected error while setting up the repo when adding a code location in Dagster+ Serverless

Last updated: October 9, 2025

Issue

When attempting to add a code location in a Dagster+ Serverless deployment by configuring a Git repository, you may encounter an error message of "Got an unexpected error while setting up the repo". This often occurs when the repository's configuration files are not properly set up for Dagster.

Solution

This error typically appears when your repository is missing the required Dagster configuration in the pyproject.toml file. To resolve this:

  1. Ensure your repository has a pyproject.toml file in the root directory.

  2. Add the required Dagster configuration block to your pyproject.toml file. It should be similar to this example:

[tool.dagster]
module_name = "my_dagster_project"

For a complete example of how to structure your repository correctly, see the Dagster Cloud Serverless Quickstart repository, which includes a properly configured pyproject.toml file.

You can check your Dagster project locally for errors with your TOML configuration file before you push changes to GitHub and attempt to deploy to Dagster+. To do so, run dg check toml on the command line. For more information on this and the other dg check validation commands, see the dg CLI documentation.