SublimeText2-FTPSync icon indicating copy to clipboard operation
SublimeText2-FTPSync copied to clipboard

ftpsync.settings JSON error

Open fabiobozzo opened this issue 10 years ago • 11 comments

I just installed the plugin via Package control > Install package. Then I went into a website local directory and created a ftpsync.settings file like this:

{ 'primary': { host: '192.168.1.1', username: 'YYY', password: 'XXX', path: '/Black_Sitez/test/' } }

The error shown at the bottom is: Line 1 column2 Failed parsing configuration file:{} (commas problem?) [Exception: No JSON object could be decoded]

...however, JSON lint told me it was valid!

Then I tried to:

  • use the 'Setup FTPSync in this folder' template
  • use " instead of '
  • download the latest build and upgrade

Nothing solved that problem. Please help. Thank you.

fabiobozzo avatar Feb 26 '14 14:02 fabiobozzo

Hi, so if you use Setup FTPSync in this folder and just change values, it throws this error? No special character in username/password used?

Oh...by any chance it does not include // a value?

NoxArt avatar Feb 26 '14 15:02 NoxArt

my username is normal, no special chars... just 'admin'. my pw is like 'ONE111_two&three'

fabiobozzo avatar Feb 26 '14 15:02 fabiobozzo

Can you try using " instead of ' + wrapping property names in quotes? host => "host"? Sorry if you've tried already

NoxArt avatar Feb 26 '14 15:02 NoxArt

{ "primary": { "host": "192.168.1.1", "username": "admin", "password": "ONE111_two&three", "path": "/Black_Sitez/test/" } }

The error is still there :((

fabiobozzo avatar Feb 26 '14 15:02 fabiobozzo

That's very odd, I've tested it in ST2 and ST3 and both were OK. Can you please tell me your OS and Sublime version? I assume you've tried restarting it. Or perhaps try copying back this text so that any unintentiall characters like shift+space are (hopefully) removed

NoxArt avatar Feb 26 '14 15:02 NoxArt

Ubuntu Desktop 13.04 (32-bit) ST v. 2.0.2 build 2221

fabiobozzo avatar Feb 26 '14 15:02 fabiobozzo

I only have access to Ubuntu 11 x64 ST2, but it's OK there too.

I added a debug option, can you please go to Preferences > Packages > FTPSync > Settings - User and add

{
    "debug_json":true
}

restart Sublime and then try to use FTPSync (save a file in a folder with ftpsync.settings file) and look into console (View > Show console) to see what exact string is being parsed? Thank you!

NoxArt avatar Feb 26 '14 17:02 NoxArt

FYI: my mate is using Windows 8, same ST version, and having the same error.

FTPSync > Debug JSON:

{ "primary": { "host": "192.168.1.1", "username": "admin", "password": "ONE111_two&three", "path": "/Black_Sitez/xxx/" }

}

Writing file /home/fabio/Siti/klepsoo/ftpsync.settings with encoding UTF-8

FTPSync > Debug JSON:

FTPSync > Failed parsing configuration file: {/home/fabio/Siti/klepsoo/ftpsync.settings} (commas problem?) [Exception: argument 1 must be string without null bytes, not str]

FTPSync > Exception in user code:

Traceback (most recent call last): File "./FTPSync.py", line 777, in loadConfig File "./FTPSync.py", line 663, in parseJson

TypeError: argument 1 must be string without null bytes, not str

Exception in thread Thread-4: Traceback (most recent call last): File ".\threading.py", line 532, in __bootstrap_inner File "./FTPSync.py", line 2584, in run

TypeError: 'NoneType' object is unsubscriptable

The error, however, is changed into: " Exception: argument 1 must be string without null bytes, not str "

fabiobozzo avatar Feb 28 '14 07:02 fabiobozzo

Oh ... I think the problem is somewhere else, the thing is I have not ideal try-catch clause, give me a moment, I'll get back to you

Ok, I guess that was premature. As for mentions of this errors on the internet there aren't many, mostly concerning unescaped backslashes, but I don't think you have any in the config...

NoxArt avatar Feb 28 '14 11:02 NoxArt

I changed the way config is parsed in f3920a0, did it help or is there still an issue?

NoxArt avatar Aug 31 '14 11:08 NoxArt

I'm having the same issue

dasmikko avatar May 08 '15 11:05 dasmikko