alex-phillips / node-clouddrive

Node SDK and CLI for Amazon's Cloud Drive
74 stars 18 forks source link

Pool problem #28

Open iliakan opened 8 years ago

iliakan commented 8 years ago

I made a script that downloads about 500 files from clouddrive, each one uses a separate clouddrive download <file> call.

The problem is that after some calls I get this:

clouddrive download -vvv /archive/aes/webpack-screencast.tgz.aes/webpack-screencast.tgz.aes.part04.rar
Loading application config...
Running command...
Initializing command...
Initializing database...
Connecting to MySQL database...
Knex:warning - Pool2 - Error: Pool was destroyed
Knex:Error Pool2 - Error: connect ECONNREFUSED 127.0.0.1:3306
Knex:Error Pool2 - Error: connect ECONNREFUSED 127.0.0.1:3306
Unhandled rejection Error: Pool was destroyed
    at Pool._destroyPool (/usr/lib/node_modules/clouddrive/node_modules/pool2/lib/pool.js:548:20)
    at Pool.<anonymous> (/usr/lib/node_modules/clouddrive/node_modules/pool2/lib/pool.js:465:18)
    at Pool.<anonymous> (/usr/lib/node_modules/clouddrive/node_modules/pool2/lib/pool.js:505:17)
    at tryCatcher (/usr/lib/node_modules/clouddrive/node_modules/bluebird/js/main/util.js:26:23)
    at Promise.errorAdapter (/usr/lib/node_modules/clouddrive/node_modules/bluebird/js/main/nodeify.js:36:34)
    at Promise._settlePromiseAt (/usr/lib/node_modules/clouddrive/node_modules/bluebird/js/main/promise.js:579:21)
    at Promise._settlePromises (/usr/lib/node_modules/clouddrive/node_modules/bluebird/js/main/promise.js:697:14)
    at Async._drainQueue (/usr/lib/node_modules/clouddrive/node_modules/bluebird/js/main/async.js:123:16)
    at Async._drainQueues (/usr/lib/node_modules/clouddrive/node_modules/bluebird/js/main/async.js:133:10)
    at Immediate.Async.drainQueues [as _onImmediate] (/usr/lib/node_modules/clouddrive/node_modules/bluebird/js/main/async.js:15:14)
    at tryOnImmediate (timers.js:543:15)
    at processImmediate [as _immediateCallback] (timers.js:523:5)

This repeats for further calls, so actually clouddrive stops working.

P.S. Node 6.2.1, Mysql 5.5, Debian Jessie.

alex-phillips commented 8 years ago

Given the ECONNREFUSED error, it looks like clouddrive is unable to connect to mysql given the credentials in the config. Can you double check that the host, username, and password are all accurate?

iliakan commented 8 years ago

It works fine, then I leave it overnight and it dies. Not sure what's happening.

alex-phillips commented 7 years ago

@iliakan Hey, I've made some updates and improvements which may solve your issue. If you could get the latest version (0.6.3) and give it a try, let me know if its fixed or not.