timburgess / brackets-ftp-sync

FTP/SFTP for Adobe Brackets
105 stars 19 forks source link

Files not been created on FTP when they don't exists #5

Open Parcye opened 10 years ago

Parcye commented 10 years ago

I normally do live work on the test server via FTP on PSPad, but Brackets looks promissing so I decided to have a look.

I have installed this extension and have a few problems; one is that files are not created on the FTP when I save new files and choose to go for sync FTP.

I get this message: cannot stat remote file:Error: 450 ///application/views/field_image.php: No such file or directory

The user is directly into root, but if I leave root empty, I get an error; so I have root setup as / .

Other files I have changed, even in the same folder; are updated.

timburgess commented 10 years ago

Looking at the error, an issue with multiple slashes (amongst a number of others) was fixed in 1.0.3 so you likely have an earlier version. If you have installed FTP-Sync via the Brackets registry, you will have 1.0.2 installed.

A new Brackets release (version 36) is imminent. When released, I plan to test against it and then update the registry to 1.0.3. In the meantime, the ftp-sync_1.0.3.zip is in the repository if you want to try it. If you clone the repository or download the repository as a zip, 1.0.3 is in the root directory. Help->Show Extensions Folder will show you the extensions folder, which has a user directory where the zip should be expanded in.

Parcye commented 10 years ago

I have just checked the package.json file included in the zip I downloaded this afternoon and installed; is says : "version": "1.0.3", file date-time is 06-02-2014 10:35 .

I have found that the error comes from the function statOp, and happens on line 112 .

Looking further into the the code; I get the feeling the 450 error code the FTP server gives on STAT should also force JSFTP to use LIST . As it does for error code 500 and 502 . Therefor the issue might not been a brackets-ftp-sync issue but JSFTP issue.

But as I am new to and brackets, node, jsftp and github; I don't want to be jumping to conclusions to quick

timburgess commented 10 years ago

statOp() should be pretty elementary. If it has problems, it's likely there are some issues with the remote path. Please use Debug->Show Developer Tools to show the console when you get the error and post it here. That should allow me to reproduce the issue. Cheers.

Parcye commented 10 years ago

This is a copy-paste from the log:

[node-log 12:52:49 AM] stating /gnx/application/views/generix/field_filelist.php NodeDebugUtils.js:117
[node-log 12:52:49 AM] cannot stat remote file:Error: 450 /gnx/application/views/generix/field_filelist.php: No such file or directory NodeDebugUtils.js:117
[node-log 12:52:49 AM] stating /gnx/application/views/generix/field_image.php NodeDebugUtils.js:117
[node-log 12:52:49 AM] stating /gnx/application/views/generix/field_imagelist.php NodeDebugUtils.js:117
[node-log 12:52:49 AM] cannot stat remote file:Error: 450 /gnx/application/views/generix/field_imagelist.php: No such file or directory NodeDebugUtils.js:117
[node-log 12:52:49 AM] stating /gnx/application/views/generix/field_string.php NodeDebugUtils.js:117

At the end of the log; it does show a upload; but only from a file that already exists.

[node-log 12:53:04 AM] uploaded /gnx/application/views/generix/field_image.php NodeDebugUtils.js:117
timburgess commented 10 years ago

Please paste the complete log. If there are a very large number of files/directories with a 'stating' line, you can omit these but I need to see what occurs from the beginning.

Parcye commented 10 years ago

I have the log, minus the stating of other directories.

parsed .ftpsync_settings main.js:68
[ftp-sync] loaded main.js:247
[ftp-sync] started ftp upload main.js:182
[node-log 8:24:40 AM] Connected 230 User gnx@testdev.nl logged in NodeDebugUtils.js:117
[node-log 8:24:40 AM] { code: 257,
  text: '257 "/" is the current directory',
  isMark: false,
  isError: false } NodeDebugUtils.js:117
