# Troubleshoot Import and Apply Errors


This guide covers common validation and error scenarios when you import workspace resources into a CLI project or run `apply` afterward.

## Unsynced changes in project

If your project has unsynced changes, running the `import workspace` command will give you the following error:

```text
Error: import not allowed as project has changes to be synced
```

**Fix**: Run `apply` to sync pending changes, then run `import workspace` again.

## Imported directory already exists

If an `imported` directory already exists in your project, the `import workspace` command will fail with the following error:

```text
Error: directory for import: my-project/imported already exists
```

**Fix**: Move anything you need out of `imported/`, delete the `imported` directory, and run `import workspace` again.

## Import fails for a specific resource

When `import workspace` or a resource-specific `import` fails:

- Confirm the workspace still contains the `remote_id` you're importing
- Confirm your token includes the [required permissions]({{< ref "dev-tools/rudder-cli/import-resources/_index.md#required-permissions" >}}) for that resource type
- Make sure the `local_id` doesn't conflict with an existing CLI-managed resource

## Apply fails after import

When `apply` fails right after an import:

- Check that every generated YAML file is present and valid
- For SQL models you imported with `--sql-location`, keep the YAML and the referenced `.sql` file on the paths Rudder CLI expects
- Confirm you're logged in and the token can reach the workspace
- Confirm that no manual changes were made to the resource in the RudderStack dashboard after import — if changes were 
made outside Rudder CLI, you will be prompted to reconcile them

## Resource deleted from dashboard before apply {#resource-deleted-from-dashboard-before-apply}

If you delete a resource from the RudderStack dashboard after running `import workspace` but before running `apply`, the `apply` command will fail with:

```text
Resource with ID not found
```

**Fix**: Remove the matching YAML from the project (or rewrite it so Rudder CLI creates a new resource), then run `apply` again.

