"codecrafters test" permission denied on WSL (copying ./vs/...*.idx)

I’m stuck on Stage #RG2.

When I run the ‘codecrafters test’ command, the following error is output:

make a repo temp copy: copy files: open codecrafters-redis-csharp/.vs/codecrafters-redis-csharp/FileContentIndex/3ad90655-af23-48fd-94b8-ff1dbb66b770.vsidx: permission denied

I’ve tried reinstalling the codecrafters CLI and checking user permissions but the issue persists.

However, if I push to the repo, it tests and executes without issue. It just doesn’t work locally with the codecrafters CLI.

Does anyone know what might be causing this?

@Aqiil could you try removing .vs once (rm -rf .vs/), and see if this issue persists? I’ve seen this happen before but it was because I messed up the permissions in my repository at some point.

Received a similar report of this from another user too. Moved to Bug Reports.

We’re looking into what possible solutions there are here.

A temporary workaround is to remove .vs/ (rm -rf ./vs) and then run codecrafters test. This fix is temporary, the .vs/ folder will be back soon enough once you edit files in VS Code and save again.

Apologies for the late reply.

I managed to solve this issue by closing Visual Studio, executing ‘codecrafters test’ (which then works) and re-opening the editor back up again.

I’ve had this occur twice so far and I’m not sure what’s causing it but do let me know if you pinpoint the root of the issue.

1 Like

One potential fix here is to only copy files that wouldn’t be ignored by .gitignore. I’m not sure if all of our .gitignores have .vs added though, or whether this is mostly caught by global gitignores.

im having this same issue, but even though .vs is deleted it still wont commit since file size is too large even though the file isn’t there. looks like im screwed

Is anyone working on fixing it?
This issue happens every time if you have Visual Studio opened.

Scenario is like this:

  1. Open Visual Studio
  2. Open cmd and start wsl
  3. Run codecrafters test - “permission denied” appears on files from .vs directory
  4. Close Visual Studio
  5. Run codecrafters test - it works
  6. Open Visual studio
  7. Run codecrafters test - it fails again

A need to constantly close and reopen Visual Studio before running tests makes it very annoying.
Ignoring files/directories that are included in .gitignore would be a good fix - as .vs directory is included there by default.

2 Likes

I’m having the same issue. @rohitpaulk any suggestions? Thanks!

We’re going to take at this next week! @andy1li will have an update here soon.

1 Like

Some implementation notes:

2 Likes

Hi all, we’ve fixed the issue in this PR.

Could you upgrade the CLI (v35) and check if the issue persists?

Thanks again for highlighting the issue!

1 Like

@andy1li it’s fixed! I reproduced the issue by running the CLI with VS open. Then I updated the CLI, tested again, and it ran successfully.

Thanks!

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.