yongkangchen / remote-sync

Upload your files to remote host after every change. Both SCP/SFTP and FTP are supported.
https://atom.io/packages/remote-sync
MIT License
237 stars 71 forks source link

Uncaught Error: Callback was already called. #92

Open wyqydsyq opened 9 years ago

wyqydsyq commented 9 years ago
  1. Upload a relatively large folder containing images of various sizes

Atom Version: 0.179.0 System: linux 3.16.7-7-desktop Thrown From: remote-sync package, v2.4.0

Stack Trace

Uncaught Error: Callback was already called.

At /usr/share/atom/resources/app/node_modules/async/lib/async.js:22

Error: Callback was already called.
  at /usr/share/atom/resources/app/node_modules/async/lib/async.js:22:31
  at /home/damon/.atom/packages/remote-sync/lib/transports/FtpTransport.coffee:23:7
  at /home/damon/.atom/packages/remote-sync/lib/transports/FtpTransport.coffee:34:18
  at /home/damon/.atom/packages/atom-beautify/node_modules/analytics-node/node_modules/superagent-proxy/node_modules/proxy-agent/node_modules/pac-proxy-agent/node_modules/get-uri/node_modules/ftp/lib/connection.js:961:14
  at Object.cb (/home/damon/.atom/packages/atom-beautify/node_modules/analytics-node/node_modules/superagent-proxy/node_modules/proxy-agent/node_modules/pac-proxy-agent/node_modules/get-uri/node_modules/ftp/lib/connection.js:885:11)
  at Parser.<anonymous> (/home/damon/.atom/packages/atom-beautify/node_modules/analytics-node/node_modules/superagent-proxy/node_modules/proxy-agent/node_modules/pac-proxy-agent/node_modules/get-uri/node_modules/ftp/lib/connection.js:117:20)
  at Parser.emit (events.js:119:17)
  at Parser._write (/home/damon/.atom/packages/atom-beautify/node_modules/analytics-node/node_modules/superagent-proxy/node_modules/proxy-agent/node_modules/pac-proxy-agent/node_modules/get-uri/node_modules/ftp/lib/parser.js:58:10)
  at doWrite (_stream_writable.js:303:12)
  at writeOrBuffer (_stream_writable.js:290:5)
  at Parser.Writable.write (_stream_writable.js:219:11)
  at Socket.ondata (/home/damon/.atom/packages/atom-beautify/node_modules/analytics-node/node_modules/superagent-proxy/node_modules/proxy-agent/node_modules/pac-proxy-agent/node_modules/get-uri/node_modules/ftp/lib/connection.js:281:20)
  at Socket.emit (events.js:116:17)
  at readableAddChunk (_stream_readable.js:164:16)
  at Socket.Readable.push (_stream_readable.js:127:10)
  at TCP.onread (net.js:530:20)

Commands

  3x -1:14.7 editor:select-to-end-of-word (atom-text-editor.editor)
     -1:13.2 core:backspace (atom-text-editor.editor)
  2x -1:12.4 editor:select-to-end-of-word (atom-text-editor.editor)
     -1:10.0 core:save (atom-text-editor.editor)

Config

{
  "core": {
    "followSymlinks": true,
    "disabledPackages": [
      "file-icons",
      "open-sesame"
    ],
    "themes": [
      "one-dark-ui",
      "one-dark-syntax"
    ],
    "projectHome": "/home/damon/Projects",
    "autoHideMenuBar": true
  },
  "remote-sync": {
    "difftoolCommand": "meld"
  }
}

Installed Packages

# User
Remote-FTP, v0.4.8
atom-beautify, v0.21.3
autocomplete-paths, v1.0.2
autocomplete-plus, v2.1.6
color-picker, v1.4.4
editor-stats, v0.17.0
esformatter, v1.3.0
git-log, v0.2.0
git-tab-status, v1.5.3
grammar-token-limit, v0.1.1
highlight-line, v0.9.3
highlight-selected, v0.9.0
indentation-indicator, v0.4.1
jsdoc, v0.9.0
language-apache, v1.2.0
language-ejs, v0.1.0
less-autocompile, v0.3.3
linter, v0.11.1
minimap, v4.2.2
project-manager, v1.15.5
regex-railroad-diagram, v0.6.3
remote-sync, v2.4.0
save-session, v0.11.5
underscorejs-snippets, v0.2.2

# Dev
No dev packages
lordgiotto commented 9 years ago

Same issue here.

vildhjarta8 commented 8 years ago

Same

yongkangchen commented 8 years ago

According to the source code and error, there should be a error msg in console or status panel? Someone who can put the error log?

chapma26 commented 8 years ago

This happened to me, too, - also using remote-sync. The issue was caused by the server that I was trying to save to not having any more room on the hard drive. Anyways - one thing to look out for if this error shows up.

ChristianGrech commented 8 years ago

+1 on latest update 4.0.0

sompylasar commented 8 years ago

Happens along with:

[18:01:15] Connecting: ****@****:22
Error: Unexpected disconnection from agent
[18:01:17] Upload: D:\****.js to /home/****.js ...
Error: Authentication failure. Available authentication methods: undefined
Error: Timed out while waiting for handshake
sompylasar commented 8 years ago

@yongkangchen Any update on this?

abudayah commented 8 years ago

same issue here

sompylasar commented 8 years ago

@yongkangchen This is a critical issue that renders remote-sync completely unusable in certain conditions, could you please take a look at your source code and find out why the async callback may be called more than once?

okanatabag commented 7 years ago

Same issue. Maybe help this https://github.com/caolan/async/issues/1279

beenfishinglately commented 7 years ago

I had this error when I simply had an invalid ftp username.

thomasfrobieter commented 7 years ago

In my case this issue appears while pageant was not running (agent auth.). After starting pageant it's working.

hfossli commented 7 years ago

This happens to me as well. It is not async's fault, but async should provide way better error messages.

Example code

async.parallel({
  accounts: function (callback) {
    NativeModules.AppAccountBridge.fetchData().then((accounts) => {
      callback(null, accounts);
    }).catch(function (error) {
      callback(error, null)
    })
  },
  limits: function (callback) {
    NativeModules.AppPurchaseLimitBridge.getLimits().then((data) => {
      callback(null, data.limits) // <<<<<<<<<<<<<<<<<  the offending line <<<<<<<<<<<<<<<<<<<<<
    }).catch(function (error) {
      callback(error, null)
    })
  }
}, (err, success) => {
  console.log(success);
})

See " the offending line". Here I'm trying to access limits on data. Problem is that limits doesn't exist. This throws an exception which async catches. Then async emits that ill-formed and misleading error message.

justinmchase commented 6 years ago

@hfossli I don't think that the problem is with async or that its providing the wrong error, the problem is that you are actually calling the callback twice. You should be using a finally construct essentially:

let data = null
let err = null
NativeModules
  .AppPurchaseLimitBridge
  .getLimits()
  .then(d => data = d)
  .catch(e => err = e)
  .finally(() => callback(err, data))
veeraRaghavSanthosh commented 5 years ago

+1