[node-log 8:24:40 AM] logged in at / NodeDebugUtils.js:117
[node-log 8:24:40 AM] full remote path is /gnx NodeDebugUtils.js:117
[node-log 8:24:40 AM] mkdir /gnx/application NodeDebugUtils.js:117
[node-log 8:24:41 AM] mkdir /gnx/application/cache NodeDebugUtils.js:117
[node-log 8:24:41 AM] stating /gnx/application/cache/index.html NodeDebugUtils.js:117
...
[node-log 8:24:42 AM] mkdir /gnx/application/views/generix NodeDebugUtils.js:117
[node-log 8:24:42 AM] stating /gnx/application/views/generix/fields_close_container.php NodeDebugUtils.js:117
[node-log 8:24:42 AM] stating /gnx/application/views/generix/fields_open_container.php NodeDebugUtils.js:117
[node-log 8:24:42 AM] stating /gnx/application/views/generix/field_container.php NodeDebugUtils.js:117
[node-log 8:24:42 AM] stating /gnx/application/views/generix/field_divider_close.php NodeDebugUtils.js:117
[node-log 8:24:42 AM] stating /gnx/application/views/generix/field_divider_open.php NodeDebugUtils.js:117
[node-log 8:24:42 AM] stating /gnx/application/views/generix/field_filelist.php NodeDebugUtils.js:117
[node-log 8:24:42 AM] cannot stat remote file:Error: 450 /gnx/application/views/generix/field_filelist.php: No such file or directory NodeDebugUtils.js:117
[node-log 8:24:42 AM] stating /gnx/application/views/generix/field_image.php NodeDebugUtils.js:117
[node-log 8:24:42 AM] stating /gnx/application/views/generix/field_imagelist.php NodeDebugUtils.js:117
[node-log 8:24:42 AM] cannot stat remote file:Error: 450 /gnx/application/views/generix/field_imagelist.php: No such file or directory NodeDebugUtils.js:117
[node-log 8:24:42 AM] stating /gnx/application/views/generix/field_string.php NodeDebugUtils.js:117
[node-log 8:24:42 AM] stating /gnx/application/views/generix/field_text.php NodeDebugUtils.js:117
[node-log 8:24:42 AM] stating /gnx/application/views/generix/field_video.php NodeDebugUtils.js:117
[node-log 8:24:42 AM] stating /gnx/application/views/generix/field_wysiwyg.php NodeDebugUtils.js:117
[node-log 8:24:58 AM] mkdir /gnx/thumbs/New Folder NodeDebugUtils.js:117
[node-log 8:24:58 AM] stating /gnx/thumbs/New Folder/DIS-COMPR1_2.JPG NodeDebugUtils.js:117
[node-log 8:24:58 AM] mkdir /gnx/thumbs/New Folder/N NodeDebugUtils.js:117
[node-log 8:24:58 AM] created remote dir /gnx/thumbs/New Folder/N NodeDebugUtils.js:117
[node-log 8:24:58 AM] quit: 221 Goodbye. NodeDebugUtils.js:117

And then I also notice something strang; the last directory in the tree, is always created. Even if it already exists. The folder /gnx/thumbs/New Folder/N exists from the start; but still is listed as created every time.

timburgess commented 10 years ago

Thanks, that's great. I'm putting together a test framework at present and will add your directory structure in and see if I can duplicate the problem.

Parcye commented 10 years ago

I have basicly got CodeIgniter and a few extra folders; js, css, images, thumbs and have a few subs in de CI application/views folder.

timburgess commented 10 years ago

My framework is now basically functional and I have been looking at your directory structure to create a test. I notice that you have a folder name with spaces i.e. "New Folder". I haven't tried/tested FTP-Sync yet with directory names with spaces and my guess is that it will need explicit support. Please try with directory names without spaces. Thanks.

Parcye commented 10 years ago

Hi,

The main problem is not the folder with spaces, that was created with image uploader.

The problem is error 450 when statimg, so no new files are uploaded. I think it is an active/passive ftp issue.

Verstuurd vanaf remote werkstation

Op 11 feb. 2014 om 04:22 heeft Tim Burgess notifications@github.com het volgende geschreven:

My framework is now basically functional and I have been looking at your directory structure to create a test. I notice that you have a folder name with spaces i.e. "New Folder". I haven't tried/tested FTP-Sync yet with directory names with spaces and my guess is that it will need explicit support. Please try with directory names without spaces. Thanks.

— Reply to this email directly or view it on GitHub.

timburgess commented 10 years ago

If you think it is an active vs passive issue, testing with an FTP server on localhost will allow you to use active mode. FYI, I have now pushed the test framework and a small FTP change to master if you want to test with the latest.

Parcye commented 10 years ago

I have justs tested with the latest; same error:

[node-log 3:55:51 PM] cannot stat remote file:Error: 450 /gnx/application/views/generix/field_imagelist.php: No such file or directory 

450 FTP Reply Code Example Reply 450 Requested file action not taken.

To be able to use the ftp sync at the moment, I have added the following after line 113 in core.js :

if (err.code == 450) ops.push([putOp, localPath, remotePath]); 

This allowing it to ignore the 450 error

timburgess commented 10 years ago

Thanks for the info and glad you're using the latest. Unfortunately I have been unable to reproduce this error. I created a similar directory layout in the test suite but that works without issue. And it's not a directory depth or filename issue as I can sync the complete contents of the ftp-sync project and that has a deeper directory structure.

What operating system are you using? And have you tried a local FTP server?