Skip to content
This repository has been archived by the owner on Feb 15, 2022. It is now read-only.

Can not start docker with conf.js #1024

Closed
mrzobot opened this issue Dec 31, 2017 · 5 comments
Closed

Can not start docker with conf.js #1024

mrzobot opened this issue Dec 31, 2017 · 5 comments

Comments

@mrzobot
Copy link

mrzobot commented Dec 31, 2017

System information

  • Have I written custom code (as opposed to using zenbot vanilla):
  • OS Platform and Distribution (e.g., Linux Ubuntu 16.04):
  • Zenbot version:
    $ docker-compose exec server zenbot --version
    4.0.5
  • Python version:
    $ python --version
    Python 2.7.10
  • Exact command to reproduce:
    docker-compose exec server zenbot buy gdax.BTC-USD --ptc=10

My conf.js is actually a directory, I tried removing it and renaming conf-sample.js to conf.js..
This is the error with conf.js

ERROR:
docker-compose exec server zenbot buy gdax.BTC-USD --ptc=10
/app/extensions/exchanges/gdax/exchange.js:21
throw new Error('please configure your GDAX credentials in conf.js')
^

Error: please configure your GDAX credentials in conf.js
    at authedClient (/app/extensions/exchanges/gdax/exchange.js:21:15)
    at Object.getBalance (/app/extensions/exchanges/gdax/exchange.js:91:20)
    at syncBalance (/app/lib/engine.js:178:18)
    at Object.executeSignal (/app/lib/engine.js:409:7)
    at Command.<anonymous> (/app/commands/buy.js:39:16)
    at Command.listener (/app/node_modules/commander/index.js:315:8)
    at Command.emit (events.js:159:13)
    at Command.parseArgs (/app/node_modules/commander/index.js:653:12)
    at Command.parse (/app/node_modules/commander/index.js:475:21)
    at /app/zenbot.js:39:11
    at /app/boot.js:28:7
    at f (/app/node_modules/once/once.js:25:25)
    at Glob.<anonymous> (/app/node_modules/glob/glob.js:151:7)
    at Glob.emit (events.js:159:13)
    at Glob._finish (/app/node_modules/glob/glob.js:197:8)
    at done (/app/node_modules/glob/glob.js:182:14)
    at Glob._processGlobStar2 (/app/node_modules/glob/glob.js:637:12)
    at /app/node_modules/glob/glob.js:626:10
    at RES (/app/node_modules/inflight/inflight.js:31:16)
    at f (/app/node_modules/once/once.js:25:25)
    at lstatcb_ (/app/node_modules/glob/glob.js:519:7)
    at RES (/app/node_modules/inflight/inflight.js:31:16)

This is the error with conf.js file vs dir.

ERROR: for zenbot_server_1  Cannot start service server: oci runtime error: container_linux.go:262: starting container process caused "process_linux.go:339: container init caused \"rootfs_linux.go:57: mounting \\\"/Users/myusername/docker/zenbot/conf.js\\\" to rootfs \\\"/var/lib/docker/overlay2/mydockerID/merged\\\" at \\\"/var/lib/docker/overlay2/mydockerID/merged/app/conf.js\\\" caused \\\"not a directory\\\"\""
: Are you trying to mount a directory onto a file (or vice-versa)? Check if the specified host path exists and is the expected type

ERROR: for server  Cannot start service server: oci runtime error: container_linux.go:262: starting container process caused "process_linux.go:339: container init caused \"rootfs_linux.go:57: mounting \\\"/Users/myusername/docker/zenbot/conf.js\\\" to rootfs \\\"/var/lib/docker/overlay2/mydockerID/merged\\\" at \\\"/var/lib/docker/overlay2/mydockerID/merged/app/conf.js\\\" caused \\\"not a directory\\\"\""
: Are you trying to mount a directory onto a file (or vice-versa)? Check if the specified host path exists and is the expected type
@DeviaVir
Copy link
Owner

You are trying to use conf.js and probably GDAX without having filled out credentials for GDAX.
Please see the README.

@mrzobot
Copy link
Author

mrzobot commented Dec 31, 2017

Wish that would be the case, but I placed my api key/secret/passphrase in conf-sample.js and renamed it to conf.js as well as copied to conf.js/dir

Remember this is docker..

@yang2lalang
Copy link
Contributor

I had the same issue and was solved by putting the api keys in conf-sample.js for gdax. dont know why it insists on checking this file for api keys instead of conf.js

@mrzobot
Copy link
Author

mrzobot commented Jan 8, 2018

@yang2lalang I have same issue still, with error above.

var c = module.exports = {}

// mongo configuration
c.mongo = {}
c.mongo.host = process.env.MONGODB_PORT_27017_TCP_ADDR || 'localhost'
c.mongo.port = 27017
c.mongo.db = 'zenbot4'
c.mongo.username = null
c.mongo.password = null
// when using mongodb replication, i.e. when running a mongodb cluster, you can define your replication set here; when you are not using replication (most of the users), just set it to `null` (default).
c.mongo.replicaSet = null

// default selector. only used if omitting [selector] argument from a command.
c.selector = 'gdax.BTC-USD'
// name of default trade strategy
c.strategy = 'trend_ema'

// Exchange API keys:

// to enable GDAX trading, enter your API credentials:
c.gdax = {}
c.gdax.key = '5513866..........'
c.gdax.b64secret = 'blahYAOGIqlP4y444513VitoTfy9dn85c0xXIhsomesad'
c.gdax.passphrase = 'gdaxphrasegoeshere'

@yang2lalang
Copy link
Contributor

do you have another config file in the zenbot root?

Try to call zenbot trade without the --config option

Try to simulate an error by changing something in all conf.js files you have to help you know exactly which of the config filename zenbot is using. This is the file where you put gdax credentials

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants