Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

wp-env start fails with "error: cannot open .git/FETCH_HEAD: Permission denied" #49490

Open
duncan-tincello opened this issue Mar 30, 2023 · 4 comments
Labels
[Package] Env /packages/env [Type] Bug An existing feature does not function as intended

Comments

@duncan-tincello
Copy link

I attempted to start an existing project today, after a cap of a few months. I ran wp-env start as usual, and saw messages about updating Docker images (I have seen those before after a gap in my work on the project). This time it failed with

✖ error: cannot open .git/FETCH_HEAD: Permission denied

GitError: error: cannot open .git/FETCH_HEAD: Permission denied

    at Object.action (/home/blob/theme/node_modules/simple-git/dist/cjs/index.js:1228:25)
    at PluginStore.exec (/home/blob/theme/node_modules/simple-git/dist/cjs/index.js:1263:29)
    at /home/blob/theme/node_modules/simple-git/dist/cjs/index.js:1627:43
    at new Promise (<anonymous>)
    at GitExecutorChain.handleTaskData (/home/blob/theme/node_modules/simple-git/dist/cjs/index.js:1625:16)
    at GitExecutorChain.<anonymous> (/home/blob/theme/node_modules/simple-git/dist/cjs/index.js:1609:44)
    at Generator.next (<anonymous>)
    at fulfilled (/home/blob/theme/node_modules/simple-git/dist/cjs/index.js:55:24)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5) {
  task: {
    commands: [ 'fetch', '--tags', 'origin', '6.2' ],
    format: 'utf-8',
    parser: [Function: parseFetchResult]
  }
}

I tried setting up a new plugin project and using wp-env from scratch and that works OK, but I cannot start this project.
I am developing on Mint Linux. The permissions for the project root folder are drwxr-xr-x, and .git/ has the same permissions. .git/FETCH_HEAD has permissions -rw-r--r--.
Any ideas?

@skorasaurus skorasaurus added the [Package] Env /packages/env label Mar 30, 2023
@noahtallen
Copy link
Member

You could always try npx wp-env --destroy to start from scratch for this specific project. (Though you'd loose any database content). I'm not sure what the issue is, but it seems like the local permissions may have changed since the last time you ran it?

@duncan-tincello
Copy link
Author

Hi Noah, yes, I could do that. The thing is, this is the second time this has happened in the last two years, and in both cases I had changed nothing locally, to the best of my knowledge, I had merely left the project alone for a few months then returned to find it will not start because of this fault. I might have to abandon wp-env and set up my own Docker containers - I did that before I found wp-env - because they are more reliable.

@noahtallen
Copy link
Member

We're overhauling the permissions here to hopefully improve things: #49962 I'm not sure that will fix this specific issue though

@duncan-tincello
Copy link
Author

Thanks Noah

@jordesign jordesign added the [Type] Bug An existing feature does not function as intended label Jul 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Package] Env /packages/env [Type] Bug An existing feature does not function as intended
Projects
None yet
Development

No branches or pull requests

4 participants