# Troubleshooting cache volumes

Debugging issues that involve cached data is difficult because the workflow environment can change between runs. To inspect a cache volume directly, you can attach it to a one-off instance.

## Connecting to cache volumes

Namespace allows you to create one-off instances and connect them to a cache volume.

### 1. Create an instance

Using [nsc create --volume](/content/docs/reference/cli/create.md#--volume/index.html), you can create an instance and attach a cache volume.

```bash theme={null}
nsc create --volume cache:<cache-tag>:/cache:<size>gb
```

The size and the tag should match what you see on [the dashboard](https://cloud.namespace.so/workspace/storage).

**Note**: this follows standard [cache volume semantics](/content/docs/architecture/storage/cache-volumes.md#cache-hits-and-misses/index.html). Namespace tries hard to provide you with the latest cache version, but you may rarely see a slightly stale cache instead.

### 2. Connect via SSH

```bash theme={null}
nsc ssh <instance>
```

Inside the instance, you can find the cache contents at the mount point:

```bash theme={null}
ls -al /cache
```

## Setting breakpoints

When you want to investigate a particular cache state, you can temporarily add a [breakpoint](/content/docs/solutions/github-actions/debugging/interactive-access.md#setting-breakpoints/index.html) to your workflow definition and jump into an interactive SSH session.

```yaml {8-9,15-21} theme={null}
jobs:
  tests:
    runs-on: namespace-profile-with-caching

steps:
      - uses: actions/checkout@v4

- uses: namespacelabs/nscloud-cache-action@v1
        with: ...

- name: Run tests
        shell: bash
        run: ...

- name: Breakpoint if tests failed
        if: failure() # Remove this for an unconditional breakpoint
        uses: namespacelabs/breakpoint-action@v0
        with:
          duration: 15m
          authorized-users: <your-github-username>,<another-github-username>
```

For the full breakpoint mechanism, including `breakpoint-action`'s options, duration, and authorized-users, see [Debugging: Interactive access](/content/docs/solutions/github-actions/debugging/interactive-access.md#setting-breakpoints/index.html).

## Next steps

* [Interactive access](/content/docs/solutions/github-actions/debugging/interactive-access.md)
* [Cache Volumes overview](/content/docs/solutions/github-actions/caching.md)

## Hands-on support

Got stuck? Need help with debugging one of your workflows? Our team is here to assist:

* **Technical support**: Reach out to [support@namespace.so](mailto:support@namespace.so) to talk to one of our engineers.
* **Community**: Join our community [Discord](https://discord.gg/DqMzDFR6Hc) to learn about tips and best practices.
