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

file permission errors on various action and commands #1774

Closed
itaymendel opened this issue Jul 2, 2019 · 5 comments
Closed

file permission errors on various action and commands #1774

itaymendel opened this issue Jul 2, 2019 · 5 comments
Assignees
Labels
Milestone

Comments

@itaymendel
Copy link
Contributor

itaymendel commented Jul 2, 2019

There are many errors that are reported anonymously through Bit about file-access issues.

EACCES: permission denied, open '<path>/.git/bit/objects/a5/...106f01f31f73feed'
EACCES: permission denied, mkdir '/opt/bit/first-scope/objects/06'
EACCES: permission denied, open '<path>/package.json'
EACCES: permission denied, rmdir '<path>/node_modules/@bit/<component-id>/dist'

It's hard to triage the issues, as I was unable to recreate them locally. However, these are the most common type of errors. I assume that they happen when any file/dir that was created in a project was not assigned with the correct permission afterward, so the permissions used when running the Bit command are not enough to read/write a file.

@itaymendel
Copy link
Contributor Author

thought - this most likely happens when either an npm or bit command ran as root. some files/dirs require root permissions, so when running a command as another account - it breaks.

@Tallyb
Copy link
Contributor

Tallyb commented Jul 24, 2019

Bit cannot access files or directories. Make sure Bit has proper access permissions.

@imsnif
Copy link
Contributor

imsnif commented Jul 25, 2019

Continuing an offline conversation:

Suggested warning messages:

Instead of EACCESS:
Error: You do not have permissions to access <file-list>, were you running bit as root?

When running bit as root:
Warning: running bit as root might cause permission issues later.

@itaymendel
Copy link
Contributor Author

I think that the error should be extended and include that this error might occur if the user ran npm/yarn/git command as sudo.

So perhaps something like this:

error: you do not have permissions to access <file-list>, were you running bit, npm or git as root?

Note - I've removed the reference to the eject error, as this error occurs on several occasion, not only permission issues (happens when npm gets 404 and 401 as well). I suggest handling it specifically as its own case.

@davidfirst
Copy link
Member

I was able to reproduce it easily by running the following:

➜  touch aaa.js
➜  sudo bit add aaa.js
tracking component aaa:
added aaa.js
➜  bit tag -a
EACCES: permission denied, open '/tmp/wp/.bit/index.json'

Changed the error message and added a warning when a user is using sudo.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants