{"action":"created","issue":{"url":"https://api.github.com/repos/fandoghpaas/fandogh-cli/issues/171","repository_url":"https://api.github.com/repos/fandoghpaas/fandogh-cli","labels_url":"https://api.github.com/repos/fandoghpaas/fandogh-cli/issues/171/labels{/name}","comments_url":"https://api.github.com/repos/fandoghpaas/fandogh-cli/issues/171/comments","events_url":"https://api.github.com/repos/fandoghpaas/fandogh-cli/issues/171/events","html_url":"https://github.com/fandoghpaas/fandogh-cli/issues/171","id":370758974,"node_id":"MDU6SXNzdWUzNzA3NTg5NzQ=","number":171,"title":"Cannot connect to mongoDB","user":{"login":"sadra","id":18361407,"node_id":"MDQ6VXNlcjE4MzYxNDA3","avatar_url":"https://avatars2.githubusercontent.com/u/18361407?v=4","gravatar_id":"","url":"https://api.github.com/users/sadra","html_url":"https://github.com/sadra","followers_url":"https://api.github.com/users/sadra/followers","following_url":"https://api.github.com/users/sadra/following{/other_user}","gists_url":"https://api.github.com/users/sadra/gists{/gist_id}","starred_url":"https://api.github.com/users/sadra/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sadra/subscriptions","organizations_url":"https://api.github.com/users/sadra/orgs","repos_url":"https://api.github.com/users/sadra/repos","events_url":"https://api.github.com/users/sadra/events{/privacy}","received_events_url":"https://api.github.com/users/sadra/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2018-10-16T19:14:45Z","updated_at":"2018-10-17T07:02:44Z","closed_at":null,"author_association":"NONE","body":"I've deployed a mongo service with the following command:\r\n\r\n```bash\r\nfandogh service deploy \\\r\n --image library/mongo \\\r\n --version latest \\\r\n --port 27017 \\\r\n --name mongo-service-name\r\n```\r\nBut I can't connect to database!\r\n\r\n- with `mongodb+srv://mongo-service-name-account.fandogh.cloud/`\r\nI get:\r\n```bash\r\nconnection error: { Error: querySrv ENODATA _mongodb._tcp.mongo-service-name-account.fandogh.cloud\r\n    at errnoException (dns.js:28:10)\r\n    at QueryReqWrap.onresolve [as oncomplete] (dns.js:216:19)\r\n  code: 'ENODATA',\r\n  errno: 'ENODATA',\r\n  syscall: 'querySrv',\r\n  hostname: '_mongodb._tcp.mongo-service-name-account.fandogh.cloud' }\r\n```\r\n\r\n- and with `mongodb://public-mongo-sadra.fandogh.cloud/`\r\nI get:\r\n```bash\r\nconnection error: { Error: failed to connect to server [mongo-service-name-account.fandogh.cloud:27017] on first connect [MongoNetworkError: connect ECONNREFUSED 165.227.244.57:27017]\r\n    at Pool.<anonymous> (/MY_DIR/node_modules/mongodb-core/lib/topologies/server.js:564:11)\r\n    at emitOne (events.js:96:13)\r\n    at Pool.emit (events.js:191:7)\r\n    at Connection.<anonymous> (/MY_DIR/node_modules/mongodb-core/lib/connection/pool.js:317:12)\r\n    at Object.onceWrapper (events.js:293:19)\r\n    at emitTwo (events.js:106:13)\r\n    at Connection.emit (events.js:194:7)\r\n    at Socket.<anonymous> (/MY_DIR/node_modules/mongodb-core/lib/connection/connection.js:246:50)\r\n    at Object.onceWrapper (events.js:293:19)\r\n    at emitOne (events.js:96:13)\r\n    at Socket.emit (events.js:191:7)\r\n    at emitErrorNT (net.js:1289:8)\r\n    at _combinedTickCallback (internal/process/next_tick.js:80:11)\r\n    at process._tickCallback (internal/process/next_tick.js:104:9)\r\n  name: 'MongoNetworkError',\r\n  errorLabels: [ 'TransientTransactionError' ] }\r\n```\r\n\r\nSo what's the solution?"},"comment":{"url":"https://api.github.com/repos/fandoghpaas/fandogh-cli/issues/comments/430513245","html_url":"https://github.com/fandoghpaas/fandogh-cli/issues/171#issuecomment-430513245","issue_url":"https://api.github.com/repos/fandoghpaas/fandogh-cli/issues/171","id":430513245,"node_id":"MDEyOklzc3VlQ29tbWVudDQzMDUxMzI0NQ==","user":{"login":"psycho-ir","id":726875,"node_id":"MDQ6VXNlcjcyNjg3NQ==","avatar_url":"https://avatars0.githubusercontent.com/u/726875?v=4","gravatar_id":"","url":"https://api.github.com/users/psycho-ir","html_url":"https://github.com/psycho-ir","followers_url":"https://api.github.com/users/psycho-ir/followers","following_url":"https://api.github.com/users/psycho-ir/following{/other_user}","gists_url":"https://api.github.com/users/psycho-ir/gists{/gist_id}","starred_url":"https://api.github.com/users/psycho-ir/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/psycho-ir/subscriptions","organizations_url":"https://api.github.com/users/psycho-ir/orgs","repos_url":"https://api.github.com/users/psycho-ir/repos","events_url":"https://api.github.com/users/psycho-ir/events{/privacy}","received_events_url":"https://api.github.com/users/psycho-ir/received_events","type":"User","site_admin":false},"created_at":"2018-10-17T07:02:44Z","updated_at":"2018-10-17T07:02:44Z","author_association":"MEMBER","body":"@sadra , your services inside your namespace are accessible through their names.\r\n\r\nSo if you mongo service name is `mongo1`, then your connection string will be sth like:\r\n`mongodb://mongo1/DB_NAME`"}}
{"actor":{"display_login":"psycho-ir"}}