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

Entire project directory fails to load when permission denied to a file #1846

Open
nmalinoski opened this issue Sep 12, 2024 · 1 comment
Open
Labels
bug Something isn't working customer raised issues raised by end user/customer

Comments

@nmalinoski
Copy link

Describe the bug

When encountering a file that Phoenix Code does not have permission to read, the entire project fails to load (no files in the file tree, directory does not appear in the project switcher (switcher reads "default project", probably because it's the only other one in the list), Start Project dialog will not open).

Reproduction

  1. Using a Windows host running a Docker container or a VM running Linux, mount a directory on the host in the VM
  2. From within the VM, create a symlink in that mounted directory
    1. Might be sufficient to just change the permissions on any file in the directory so the current user account doesn't have access to it
  3. Attempt to open the directory as a project in Phoenix Code

Expected behavior

The IDE should simply not show the inaccessible file in the file tree and continue to process everything else per usual.

OS, Browser and Phoenix versions

  1. Windows 10 x64, desktop PC
  2. Phoenix Code 3.8.8, 3.9.4 for Windows x64

logs or debug stack trace if any

{
    "name": "EACCES",
    "code": "EACCES",
    "errno": 3,
    "message": "Failed to read directory:  Permission denied: /tauri/C/path/to/project EACCES: permission denied, stat 'C:\\path\\to\\project\\.env'",
    "path": "/tauri/C/path/to/project",
    "stack": "Error: Failed to read directory:  Permission denied: /tauri/C/path/to/project EACCES: permission denied, stat 'C:\\path\\to\\project\\.env'\n    at new n (https://phtauri.localhost/v3.9.4/phoenix/virtualfs.js:1:461316)\n    at e4 (https://phtauri.localhost/v3.9.4/phoenix/virtualfs.js:1:481427)\n    at https://phtauri.localhost/v3.9.4/phoenix/virtualfs.js:1:486521",
    "nodeStack": "Error: EACCES: permission denied, stat 'C:\\path\\to\\project\\.env'\n    at async Object.stat (node:internal/fs/promises:1032:18)"
}

Additional context

I typically work on Laravel webapps where .env is a symlink to one of .env.{local,www_dev,www_prod}. This symlink gets created on the host by a Linux VM, and is ultimately inaccessible/unusable by the host (which is fine for me).

I don't have this problem with Brackets 2.2.1; the .env file simply doesn't show up in the file tree, and neither do the variants. I don't know for sure, but I'm thinking that either Brackets recognizes that the file is inaccessible and just ignores it, or it processes the .gitignore file (which contains entries for .env{,.local,.www_dev,.www_prod}) in the project root first, then just ignores them when it starts reading through the directory.

This is preventing me from migrating from Brackets to Phoenix.

@nmalinoski nmalinoski added the bug Something isn't working label Sep 12, 2024
@abose abose added the customer raised issues raised by end user/customer label Sep 13, 2024
@abose
Copy link
Member

abose commented Sep 13, 2024

Thanks for reporting the issue @nmalinoski . This will be fixed when we address #1710 and other file system related issues in the next release or by November release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working customer raised issues raised by end user/customer
Projects
None yet
Development

No branches or pull requests

2 participants