{"action":"created","issue":{"url":"https://api.github.com/repos/influxdata/influxdb/issues/1570","repository_url":"https://api.github.com/repos/influxdata/influxdb","labels_url":"https://api.github.com/repos/influxdata/influxdb/issues/1570/labels{/name}","comments_url":"https://api.github.com/repos/influxdata/influxdb/issues/1570/comments","events_url":"https://api.github.com/repos/influxdata/influxdb/issues/1570/events","html_url":"https://github.com/influxdata/influxdb/issues/1570","id":57354936,"number":1570,"title":"Starting InfluxDB on CircleCI fails to start via a script even though it says it does","user":{"login":"andrewmatthewthompson","id":2790817,"avatar_url":"https://avatars.githubusercontent.com/u/2790817?v=3","gravatar_id":"","url":"https://api.github.com/users/andrewmatthewthompson","html_url":"https://github.com/andrewmatthewthompson","followers_url":"https://api.github.com/users/andrewmatthewthompson/followers","following_url":"https://api.github.com/users/andrewmatthewthompson/following{/other_user}","gists_url":"https://api.github.com/users/andrewmatthewthompson/gists{/gist_id}","starred_url":"https://api.github.com/users/andrewmatthewthompson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andrewmatthewthompson/subscriptions","organizations_url":"https://api.github.com/users/andrewmatthewthompson/orgs","repos_url":"https://api.github.com/users/andrewmatthewthompson/repos","events_url":"https://api.github.com/users/andrewmatthewthompson/events{/privacy}","received_events_url":"https://api.github.com/users/andrewmatthewthompson/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/influxdata/influxdb/labels/obsoleted%20by%20v0.9","name":"obsoleted by v0.9","color":"ffaa55"}],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":12,"created_at":"2015-02-11T18:19:20Z","updated_at":"2016-03-02T21:45:53Z","closed_at":"2015-04-20T22:18:19Z","body":"Hi,\r\n\r\nI'm trying to install and run my own tests against InfluxDB on a CircleCI build instance. InfluxDB seems to be installed and start correctly with the following output but unfortunately my tests fail due to a 'Connection refused' error (which hints that InfluxDB may not be running properly):\r\n\r\n```\r\n$ wget http://s3.amazonaws.com/influxdb/influxdb_latest_amd64.deb\r\n--2015-02-11 17:40:25--  http://s3.amazonaws.com/influxdb/influxdb_latest_amd64.deb\r\nResolving s3.amazonaws.com (s3.amazonaws.com)... 54.231.96.128\r\nConnecting to s3.amazonaws.com (s3.amazonaws.com)|54.231.96.128|:80... connected.\r\nHTTP request sent, awaiting response... 200 OK\r\nLength: 16572810 (16M) [binary/octet-stream]\r\nSaving to: `influxdb_latest_amd64.deb'\r\n100%[======================================>] 16,572,810  53.8M/s   in 0.3s    \r\n2015-02-11 17:40:25 (53.8 MB/s) - `influxdb_latest_amd64.deb' saved [16572810/16572810]\r\n\r\n$ sudo dpkg -i influxdb_latest_amd64.deb\r\nSelecting previously unselected package influxdb.\r\n(Reading database ... 525927 files and directories currently installed.)\r\nUnpacking influxdb (from influxdb_latest_amd64.deb) ...\r\nSetting up influxdb (0.8.8) ...\r\n Removing any system startup links for /etc/init.d/influxdb ...\r\n Adding system startup for /etc/init.d/influxdb ...\r\n   /etc/rc0.d/K20influxdb -> ../init.d/influxdb\r\n   /etc/rc1.d/K20influxdb -> ../init.d/influxdb\r\n   /etc/rc6.d/K20influxdb -> ../init.d/influxdb\r\n   /etc/rc2.d/S20influxdb -> ../init.d/influxdb\r\n   /etc/rc3.d/S20influxdb -> ../init.d/influxdb\r\n   /etc/rc4.d/S20influxdb -> ../init.d/influxdb\r\n/etc/rc5.d/S20influxdb -> ../init.d/influxdb\r\n\r\n$sudo /etc/init.d/influxdb start\r\nSetting ulimit -n 65536\r\nStarting the process influxdb [ OK ]\r\ninfluxdb process was started [ OK ]\r\n```\r\n\r\nHowever when I ssh into the CircleCI build instance I run the following:\r\n\r\n```\r\n$ sudo /etc/init.d/influxdb stop\r\nSetting ulimit -n 65536\r\ninfluxdb process is not running [ FAILED ]\r\n```\r\n\r\nSo this indicates InfluxDB was never running. I then start it with the following and it starts successfully and I am then then able to connect to InfluxDB and run the tests successfully:\r\n\r\n```\r\n$ sudo /etc/init.d/influxdb start\r\nSetting ulimit -n 65536\r\nStarting the process influxdb [ OK ]\r\ninfluxdb process was started [ OK ]\r\n```\r\n\r\nThe entire log file from both the start, stop and then start again is:\r\n\r\n```\r\n$ cat /opt/influxdb/shared/log.txt \r\n[2015/02/11 18:15:40 GMT] [INFO] (main.setupLogging:69) Redirectoring logging to /opt/influxdb/shared/log.txt\r\n[2015/02/11 18:15:40 GMT] [INFO] (main.start:164) Starting Influx Server 0.8.8 bound to 0.0.0.0...\r\n[2015/02/11 18:15:40 GMT] [INFO] (github.com/influxdb/influxdb/server.NewServer:43) Opening database at /opt/influxdb/shared/data/db\r\n[2015/02/11 18:15:40 GMT] [INFO] (github.com/influxdb/influxdb/wal.NewWAL:40) Opening wal in /opt/influxdb/shared/data/wal\r\n[2015/02/11 18:15:40 GMT] [INFO] (github.com/influxdb/influxdb/coordinator.NewRaftServer:79) Using /dev/urandom to initialize the raft server name\r\n[2015/02/11 18:15:40 GMT] [INFO] (github.com/influxdb/influxdb/coordinator.NewRaftServer:104) Setting raft name to 3ccdfe35a0e7452e\r\n[2015/02/11 18:15:40 GMT] [INFO] (github.com/influxdb/influxdb/api/http.(*HttpServer).EnableSsl:74) Ssl will be disabled since the ssl port or certificate path weren't set\r\n[2015/02/11 18:15:40 GMT] [INFO] (github.com/influxdb/influxdb/coordinator.(*RaftServer).Serve:566) Initializing Raft HTTP server\r\n[2015/02/11 18:15:40 GMT] [INFO] (github.com/influxdb/influxdb/coordinator.(*RaftServer).Serve:576) Raft Server Listening at 0.0.0.0:8090\r\n[2015/02/11 18:15:40 GMT] [INFO] (github.com/influxdb/influxdb/coordinator.(*RaftServer).startRaft:384) Initializing Raft Server: http://box267:8090\r\n[2015/02/11 18:15:40 GMT] [INFO] (github.com/influxdb/influxdb/coordinator.(*RaftServer).startRaft:416) Starting as new Raft leader...\r\n[2015/02/11 18:15:40 GMT] [INFO] (github.com/influxdb/influxdb/coordinator.(*RaftServer).raftEventHandler:448) (raft:3ccdfe35a0e7452e) Selected as leader. Starting leader loop.\r\n[2015/02/11 18:15:40 GMT] [INFO] (github.com/influxdb/influxdb/coordinator.(*InfluxJoinCommand).Apply:252) Adding new server to the cluster config 3ccdfe35a0e7452e\r\n[2015/02/11 18:15:40 GMT] [INFO] (github.com/influxdb/influxdb/cluster.(*ClusterConfiguration).AddPotentialServer:291) Added server to cluster config: 1, http://box267:8090, box267:8099\r\n[2015/02/11 18:15:40 GMT] [INFO] (github.com/influxdb/influxdb/cluster.(*ClusterConfiguration).AddPotentialServer:292) Checking whether this is the local server local: box267:8099, new: box267:8099\r\n[2015/02/11 18:15:40 GMT] [INFO] (github.com/influxdb/influxdb/cluster.(*ClusterConfiguration).AddPotentialServer:301) Added the local server\r\n[2015/02/11 18:15:40 GMT] [INFO] (github.com/influxdb/influxdb/server.(*Server).ListenAndServe:96) Waiting for local server to be added\r\n[2015/02/11 18:15:40 GMT] [INFO] (github.com/influxdb/influxdb/wal.(*WAL).SetServerId:109) Setting server id to 1 and recovering\r\n[2015/02/11 18:15:45 GMT] [INFO] (github.com/influxdb/influxdb/server.(*Server).ListenAndServe:128) Recovering from log...\r\n[2015/02/11 18:15:45 GMT] [INFO] (github.com/influxdb/influxdb/cluster.NewWriteBuffer:30) local: Initializing write buffer with buffer size of 10000\r\n[2015/02/11 18:15:45 GMT] [INFO] (github.com/influxdb/influxdb/cluster.(*ClusterConfiguration).RecoverFromWAL:1203) Waiting for servers to recover\r\n[2015/02/11 18:15:45 GMT] [INFO] (github.com/influxdb/influxdb/coordinator.(*ProtobufServer).ListenAndServe:66) ProtobufServer listening on 0.0.0.0:8099\r\n[2015/02/11 18:15:45 GMT] [INFO] (github.com/influxdb/influxdb/cluster.func·005:1185) Recovering local server\r\n[2015/02/11 18:15:45 GMT] [INFO] (github.com/influxdb/influxdb/cluster.(*ClusterConfiguration).recover:1211) No shards to recover for 1\r\n[2015/02/11 18:15:45 GMT] [INFO] (github.com/influxdb/influxdb/cluster.func·005:1187) Recovered local server\r\n[2015/02/11 18:15:45 GMT] [INFO] (github.com/influxdb/influxdb/server.(*Server).ListenAndServe:133) recovered\r\n[2015/02/11 18:15:45 GMT] [INFO] (github.com/influxdb/influxdb/coordinator.(*Coordinator).ConnectToProtobufServers:898) Connecting to other nodes in the cluster\r\n[2015/02/11 18:15:45 GMT] [INFO] (github.com/influxdb/influxdb/server.(*Server).ListenAndServe:139) Starting admin interface on port 8083\r\n[2015/02/11 18:15:45 GMT] [INFO] (github.com/influxdb/influxdb/server.(*Server).ListenAndServe:156) Graphite input plugins is disabled\r\n[2015/02/11 18:15:45 GMT] [INFO] (github.com/influxdb/influxdb/server.(*Server).ListenAndServe:178) Collectd input plugins is disabled\r\n[2015/02/11 18:15:45 GMT] [INFO] (github.com/influxdb/influxdb/server.(*Server).ListenAndServe:187) UDP server is disabled\r\n[2015/02/11 18:15:45 GMT] [INFO] (github.com/influxdb/influxdb/server.(*Server).ListenAndServe:187) UDP server is disabled\r\n[2015/02/11 18:15:45 GMT] [INFO] (github.com/influxdb/influxdb/server.(*Server).ListenAndServe:216) Starting Http Api server on port 8086\r\n[2015/02/11 18:15:45 GMT] [INFO] (github.com/influxdb/influxdb/server.(*Server).reportStats:254) Reporting stats: &client.Series{Name:\"reports\", Columns:[]string{\"os\", \"arch\", \"id\", \"version\"}, Points:[][]interface {}{[]interface {}{\"linux\", \"amd64\", \"3ccdfe35a0e7452e\", \"0.8.8\"}}}\r\n```\r\n\r\nWhat's interesting here is there is not a single log entry for the initial starting of InfluxDB and only the second start.\r\n\r\nAny ideas why this is not starting the first time when invoked via a bash script automatically on a CircleCI build instance?\r\n\r\nThanks.\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/influxdata/influxdb/issues/comments/191447018","html_url":"https://github.com/influxdata/influxdb/issues/1570#issuecomment-191447018","issue_url":"https://api.github.com/repos/influxdata/influxdb/issues/1570","id":191447018,"user":{"login":"timraymond","id":288061,"avatar_url":"https://avatars.githubusercontent.com/u/288061?v=3","gravatar_id":"","url":"https://api.github.com/users/timraymond","html_url":"https://github.com/timraymond","followers_url":"https://api.github.com/users/timraymond/followers","following_url":"https://api.github.com/users/timraymond/following{/other_user}","gists_url":"https://api.github.com/users/timraymond/gists{/gist_id}","starred_url":"https://api.github.com/users/timraymond/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/timraymond/subscriptions","organizations_url":"https://api.github.com/users/timraymond/orgs","repos_url":"https://api.github.com/users/timraymond/repos","events_url":"https://api.github.com/users/timraymond/events{/privacy}","received_events_url":"https://api.github.com/users/timraymond/received_events","type":"User","site_admin":false},"created_at":"2016-03-02T21:45:53Z","updated_at":"2016-03-02T21:45:53Z","body":"@toddboom Just hit this on one of our builds on 0.10.1. @jonnonz1 's workaround worked for us.\r\n\r\n<img width=\"927\" alt=\"influxdata_enterprise__366_-_circleci\" src=\"https://cloud.githubusercontent.com/assets/288061/13476442/e0841a96-e095-11e5-965c-eed19200d045.png\">\r\n"}}