remote-sync icon indicating copy to clipboard operation
remote-sync copied to clipboard

Uncaught Error: Callback was already called.

Open wyqydsyq opened this issue 10 years ago • 15 comments

  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

wyqydsyq avatar Feb 17 '15 01:02 wyqydsyq

Same issue here.

lordgiotto avatar Sep 03 '15 09:09 lordgiotto

Same

vildhjarta8 avatar Oct 20 '15 08:10 vildhjarta8

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?

yongkangchen avatar Nov 05 '15 06:11 yongkangchen

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.

chapma26 avatar Jan 07 '16 17:01 chapma26

+1 on latest update 4.0.0

ChristianGrech avatar Apr 12 '16 14:04 ChristianGrech

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 avatar May 12 '16 15:05 sompylasar

@yongkangchen Any update on this?

sompylasar avatar Aug 23 '16 09:08 sompylasar

same issue here

abudayah avatar Aug 24 '16 09:08 abudayah

@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?

sompylasar avatar Sep 05 '16 15:09 sompylasar

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

okanatabag avatar Nov 10 '16 06:11 okanatabag

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

beenfishinglately avatar Dec 15 '16 10:12 beenfishinglately

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

thomasfrobieter avatar Aug 03 '17 14:08 thomasfrobieter

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.

hfossli avatar Sep 19 '17 07:09 hfossli

@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))

justinmchase avatar Feb 13 '18 15:02 justinmchase

+1

veeraRaghavSanthosh avatar Sep 30 '18 17:09 veeraRaghavSanthosh