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

Linux: opening files from FTP connection show up empty #73884

Closed
MartinPL opened this issue May 17, 2019 · 20 comments

Comments

@MartinPL
Copy link

commented May 17, 2019

  • VSCode Version: 1.34.0 & 1.35.0-insider
  • OS Version: Antergos / Arch Linux (Linux x64 5.1.2-arch1-1-ARCH) / GNOME

Steps to Reproduce:

  1. Login to FTP on GNOME
  2. Drag file to VSC

Does this issue occur when all extensions are disabled?: Yes

@MartinPL MartinPL changed the title Files on FTP now opens as empty Files from FTP now opens as empty May 17, 2019

@bpasero

This comment has been minimized.

Copy link
Member

commented May 17, 2019

We are building exploration builds that use a much newer version of our UI framework (Electron version 4.0.x). I wonder if this issue reproduces with one of these builds, could you try? Download:

@bpasero bpasero self-assigned this May 17, 2019

@MartinPL

This comment has been minimized.

Copy link
Author

commented May 17, 2019

Yep, exploration don't have this problem.

@bpasero

This comment has been minimized.

Copy link
Member

commented Jul 1, 2019

We will ship with Electron 4 with our upcoming release 1.36 this week. As such I am closing this issue. To benefit from the update already today, consider to use our insiders version: https://code.visualstudio.com/insiders/

@bpasero bpasero closed this Jul 1, 2019

@bpasero bpasero added this to the June 2019 milestone Jul 1, 2019

@MartinPL

This comment has been minimized.

Copy link
Author

commented Jul 24, 2019

Retested, bug still remain even with Insider.

Version: 1.37.0-insider
Commit: 188180bccf1f56b3368c4eb20e877238d69925b8
Date: 2019-07-24T05:28:47.848Z
Electron: 4.2.5
Chrome: 69.0.3497.128
Node.js: 10.11.0
V8: 6.9.427.31-electron.0
OS: Linux x64 5.2.2-arch1-1-ARCH
@MartinPL

This comment has been minimized.

Copy link
Author

commented Aug 2, 2019

@bpasero / @Tyriar could you reopen this issues?

@bpasero

This comment has been minimized.

Copy link
Member

commented Aug 5, 2019

@MartinPL does this reproduce only when dragging dropping, or also when you open the FTP folder in VSCode? Is any FTP extension involved?

Sounds similar to #78320

@MartinPL

This comment has been minimized.

Copy link
Author

commented Aug 5, 2019

In both case same result, tested on clear VSC.

Yea #78320 probably is same issues since PCmanFM may using same backend as Nautilus / GNOME Files (gvfsd)

You can easy reproduce this on newest Ubuntu.

SFTP works fine. (https://youtu.be/Uftv5ahCRqc - FTP vs SFTP)

@bpasero

This comment has been minimized.

Copy link
Member

commented Aug 5, 2019

You can easy reproduce this on newest Ubuntu.

I must ask for your help here how to set this up. This is the only chance of ever resolving this issue.

@MartinPL

This comment has been minimized.

Copy link
Author

commented Aug 5, 2019

Sure:

@bpasero

This comment has been minimized.

Copy link
Member

commented Aug 5, 2019

@MartinPL and then how do you open that as folder in VSCode?

@MartinPL

This comment has been minimized.

Copy link
Author

commented Aug 5, 2019

If you are connected to FTP you can just use Open folder, FTP folder should be in Other Locations.

@bpasero bpasero changed the title Files from FTP now opens as empty Linux: opening files from FTP connection show up empty Aug 6, 2019

@bpasero bpasero added the important label Aug 6, 2019

@bpasero

This comment has been minimized.

Copy link
Member

commented Aug 6, 2019

I think I understand the issue now. Steps: see #78364 (comment)

The underlying issue is that we call fs.read with a position argument to instruct node to read from a certain position in the file. However, some file systems do not support this and will throw an error ESPIPE: invalid seek, read. One half of the bug was that we would not properly bubble up this error, so the file ended up empty. I fixed that.

The reason why this used to work is that previously we would set position to null which instructs node to simply use the current position in the file when reading. I do not think we have many usecases for reading from a certain position (though we do expose this as part of our file system API). Have to decide if the fix should go into the file service as general thing for every file system provider, or local to the node.js backed implementation.

@jrieken

This comment has been minimized.

Copy link
Member

commented Aug 6, 2019

@bpasero our internal (and proposed) api is modelled after pread, we can consider adding more overloads to support read or to replace pread with read. No strong feelings or experience here...

@bpasero

This comment has been minimized.

Copy link
Member

commented Aug 7, 2019

Pushed a fix to prefer NULL for fs.read / fs.write if we detect that the file position is the same. That means FTP access will only fail if we have code that requires a certain position to read/write, which we currently do not have in the text editor at least.

@bpasero bpasero closed this Aug 7, 2019

bpasero added a commit that referenced this issue Aug 7, 2019
@MartinPL

This comment has been minimized.

Copy link
Author

commented Aug 16, 2019

@bpasero I still have this issues, this is intended?

Version: 1.37.1
Commit: f06011a
Date: 2019-08-15T16:17:25.463Z
Electron: 4.2.7
Chrome: 69.0.3497.128
Node.js: 10.11.0
V8: 6.9.427.31-electron.0
OS: Linux x64 5.2.8-arch1-1-ARCH

@bpasero

This comment has been minimized.

Copy link
Member

commented Aug 16, 2019

@MartinPL to clarify you do this:

  • add an FTP location to Nautilus on Ubuntu
  • open that folder in VSCode
  • click on a file
  • file shows without any content (and no error is printed)

With version 1.37.1?

@MartinPL

This comment has been minimized.

Copy link
Author

commented Aug 17, 2019

@bpasero yes, just tested on Ubuntu in Virtualbox.
https://i.imgur.com/IPIA44y.png

BTW. Snap edition don't show FTPs location.

@bpasero

This comment has been minimized.

Copy link
Member

commented Aug 17, 2019

@MartinPL ah, this fix is not yet released to our stable version. You have to use our insiders until then:
Can you try to reproduce with our nightly insider builds? You can give our preview releases a try from: https://code.visualstudio.com/insiders/

@MartinPL

This comment has been minimized.

Copy link
Author

commented Aug 17, 2019

@bpasero With insiders works fine 👌

@aeschli

This comment has been minimized.

Copy link
Contributor

commented Aug 28, 2019

Set verified based on #73884 (comment)

@aeschli aeschli added the verified label Aug 28, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants
You can’t perform that action at this time.