I'm getting an error in Sublime2 SFTP.
Error parsing sftp-config.json file:
No JSON object could be decoded
I'm not sure what is going. Help is appreciated. I've tried uninstalling and reinstalling the SFTP plugin but that didn't fix it.
Here is my code:
{
// The tab key will cycle through the settings when first created
// Visit http://wbond.net/sublime_packages/sftp/settings for help
// sftp, ftp or ftps
"type": "sftp",
"save_before_upload": true,
"upload_on_save": false,
"sync_down_on_open": false,
"sync_skip_deletes": false,
"sync_same_age": true,
"confirm_downloads": false,
"confirm_sync": true,
"confirm_overwrite_newer": false,
"host": "54.173.65.194",
"user": "brent",
//"password": "password",
//"port": "22",
"remote_path": "/example",
"ignore_regexes": [
"\\.sublime-(project|workspace)", "sftp-config(-alt\\d?)?\\.json",
"sftp-settings\\.json", "/venv/", "\\.svn/", "\\.hg/", "\\.git/",
"\\.bzr", "_darcs", "CVS", "\\.DS_Store", "Thumbs\\.db", "desktop\\.ini"
],
//"file_permissions": "664",
//"dir_permissions": "775",
//"extra_list_connections": 0,
"connect_timeout": 30,
//"keepalive": 120,
//"ftp_passive_mode": true,
//"ftp_obey_passive_host": false,
//"ssh_key_file": "~/.ssh/id_rsa",
//"sftp_flags": ["-F", "/path/to/ssh_config"],
//"preserve_modification_times": false,
//"remote_time_offset_in_hours": 0,
//"remote_encoding": "utf-8",
//"remote_locale": "C",
//"allow_config_upload": false,
}
Go to
~/.config/sublime-text-3/Packages/User/sftp_servers
and delete the file that is causing the error
this sftp_server folder contains all your existing server connection config so you can decide which one is causing the problem by reading the error properly.
I think it might be the','(comma) after the connect_timeout. Javscript/json doesn't allow trailing commas on the last item in a list, unlike Python.
I resolved it by uninstalling Sublime 2, removing all preferences, and reinstalling. It works now.
On my MacOS it was non-json file app.py inside (could be another file)
/Users/<your_username>/Library/Application Support/Sublime Text 3/Packages/User/sftp_servers
When I deleted it error disappeared
Related
Error:
Template validation failed. Errors are shown below.
Errors validating build 'amazon-ebs'. 1 error(s) occurred:
unknown configuration key: "launch_block_device_mappings[0].throughput"
script returned exit code 1
Code:
"launch_block_device_mappings": [
{
"device_name": "/dev/sda1",
"volume_size": 40,
"volume_type": "gp2",
"volume_size": 80,
"volume_type": "gp3",
"throughput": 270,
"delete_on_termination": true"
I had this issue too and I updated my packer version to 1.6.6 and that worked.
Right after the startup of the app, everything seems fine, all four cores are online running in the cluster mode. Two cores have the same name, remaining two differ. Here is the ecosystem.json file:
{ 'apps': [
{
'name': 'CHS',
'script': './main.js',
'out_file': '../logs/appname.log',
'error_file': '../logs/appname.log',
'log_date_format' : 'YYYY-MM-DD HH:mm:ss Z',
'rotateModule': true,
'compress': true,
'dateFormat': 'YYYY-MM-DD',
'max_size': '10M',
'retain': 300,
'log_date_format' : 'YYYY-MM-DD HH:mm:ss Z',
'merge_logs': true,
'env': {
'NODE_ENV': 'production',
'METEOR_SETTINGS': '{ ... }'
},
'env_production': {
'NODE_ENV': 'production'
},
'instances': '1',
'exec_mode': 'cluster'
},
{
'name': 'ORC',
'script': './main.js',
'out_file': '../logs/appname.log',
'error_file': '../logs/appname.log',
'log_date_format' : 'YYYY-MM-DD HH:mm:ss Z',
'rotateModule': true,
'compress': true,
'dateFormat': 'YYYY-MM-DD',
'max_size': '10M',
'retain': 300,
'merge_logs': true,
'env': {
'NODE_ENV': 'production',
'METEOR_SETTINGS': '{ ... }'
},
'env_production': {
'NODE_ENV': 'production'
},
'instances': '1',
'exec_mode': 'cluster'
},
{
'name': 'WCR',
'script': './main.js',
'out_file': '../logs/appname.log',
'error_file': '../logs/appname.log',
'log_date_format' : 'YYYY-MM-DD HH:mm:ss Z',
'rotateModule': true,
'compress': true,
'dateFormat': 'YYYY-MM-DD',
'max_size': '10M',
'retain': 300,
'merge_logs': true,
'env': {
'NODE_ENV': 'production',
'METEOR_SETTINGS': '{ ... }'
},
'instances': '2',
'exec_mode': 'cluster'
}
]
}
Few seconds after the startup, CHS core does not execute any code for some reason (without any errors), while other three works fine. I have tried to reorder cores in ecosystem.json, add "pmx": false (per some online suggestion, to avoid some parts in pm2 itself), rename cores, and some other things but issue was the same. I was trying to make sure there is nothing in the app code that makes this issue happens, searched errors in the logs, and this is only I have (in pm2 logs):
2020-04-17T14:16:49: PM2 error: (node:3720) [DEP0007] DeprecationWarning: worker.suicide is depricated. Please use worker.exitedAfterDisconnect.
2020-04-17T14:17:01: PM2 error: Error: write ENOTSUP
at ChildProcess.target._send (internal/child_process.js:692:20)
at ChildProcess.target.send (internal/child_process.js:576:19)
at senderHelper (internal/cluster/utils.js:25:15)
at send (internal/cluster/master.js:357:10)
at handle.add (internal/cluster/master.js:329:5)
at SharedHandle.add (internal/cluster/shared_handle.js:29:3)
at queryServer (internal/cluster/master.js:318:10)
at Worker.onmessage (internal/cluster/master.js:250:5)
at ChildProcess.onInternalMessage (internal/cluster/utils.js:42:8)
at emitTwo (events.js:131:20)
2020-04-17T14:17:01 PM2 log: App name:CHS id:0 disconnected
Also, at the end this happens only on the one windows VM instance (on the second one no issues at all). These instances are identical based on the configurations. PM2 version was 4.2.3 but then I have tried with 3.5.1 and I got the same issue. Does anybody have any idea how to troubleshoot this issue?
Lately it turned out that issue is related with UDP, and probably some unsupported features in node for windows, like this:
https://nodejs.org/api/cluster.html#cluster_event_listening
The root cause was that UDP does not work in a cluster mode on PM2. Actually we were using SNMP which relies on UDP under the hood, and it was not clear we have such an issue considering the logs. Spinning up a new core in a fork mode, running SNMP resolves the issue.
I seem to have encountered a problem similar to this.
file my-app.js:
import {PolymerElement, html} from "../node_modules/#polymer/polymer/polymer-element.js";
import "../node_modules/#polymer/polymer/lib/elements/dom-if.js";
import "../node_modules/#polymer/app-route/app-location.js";
import "../node_modules/#polymer/app-route/app-route.js";
class MyApp extends PolymerElement {
...
}
customElements.define('my-app',MyApp);
file polymer.json:
{
"entrypoint":"index.html"
,"shell":"src/my-app.js"
,"builds":[
{
"preset":"es5-bundled"
,"addServiceWorker": false
}
]
}
command polymer build produces file my-app.js with 0 byte. All other built files look correct according to my naked eyes (at least they are not truncated to 0 byte).
I then re-built the application with the following "dev" polymer.json:
"builds":[
{
"name": "dev",
"addServiceWorker": false,
"js": {"minify": false, "compile": false},
"css": {"minify": false},
"html": {"minify": false},
"bundle": false,
"addPushManifest": false
}
]
The built my-app.js looks correct with this "dev" configuration. However, browser's sources window highlights with red under score the first of the followings lines:
import {PolymerElement, html} from "../node_modules/#polymer/polymer/polymer-element.js";
import "../node_modules/#polymer/polymer/lib/elements/dom-if.js";
import "../node_modules/#polymer/app-route/app-location.js";
import "../node_modules/#polymer/app-route/app-route.js";
and console window prints this strange message:
Uncaught TypeError: Failed to resolve module specifier "#polymer/polymer/polymer-legacy.js". Relative references must start with either "/", "./", or "../". (index):1
I have searched all my .js files and directory ../node_modules/ and have not found any file containing polymer-legacy.js.
Helps will be much appreciated.
EDIT
Thank you for the attention!
These weird symptoms are caused by the stale polymer 1.6.0 which was installed in /usr/local/bin/polymer using yarn .
These issues are gone with polymer 1.7.2.
trying to setup sublime SFTP to work on google cloud (GCP) VM and keep getting this basic error.
I think my sublime-2 setup is messed up, but I am not sure how to solve it.
this is my sftp setup file as for now -
{
// The tab key will cycle through the settings when first created
// Visit http://wbond.net/sublime_packages/sftp/settings for help
// sftp, ftp or ftps
"type": "sftp",
"sync_down_on_open": true,
"sync_same_age": true,
"host": "[SERVER_IP]",
"user": "[MY_USER]",
//"password": "password",
//"port": "22",
"remote_path": "/home/[MY_USER]/",
"connect_timeout": 30,
"ssh_key_file": "~/.ssh/my-ssh-key",
}
I wanted to use gulp-jscs in my project, so I've installed it according the documentation:
npm install --save-dev gulp-jscs
But when I try to run the gulp file, I'm getting this error:
TypeError: Cannot convert undefined or null to object
at Function.keys (native)
at copyConfiguration (C:\Users\[User]\Desktop\[Project]\
node_modules\jscs\lib\config\configuration.js:920:12)
Also, there are other errors related to this:
at NodeConfiguration.Configuration.
_processConfig([location-path]\node_modules\jscs\lib\config\configuration.js:459:5)
at NodeConfiguration.Configuration.load
([location-path]\node_modules\jscs\lib\config\configuration.js:211:10)
at null.StringChecker.configure
([location-path]\node_modules\jscs\lib\string-checker.js:62:29)
at null.Checker.configure ([location-path]\node_modules\jscs\lib\checker.js:27:39)
at Object.module.exports ([location-path]\node_modules\gulp-jscs\index.js:35:10)
at Gulp.<anonymous> ([location-path]\Gulpfile.js:60:17)
at module.exports ([location-path]\node_modules\orchestrator\lib\runTask.js:34:7)
at Gulp.Orchestrator._runTask ([location-path]\node_modules\orchestrator\index.js:273:3)
Process terminated with code 1.
You need to have a .jscsrc file in the root of you project present. In there you can provide options for JSCS as well as the code style rules that should be followed.
Below is the .jscsrc that's used by node-jscs project itself. You can use this to base your own configuration on.
{
"preset": "google",
"fileExtensions": [".js", "jscs"],
"requireSemicolons": true,
"requireParenthesesAroundIIFE": true,
"maximumLineLength": 120,
"validateLineBreaks": "LF",
"validateIndentation": 4,
"disallowTrailingComma": true,
"disallowUnusedParams": true,
"disallowSpacesInsideObjectBrackets": null,
"disallowImplicitTypeConversion": ["string"],
"safeContextKeyword": "_this",
"jsDoc": {
"checkAnnotations": "closurecompiler",
"checkParamNames": true,
"requireParamTypes": true,
"checkRedundantParams": true,
"checkReturnTypes": true,
"checkRedundantReturns": true,
"requireReturnTypes": true,
"checkTypes": "capitalizedNativeCase",
"checkRedundantAccess": true,
"requireNewlineAfterDescription": true
},
"excludeFiles": [
"test/data/**",
"patterns/*"
]
}
Note that jscs won't actually check for anything unless you have a "preset" in your .jscsrc or have explicitly specified the rules that should be followed.