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 · 5 comments
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.

@ChristopherKlay
Copy link

Any update on this issue?

I currently have the same issue as the linked issue and it partly makes the editor unusable because working on multiple files just results in constant "Refresh or keep in-editor?" prompts, catching you mid keypress.

@abose
Copy link
Member

abose commented Feb 13, 2025

@ChristopherKlay is the project in a network location or on a synced cloud drive by any chance? Which os is this btw.

@ChristopherKlay
Copy link

The project is on a synced cloud drive (Google Drive) accessed via editor version 4.0 build 4.0.3-20878 on a Windows 11 Pro device.

@abose
Copy link
Member

abose commented Feb 14, 2025

We are yet to fix that error. File system related fixes are scheduled for the next 2 releases as there are a few pending.

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

3 participants