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

Cannot read 1 resources #10103

Closed
DevTester425 opened this issue Sep 15, 2021 · 2 comments · Fixed by #10131
Closed

Cannot read 1 resources #10103

DevTester425 opened this issue Sep 15, 2021 · 2 comments · Fixed by #10131
Labels
electron issues related to the electron target

Comments

@DevTester425
Copy link

Bug Description:

When opening a folder, a notification appears: "Cannot read 1 resources:"

Steps to Reproduce:

  1. click menu item File->Open Folder...
  2. select a folder
  3. a notification appears
  4. a new instance of the editor successfully opens at the specified path

See the video

Cannot_read_1_resources_notification_2021-09-15.mp4

Additional Information

  • Operating System: Microsoft Windows 10, 64 bit
  • @theia/example-electron: 1.17.0
@vince-fugnitto vince-fugnitto added 🤔 needs more info issues that require more info from the author electron issues related to the electron target labels Sep 15, 2021
@vince-fugnitto
Copy link
Member

@DevTester425 the notification should appear when attempting to open a resource which cannot be read (#9950), is it the case in your example?

protected async canRead(uris: MaybeArray<URI>): Promise<boolean> {
const inaccessibleFilePaths = await Promise.all((Array.isArray(uris) ? uris : [uris]).map(
async uri => (!await this.fileService.access(uri, FileAccess.Constants.R_OK) && uri.path || '')
).filter(e => e));
if (inaccessibleFilePaths.length) {
this.messageService.error(`Cannot read ${inaccessibleFilePaths.length} resources: ${inaccessibleFilePaths.join(', ')}`);
}
return !!inaccessibleFilePaths.length;
}

@bayang
Copy link

bayang commented Sep 17, 2021

Same issue here on linux with version 1.2.0,
I choose open file with ctrl + o, pick the file in explorer, the file is displayed in editor but a notification appears

Screenshot_20210917_105813

I tried with a test folder containing only one text file that is rw, the notification still appears

ls -larth
total 12K
drwxr-xr-x 10 me me 4,0K 17 sept. 11:08 ..
drwxr-xr-x  2 me me 4,0K 17 sept. 11:08 .
-rw-r--r--  1 me me   24 17 sept. 11:08 test.txt

Also the path of the problematic files should be displayed in the notification as per the code sample posted above (the ${inaccessibleFilePaths.join(', ') part).

It is never present in my case.

Nothing in the logs (I can see info, warn and errors in the logs so I guess the problematic part is not logged or is at debug level).

@vince-fugnitto vince-fugnitto removed the 🤔 needs more info issues that require more info from the author label Sep 17, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
electron issues related to the electron target
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants